copia12092018

Dependencies:   mbed

Revision:
9:6fb26643eecd
Parent:
7:dc3cb1a5764b
Child:
10:08ea112cd13a
--- a/variables.h	Fri Sep 14 15:23:34 2018 +0000
+++ b/variables.h	Tue Sep 18 13:29:34 2018 +0000
@@ -3,6 +3,8 @@
 int DC_brake=1;
 int DC_forward=1;
 
+float PID_Rate(0.1);
+
 string MachineType("electric");  //two options: "electric" or "idraulic"
 
 float Percent(1.0);  //variable to add/take out a Percent of product with PlusPercentPin/MinusPercentPin
@@ -19,7 +21,9 @@
 int MinMotorPwm(1);  //min pwm for the motor to start
 int MinMotorSpeed(1000);  //min motor speed
 int MaxMotorSpeed(10000);  //max motor speed
-int WheelToMotorRatio(100);  //set the ideal ratio between wheel speed and motor speed  //RUOTA FONICA > MOTORE
+//int WheelToMotorRatio(100);  //set the ideal ratio between wheel speed and motor speed  //RUOTA FONICA > MOTORE
+//francesco 17/09/2018 -> test
+int WheelToMotorRatio(100); // 4 (=pv) * 60(=3000/50) * 12 (differenza circonferenza di rotazione)
 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
@@ -36,7 +40,9 @@
 //from PID library: 0.0 - 1.0
 //PID motorPID(0.5, 0.3, 0.1, 0.1);  //Kc, Ti, Td, interval (0.1ms)
 //francesco 13/09/2018 --> test togliendo la parte derivativa del PID
-PID motorPID(0.5, 0.3, 0.0, 0.1);  //Kc, Ti, Td, interval (0.1ms)
+//PID motorPID(0.5, 0.3, 0.0, 0.1);  //Kc, Ti, Td, interval (0.1ms)
+PID motorPID(1.0, 0.0, 0.0, 0.1);  //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