Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Autopilot Heading Select Function
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
53.971 KB
1 Mar, 2019 @ 1:07pm
8 Mar, 2019 @ 11:58am
3 Change Notes ( view )

Subscribe to download
Autopilot Heading Select Function

In 1 collection by jbaker96
Autopilot Mode Control Panel
16 items
Description
A micro-controller, designed to be used either as a standalone controller or with my autopilot system, with multiple features. This device comes with a toggle button to enable the heading autopilot, a keypad to enter the desired heading, and a keypad to specify the max bank angle of the aircraft in a turn. There is also an option in the property window of the micro-controller to enable or disable an "Active Roll Stabilizer." This feature will attempt to keep the aircraft level even when the device is turned off - NOTE: this will not control the pitch of the aircraft, only the roll.

Setup:
- To place this device in your aircraft, 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 of the blocks is not important for normal operation.
- The included toggle button labelled "Heading Select" and keypad labelled "Desired Heading" are required and cannot be removed unless this device is used with the Autopilot Controller
- The included keypad labelled "Max Bank Angle" is not required, and may be replaced with a constant number.
- The included keypad labeled "In Flight Tuner" can safely be removed after the PID is properly tuned for your aircraft.
NOTE: Make sure your ailerons are set up properly, ailerons on the right wing should point up with a positive value, and ailerons on the left wing should point down with a positive value.

Nodes:
Input:
  • Current Heading - Connect this node to the output of the micro-controller for the heading sensor.
  • Bank Angle - Connect this node to the output of the function block for the roll sensor
  • Aileron Axis - Connect this node directly to the axis you are using to control the roll of your aircraft, normally one of the control chair axis's.
Output:
  • Ailerons - Connect this node directly to both ailerons NOTE: make sure your ailerons are oriented correctly.

Operation:
To operate the heading autopilot, simply enter the max angle you want your aircraft to roll in either direction, and enter the desired compass heading from 0 to 360 degrees. Press the toggle button to enable the heading autopilot and your aircraft will roll to turn in the direction of your selected heading.

Tuning:
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. Place a dial and connect it to the output of the Roll Angle Sensor
  2. Use the Select tool in the Stormworks vehicle editor to select the heading micro-controller.
  3. In the properties window, turn the option "Enable In-Flight Tuning" on.
  4. Spawn your aircraft and enter a value of 1 in the tuner keypad to start.
  5. Once you are flying, enter a heading value between 0 and 360 degrees into the desired heading keypad, set the max bank angle in the max bank angle keypad, and turn on the heading autopilot while monitoring the heading indicator and roll angle dial.
  6. If the aircraft reacts violently, the tuning value is way too high, and you should reduce the value by at least 10x.
  7. If the aircraft takes too long to reach the max bank angle, or overshoots the desired heading by more than 1 or 2 degrees, gradually increase the tuning value.
  8. If the aircraft rolls rapidly when entering a turn possibly overshooting the max bank angle, or rolls out of the turn way too early, gradually lower the tuning value until the aircraft smoothly and accurately rolls into and out of a turn.
  9. Repeat the previous two steps until you are satisfied with the responsiveness and accuracy of the heading autopilot.
  10. Write down the value you have entered in the tuner keypad so you don't forget it.
  11. 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.
  12. Make sure to save your vehicle, and enjoy the easy and smooth turning in flight.
4 Comments
Tesla 9 Mar, 2020 @ 1:00pm 
Thank you, Baker. This makes my life sooooo much easier! <3
jbaker96  [author] 14 Mar, 2019 @ 5:30pm 
Also, if you take a look inside the various micro-controllers, you may understand why putting them all together might do my head in.
jbaker96  [author] 14 Mar, 2019 @ 5:29pm 
Because there is just so much to this autopilot system. If you only want altitude and heading control, you shouldn't need all this stuff. Also, once I release the autopilot controller, you may understand a bit better, since I used almost all of the available nodes on that microcontroller and had to use composite inputs to save some space.
Ghost 14 Mar, 2019 @ 5:26pm 
why isn’t this all one assembly

the multiple assemblies is pointless