Messa in campo 4 file - 26/06/2020 Francia

Dependencies:   mbed X_NUCLEO_IHM03A1_for

Fork of FORIGO_Modula_V7_3_VdcStep_maggio2020 by Francesco Pistone

Revision:
19:231b8931cabc
Parent:
18:7c978f69cc51
Child:
20:4a400a4cc419
--- a/main.cpp	Fri Apr 12 12:20:05 2019 +0000
+++ b/main.cpp	Tue Apr 23 16:01:54 2019 +0000
@@ -570,9 +570,9 @@
             posError = posSD - (double)TBactualPosition;
             // interviene sulla velocità di TB per raggiungere la corretta posizione relativa
             if((lowSpeed==0)&&(aspettaStart==0)) {
-                double lowLim=-50.0f;
-                double higLim= 50.0f;
-                double divide= 100.0f;
+                double lowLim=-500.0f;
+                double higLim= 130.0f;
+                double divide= 25.0f;
                 if (pickNumber <= 5) {
                     lowLim=-500.0f;
                     higLim= 500.0f;
@@ -580,7 +580,7 @@
                 } else {
                     lowLim=-10.0f;
                     higLim= 130.0f;
-                    divide= 100.0f;
+                    divide= 20.0f;
                 }
                 if (posError>higLim) {
                     posError=higLim;
@@ -1481,7 +1481,7 @@
 
     wait(1.0f);
     wait(1.0f);
-    wait(1.0f);
+    wait(ritAvv);
 
     //stepSetting();
 
@@ -1797,7 +1797,7 @@
                         pc.printf(" SPEED: %f \n",tractorSpeed_MtS_timed);
                     #endif
                 #endif
-                if (tractorSpeed_MtS_timed>0.0f){
+                if (tractorSpeed_MtS_timed>0.2f){
                     if (timeIntraPick >= (memoIntraPick*2)) {
                         if ((aspettaStart==0)) {
                             if (firstStart==0) {
@@ -1910,7 +1910,7 @@
                 if (cntTbError>0) {
                     cntCellsCorrect++;
                 }
-                if (cntCellsCorrect>3) {
+                if (cntCellsCorrect>0) {
                     cntTbError=0;
                     cntCellsCorrect=0;
                 }
@@ -2462,7 +2462,8 @@
                     motor->set_home();
                     cntSpeedError=0;    
                     timeIntraPick=0.0f;
-                    memoIntraPick=0.0f;
+                    memoIntraPick=0.001f;
+                    intraPickTimer.reset();
                     pntMedia=0;
                     #if defined(pcSerial)
                         #if defined(stopSignal)