Francesco Pistone
/
Viaro_SpandiConcime_V3_inizio
copia12092018
Diff: variables.h
- Revision:
- 3:1cd8d048cd4a
- Parent:
- 0:b0a79a3a9da8
- Child:
- 4:1643fea75703
--- a/variables.h Fri Jun 15 17:04:46 2018 +0000 +++ b/variables.h Tue Jun 19 16:47:15 2018 +0000 @@ -17,14 +17,14 @@ float MotorSpeedPwmTemp(0); //motor speed pwm (initial is 0) float MotorSpeedPwm(0); //motor speed pwm (initial is 0) int MinMotorPwm(1); //min pwm for the motor to start -int MinMotorSpeed(10); //min motor speed +int MinMotorSpeed(1300); //min motor speed int MaxMotorSpeed(100000); //max motor speed float WheelToMotorRatio; //set the ideal ratio between wheel speed and motor speed //float ReductionRatio(24); float MotorCorrection(1.0); //set the initial motor correction factor int MotorSensorSecurityCheck(0); //set the initial motor correction factor float DecelerationControlRatio(1.5); //ratio to control wheel decelaration accepted limit -const int ConstArrayIns(3); //the number set the array values +const int ConstArrayIns(4); //the number set the array values CB1<int,ConstArrayIns> ReadWheelArray; //Circular array (for LIFO purposes) for wheel sensor readings CB1<int,ConstArrayIns> ReadMotorArray; //Circular array (for LIFO purposes) for wheel sensor readings int i; //general purpose integer for loops @@ -35,7 +35,7 @@ unsigned long ElapsedM(0); //used to take note of Elapsed time unsigned long CheckIfReadMChanges(0); //feedback of motor sensor //from PID library: 0.0 - 1.0 -PID motorPID(1.0, 0.2, 0.4, 0.1); //Kc, Ti, Td, interval (0.1ms) +PID motorPID(1.0, 0.4, 0.3, 0.3); //Kc, Ti, Td, interval (0.1ms) //the below declarations are meant to prevent problems on switches due to tractor vibrations int VibrationTimer(500); //timer for avoid vibrations in millis