Electronic Stability Control (ESC)
Manages Electronic Stability Control (ESC) and Traction Control System (TCS) interventions. Monitors yaw rate, lateral slip, and wheel spin to selectively apply brakes and reduce engine torque, keeping the vehicle stable. Supports multiple ESC modes and automated calibration.
Manages Electronic Stability Control (ESC) and Traction Control System (TCS) interventions. Monitors yaw rate, lateral slip, and wheel spin to selectively apply brakes and reduce engine torque, keeping the vehicle stable. Supports multiple ESC modes and automated calibration.
State Fields
| Field | Type | Description |
|---|---|---|
pauseESCAction | boolean | If true, temporarily disables all ESC/TCS interventions (used by other controllers like calibration). |
calibrationMeasurementReady, calibrationSettled | boolean | Status flags for the automated ESC calibration process. |
doSettle, doMeasure | boolean | Control flags to trigger calibration phases. |
stiffnessFront, stiffnessRear, wheelAngleFront, wheelAngleRear | number | Calculated vehicle dynamics parameters used by the ESC logic. |
isExisting | boolean | True if an ESC configuration exists for this vehicle. |
Public API
| Function | Description |
|---|---|
new(jbeamData) | Creates a new ESC/TCS controller instance. |
nextESCMode() | Cycles to the next available ESC mode. |
startESCCalibration() | Puts the controller into calibration mode to measure stiffness. |
stopESCCalibration() | Ends the calibration process. |
module.toggleESCMode() | Toggles the ESC mode. |
module.setESCMode(key) | Sets the ESC mode. |
module.getCarData() | Returns the car data. |
module.getCurrentConfigData() | Returns the current config data. |
Hooks
| Hook | Description |
|---|---|
updateGFX(dt) | Main per-frame logic. Calculates yaw rates, slip, and determines if interventions are required. Manages warning lights. |
module.init(jbeamData) | Initializes the controller from JBeam data. |
module.initSecondStage() | Second-stage initialization after all controllers are loaded. |
Usage Example
-- Cycle ESC modes (Full, Sport, Off)
controller.getController("esc").toggleESCMode()
-- Set a specific ESC mode
controller.getController("esc").setESCMode("sport")
-- Get vehicle dynamics data
local carData = controller.getController("esc").getCarData()See Also
- Traction Control — Advanced traction control supervisor
- Yaw Control — Advanced yaw control supervisor
- Drive Modes — ESC behavior may vary per drive mode
Dummy Controller
A minimal "Main" controller implementation that provides the required interface without any powertrain logic. Used for testing, props, or vehicles that don't need engine/transmission simulation (e.g., trailers, static objects). Maps raw inputs directly to electrics values.
ETK Gauges Controller
Backend controller for the ETK-series vehicle instrument cluster. Processes powertrain, speed, and warning data into gauge-ready values for the ETK dashboard display.