Переглянути джерело

1.解决扩增模块,自检报错时间过长问题。
2.调整插卡后光电自检报错为人为故障
3.版本为7.4.0.13

yidongFan 3 тижнів тому
батько
коміт
c891a9e3fd

+ 1 - 1
BoardInterface/onechip_load_inf.h

@@ -8,7 +8,7 @@
 #define SOFT_VERSION_1  7	//软件版本号
 #define SOFT_VERSION_2  4	//软件版本号
 #define SOFT_VERSION_3  0	//软件版本号
-#define SOFT_VERSION_4  12	//软件版本号
+#define SOFT_VERSION_4  13	//软件版本号
 
 
 

+ 0 - 1
Core/Src/main.c

@@ -222,7 +222,6 @@ int main(void)
   Motor_Init();
   updatParm_lysis();
   updatParm_heater_master();
-  check_heater_master_needPreheat();
 	if (HAL_TIM_Base_Start_IT(&htim2) != HAL_OK) {
 			/* 启动失败,可在此处添加错误处理 */
 			Error_Handler();

+ 1 - 1
DriverInterface/rgb381.c

@@ -392,7 +392,7 @@ int check_first_zero(void)
 		error_clear();
    		return 0;
 	}else{
-		error_set(ERROR_SENSOR_SELF_CHECK);
+		error_set(ERROR_SENSOR_CARD_CHECK);
 		return 1;
 	}
 }

+ 18 - 22
DriverInterface/state_mini.c

@@ -326,15 +326,12 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
             sts->state = SW_Target_reached;
             sts->statusword |= SW_Target_reached;
             
-        }
-
-        break;
-    }
+        }       
+    } break;
     case SW_Fault:
     {
         // 没有预热完成前插卡检测
-        // 采样没有完成,拔卡检测
-        
+        // 采样没有完成,拔卡检测        
         sts->sampleStart = 0;
 
         if(error_info.error_code < ERROR_SENSOR_SELF_CHECK && sysinf.error_delay == 0)
@@ -348,15 +345,15 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
 				memset(&sts->card_param_info, 0 , sizeof(str_card_param_info_t));
             }
         }
-		if(error_info.error_code == ERROR_SENSOR_SELF_CHECK){
-			if(check_first_zero() == 0){ 
-				sts->statusword |= SW_Chip_Id;
-            	sts->state = SW_Chip_Id;
-                error_clear();
-				}
-		}
-        break;
+		// if(error_info.error_code == ERROR_SENSOR_CARD_CHECK){
+		// 	if(check_first_zero() == 0){ 
+		// 		sts->statusword |= SW_Chip_Id;
+        //     	sts->state = SW_Chip_Id;
+        //         error_clear();
+		// 	}
+		// }
     }
+    break;
     // 快速停止
     case SW_Quick_stop:
     {
@@ -397,8 +394,8 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
             sts->state = SW_Scan_Qrcode;
             sts->heat_timeout = 0;
         }
-        break;
     }
+        break;
     
     // 扫码
     case SW_Scan_Qrcode:
@@ -420,8 +417,8 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
 	         sts->state = SW_Chip_Id;
              updateAmplifState(SYS_STATE_CHECK); 
 		}
-        break;
     }
+        break;
     // 插卡,通道检测
     case SW_Chip_Id:
     {
@@ -432,7 +429,7 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
       		Refresh_IWDG();
 			if(!(sysinf.skip_CheckOrRun & SKIP_CHECK_CARDINSERT)){
 				if(check_first_zero() == 1){                    
-                    updateAmplifState(SYS_STATE_ERROR_HW); 
+                    updateAmplifState(SYS_STATE_ERROR_HM); 
                     break;
                 }
 			}
@@ -453,8 +450,8 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
 				}
 				};
         }
-        break;
     }
+        break;
     // 采样,30min定时
     case SW_Sample_timeout:
     {
@@ -541,8 +538,8 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
 			
         }
 
-        break;
     }
+        break;
     // 计算,阈值范围,所有孔的结果(阴阳性、无效)
     // 结果上传&数据上传
     case SW_result_report:
@@ -581,9 +578,8 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
             updateAmplifState(SYS_STATE_WORKEND);             
 			beep_set(BEEP_WORKEND);
         }
-        break;
     }
-
+        break;
     case SW_move_card:
     {
         //等待拔卡进入下一次循环
@@ -604,8 +600,8 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
             sts->controlword = Board_Selftest_cmd; 
              updateAmplifState(SYS_STATE_PREPARE); 
         }
-        break;
     }
+        break;
     default:
         break;
     }

+ 1 - 0
DriverInterface/state_mini.h

