Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
[MZ] EasyPID Diesel RPS Hold v01
   
Award
Favorite
Favorited
Unfavorite
Vehicles: Mechanical
Microcontrollers: Calculation, Microcontroller
Tags: v1.6.7
File Size
Posted
Updated
223.480 KB
22 Nov, 2022 @ 1:48pm
22 Nov, 2022 @ 7:56pm
2 Change Notes ( view )

Subscribe to download
[MZ] EasyPID Diesel RPS Hold v01

Description
MZ EasyPID Series


The EasyPID series of MCs by MZ Technologies offeres class leading performance with easy integration allowing users to quickly develop great builds.
Will be adding more MCs to the series to cover more usages.





Diesel RPS Hold


The Diesel RPS Hold MC can quickly respond to any change in commanded RPS while also being able to hold percisely and accurately.





Quick start setup


The EasyPID Diesel RPS Hold comes preconfigured with a generic rough tune for diesel engines that should most allow user to quickly implement without tuning however for best results tuning is recommended.


Easy implementation in just 4 steps:
  1. Connect a means of setting a target RPS for exmaple a keypad or throtle lever.
  2. Connect to the RPS sensor of the diesel engine to be controlled.
  3. Connect to the throttle of the diesel engine to be controled.
  4. Connect a means of starting the diesel engine.





Internal operation


The EasyPID Diesel RPS Hold operates on two simple premises:
  1. Determin the rate of change in the RPS the diesel engine should make (ΔRPS).
  2. Apply the appropriate amount of throttle accounting for diesel engines power curve and cumulated error to achieve determined ΔRPS.
  3. Clamp the output to the min and max permissable values (default: 0, 1).

These operations are varied by their respective parameters:
  1. Smoothing: Determins how gradual the MC should be to reach desired RPS. This essentially counteracts the effects of inertia by requesting less ΔRPS.
  2. Responsiveness: How agressively the MC will try to achieve determined ΔRPS.
  3. Min output value: Will prevent the output and cumulative error from falling below this value.
  4. Max output value: The maximum counterpart of Min output value.





Tuning


While tuning in most cases it shouldn't be necessary, tuning is simple and will greatful improve performance.
Tuning well to your application may result in dropping your target RPS striaght from max to much less than 0.001 over stall (2.001 RPS target)

In general we want to aim for low smoothing and high response yet not too little smoothing and not too much response as this could cause issues.

To tune the parameters it's best to be aware of how laden our engine will be and how that may vary in it's operation.
For which we care to tune the engine in two states:
  • Laden: To have anything in it's application that can to be clutched to the engine.
    When laden engines are much more likely to overshoot vs unladen due to incrased inertia reducing natural responsiveness.
  • Unladen: To have anything in it's application that can to be declutched from the engine.
    When unladen engines are much more likely to jitter vs laden due to reduced inertia increasing natural responsiveness.

Example: using an engine with two generators, one is directly connected to the output of the engine while the other is connected though a clutch.
  • Laden: Having power sent to both generators, the first directly connected and the second connected with the clutch fully applied.
  • Unladen: Sending power to only the first directly connected generator while the second generator is disconnected with the clutch fully released.

    Refering to the below table and two dials, one for RPS and another for Throttle we can observe the behaviour of the engine to better tune the MC.

    Observation
    Action
    Throttle jitter
    Reduce Response parameter
    Excessively slow approuch to target with patial throttle
    Reduce Smoothing parameter
    Overshooting target with throttle pointing fully towards target
    Increase Smoothing parameter
    Overshooting target with throttle slowly adjusting
    Increase Response unless will introduce throttle jitter, instead increase Smoothing

    Quick and reliable tuning can be had following the above table while first trying to increase response while unladen till just before throttle jitter occurs, reduced if already jittering. Then while laden decrease smoothing till just before overshoot occurs, increase if already overshooting.
    To speed up the tuning process it is often worth artificially inducing unladed and laden states.





    Notes
    • Diesel RPS Hold is intended for the "Small Diesel", "Medium Diesel" and "Large Diesel" engines.
    • More MC are intended for the MZ EasyPID series, next will be an MC for maintaining min and max RPS with X input throttle.
    • MZ EasyPID series are likely to have several different MCs for same types of power for varing applications.
    • Currently there are no Modular Engine (ME) MCs, this will come later but for now you can multiply/divide the output to get air and fuel throttles.
    • Currently there are no Jet Engine MCs, this will come later but for now using this MC can service well with tuning and being mindful the power curve is not correctly accounted for so tuning will have to be braod for the intended low and high RPS.
    • There is no Electric Motor MC and I'm unsure if people would like this.
3 Comments
BasicallyIPlayGames 22 Jan, 2023 @ 1:37pm 
Thank you.
Magazorb  [author] 22 Jan, 2023 @ 1:27pm 
@BasicallyIPlayGames and anyone else interested with use with Modular Engines
Sadly I've not had time to even play the game much due to work
when i get time I'll try to upload a more universal version of this along with a ME version

Meanwhile for anyone wanting to use modular engines with this MC you can use the output of this for air and divided by 2 for fuel

Since Modular Engines are very jittery I also suggest smoothing the RPS from the crankshaft via a 3 input function
Input Crank RPS to X
the output of the function to Y
Z is unused
set the function to the following line
lerp(y,x,0.5)
this function will smooth out jitter in the crankshaft RPS which will allow this MC to work magnitudes better with Modular Engines

Note due to how Standard Engines work this function isn't required for them




I hope to upload a ME version with AFR control when i get some time

In the mean time I hope this helps anyone wanting to use this for ME
BasicallyIPlayGames 22 Jan, 2023 @ 11:23am 
what about modular?