Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Adjustable Diesel Throttle Manager
   
Award
Favorite
Favorited
Unfavorite
Vehicles: Mechanical
Microcontrollers: Microcontroller
Tags: v0.10.14
File Size
Posted
Updated
21.487 KB
17 Apr, 2020 @ 10:22pm
24 Apr, 2020 @ 3:45am
12 Change Notes ( view )

Subscribe to download
Adjustable Diesel Throttle Manager

Description
PID for diesel engines.

Set a target RPS (clamped to range 7-100) and enable, and it will manage your throttle to try to maintain it., Minimum throttle value of 0.08 to prevent stalling and allow ignition while enabled.

Includes a bypass function. In bypass mode, input throttle maps the corrected [-1,1] axis value to a suitable [0,1] value for the engine's throttle input, but no PID adjustment occurs.

PID coefficients are adjustable when selecting the microcontroller in the editor, no need to edit the logic page.

If you're just looking for some sane PID values to try your own controller, I'll save you the download - the values I've gone with are as such:
p = 0.2
i = 0.001
d = 0.01

UPDATE 1: added a set of properties to allow specifying a particular RPS instead of needing a wired-in signal.

UPDATE 2: Added integral, and tuned on a test platform. You'll get some throttle wobble at high RPS or near-zero load, but not too badly. When the engine has load, it should respond appropriately.