Automatic Gearbox

Summary

The automatic gearbox device simulates the operation of an old or modern automatic transmission. It can be configured extensively to match a wide range of real life behaviors.

File Info

Filename automaticGearbox.lua
Path /lua/vehicle/powertrain/automaticGearbox.lua
Categories gearbox
Mandatory parent category viscouscoupling
Number of outputs 1
Mandatory outputs [1]

Jbeam Properties

Name Default Unit Description
friction 0 Nm Static friction loss in the gearbox
shiftEfficiency 0.5 number Percentage how much torque is lost during shifting
gearChangeTime 0.5 s Minimum amount of time it takes to shift to a different gear, the actual time can be prolonged by the main controller to ensure smoother shifts
gearRatios   array<number> Gear ratios of the gearbox, includes forward(+), reverse(-) and neutral(0) if desired
parkLockTorque 1000 Nm Maximum amount of torque the park mode can hold
oneWayViscousCoef 5 number  
oneWayViscousTorque oneWayViscousCoef * 25 Nm  
oneWayViscousSmoothing 50 number  
gearboxNode:   Node reference Node that is close to the gearbox, for example used as a sound emitter location

Public Properties

Name Description
lockCoef  
shiftEfficiency  
shiftLossCoef  
isShifting  
mode  
maxGearIndex  
minGearIndex  
maxGearRatio  
minGearRatio  
gearCount  

Public Functions

Function name Parameters Description
setMode(device, mode) device, string  
setGearIndex(device, index) device, number  
setLock(device, enabled) device, bool  

Example Usage

"powertrain": [
  ["type", "name", "inputName", "inputIndex"],
  ["automaticGearbox", "automaticGearbox", "mainEngine", 1],
],
"automaticGearbox": {
  "gearRatios":[-3.73, 0, 4.11, 2.32, 1.54, 1.18, 1.00, 0.85],
  "friction": 1,
  "gearboxNode:":["tra1"],
}