状态机(Apture)
2024-02-23 08:52:35 1 举报
状态机(Apture)是一种用于描述对象在其生命周期内所经历的各种状态以及状态之间转换的模型。它通常由一组状态、事件和转移规则组成。在软件开发中,状态机被广泛应用于面向对象编程、游戏开发、协议解析等领域。通过使用状态机,开发人员可以更好地理解和控制对象的内部行为,提高代码的可读性和可维护性。
作者其他创作
大纲/内容
Exit
+ Clear Delay Flag Bit+ Set PWM_OFF- Clear PWM_DUTY+ Com485_Ctrl_On
PostLoop
+ DispostException( )+ Collect AD+ Detect PowerOnOFF Sign
Loop
+ if ( Grid_Detect || OVP_Detect )- Transited Stop State+ else- Transited RectifierSoftStart State- After 1s - + TMR1_CH2_V_OFF+ TMR1_CH3_I_OFF
+ Clear Flag Bit
Normal Output(Must Add Constraint)
+ PID调节占空比实现带载,CV模式- VOut 恒压至 48V+ 占空比调节- TIM_V(Duty);
Action(Only Once)
+ Buffer_Relay_OFF+ PFC_StartUp_OFF+ OVP_ShuttDown_Ctrl_OFF+ Prim_PwrSupCtrl_OFF
+PFC_StartUp_ON+TMR2_CH2_V_OFF- TMR_V(0)
+ if ( ErrchgRecovType.all == 0 )- Transited RectifierSoftStart State- After 1s -
+ if ( PowerOnOFFCommand == 1 )- Transited RectifierStartUpCheckState- After 1s -
+ DispostException( )+ Collect AD+ Detect PowerOnOFF Sign
StateRectifierStartUpCheck(Check Execution State)
Initilizatioin
+ if ( (30 < Vbat < 48V) && (abs(Vbat - Vout) < 30 ) )- Transited RechargeableBattery State+ else if (Vbat < 30)- Transited RectifierOutputLoad State- After 1s -
StateInit(Init State)
StateRectifierOutputLoad(Execute CV State)
StateStopOutput(Uart Execution State)
Action(Only Once)
+ Prim_PwrSupCtrl_ON
+ PFC_StartUp_OFF+ PRIM_PWRSUP_CTRL_OFF+TMR1_CH3_I_OFF+TMR1_CH2_V_OFF+ TIM_V(0);+ TIM_I(0);
+ OVP_ShuttDown_Ctrl_ON- TIM_V(50);- TIM_I(50);
+ Buffer_Relay_ON+ TMR1_CH2_V_On+ TMR1_CH3_I_On- TIM_V(50);- TIM_I(50);
StateHiccupOutput(Abnormal Execution State)
Before enter the Loop
+ Psu_VccpCtrl_On- COM485_CTRL_OFF();- BUFFER_RELAY_OFF();- PFC_STARTUP_OFF();- OVP_SHUTTDOWN_CTRL_OFF- PRIM_PWRSUP_CTRL_OFF();+ Initialization parameters+ Initialization DMA+ Initialization Uart
+ PFC_StartUp_ON+ TMR2_CH3_I_OFF- TIM_I( 0 )
Abnormal Hiccup Output(Must Add Constraint)
+ if (FreqAddCheck == True)- Transited RectifierStartupCheck State- After 1s - + TMR1_CH2_V_0+ TMR1_CH3_I_0
StateRechargeableBattery(Execute CC or CV State)
StateRectifierSoftStart(Select Execution State)
收藏
0 条评论
下一页