diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
4 files changed, 14 insertions, 30 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h index 3b357ce11..f7a2f3079 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h @@ -50,20 +50,8 @@ typedef struct HeaterCommandstruc uint32_t targettemperatue; }HeaterCommand; -typedef struct -{ - bool m_isEnabled; - float m_SetParam; - float m_mesuredParam; - float m_preError; - float m_integral; - float m_calculatedError; - bool m_isReady; - PID_Config_Params m_params; -}HeaterControlConfig_t; extern HeaterPIDControlConfig HeaterControl[MAX_HEATERS_NUM]; -extern HeaterControlConfig_t HeaterPIDConfig[MAX_HEATERS_NUM]; extern HeaterCommand HeaterCmd[MAX_HEATERS_NUM]; extern uint32_t Heater_timerBase; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c index 87a202469..e862107ff 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c @@ -46,7 +46,6 @@ typedef enum { /******************** GLOBAL PARAMETERS ********************************************/ HeaterPIDControlConfig HeaterControl[MAX_HEATERS_NUM] = {0,0,0,0,0,0,0,0,0,0,0,0}; -HeaterControlConfig_t HeaterPIDConfig[MAX_HEATERS_NUM] = {0,0,0,0,0,0,0,0,0,0,0,0}; bool AcHeaterConfigured[MAX_AC_HEATERS] = {0,0,0}; int NumberOFSlicesInUse = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 08a86ac39..3caf91de4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -41,6 +41,18 @@ typedef struct HeatersControlMessage{ uint32_t tick; uint8_t messageData[20]; }HeatersControlMessageStruc; +typedef struct +{ + bool m_isEnabled; + float m_SetParam; + float m_mesuredParam; + float m_preError; + float m_integral; + float m_calculatedError; + bool m_isReady; + PID_Config_Params m_params; +}HeaterControlConfig_t; +HeaterControlConfig_t HeaterPIDConfig[MAX_HEATERS_NUM] = {0,0,0,0,0,0,0,0,0,0,0,0}; /******************** GLOBAL PARAMETERS ********************************************/ HeaterCommand HeaterCmd[MAX_HEATERS_NUM]; @@ -522,7 +534,7 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) //check only for the proportional band limits HeaterPIDConfig[index].m_calculatedError = PIDAlgorithmCalculation(HeaterPIDConfig[index].m_SetParam , HeaterPIDConfig[index].m_mesuredParam, &HeaterPIDConfig[index].m_params, &HeaterPIDConfig[index].m_preError, &HeaterPIDConfig[index].m_integral); - //HeaterRecalculateSharedHeatersParams(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain, (int)(HeaterPIDConfig[index].m_calculatedError)); + //HeaterRecalculateSharedHeatersParams(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain, (int)(HeaterPIDConfig[index].m_calculatedError/100)); } @@ -618,7 +630,7 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) // Report(logmsg[index],__FILE__,__LINE__,index,RpWarning,index, Counter[index]); //#warning PID is now only proportional (above) - //HeaterRecalculateHeaterParams(index, (int)(HeaterPIDConfig[index].m_calculatedError)); + //HeaterRecalculateHeaterParams(index, (int)(HeaterPIDConfig[index].m_calculatedError/100)); } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index d2bbad72b..503ef2c37 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -461,21 +461,6 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //KeepNormalizedError = NormalizedError; } calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index]; - /*if (index == FEEDER_MOTOR) - { - if (KeepReadValue != TranslatedReadValue) - { - eNormalizedError[controlIndex] = NormalizedError; - calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError; - readValue[controlIndex] = ReadValue; - TranslatedreadValue[controlIndex] = TranslatedReadValue; - AveragereadValue[controlIndex] = avreageSampleValue; - calculatedspeed[controlIndex] = calculated_speed; - controlIndex++; - if (controlIndex >= 99) controlIndex = 0; - KeepReadValue = TranslatedReadValue; - } - }*/ if (abs(calculated_speed-CurrentControlledSpeed[index])>2) { /*if (keepdata == true) |
