Electric Motor Shift Logic
Shift logic for electric motor drivetrains. Manages single or multi-speed EV transmissions, regenerative braking integration, and one-pedal driving mode. Handles the unique torque characteristics of electric motors.
Shift logic for electric motor drivetrains. Manages single or multi-speed EV transmissions, regenerative braking integration, and one-pedal driving mode. Handles the unique torque characteristics of electric motors.
State Fields
| Field | Type | Description |
|---|---|---|
gearboxHandling, timer, timerConstants, inputValues, shiftPreventionData, shiftBehavior, smoothedValues | table | Internal controller state buffers. |
currentGearIndex, maxGearIndex, minGearIndex | number | Gear metadata (typically 1 forward, 1 reverse for EVs). |
throttle, brake, regen, clutchRatio, shiftingAggression, throttleInput | number | processed user inputs and energy recovery state. |
isArcadeSwitched, isSportModeActive | boolean | logic state flags. |
smoothedAvgAVInput, rpm, idleRPM, maxRPM | number | rotational speed telemetry. |
engineThrottle, engineLoad, engineTorque, flywheelTorque, gearboxTorque | number | powertrain load metrics. |
ignition, isEngineRunning | boolean | motor powered status. |
oilTemp, waterTemp, checkEngine | number | thermal diagnostics. |
energyStorages | table | linked battery devices. |
Public API
| Function | Description |
|---|---|
shiftUp() | Manages PRND mode transitions. |
getGearName() | returns formatted name (e.g., 'D', 'R') and cluster UI position. |
setIgnition(enabled) | Toggles the motor's ability to draw power. |
module.getState() | Returns the state. |
module.setState(data) | Sets the state. |
Hooks
| Hook | Description |
|---|---|
init(jbeamData, sharedFunctionTable) | Initializes the EV shift logic, setting up launch targets and regenerative braking parameters. |
gearboxBehaviorChanged(behavior) | Configures the motor's response to user inputs based on the selected control scheme. |
onSerialize() | Persists the active transmission mode. |
See Also
- Vehicle Controller — Parent controller
- Electric Motor Data — EV gauge module
- AVAS — Pedestrian warning sound
Dummy Shift Logic
A minimal shift logic implementation that provides the required interface without actual shifting behavior. Used for direct-drive vehicles, single-speed EVs, or testing scenarios.
Manual Gearbox Shift Logic
Shift logic for manual (stick shift) transmissions. Manages clutch engagement, synchromesh simulation, gear grinding detection, and rev-matching. In arcade mode, provides automatic clutch assistance.