Space Engineers

Space Engineers

Not enough ratings
Fly-By-Wire - Control and stability for Aircraft
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
383.073 KB
27 Jan, 2022 @ 2:09pm
31 Mar, 2022 @ 9:50am
9 Change Notes ( view )

Subscribe to download
Fly-By-Wire - Control and stability for Aircraft

Description
Made to control and improve control of aircraft made for Atmospheric flight under the mod Aerodynamic Physics or similar mods.

How-to:
Build control surfaces on top of rotors.
Group the rotors in block-groups for Elevator (Pitch), Ailerons (Roll) and Rudder (Yaw), you may exclude one or several categories.

At the top of the script, input the name of your controller (Cockpit/Seat/remote) and the groups between the quotation marks of the relevant strings.

Below the strings are 5 inputs corresponding to the normal control inputs from a craft: Strafe Left/Right, Forward/back, Up/Down, Roll, pitch/look up/down, yaw/look left/right.
Change the number next to these, to make these input affect the output corresponding with the number;
1 = Pitch, 2 = Roll, 3 = Yaw
Any other number will disable the input.


Presto, you're good to go!


Below the input selection, there are values that affect how the controls react, these can be change to try and improve stability, or invert axis'
"D" affects the autonomic response of the script, higher values make for more agressive action, which may be better for heavier crafts, but may cause oscillation/wobbling in lighter ones.
Lower values reduce the response, slowing down cancelling of rotation, but improving responsiveness to user input.
This value must be higher than 0.


Pitch/Yaw/Roll Mult are multipliers for the user input on those axis', if your craft is too sluggish, raising these values will make it more responsive, likewise, if your craft is too sensitive, lower values will improve stability.
Negating these values will invert the input.


maxDeflection is the max angle the control surfaces will turn, 40 means +/- 40 degrees from 0.


pitchComp adds extra stability to the pitch axis, by attempting to limit the rotational acceleration; Larger values will reduce the chance of your craft flipping end-over-end, but will also reduce max pitch rate.
This value should carry the same sign as PitchMult (eg. if PitchMult is negative, pitchComp should be negative).
This value can be set to 0 to disable the compensation and increase Pitch rate, its value should always be between -0.99 and 0.99, setting it to 1 or -1 will cancel pitch acceleration and thus pitch input.


The script should automatically assign direction to elevators based on whether they're at the front or rear of the craft, or on the left/right side, but if you need to reverse the direction of a rotor, then you can add "rev" to the particular rotors Custom Data.

Configuration information is also written at the top of the script.
For more info check the video https://www.youtube.com/watch?v=s51dc9u4lNw at time 4:50

Demo craft can be found here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2733568912

Aerodynamic Physics (Deadly Reentry + Drag + Flight) mod can be found here:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=571920453
33 Comments
TheMajesticCarabao 20 May, 2024 @ 2:16am 
Would you be able to make the max deflection "+" and "-" separate to one another? For example I want to be able to have "+40" and "-20"
TortoTheConqueror 12 Jan, 2024 @ 7:43am 
I found out why! I was using 5x4 wing blocks and for some reason when I use 1x1 wing blocks it works fine.
Tekk  [author] 12 Jan, 2024 @ 6:46am 
Might be the added force on the rotor/hinge; I've recently tried to get a bit back into making things, and have noticed that rotors and especially hinges have become wonky when under load.

If you're using hinges, try adding more in parallel and see if that works better?
TortoTheConqueror 11 Jan, 2024 @ 10:22am 
Whenever I attempt to take off, my control surfaces bug out. But they work fine on the ground. Do you have any idea what might be causing this?
DeltaWing 8 Dec, 2022 @ 3:28pm 
Ahh, I see it now, that's really cool! It's nice to see that you've really thought about what people might want to make with this and planned acordingly
Tekk  [author] 8 Dec, 2022 @ 3:26pm 
@Deltarray[0] Yes!
Seems i added it without documenting it.

In the config section at the top, there are 6 lines under //Control crosswiring

double RollToElevator = 0.0;
double RollToRudder = 0.0;

double PitchToAileron = 0.0;
double PitchToRudder = 0.0;

double YawToElevator = 0.0;
double YawToAileron = 0.0;

Setting RollToElevator = 0.5 for example, will add 50% of the Roll input, to the Elevators, setting it to 1.0 will make them get the full input.
Negative values invert direction of the input.
DeltaWing 8 Dec, 2022 @ 3:13pm 
Heyo, is there a way to have one control surface controlled by multiple inputs (EG, the horizontal stabilizers on the F22 Raptor)?
Cynical 5 Dec, 2022 @ 10:34am 
No worries mate, glad to hear you haven't lost interest! If and when you do get back into SE scripting, I have had an idea that I am currently using this script and your other rotor control script for that I think you may be interested in publishing a dedicated one for. I'll hint and say it involves cyclic and collective pitch controls :D
Tekk  [author] 3 Dec, 2022 @ 4:15pm 
Yeah, sorry, I've been absolutely slammed this semester, so I've not really been able to get into any extracurricular projects :/
Exams are over in a couple of weeks, and doing engineering internship for the first half of next year (so normal work day), one of my plans with my soon to be newfound free time is to go through my old SE stuff and update/fix, plus have a couple of unfinished projects.

So yeah, can't realistically say a time, but i'll get to it!
Cynical 2 Dec, 2022 @ 6:02pm 
Hey dude, was wondering if you're still working on this script at all?