|
@@ -50,6 +50,9 @@ void updatParm_lysis(void) {
|
|
|
sysinf.lysis.pid.Kp = sysinf.lysis_Kp;
|
|
sysinf.lysis.pid.Kp = sysinf.lysis_Kp;
|
|
|
sysinf.lysis.pid.Ki = sysinf.lysis_Ki ;
|
|
sysinf.lysis.pid.Ki = sysinf.lysis_Ki ;
|
|
|
sysinf.lysis.pid.Kd = sysinf.lysis_Kd;
|
|
sysinf.lysis.pid.Kd = sysinf.lysis_Kd;
|
|
|
|
|
+ sysinf.lysis.idletemp = sysinf.lysis_idleTemp;
|
|
|
|
|
+ sysinf.lysis.setgaol = sysinf.lysis_Goal;
|
|
|
|
|
+ sysinf.lysis.worktime = sysinf.lysis_HeatTime * 10;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -89,7 +92,6 @@ uint32_t Therm_Check(void) {
|
|
|
*/
|
|
*/
|
|
|
void set_lysis(float goal) {
|
|
void set_lysis(float goal) {
|
|
|
sysinf.lysis.pid.goal = goal;
|
|
sysinf.lysis.pid.goal = goal;
|
|
|
- sysinf.lysis.lastgaol = goal;
|
|
|
|
|
if(goal > (sysinf.lysis.overHeat + sysinf.lysis.pid.realtemp )){
|
|
if(goal > (sysinf.lysis.overHeat + sysinf.lysis.pid.realtemp )){
|
|
|
sysinf.lysis.pid_st = PID_OVERHEAT;
|
|
sysinf.lysis.pid_st = PID_OVERHEAT;
|
|
|
sysinf.lysis.pid.goal += sysinf.lysis.overHeat;
|
|
sysinf.lysis.pid.goal += sysinf.lysis.overHeat;
|
|
@@ -196,10 +198,7 @@ uint32_t lysis_work(void) {
|
|
|
ptherm->firstin = false;
|
|
ptherm->firstin = false;
|
|
|
updateLysisState(SYS_STATE_PREPARE);sysinf.lysisState = SYS_STATE_PREPARE;
|
|
updateLysisState(SYS_STATE_PREPARE);sysinf.lysisState = SYS_STATE_PREPARE;
|
|
|
firstTemp = getADC_Chanel_value(1);
|
|
firstTemp = getADC_Chanel_value(1);
|
|
|
- set_lysis(95);
|
|
|
|
|
- ptherm->pid.goal = 95;
|
|
|
|
|
- ptherm->worktime = 3000;
|
|
|
|
|
- ptherm->lastgaol = 95;
|
|
|
|
|
|
|
+ set_lysis(sysinf.lysis.setgaol);
|
|
|
last10ms = sysinf.conter10ms;
|
|
last10ms = sysinf.conter10ms;
|
|
|
}else{
|
|
}else{
|
|
|
float heattemp = getADC_Chanel_value(1);
|
|
float heattemp = getADC_Chanel_value(1);
|
|
@@ -260,24 +259,31 @@ uint32_t lysis_work(void) {
|
|
|
}break;
|
|
}break;
|
|
|
case THERMOSTAT_IDLE:{
|
|
case THERMOSTAT_IDLE:{
|
|
|
if(ptherm->firstin){
|
|
if(ptherm->firstin){
|
|
|
- updateLysisState(SYS_STATE_READY);
|
|
|
|
|
|
|
+ // updateLysisState(SYS_STATE_READY);
|
|
|
ptherm->firstin = false;
|
|
ptherm->firstin = false;
|
|
|
Close_therm(0);
|
|
Close_therm(0);
|
|
|
ptherm->recGoalFlag = 0;
|
|
ptherm->recGoalFlag = 0;
|
|
|
firstTemp = getADC_Chanel_value(1);
|
|
firstTemp = getADC_Chanel_value(1);
|
|
|
|
|
|
|
|
|
|
+ updateLysisState(SYS_STATE_CHECK);
|
|
|
}else{
|
|
}else{
|
|
|
- if(ptherm->recGoalFlag){
|
|
|
|
|
- set_lysis(ptherm->pid.goal);
|
|
|
|
|
|
|
+ if(Read_Tupe()){
|
|
|
|
|
+ set_lysis(ptherm->setgaol);
|
|
|
ptherm->recGoalFlag = 0;
|
|
ptherm->recGoalFlag = 0;
|
|
|
- updateLysisState(SYS_STATE_PREHEAT);
|
|
|
|
|
firstTemp = getADC_Chanel_value(1);
|
|
firstTemp = getADC_Chanel_value(1);
|
|
|
last10ms = sysinf.conter10ms;
|
|
last10ms = sysinf.conter10ms;
|
|
|
- }
|
|
|
|
|
- if(ptherm->pid_stable){
|
|
|
|
|
ptherm->thermostat_st = THERMOSTAT_INSERT;
|
|
ptherm->thermostat_st = THERMOSTAT_INSERT;
|
|
|
- ptherm->firstin = true;
|
|
|
|
|
|
|
+ ptherm->firstin = 1;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ }break;
|
|
|
|
|
+ case THERMOSTAT_INSERT:{
|
|
|
|
|
+ if(ptherm->firstin){
|
|
|
|
|
+ ptherm->firstin = false;
|
|
|
|
|
+ updateLysisState(SYS_STATE_RUNING);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ /*加热异常判断*/
|
|
|
if(((ptherm->pid.realtemp - firstTemp) < HEAT_WORK_THD)&&
|
|
if(((ptherm->pid.realtemp - firstTemp) < HEAT_WORK_THD)&&
|
|
|
((sysinf.conter10ms-last10ms)> HEAT_TEST_TIME)&&((ptherm->pid.goal - firstTemp) > 10.0)){
|
|
((sysinf.conter10ms-last10ms)> HEAT_TEST_TIME)&&((ptherm->pid.goal - firstTemp) > 10.0)){
|
|
|
/*目标温差大于10,加热启动30s之内没升温2.5° 超时判断*/
|
|
/*目标温差大于10,加热启动30s之内没升温2.5° 超时判断*/
|
|
@@ -285,18 +291,11 @@ uint32_t lysis_work(void) {
|
|
|
updateLysisState(SYS_STATE_ERROR_HW);
|
|
updateLysisState(SYS_STATE_ERROR_HW);
|
|
|
error_set(ERROR_HEATFUC_EER);
|
|
error_set(ERROR_HEATFUC_EER);
|
|
|
ptherm->firstin = true;
|
|
ptherm->firstin = true;
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }break;
|
|
|
|
|
- case THERMOSTAT_INSERT:{
|
|
|
|
|
- if(ptherm->firstin){
|
|
|
|
|
- updateLysisState(SYS_STATE_CHECK);
|
|
|
|
|
- ptherm->firstin = false;
|
|
|
|
|
- }else{
|
|
|
|
|
- if(Read_Tupe()){
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if((ptherm->pid.realtemp + 5) >ptherm->setgaol ) {
|
|
|
ptherm->thermostat_st = THERMOSTAT_WORK;
|
|
ptherm->thermostat_st = THERMOSTAT_WORK;
|
|
|
- ptherm->firstin = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ptherm->firstin = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}break;
|
|
}break;
|
|
|
case THERMOSTAT_WORK:{
|
|
case THERMOSTAT_WORK:{
|