Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Autopilot Autothrottle Function
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
52.215 KB
7 Mar, 2019 @ 11:07pm
20 Mar, 2019 @ 7:14pm
4 Change Notes ( view )

Subscribe to download
Autopilot Autothrottle Function

In 1 collection by jbaker96
Autopilot Mode Control Panel
16 items
Description
A micro-controller, designed to be used either by itself or with my Autopilot System, that will attempt to maintain the set speed in knots. This controller comes with a toggle button to enable the autothrottle, a keypad to enter the desired speed, and a throttle lever for manual control of the throttle when the autothrottle is disabled. When the autothrottle is enabled, it will automatically move the throttle lever to match the output of the controller so your vehicle won't suddenly accelerate or decelerate when disabling the autothrottle.

Setup:
- To place this device in your vehicle, use the Selection Grid tool in the Stormworks vehicle editor to load this device into your vehicle. You can use the arrows to drag the device around and place it anywhere on your vehicle.
- You can move and rotate any part of this device in any way you like. Placement and orientation is not important for normal operation.
- The included keypad labeled "In Flight Tuner" can safely be removed after the PID is properly tuned for your aircraft.

Nodes:
Input:
  • Current Speed - Connect this node to the output of the Airspeed Sensor[http//Airspeed+Sensor]
  • Climb/Descent - Do not connect this node unless you are also using the Autopilot Controller.
Output:
  • Throttle Setting - Connect this node to your engine throttle or an engine controller of your choice NOTE: the autothrottle will not idle your engine - if you set the speed to 0, it will set the throttle to 0 and cause your engines to shut off.

Operation:
When the autothrottle is disabled, you can operate the throttle lever normally. To activate the autothrottle, first set your desired speed in the keypad labelled "Target Speed, then activate the autothrottle using the toggle button. The controller will take over control of the throttle and the throttle lever to maintain your set speed.

Tuning:
The autothrottle may or may not need tuning depending on characteristics of your engine(s).
This device uses a PID controller to control the aircraft roll, which means it must be tuned for each aircraft it is installed on. Tuning has been made easy by the use of a simple coefficient for each of the PID values.
  1. Use the Select tool in the Stormworks vehicle editor to select the heading micro-controller.
  2. In the properties window, turn the option "Enable In-Flight Tuning" on.
  3. Spawn your aircraft and enter a value of 1 in the tuner keypad to start.
  4. Once you are flying, enter a speed value into the target speed keypad, and activate the autothrottle while monitoring your speed.
  5. If the vehicle reacts too slowly to changing conditions and is unable to maintain speed while maneuvering even if it hasn't maxed out the throttle, increase the tuning value.
  6. If the throttle reacts too quickly or your vehicle overshoots your target speed, decrease the tuning value.
  7. Repeat the previous two steps until you are satisfied with the responsiveness and accuracy of the autothrottle.
  8. Write down the value you have entered in the tuner keypad so you don't forget it.
  9. Return to the workshop and select the micro-controller again, turn off "Enable In Flight Tuning," and enter the value you wrote down into the "Tuner Coefficient" property box.
  10. Make sure to save your vehicle, and enjoy the relaxation of never needing to micromanage your throttle.
5 Comments
Tesla 15 Mar, 2021 @ 1:37pm 
oh baker, please come back to the living! You've been away for far too long
jbaker96  [author] 9 Mar, 2020 @ 10:48pm 
Short and simple of it all is that the bang is just the throttle being momentarily set to 0 or less than 0 and is a harmless side effect of the outdated methods used for the controller.
jbaker96  [author] 9 Mar, 2020 @ 10:48pm 
The loud bang is from the throttle momentarily being set to 0 or below 0 and is a result of how the PID controllers manages the throttle output. More careful tuning of each of the PID values would probably be the easiest way to fix it for jet engines since the autothrottle was initially tuned on a piston engine, but the microcontroller itself is a bit old and outdated anyways, so a lot of the problems with this controller will hopefully be completely solved when I finish the new lua based autopilot.

Also, the error tooltip on the microcontroller just tells you when the PID is attempting to output a value outside the 0-1 range for the throttle. The reason you see a short flicker is because there is a 1 tick delay between each of the components of a microcontroller so it takes a couple ticks for the controller to detect the out of range condition and then clamp it to 0-1.
Jason 9 Mar, 2020 @ 9:33pm 
So while the number on the microcontroller doesn't seem to change, monitoring the value on my displays it seems the throttle, for what is likely just a tick, changes to a negative number causing the 'cut off' - but it happens so quick it has no obvious impact on anything.

https://i.gyazo.com/1d6250f83f8e5add1150c4a95975be57.mp4

This is a video, although it did flicker the negative number on every bang for me (I think at 30fps it won't 'capture' every tick on the recording software).

Ultimately it will spend a lot of time backfiring, usually, when close to the speed it's trying to achieve.
Jason 9 Mar, 2020 @ 9:05pm 
Thank you for this, the aircraft holds it's speed well. However, for some reason when changing speed it causes the jet engines to make a loud bang repeatedly, although they never seen to
shut down or have any issues. It's not something that occurs when using the throttle manually.

I tried monitoring the microcontroller and the Error YES flashes when this occurs, but the throttle value seems to remain at least the idle if not slightly higher throttle setting. I've had a play with the coef and it doesn't seem to make much difference.

If you didn't have audio you wouldn't notice anything out of ordinary. Any thoughts?