Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
duniel's Modular Engine MC
   
Award
Favorite
Favorited
Unfavorite
Tags: v1.5.14
File Size
Posted
Updated
30.718 KB
14 Apr, 2022 @ 1:06pm
17 Sep, 2022 @ 4:48pm
2 Change Notes ( view )

Subscribe to download
duniel's Modular Engine MC

Description
Microcontroller for modular engines.

Connect to various parts of the engine and to a throttle that outputs a value between 0 and 1 (such as a seat or throttle lever).

Idle RPS, maximum RPS, Air-to-Fuel Ratio (AFR) and a few other variables can be set by selecting the MC with the select tool.

The engine is essentially controlled by Lua code that runs two PID controllers, one for maintaining AFR and one for maintaining the RPS setpoint. The RPS setpoint is determined through a function: lerp(min_rps, max_rps, clamp(throttle, 0, 1)).

This function essentially "converts" the throttle value to an equivalent value between the values min_rps and max_rps - lerp(100, 200, 0.5) would output 150(as that is 0.5 / 50% of the range between 100 and 200.

P.S. It can easily be converted to using a composite channel for various inputs and outputs from/to the player.