openOMSI GitHub Discord
Trolleybuses

Docs / Routes and rail / Trolleybuses

The gear: vehicle blocks

4 min readEdit this pagedocs/TROLLEYBUS.md

On this page
  1. [trolley_pole]
  2. [trolley_rheostat]
  3. [trolley_async]
  4. [trolley_battery]
  5. [trolley_aux]
  6. [trolley_vars]
  7. [trolley_none]
  8. Articulated buses
  9. Drive and the bus script

The gear goes in the vehicle's .bus. Inside a block each line is key value, // starts a comment, and keys left out keep their defaults. Values outside the allowed range are clamped.

[trolley_pole]#

One block per pole.

[trolley_pole]
side left
pos -0.3 1.0 4.16
length 6.7
rest_angle -1.5
work_angle 16
motor 1
retriever 35
Key Meaning Default
side left / right (or -1 / 1): the wire it runs on, seen from the driver right
pos (or base) Hinge on the roof: x right, y forward, z up (m) 0.35 -1.0 3.0
length Boom length, hinge to the shoe's groove (m, 2 to 12) 6.6
rest_angle Elevation lying on the hook (°, -10 to 30) 2.5
work_angle Elevation in work, where tip_force is rated (°, 5 to 70) 26
max_angle Highest it rises loose, held by its rope (°, 10 to 80) 45
tip_force What the shoe presses the wire with at work_angle (N, 20 to 600) 120
mass Boom with rope (kg) 16
head_mass Head and shoe (kg) 3
groove_depth How deep the wire sits in the shoe (m) 0.06
funnel Half the width the horns catch a wire in (m) 0.12
max_wire_angle How far the boom may stand off the wire, seen from above (°) 40
kink_speed Sideways shoe speed a bend may ask for (m/s) 3.0
retriever A rope retriever pulls it down after dewiring at this rate (°/s). yes means 35 0 (none)
motor Raised and lowered from the cab 0
boom_bounce The boom's bounce on a script's lifting gear (Hz) 1.1
boom_damping How quickly that bounce dies away (damping ratio) 0.12
visible The game draws the boom and rope. 0: the model draws its own 1
reach How far from the rope's handle it can be handled (m) 9

[trolley_rheostat]#

A series DC drive with a resistor controller. All keys are optional.

Key Meaning Default
gear_ratio Motor to wheels 9.6
gear_efficiency 0.93
motors Motors in parallel (1 to 8) 1
armature_ohm Armature and series field (Ω) 0.14
flux_sat Flux linkage at saturation (V·s/rad) 3.3
flux_half_amps Current at which half of it is built up (A) 25
steps Resistor steps (2 to 60) 14
start_ohm The whole external resistance (Ω) 2.6
field_steps Flux kept in each field-weakening step 0.72 0.5
step_up_s Seconds per step while the controller climbs 0.22
step_down_s Seconds per step while it falls 0.08
current_min The pedal's current at its low end (A per motor) 120
current_max The pedal's current at its high end (A per motor) 310
brake_current Dynamic braking: largest generator current (A). 0: none 220
brake_excitation Its excitation, as a share of saturation flux 0.75
brake_force Mechanical brakes with the pedal down (N) 56000
overspeed Motor speed limit (rad/s) 380

[trolley_async]#

An inverter drive.

Key Meaning Default
max_force Force at the wheels from standstill (N) 30000
max_power_kw Power at the wheels above the corner speed 170
efficiency Motor and inverter together 0.9
regen_power_kw Most regenerative power 150
regen_force Largest regenerative braking force (N) 26000
chopper A brake resistor takes what the line will not 1
v_min Voltage below which the force fades (V) 480
v_trip Voltage below which the inverter trips (V) 380
v_regen_max Regeneration stops above this voltage (V) 720
force_rate How fast the force follows the pedal (N/s) 60000
brake_force Mechanical brakes with the pedal down (N) 56000

[trolley_battery]#

Optional, for the asynchronous drive.

Key Meaning Default
kwh Capacity 4
kw Most it drives with (kW at the wheels) 30
max_kmh Speed it works up to 15

[trolley_aux]#

One number on the next line: lights, compressor and heater, taken from the line (kW). Default 0.

[trolley_aux]
6.0

[trolley_vars]#

Names of the script variables the gear reads, when the model uses different ones. A name the vehicle's variable list does not have is left alone.

Key Default variable Meaning
direction Trolley_Direction > 0.5 forward, < -0.5 reverse, else neutral. Without it: forward
indicator_left Blinker_Left For switches in indicator mode
indicator_right Blinker_Right The same
raise_request Trolley_Poles_Raise +1 raise, -1 lower the poles that have a motor
switch_request Trolley_Switch_Request Radio: -1 left, +1 right, 2 momentary toggle, 0 none. Without it the indicator is sent
switch_code Trolley_Switch_Code Radio: the route code, 0 none
switch_channel Trolley_Switch_Channel Radio: the channel sent on

[trolley_none]#

A vehicle whose own script or plugin moves its poles puts an empty block in its .bus:

[trolley_none]

The game then gives it no gear, and does not read poles from its model either. The meshes keep their own [visible] and animations.

Without any trolley block, a vehicle is taken as a plain trolleybus when its model looks like one (see Real trolleybus add-ons).

Articulated buses#

Each section of an articulated vehicle has its own .bus, read on its own. Put the blocks in the .bus of the section whose model carries the poles (usually the rear one, as on the Ikarus 280T).

Drive and the bus script#

With a drive block:

  • the vehicle's M_Wheel is replaced by the drive's force times the driven axle's wheel radius;
  • the drive's mechanical brake force is added to Brakeforce.

The vehicle's variable list must declare Brakeforce, M_Wheel, Throttle and Brake, as every vehicle's does.

Without a drive block, the script's driving torque is kept, scaled by line voltage over nominal voltage, and cut when the poles bring no current.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open