Massimo Viaro / Mbed 2 deprecated Viaro_SpandiConcime_V3

Dependencies:   mbed

Fork of Viaro_SpandiConcime_V2b by Neri Tiziano

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers variables.h Source File

variables.h

00001 int SD_faultA=0;
00002 int SD_faultB=0;
00003 int DC_brake=1;
00004 int DC_forward=1;
00005 
00006 string MachineType("electric");  //two options: "electric" or "idraulic"
00007 
00008 float Percent(1.0);  //variable to add/take out a Percent of product with PlusPercentPin/MinusPercentPin
00009 char ChangeFromOffToOn(1);  //used to reset Previous millis() when the operator switch off and back on
00010 char StopTheMotorWeGoTooSlow(1);  //stop the motor, we go too slow
00011 char MotorSensorError(0);  //stop the motor, we go too slow
00012 int TrigsPerWheelRevolution(10);  //number of triggers per weheel complete revolution
00013 int WheelDiameter(400);  //wheel diameter in millimeters
00014 unsigned long WantedMotorSpeed(0);  //motor speed (initial is 0)
00015 unsigned long ReadMotorSpeed(0);  //motor speed (initial is 0)
00016 float MotorSpeedCorrected(0);  //motor speed (initial is 0)
00017 float MotorSpeedPwmTemp(0);  //motor speed pwm (initial is 0)
00018 float MotorSpeedPwm(0);  //motor speed pwm (initial is 0)
00019 int MinMotorPwm(1);  //min pwm for the motor to start
00020 int MinMotorSpeed(1000);  //min motor speed
00021 int MaxMotorSpeed(10000);  //max motor speed
00022 int WheelToMotorRatio(100);  //set the ideal ratio between wheel speed and motor speed  //RUOTA FONICA > MOTORE
00023 float MotorCorrection(1.0);  //set the initial motor correction factor
00024 int MotorSensorSecurityCheck(0);  //set the initial motor correction factor
00025 float DecelerationControlRatio(1.5);  //ratio to control wheel decelaration accepted limit
00026 const int ConstArrayIns(3);  //the number set the array values
00027 CB1<int,ConstArrayIns> ReadWheelArray;  //Circular array (for LIFO purposes) for wheel sensor readings
00028 CB1<int,ConstArrayIns> ReadMotorArray;  //Circular array (for LIFO purposes) for wheel sensor readings
00029 int i;  //general purpose integer for loops
00030 int a;  //general purpose integer for loops
00031 unsigned long TempReadW;  //temporal read of wheel sensor millis for analysis
00032 unsigned long TempReadM;  //temporal read of motor sensor millis for analysis
00033 unsigned long ElapsedW(0);  //used to take note of Elapsed time
00034 unsigned long ElapsedM(0);  //used to take note of Elapsed time
00035 unsigned long CheckIfReadMChanges(0);  //feedback of motor sensor
00036 //from PID library: 0.0 - 1.0
00037 PID motorPID(0.5, 0.3, 0.1, 0.1);  //Kc, Ti, Td, interval (0.1ms)
00038 
00039 //the below declarations are meant to prevent problems on switches due to tractor vibrations
00040 int VibrationTimer(500);  //timer for avoid vibrations in millis
00041 bool ChangeStatusOfOnOffPinToHigh(1);
00042 bool ChangeStatusOfOnOffPinToLow(1);
00043 bool ChangeStatusOfPlusPercentPinToHigh(1);
00044 bool ChangeStatusOfPlusPercentPinToLow(1);
00045 bool PercentPlus(0);
00046 bool ChangeStatusOfMinusPercentPinToHigh(1);
00047 bool ChangeStatusOfMinusPercentPinToLow(1);
00048 bool PercentMinus(0);
00049 bool WheelData(0);  //need to tell main() there's some data to handle
00050 bool MotorData(0);  //need to tell main() there's some data to handle
00051 bool Compute(0);
00052 bool SecurityStop(0);