Autopilot, and better fly-by-wire


I’m currently working on improving the fly-by-wire system, and I’m also making an autopilot system

The final game will have a race mode, either against the clock, AI, or other players. There will also be a combat mode, against AI or other players

For the AI I need some form of controlling them, and make them fly in a certain direction, but how?

For both the old fly-by-wire and the autopilot I use PID controllers to control the control surfaces directly.

For the old fly-by-wire, the error was the rotation rate, and for the autopilot it’s how far off the craft is from it’s current heading (dot product of the heading and craft upward for pitch, and dot with the craft right for roll and yaw)

While this works, it’s rather hard to properly tune PID controllers, especially when they need to work in a multitude of environments (low speed flight, high speed flight, no atmosphere ect)

That’s why I’m trying a new way: do it analytically For RCS thrusters this is very easy to do, just get the torque required to stop rotating, and give the input command to make the RCS thrusters produce the needed torque.

However, Control surfaces and thrust vectoring are quite a bit harder. Their force does not scale linearly with deflection, and it takes some time to actually move them into place.

My current idea for solving this is figure out what time it takes to return to the 0-deflection state, then figure out how much torque would be generated over time, and from that figure out when to stop keeping the deflection on.

It’s similar to landing a rocket that has an engine that needs some time to ramp up, but it will take some effort to figure out how I can do this for all 3 control systems at the same time (RCS, Thrust vectoring and control surfaces)

When it’s done, I’ll upload a new demo with this system implemented

Get Horizons

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.