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
Filename
Path
automaticGearbox.lua
/lua/vehicle/powertrain/automaticGearbox.lua
Filename
Categories
automaticGearbox.lua
gearbox
Filename
Mandatory parent category
automaticGearbox.lua
viscouscoupling
Filename
Number of outputs
automaticGearbox.lua
1
Filename
Mandatory outputs
automaticGearbox.lua
[1]

JBeam Properties

Name
Default
Unit
Description
Name
friction
Default
0
Unit
Nm
Description
Static friction loss in the gearbox
Name
shiftEfficiency
Default
0.5
Unit
number
Description
Percentage how much torque is lost during shifting
Name
gearChangeTime
Default
0.5
Unit
s
Description
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
Name
gearRatios
Default
Unit
array
Description
Gear ratios of the gearbox, includes forward(+), reverse(-) and neutral(0) if desired
Name
parkLockTorque
Default
1000
Unit
Nm
Description
Maximum amount of torque the park mode can hold
Name
oneWayViscousCoef
Default
5
Unit
number
Description
Name
oneWayViscousTorque
Default
oneWayViscousCoef * 25
Unit
Nm
Description
Name
oneWayViscousSmoothing
Default
50
Unit
number
Description
Name
gearboxNode:
Default
Unit
Node reference
Description
Node that is close to the gearbox, for example used as a sound emitter location

Public Properties

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

Public Functions

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

Example Usage

"controller": [
  ["fileName"],
  ["4wd"]
],
"4wd": {
  "shaftName":"driveshaftF",
  "rangeBoxName":"rangeBox",
}

Page created: 18 March 2021, at 10:02
Last modified: 25 August 2021, at 17:09

Any further questions?

Join our discord