Francesco Pistone / Mbed 2 deprecated FORIGO_Modula_V6_R2C_DE_HwV5_OTTOBRE2018

Dependencies:   mbed CANMsg

Files at this revision

API Documentation at this revision

Comitter:
nerit
Date:
Thu Dec 27 15:54:22 2018 +0000
Parent:
10:d85ed006056e
Child:
12:5bfbccfb3cf4
Commit message:
Versione Verificata alle 16:54 del 27/12/2018 con due elementi

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
main.hpp Show annotated file Show diff for this revision Revisions of this file
parameters.hpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Dec 27 13:43:31 2018 +0000
+++ b/main.cpp	Thu Dec 27 15:54:22 2018 +0000
@@ -206,10 +206,11 @@
 //*******************************************************
 void cambiaTB(double perio){
     // update TB frequency
+    double limite=400.0f;
     double TBper=0.0f;
     if (aspettaStart==0){
-        if (perio<250.0f){perio=500.0f;}
-        double scala =1.0f;
+        if (perio<limite){perio=limite;}
+        double scala =0.0f;
         if (lowSpeed==1){
             scala =2.0f;
         }else{
@@ -217,7 +218,7 @@
         }
         TBper=perio/scala;
         if (oldPeriodoTB!=TBper){
-            if (TBper >= 250.0f){
+            if (TBper >= (limite/2.0f)){
                 TBticker.attach_us(&step_TBPulseOut,TBper);  // clock time are milliseconds and attach seed motor stepper controls
             }else{
                 TBticker.detach();
@@ -1722,6 +1723,12 @@
                             lockStart=1;
                             periodo = TBperiod;
                             if (aspettaStart==0){cambiaTB(periodo);}
+                            #if defined(pcSerial)
+                                #if defined(inCorre)
+                                    pc.printf("entrato \n");
+                                    pc.printf("Aspetta %d \n",aspettaStart);
+                                #endif
+                            #endif
                         }
                         // controllo di stop
                         double memoIntraP = (double)memoIntraPick*1.8f;
--- a/main.hpp	Thu Dec 27 13:43:31 2018 +0000
+++ b/main.hpp	Thu Dec 27 15:54:22 2018 +0000
@@ -10,8 +10,8 @@
 
 
 // INDIRIZZAMENTO CAN BUS
-#define M1
-//#define M2
+//#define M1
+#define M2
 //#define M3
 //#define M4
 //#define M5
--- a/parameters.hpp	Thu Dec 27 13:43:31 2018 +0000
+++ b/parameters.hpp	Thu Dec 27 15:54:22 2018 +0000
@@ -37,13 +37,13 @@
 double dcMaxSpeed = 1.00f;
 double dcStarting = 0.30f;
 double fixedStepGiroSD = 9000.0f;                                  // numero di suddivisioni angolo giro della ruota di semina
-double minWorkSpeed=0.28;//pari 1kmh //0.138888f;  //metri al secondo pari a 0,5Kmh
+double minWorkSpeed=0.14;//pari 1kmh //0.138888f;  //metri al secondo pari a 0,5Kmh
 double maxWorkSpeed=1.277777f;  //metri al secondo pari a 4.6Kmh
 double tabComan[22]={0.25,0.255,0.260,0.265,0.27,0.28,0.3107,0.314,0.34,0.3655,0.391,0.4165,0.4335,0.459,0.51,0.5525,0.595};
 double tabSpeed[22]={0.10,0.14,0.19,0.22,0.25,0.28,0.33,0.36,0.41,0.45,0.49,0.55,0.59,0.62,0.75,0.80,0.82};
 
 //double minPosSpeed=0.20f;   // metri/secondo (0,20 = 0,72KmH)
-double minSeedSpeed=0.28f;  // attiva il LowSpeed mt/s (0,28 = 1,0KmH)
+double minSeedSpeed=0.22f;  // attiva il LowSpeed mt/s (0,28 = 1,0KmH)
 double speedForCorrection=0.25f;
 int cicliAspettaStart = 2;
 double avvioGradi=5.0f;