@@ -75,6 +75,7 @@ typedef enum Controlword
 //故障码
 enum ERROR_CODE
 {
+    ERROR_SENSOR_CARD_CHECK= 100,      //插卡后光信号检测异常
     ERROR_HEAT_INSERT_CARD = 101,      //温度稳定前插卡
     ERROR_NO_QRCODE = 102,             //未扫码就插卡
     ERROR_SAMP_MOVE_CARD = 103,        //检测过程中拔卡

+ 33 - 14
DriverInterface/user_heater.c

@@ -82,28 +82,47 @@ void heater_work(heat_ctrl_def *heater)
     heater->timenum ++;
     switch (heater->HeatState)
     {
+        
+        case SystemCheckHeat:{
+            if(heater->firstIn == 0){
+                com_pwm_Set(heater->pwdId,100);   
+                heater->timenum = 0; 
+                heater->lastTemp = heater->pid.realtemp;  
+                heater->firstIn = 1;            
+            }         
+            if((heater->pid.realtemp > 70) || ((heater->pid.realtemp - heater->lastTemp) > 0.2)){                
+                check_heater_master_needPreheat();
+            }   else if (heater->timenum > 60)       {
+                error_set(ERROR_HEAT_TIMEOUT);
+                updateAmplifState(SYS_STATE_ERROR_HW);
+                Van_Device_Printf(VAN_LOG_ERROR, "HEAT_TIMEOUT at:%d\n\r",__LINE__);
+                heater->HeatState = SysERRORHeat;
+            } 
+        }
+        break;
         case SystemPreHeat:{
             heater->pid.goal = heater->HoldTemp;  
             if(heater->pid.realtemp -  heater->HoldTemp  > 0.6){
                 com_pwm_Set(heater->pwdId,0);                   
                 heater->pid.integral = 0;	  
-                heater->timenum = 0;       
+                heater->timenum = 0;         
+                
             }else{
                 PIDRealize(&heater->pid);
                 com_pwm_Set(heater->pwdId,heater->pid.variate);                
-                if(heater->timenum>=60*100)//system led turn red while the temperature could not heat up to PresetTemp over 10min
-                {
-                    if((heater->pid.realtemp<heater->HoldTemp))
-                    {
-                        com_pwm_Set(heater->pwdId,0);
-                        /*TODO 加热模块故障*/
-                        error_set(ERROR_HEAT_TIMEOUT);
-                        updateAmplifState(SYS_STATE_ERROR_HW);
-                        Van_Device_Printf(VAN_LOG_ERROR, "HEAT_TIMEOUT at:%d\n\r",__LINE__);
-                        heater->HeatState = SysERRORHeat;
-                        return;
-                    }
-                }
+                // if(heater->timenum>=60*100)//system led turn red while the temperature could not heat up to PresetTemp over 10min
+                // {
+                //     if((heater->pid.realtemp<heater->HoldTemp))
+                //     {
+                //         com_pwm_Set(heater->pwdId,0);
+                //         /*TODO 加热模块故障*/
+                //         error_set(ERROR_HEAT_TIMEOUT);
+                //         updateAmplifState(SYS_STATE_ERROR_HW);
+                //         Van_Device_Printf(VAN_LOG_ERROR, "HEAT_TIMEOUT at:%d\n\r",__LINE__);
+                //         heater->HeatState = SysERRORHeat;
+                //         return;
+                //     }
+                // }
             }
             
                 //稳定条件,大于待机温度-0.5度,并且小于就绪温度

+ 3 - 0
DriverInterface/user_heater.h

@@ -3,6 +3,7 @@
 
 #include "van_com_algorithm.h"
 
+#define SystemCheckHeat    0
 #define SystemPreHeat     1
 #define SystemIdle        2
 #define SysPreHeatUP      3
@@ -29,6 +30,7 @@ typedef struct
 	float	offset;		//温度补偿
 	unsigned int   PreHeatTime;					//上电预热时间,min
 	float     adJTarget;					//根据环境温度,修正目标温度
+    float lastTemp;
     unsigned int timenum;
     unsigned int HeatState;	  
     unsigned int overtempnum;
@@ -36,6 +38,7 @@ typedef struct
     pid_def  pid;	
     unsigned int pwdId; 
     unsigned int needpreheat;  
+    unsigned int firstIn;
 }heat_ctrl_def;
 
 

Різницю між файлами не показано, бо вона завелика
+ 4 - 5
MDK-ARM/mini7_V2.uvguix.Administrator


+ 1 - 50
MDK-ARM/mini7_V2.uvoptx

@@ -470,56 +470,7 @@
           <Name>-U-O142 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RE$Flash\STM32F10x_512.FLM)</Name>
         </SetRegEntry>
       </TargetDriverDllRegistry>
-      <Breakpoint>
-        <Bp>
-          <Number>0</Number>
-          <Type>0</Type>
-          <LineNumber>167</LineNumber>
-          <EnabledFlag>1</EnabledFlag>
-          <Address>134275948</Address>
-          <ByteObject>0</ByteObject>
-          <HtxType>0</HtxType>
-          <ManyObjects>0</ManyObjects>
-          <SizeOfObject>0</SizeOfObject>
-          <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\DriverInterface\van_BSP_Scanner.c</Filename>
-          <ExecCommand></ExecCommand>
-          <Expression>\\mini7_V2\../DriverInterface/van_BSP_Scanner.c\167</Expression>
-        </Bp>
-        <Bp>
-          <Number>1</Number>
-          <Type>0</Type>
-          <LineNumber>303</LineNumber>
-          <EnabledFlag>1</EnabledFlag>
-          <Address>134247580</Address>
-          <ByteObject>0</ByteObject>
-          <HtxType>0</HtxType>
-          <ManyObjects>0</ManyObjects>
-          <SizeOfObject>0</SizeOfObject>
-          <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\DriverInterface\usr_motor.c</Filename>
-          <ExecCommand></ExecCommand>
-          <Expression>\\mini7_V2\../DriverInterface/usr_motor.c\303</Expression>
-        </Bp>
-        <Bp>
-          <Number>2</Number>
-          <Type>0</Type>
-          <LineNumber>510</LineNumber>
-          <EnabledFlag>1</EnabledFlag>
-          <Address>134246142</Address>
-          <ByteObject>0</ByteObject>
-          <HtxType>0</HtxType>
-          <ManyObjects>0</ManyObjects>
-          <SizeOfObject>0</SizeOfObject>
-          <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\DriverInterface\usr_motor.c</Filename>
-          <ExecCommand></ExecCommand>
-          <Expression>\\mini7_V2\../DriverInterface/usr_motor.c\510</Expression>
-        </Bp>
-      </Breakpoint>
+      <Breakpoint/>
       <WatchWindow1>
         <Ww>
           <count>0</count>

Деякі файли не було показано, через те що забагато файлів було змінено