This document describes what happens when the system is in STATE_READY and the
ignition input is turned OFF. It focuses on the ready relay behavior, the
separate HV request path, and the dedicated shutdown message that is sent before
the LVDU drops the VCU relay on the way to STATE_SLEEP.
Scope:
- Software paths in
LVDU(include/lvdu.h) - Ready relay (
DigIo::ready_out) - HV request (
HVCM_to_bms_hv_request) - Pre-sleep shutdown message (
LVDU_forceVCUsShutdown) - TeensyBMS VCU status feedback (
src/teensyBMS.cpp)
While in STATE_READY:
hvManager.SetHVRequest(true)is asserted.- Outputs:
DigIo::ready_outis ON.DigIo::condition_outis ON.DigIo::vcu_outis ON.
HVCM_to_bms_hv_requestis set from the HV manager request (subject to load interlocks).
Input path:
UpdateInputs()readsignition_inand storesignitionOn.UpdateState()seesignitionOn == falseinSTATE_READY.
Transition:
STATE_READY->STATE_CONDITIONING
Side effects of the transition:
TransitionTo(STATE_CONDITIONING)sets:diagnosePending = truediagnoseTimer = LVDU_DIAGNOSE_DELAY_STEPS(4000 ms)
- HV request is still ON because
STATE_CONDITIONINGis an HV-using state.
During STATE_CONDITIONING:
DigIo::ready_outis:- ON while
diagnosePending == true - OFF once the diagnose window expires
- ON while
Diagnosis behavior:
- For up to
LVDU_DIAGNOSE_DELAY_STEPS, the system expectsready_safety_into remain asserted. If it drops, an error is posted. - After the diagnose timer ends and cooldown passes,
ready_outmust be OFF andready_safety_inmust be OFF; otherwise errors are posted.
hvManager is the single place the LVDU stores the request to keep HV on.
Key points:
hvManager.SetHVRequest(true/false)is controlled by the LVDU state machine.hvManager.IsHVActive()is feedback only and reflects BMS contactor state:IsHVActive()is true only if:BMS_DataValidis true, andBMS_CONT_State == 4(closed)
So after ignition OFF:
- The request stays ON while in
STATE_CONDITIONING. - Actual HV feedback depends on the BMS contactor state.
Every 100 ms TeensyBMS::Task100Ms() sends the VCU status frame to the BMS:
- Byte 0:
LVDU_vehicle_state - Byte 1:
LVDU_forceVCUsShutdown - Byte 2:
HVCM_to_bms_hv_request - Byte 6: rolling counter
- Byte 7: CRC
Important distinction:
LVDU_forceVCUsShutdownis the shutdown messaging bit that warns the BMS and downstream VCUs that the LVDU is about to drop the VCU relay before enteringSTATE_SLEEP.HVCM_to_bms_hv_requestis only the HV request signal. It controls whether the BMS should keep HV active. It is not the shutdown message.
After ignition OFF:
STATE_CONDITIONINGkeeps the HV request ON.- Therefore
HVCM_to_bms_hv_requestremains 1 while conditioning is active, unless the HV-off interlock is explicitly allowing it to go low.
LVDU only drops the HV request when it transitions to a non-HV state:
STATE_STANDBYSTATE_SLEEPSTATE_ERROR(explicitly requests HV off)
In the READY -> ignition OFF path:
READY->CONDITIONING- Then, if
thermalTaskCompletedand diagnosis is not pending:CONDITIONING->STANDBY
- On entering
STANDBY,hvManager.SetHVRequest(false)is executed.
At that point, HVCM_to_bms_hv_request will go low unless HV loads are still
active and the HV-off interlock keeps it high.
Before the LVDU turns off DigIo::vcu_out and enters STATE_SLEEP, the sleep
call sites always transition into STATE_FORCE_VCU_SHUTDOWN first.
During STATE_FORCE_VCU_SHUTDOWN:
LVDU_forceVCUsShutdown = 1DigIo::vcu_outstays ONDigIo::condition_outis OFFDigIo::ready_outis OFF
When the delay expires:
- the next 100 ms cycle transitions to
STATE_SLEEP LVDU_forceVCUsShutdownreturns to 0DigIo::vcu_outis turned OFF
When the configured delay is 0 ms:
- the system still enters
STATE_FORCE_VCU_SHUTDOWN - on the following 100 ms cycle it transitions to
STATE_SLEEP
This same pre-sleep delay is used for:
- normal standby -> sleep shutdown
- error -> sleep shutdown
- forced low-voltage sleep shutdown
-
STATE_READY, ignition ON:ready_out = ONHVCM_to_bms_hv_request = 1
-
Ignition OFF:
STATE_READY->STATE_CONDITIONINGready_out = ONduring diagnose windowHVCM_to_bms_hv_request = 1
-
Diagnosis ends:
ready_out = OFF- still in
STATE_CONDITIONING, HV request remains ON
-
Conditioning completes:
STATE_CONDITIONING->STATE_STANDBYhvManager.SetHVRequest(false)HVCM_to_bms_hv_requestgoes low if no HV loads are active
-
Before any transition from
STATE_STANDBYorSTATE_ERRORtoSTATE_SLEEPcompletes:STATE_FORCE_VCU_SHUTDOWNis entered- TeensyBMS sends VCU status with
LVDU_forceVCUsShutdown = 1 vcu_outstays ON for the configured delay
-
After the delay expires:
STATE_SLEEPis enteredvcu_outturns OFFLVDU_forceVCUsShutdownreturns to 0
End state: STATE_SLEEP with the VCU relay off, after the shutdown warning was
held long enough to be transmitted.
Default setting:
LVDU_force_vcu_shutdown_delay = 1000 ms