Heater for threaded program
Dependents: LEX_Threaded_Programming_V3
Diff: Heater.h
- Revision:
- 35:5acf01897ed6
- Parent:
- 34:294adcc3e4b2
- Child:
- 42:166d9bc7675e
diff -r 294adcc3e4b2 -r 5acf01897ed6 Heater.h --- a/Heater.h Fri Sep 20 14:53:54 2019 +0000 +++ b/Heater.h Mon Sep 23 15:41:15 2019 +0000 @@ -12,7 +12,6 @@ #include "FastPWM.h" #include "memspcr.pb.h" - class Heater { //This class provides the interface through which each heater can be controlled @@ -24,7 +23,7 @@ * @param * drive is a pointer to the main heater * @param * guard is a pointer to the guard heater **/ - Heater(const int i_port, const int v_port, FastPWM * drive, FastPWM * guard, ADS8568_ADC * adc, DigitalIn adc_busy, const memspcr_ThermalConfiguration & thermal = memspcr_ThermalConfiguration_init_zero); + Heater(const int i_port, const int v_port, float cal_a, float cal_b, FastPWM * drive, FastPWM * guard, ADS8568_ADC * adc, DigitalIn adc_busy, const memspcr_ThermalConfiguration & thermal = memspcr_ThermalConfiguration_init_zero); //Public member functions @@ -48,18 +47,20 @@ protected: const memspcr_ThermalConfiguration thermal; - int curr; //Latest current reading from ADC - int v; //Latest voltage reading from ADC - float R; //Latest resistance calculated from ADC current and voltage - float R_ref; //Current referance for resistance - float error; //R_ref - R + int curr; //Latest current reading from ADC + int v; //Latest voltage reading from ADC + float R; //Latest resistance calculated from ADC current and voltage + float R_ref; //Current referance for resistance + float error; //R_ref - R float error_integrated; //Integrated error ADS8568_ADC * adc; DigitalIn adc_busy; - int i_port; //ADC port which corresponds to current measurements - int v_port; //ADC port which corresponds to voltage measurements - FastPWM * drive; //Pointer to the driver - FastPWM * guard; //Pointer to the guard + int i_port; //ADC port which corresponds to current measurements + int v_port; //ADC port which corresponds to voltage measurements + float cal_a; + float cal_b; //Resistance calibration ADC units to Ohms: R_Ohm = cal_a + cal_b * R_ADC + FastPWM * drive; //Pointer to the driver + FastPWM * guard; //Pointer to the guard };