Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
919 Systems Flight Stability Controller
   
Award
Favorite
Favorited
Unfavorite
Vehicles: Air, Creative
Microcontrollers: Calculation, Microcontroller
Tags: v1.0.22
File Size
Posted
Updated
204.690 KB
25 Nov, 2020 @ 2:45pm
28 Nov, 2020 @ 1:18pm
2 Change Notes ( view )

Subscribe to download
919 Systems Flight Stability Controller

Description
Intro

Let’s face it, the in-game gyros do not work very well for controlling airplanes. This is my solution, a relatively simple, easy-to-integrate microcontroller for all your stability and controllability needs! It works primarily by using a PID controller to match the value from a seat to the value from a tilt sensor. The PID values are pre-tuned, and work well for most applications, but some adjusting may need to be done if your aircraft is capable of speeds over Mach 1. Enjoy!

Setting up the Microcontroller
To set up the microcontroller, you will first have to connect two tilt sensors. One will face forward with the arrow in the vertical position, this will be your Pitch Tilt Sensor Input. The other will face to the left side of your aircraft, with the arrow, again, in the vertical position. After these sensors are connected, you will need to connect your pitch and roll control from a seat, which go into Pitch Input and Roll Input respectively. Note: if the seat controls are in “Reset” mode, the aircraft will recenter itself automatically, and “Sticky” mode will not recenter the controls. The node labeled “External Acro/ALM Switch” allows you to switch between Angle Limit Mode (ALM) and Acro Mode with a button, which we will go into further in the next section.

Tuning the Microcontroller
First, let’s talk about the difference between the two modes, Acro Mode and Angle Limit Mode. Angle Limit Mode will limit the aircraft to a predefined maximum angle; this can be configured for pitch and roll individually under the “Pitch Angle Limit” and “Roll Angle Limit” tabs. Note that a value of 1 will limit the aircraft to 90 degrees. I recommend a value of between 0.3 and 0.7 depending on the application. Acro Mode gives your aircraft an unlimited range of motion. You can switch between these two modes in the Angle Mode Select tab, or externally with the External Acro/ALM Switch. Note that the external switch only works when the microcontroller is in Angle Limit Mode by default. I would not recommend changing the PID values unless you have experience with PID tuning and the default values do not work for your aircraft, but they are easily accessible if the need to change them arises. Lastly, the “Pitch Sensor Inversion” and “Roll Sensor Inversion” are the best ways to troubleshoot the microcontroller, I recommend activating/deactivating them if the controller is either not limiting your aircraft’s max angles properly in ALM mode, or if the controller is causing your aircraft to spin.

Feel free to use this microcontroller on your own creations, that was the reason I uploaded it in the first place. Credit would be appreciated, but is not required!



Lastly, a huge thank-you to Zond3y, who helped me tune and test this microcontroller!


-919LM
20 Comments
MrKilometer  [author] 1 Aug, 2023 @ 4:14pm 
If I recall correctly, the P and D values would need to be adjusted - how much depends on the aircraft. If you shoot me a friend request, I can probably give you more specific help.
arasmus2 31 Jul, 2023 @ 8:12pm 
How much adjusting would need to be done and where
MrKilometer  [author] 25 Jul, 2023 @ 8:18pm 
Yep! You may need to adjust the PID values though.
arasmus2 25 Jul, 2023 @ 7:02pm 
does this work with an artificially stable aircraft
Twitchy115 18 Jan, 2023 @ 1:38am 
I haven't gotten it to work on a v-tail yet. As of right now I have the yaw input going into a limiter to keep the mc from freaking out because of the side slip
~
MrKilometer  [author] 17 Jan, 2023 @ 7:12pm 
...interesting. I wouldn't expect it to work stock on a V-tail, but you should be able to make a separate controller to mix the inputs. Have you tried making the ailerons smaller on the other airplane you're talking about?
Twitchy115 16 Jan, 2023 @ 7:14pm 
Don't even get me started on my V-tail >.<'
Twitchy115 16 Jan, 2023 @ 7:00pm 
Unfortunately I can either have the yaw recenter quickly and the roll freak out, or I can can make it recenter slowly but it's *a lot* less responsive
MrKilometer  [author] 16 Jan, 2023 @ 3:54pm 
On most fixed-wing aircraft, yaw "recenters" by itself. I made a more advanced version of this microcontroller that does have yaw control, but never released it.
Twitchy115 16 Jan, 2023 @ 2:57pm 
I got it working. It's unfortunate theres no yaw control though. I love the recentering roll.