new

Dependencies:   mbed CANMsg

Committer:
nerit
Date:
Thu Jan 10 10:40:27 2019 +0000
Revision:
14:24c5d58e8bc6
Parent:
11:21e990eb31d0
Child:
15:2d5ae9acff83
Versione collaudata il 09-01-2019

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nerit 0:1e09cd7d66b4 1 // define constants
nerit 0:1e09cd7d66b4 2 const double Pi = 3.141592654f;
nerit 0:1e09cd7d66b4 3
nerit 0:1e09cd7d66b4 4 // define logic UI variables which NEED TO BE SET FROM UI
nerit 0:1e09cd7d66b4 5 // *** speed wheel
nerit 0:1e09cd7d66b4 6 double speedWheelDiameter = 0.300f; // variable for tractor speed calculation (need to be set from UI) ( Unit= meters )
nerit 4:d32258ec411f 7 double speedWheelPulse = 18.0f; // variable which define the number of pulse each turn of tractor speed wheel (need to be set from UI)
nerit 0:1e09cd7d66b4 8 // *** seeding wheel
nerit 0:1e09cd7d66b4 9 double seedWheelDiameter = 0.75f; // seed wheel diameter setting
nerit 0:1e09cd7d66b4 10 double seedWheelMotorSteps = 3200.0f; // seed wheel motor steps without reduction (defined from driver)
nerit 0:1e09cd7d66b4 11 double seedWheelRPM=0.0f; // number of turn per minute of seed wheel
nerit 0:1e09cd7d66b4 12 double seedWhellFrequency=0.0f; // seed wheel frequency which is function of tractor speed
nerit 0:1e09cd7d66b4 13 double seedWheelPeriod=0.0f; // seed wheel pulse period
nerit 0:1e09cd7d66b4 14
nerit 0:1e09cd7d66b4 15 double deepOfSeed=0.00f; // deep of seeding
nerit 0:1e09cd7d66b4 16 double oldSeedWheelPeriod=0.0f;
nerit 14:24c5d58e8bc6 17 double pickNumber = 20.0f; // numero di becchi installati sulla ruota di semina
nerit 14:24c5d58e8bc6 18 double cellsNumber = 20.0f; // numero di celle del tamburo
nerit 0:1e09cd7d66b4 19
nerit 0:1e09cd7d66b4 20 double TBmotorSteps = 1600.0f; // TB wheel motor steps without reduction (defined from driver)
nerit 0:1e09cd7d66b4 21 double TBreductionRatio = 1.65625f; // TB mechanical reduction ratio
nerit 0:1e09cd7d66b4 22 double SDreductionRatio =2.5714f; // seed wheel machanical reduction ratio
nerit 0:1e09cd7d66b4 23 double TBdeltaStep = 0.0f; // steps of advance for manage tb motor respect sd motor
nerit 0:1e09cd7d66b4 24 double K_WheelRPM =0.0f;
nerit 0:1e09cd7d66b4 25 double K_WhellFrequency=0.0f;
nerit 0:1e09cd7d66b4 26 double K_TBfrequency = 0.0f;
nerit 0:1e09cd7d66b4 27 double K_percentuale = 0.0f;
nerit 0:1e09cd7d66b4 28 double timeIntraPick = 0.0f;
nerit 0:1e09cd7d66b4 29 double teoryTimeIntraPick = 0.0f;
nerit 0:1e09cd7d66b4 30 double intraPickDistance = 0.0f;
nerit 0:1e09cd7d66b4 31
nerit 0:1e09cd7d66b4 32 uint16_t periodoSD = 1000;
nerit 0:1e09cd7d66b4 33 double dcStopDuty = 0.0f;
nerit 0:1e09cd7d66b4 34 double dcMinDuty = 0.0f; // definisce il duty cycle minimo alla partenza (corrisponde alla tensione minima di rotazione)
nerit 0:1e09cd7d66b4 35 double dcMaxDuty = 1.0f; // definisce il duty cycle al massimo della velocità
nerit 0:1e09cd7d66b4 36 double dcMinSpeed = 0.65f;
nerit 0:1e09cd7d66b4 37 double dcMaxSpeed = 1.00f;
nerit 0:1e09cd7d66b4 38 double dcStarting = 0.30f;
nerit 0:1e09cd7d66b4 39 double fixedStepGiroSD = 9000.0f; // numero di suddivisioni angolo giro della ruota di semina
nerit 11:21e990eb31d0 40 double minWorkSpeed=0.14;//pari 1kmh //0.138888f; //metri al secondo pari a 0,5Kmh
nerit 0:1e09cd7d66b4 41 double maxWorkSpeed=1.277777f; //metri al secondo pari a 4.6Kmh
nerit 0:1e09cd7d66b4 42 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};
nerit 0:1e09cd7d66b4 43 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};
nerit 0:1e09cd7d66b4 44
nerit 10:d85ed006056e 45 //double minPosSpeed=0.20f; // metri/secondo (0,20 = 0,72KmH)
nerit 11:21e990eb31d0 46 double minSeedSpeed=0.22f; // attiva il LowSpeed mt/s (0,28 = 1,0KmH)
nerit 0:1e09cd7d66b4 47 double speedForCorrection=0.25f;
nerit 0:1e09cd7d66b4 48 int cicliAspettaStart = 2;
nerit 14:24c5d58e8bc6 49 double avvioGradi=4.0f;
nerit 14:24c5d58e8bc6 50 double angoloFase = 2.0f;