From ed15258abb5c3ba7076138c212be82745f4e2a8f Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Mon, 19 May 2025 13:23:01 +0200 Subject: [PATCH] ICE: small cosmetic changes and make message definition clearer Signed-off-by: Silvan Fuhrer --- msg/InternalCombustionEngineControl.msg | 8 ++++---- .../InternalCombustionEngineControl.cpp | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/msg/InternalCombustionEngineControl.msg b/msg/InternalCombustionEngineControl.msg index 08b4198e01..479b325e47 100644 --- a/msg/InternalCombustionEngineControl.msg +++ b/msg/InternalCombustionEngineControl.msg @@ -1,8 +1,8 @@ uint64 timestamp # time since system start (microseconds) -bool ignition_on # activate/deactivate ignition (Spark Plug) -float32 throttle_control # [0,1] - Motor should idle with 0. Includes slew rate if enabled. -float32 choke_control # [0,1] - 1 fully closes the air inlet. -float32 starter_engine_control # [0,1] - control value for electric starter motor. +bool ignition_on # activate/deactivate ignition (spark plug) +float32 throttle_control # setpoint for throttle actuator, with slew rate if enabled, idles with 0 [norm] [@range 0,1] +float32 choke_control # setpoint for choke actuator, 1: fully closed [norm] [@range 0,1] +float32 starter_engine_control # setpoint for (electric) starter motor [norm] [@range 0,1] uint8 user_request # user intent for the ICE being on/off diff --git a/src/modules/internal_combustion_engine_control/InternalCombustionEngineControl.cpp b/src/modules/internal_combustion_engine_control/InternalCombustionEngineControl.cpp index 1e8a1b1a35..eadd2aa46d 100644 --- a/src/modules/internal_combustion_engine_control/InternalCombustionEngineControl.cpp +++ b/src/modules/internal_combustion_engine_control/InternalCombustionEngineControl.cpp @@ -217,7 +217,6 @@ void InternalCombustionEngineControl::Run() case State::Fault: { - // do nothing if (user_request == UserOnOffRequest::Off) { _state = State::Stopped; _starting_retry_cycle = 0; @@ -355,7 +354,7 @@ int InternalCombustionEngineControl::print_usage(const char *reason) PRINT_MODULE_DESCRIPTION( R"DESCR_STR( ### Description - + The module controls internal combustion engine (ICE) features including: ignition (on/off), throttle and choke level, starter engine delay, and user request. @@ -389,18 +388,18 @@ The ICE is implemented with a (4) state machine: ![Architecture](../../assets/hardware/ice/ice_control_state_machine.png) The state machine: - + - Checks if [Rpm.msg](../msg_docs/Rpm.md) is updated to know if the engine is running - Allows for user inputs from: - - AUX{N} + - Manual control AUX - Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md) The module publishes [InternalCombustionEngineControl.msg](../msg_docs/InternalCombustionEngineControl.md). - + The architecture is as shown below: ![Architecture](../../assets/hardware/ice/ice_control_diagram.png) - + )DESCR_STR");