适配110V美标控制盒过热复位流程:过热帧后低位强制下降触发复位,复位帧后先停2s再下降完成复位;新增报错观测日志(已关闭)
This commit is contained in:
@@ -1132,11 +1132,30 @@ static void AppLoopHandler(void)
|
||||
break;}
|
||||
|
||||
case APP_STATUS_HEIGHT_CONTROL:{
|
||||
if(App.MotorPara.Current_height <= 1005
|
||||
&& App.MotorPara.RestFlag == false
|
||||
&& App.HeightContRolCnt >= 500
|
||||
&& GET_BIT0_DOUT() == 1
|
||||
&& GET_BIT1_DOUT() == 1)
|
||||
if(App.MotorPara.OverheatFlag == true)
|
||||
{
|
||||
if(App.MotorPara.Current_height <= 1005)
|
||||
{
|
||||
BDC_DOWN();//过热+低位: 继续下降触发控制盒复位(SupportControlHandle在<=1005时不执行BDC_DOWN)
|
||||
}
|
||||
//过热+高位(>1005): 由SupportControlHandle根据传感器正常判断下降
|
||||
}
|
||||
else if(App.MotorPara.RestFlag == true)
|
||||
{
|
||||
if(App.RestStop1mSCnt > 0)
|
||||
{
|
||||
BDC_STOP();//复位停顿: 先停止电机, 让控制盒进入复位流程
|
||||
}
|
||||
else
|
||||
{
|
||||
BDC_DOWN();//停顿结束: 再次下降, 触发控制盒完成复位(收到高度帧后RestFlag清除)
|
||||
}
|
||||
}
|
||||
else if(App.MotorPara.Current_height <= 1005
|
||||
&& App.MotorPara.RestFlag == false
|
||||
&& App.HeightContRolCnt >= 500
|
||||
&& GET_BIT0_DOUT() == 1
|
||||
&& GET_BIT1_DOUT() == 1)
|
||||
{
|
||||
App.HeightContRolCnt = 0;
|
||||
BDC_UP();
|
||||
@@ -1167,6 +1186,8 @@ static void App1mSRoutine(void)
|
||||
App.Uart1Delay1mSCnt--;
|
||||
if(App.Uart3RxTimeOut1mSCnt > 0)
|
||||
App.Uart3RxTimeOut1mSCnt--;
|
||||
if(App.RestStop1mSCnt > 0)
|
||||
App.RestStop1mSCnt--;
|
||||
if(App.StopCollDelay1mSCnt > 0)
|
||||
App.StopCollDelay1mSCnt--;
|
||||
if(App.RunCollDelay1mSCnt > 0)
|
||||
@@ -1206,6 +1227,7 @@ int main(void)
|
||||
FeedDogHandler();
|
||||
#endif
|
||||
DebugLoopHandler();
|
||||
//Uart3ErrLogLoopHandler(); //调试观测日志(复位流程已验证, 关闭打印, 需要时取消注释)
|
||||
#if(USE_CS1237_LEFTUP == 1)
|
||||
LEFTUP_CS1237DataLoopCollect();
|
||||
#endif
|
||||
@@ -1301,13 +1323,25 @@ void Usart3RxIrqCallback(void)
|
||||
{
|
||||
if(App.RxUart3Data.RxBuff[0] == 0x01 && App.RxUart3Data.RxBuff[1] == 0x04)
|
||||
{
|
||||
uint8_t firstErr = (App.MotorPara.RestFlag == false) ? 0 : 1; //0:首次信息帧 1:复位中回应
|
||||
App.MotorPara.RestFlag = true;
|
||||
App.MotorPara.OverheatFlag = false;//收到复位帧, 过热状态解除
|
||||
if(firstErr == 0)
|
||||
{
|
||||
App.RestStop1mSCnt = 2000;//首次收到复位帧: 启动停顿计时, 先停止电机让控制盒进入复位流程, 计时结束再下降触发复位
|
||||
}
|
||||
//Uart3ErrLog_Push(firstErr, App.RxUart3Data.RxBuff, 0);//调试观测日志(关闭打印, 需要时取消注释)
|
||||
}
|
||||
else if(App.RxUart3Data.RxBuff[0] == 0x01 && App.RxUart3Data.RxBuff[1] == 0x01)
|
||||
{
|
||||
App.MotorPara.RestFlag = false;
|
||||
int16_t h = ((App.RxUart3Data.RxBuff[2]<<8) & 0xff00) + (App.RxUart3Data.RxBuff[3] & 0x00ff);
|
||||
if(h >= 1000 && h <= 1430)
|
||||
if(App.MotorPara.RestFlag == true)
|
||||
{
|
||||
//Uart3ErrLog_Push(2, App.RxUart3Data.RxBuff, (uint16_t)h);//调试观测日志(关闭打印, 需要时取消注释)
|
||||
}
|
||||
App.MotorPara.RestFlag = false;
|
||||
App.MotorPara.OverheatFlag = false;//收到高度帧, 确认复位完成
|
||||
if(h >= 990 && h <= 1430)
|
||||
{
|
||||
App.MotorPara.Current_height = h;
|
||||
}
|
||||
@@ -1326,6 +1360,16 @@ void Usart3RxIrqCallback(void)
|
||||
App.MotorPara.RL_HeightStress[HEIGHT_TO_IDX(App.MotorPara.Current_height)] = App.ADTrack.RightLow_Org_AdZero - App.RightLowCS1237_TrendArray[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //未知帧(帧头非01 04/01 01): 过热等其它报错可能是任意组合, 全部记录供分析
|
||||
/* 过热帧(01 02 00 10): 置OverheatFlag, HEIGHT_CONTROL跳过限位纠偏, 由SupportControlHandle判断下降触发控制盒复位 */
|
||||
if(App.RxUart3Data.RxBuff[0] == 0x01 && App.RxUart3Data.RxBuff[1] == 0x02
|
||||
&& App.RxUart3Data.RxBuff[2] == 0x00 && App.RxUart3Data.RxBuff[3] == 0x10)
|
||||
{
|
||||
App.MotorPara.OverheatFlag = true;
|
||||
}
|
||||
//Uart3ErrLog_Push(3, App.RxUart3Data.RxBuff, 0);//调试观测日志(关闭打印, 需要时取消注释)
|
||||
}
|
||||
memset(App.RxUart3Data.RxBuff, 0, sizeof(App.RxUart3Data.RxBuff));
|
||||
App.RxUart3Data.RxLen = 0;
|
||||
App.Uart3RxTimeOut1mSCnt = 0;
|
||||
|
||||
Reference in New Issue
Block a user