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:
30:32e770e91998
Parent:
29:25a875d09817
Child:
31:92a9e183be8e
--- a/main.cpp	Tue May 21 05:47:56 2019 +0000
+++ b/main.cpp	Thu May 23 14:12:06 2019 +0000
@@ -226,7 +226,7 @@
             TBperiod=5.2f*TBrpm*2.0f;   //prova dopo test con contagiri
         #else
             if (cellsNumber<8.0f){
-                TBperiod=4.8f*TBrpm;   //prova dopo test con contagiri
+                TBperiod=4.8f*TBrpm;//4.8f*TBrpm;   //prova dopo test con contagiri
             }else{
                 TBperiod=5.2f*TBrpm;   //prova dopo test con contagiri
             }
@@ -438,7 +438,7 @@
         #if defined(Zucca)
             KcorT = (SDsectorStep/TBsectorStep)*2.0f;
         #else
-            KcorT = (SDsectorStep/TBsectorStep)/2.0f;
+            KcorT = (SDsectorStep/TBsectorStep);///2.0f;
         #endif
     #else
         KcorT = (SDsectorStep/TBsectorStep);///2.0f;
@@ -585,9 +585,9 @@
                     }
                 }else{
                     if (pickNumber <= 5) {
-                        lowLim=-500.0f; 
-                        higLim= 500.0f; 
-                        divide= 25.0f;  
+                        lowLim=-100.0f; 
+                        higLim= 100.0f; 
+                        divide= 75.0f;  
                     }else{
                         lowLim=-500.0f; //pneumatico Alessandria
                         higLim= 130.0f; //pneumatico Alessandria
@@ -611,7 +611,16 @@
                     #if defined(runner)
                         double variante = posError/divide;
                         if (variante < -0.399f){variante=-0.3999;}
-                        ePpos = periodo *(1.0f+ variante);
+                        /*if ((posError<=15.0f)&&(posError>=-15.0f)){
+                            ePpos = periodo;// *(1.0f+ variante);
+                        }else{*/
+                            ePpos = periodo *(1.0f+ variante);
+                        //}
+                        #if defined(pcSerial)
+                            #if defined(TBperS)
+                                pc.printf("TBpos: %f  SDpos: %f SDact: %f Err: %f Correggi: %f periodo: %f KcorT: %f \n",(double)TBactualPosition,posSD,(double)SDactualPosition,posError,ePpos,periodo, KcorT);
+                            #endif
+                        #endif
                     #else
                         ePpos = periodo /(1.0f+ ((posError/divide)));
                     #endif
@@ -621,11 +630,6 @@
                         cambiaTB(periodo);///2.0f);
                     }
                 }
-                #if defined(pcSerial)
-                    #if defined(TBperS)
-                        pc.printf("TBpos: %f  SDpos: %f SDact: %f Err: %f Correggi: %f periodo: %f \n",(double)TBactualPosition,posSD,(double)SDactualPosition,posError,ePpos,periodo);
-                    #endif
-                #endif
             }
         }
     }
@@ -1167,6 +1171,7 @@
                 uint16_t steps = (uint32_t) rxMsg.data[2]*0x00000100;
                 steps = steps + ((uint32_t)rxMsg.data[1]);
                 TBmotorSteps =steps;
+                pc.printf("pippo; %d",steps);
                 //stepSetting();
                 cellsCountSet = rxMsg.data[3];
                 if ((flags&0x01)==0x01) {
@@ -1214,6 +1219,7 @@
                 } else {
                     currentCheckEnable=false;
                 }
+                aggiornaParametri();
             }
         }
     }
@@ -2052,7 +2058,7 @@
                     cntCellsForReload=0;
                     if (tractorSpeed_MtS_timed>0.0f){
                         cntTbError++;
-                        aggiornati();
+                        //aggiornati();
                     }else{
                         cntTbError=0;
                     }