diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-01 16:14:14 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-01 16:14:14 +0200 |
| commit | 8a28295329b996314caf21b8250bf3a14f375d8a (patch) | |
| tree | c28c5011eced69f272c5c7d370d93fcbd6f9394d /Software/Embedded_SW/Embedded/Modules | |
| parent | fe7df8b4ad260397a38141c5d23a7198d184acdc (diff) | |
| download | Tango-8a28295329b996314caf21b8250bf3a14f375d8a.tar.gz Tango-8a28295329b996314caf21b8250bf3a14f375d8a.zip | |
Turn blower off while heating, on after the dryer is on temperature
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
4 files changed, 34 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index dc7774019..a5f3f48cf 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -24,6 +24,8 @@ #include "drivers/I2C_Communication/DAC/Blower.h" +HardwareBlower BlowerCfg; + uint32_t HWConfigurationFunc(MessageContainer* requestContainer) { uint32_t status = 0; @@ -104,9 +106,16 @@ uint32_t HWConfigurationFunc(MessageContainer* requestContainer) if(request->blowers[0]->enabled) { - Turn_the_Blower_On();//Turn on with the Default_Voltage + BlowerCfg.enabled = true; + BlowerCfg.voltage = request->blowers[0]->voltage; + /*Turn_the_Blower_On();//Turn on with the Default_Voltage if (request->blowers[0]->voltage) Control_Voltage_To_Blower(request->blowers[0]->voltage); + */ + } + else + { + BlowerCfg.enabled = false; } ControlStart(); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h index 60742e58b..a28efa33c 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h @@ -5,8 +5,11 @@ #include "../../DataDef.h" #include "include.h" #include "PMR/common/MessageContainer.pb-c.h" +#include "PMR/Hardware/HardwareBlower.pb-c.h" extern uint32_t HWConfigurationFunc(MessageContainer* requestContainer); extern void HWSystemResetRequest(MessageContainer* requestContainer); +extern HardwareBlower BlowerCfg; + #endif diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 2e9b1ad0c..1a4086a34 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -10,10 +10,13 @@ #include "PMR/Hardware/HardwarePidControlType.pb-c.h" #include "PMR/Hardware/HardwarePidControl.pb-c.h" +#include "PMR/Hardware/HardwareBlower.pb-c.h" #include "PMR/Diagnostics/HeaterType.pb-c.h" #include "PMR/Diagnostics/HeaterState.pb-c.h" #include "PMR/common/MessageContainer.pb-c.h" +#include "drivers/I2C_Communication/DAC/Blower.h" + #include "../control/control.h" #include "../control/pidalgo.h" #include <driverlib/timer.h> @@ -354,6 +357,7 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue) #endif InitialHeating = true; HeaterReady[HeaterId] = false; + Turn_the_Blower_Off(); } /* if (HeaterId == HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain) //Dryer Heaters { @@ -516,6 +520,13 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) HeatersControlStart(); HeaterReady[index] = true; HeaterPrepareReady(); + if (BlowerCfg.enabled == true) + { + Turn_the_Blower_On();//Turn on with the Default_Voltage + if (BlowerCfg.voltage) + Control_Voltage_To_Blower(BlowerCfg.voltage); + + } } } if(HeaterPIDConfig[index].m_isEnabled && (HeaterPIDConfig[index].m_SetParam != 0)) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index b8be023c9..175cfcc7d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -315,12 +315,13 @@ uint32_t ThreadControlSpeedReadFunction(uint32_t IfIndex, uint32_t ReadValue) } //double eNormalizedError[100]; //int TranslatedreadValue[100]; -/*double calculatedError[1000]; -int MotorId[1000]; -int readValue[1000]; -int AveragereadValue[1000]; -int calculatedspeed[1000]; -int timestamp[1000];*/ +#define MAX_THREAD_CONTROL_LOG 500 +double calculatedError[MAX_THREAD_CONTROL_LOG]; +int MotorId[MAX_THREAD_CONTROL_LOG]; +int readValue[MAX_THREAD_CONTROL_LOG]; +int AveragereadValue[MAX_THREAD_CONTROL_LOG]; +int calculatedspeed[MAX_THREAD_CONTROL_LOG]; +int timestamp[MAX_THREAD_CONTROL_LOG]; int controlIndex = 0; bool keepdata = true; /*int32_t KeepReadValue = 0; @@ -469,14 +470,14 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) { if (keepdata == true) { - /* calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; + calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; MotorId[controlIndex] = index; readValue[controlIndex] = ReadValue; AveragereadValue[controlIndex] = avreageSampleValue; calculatedspeed[controlIndex] = calculated_speed; timestamp[controlIndex] = HibernateRTCSSGet(); - if (controlIndex++>=999) - controlIndex = 0;*/ + if (controlIndex++>=MAX_THREAD_CONTROL_LOG) + controlIndex = 0; } CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); |
