I've programmed a spaceship with thrusters, and an attitude control system with a PID controller for each axis.

Although my spaceship movement is visually fine, my ship rotates to the target attitude or follows set attitude rates but rarely stops outputting. The thrusters fire small amounts at high frequency as my pid output oscillates slightly around the setpoint.

One thing that may disturb the system is that the thrusters are not perfect, and don't align exactly through the center of mass. So when one pid controller corrects one axis, it introduces small movements on the other axes.

How can I add an acceptable deadband, where the pids don't attempt to eliminate error completely, but try to keep the output within the deadbands with as little controlling as possible? i.e. I want to conserve the fuel used by the thrusters.

I'm not very good at math, so a useful answer would discuss general damping ideas, filtering, or deadband methods while avoiding getting too far into equations. I'm also not looking for a rigorous scientific explanation, just some easy to implement ideas which may help improve my simulation somewhat.

  • 4
    $\begingroup$ Have you implemented a phase-plane controller? It's well described here: space.stackexchange.com/a/51945/6944 $\endgroup$ Commented Jul 8, 2021 at 11:20
  • 1
    $\begingroup$ #1) don't adjust orientation for where you are now but where you will be in X milliseconds. With the consideration that "not there yet but heading towards it" might be good enough and #2) decide how much deviation from desired reading is allowed before any corrective action is applied. ... This will give you a system that responds a bit more sluggishly, and will oscillate a bit, but uses a magnitude less control. $\endgroup$ Commented Jul 8, 2021 at 11:21
  • 1
    $\begingroup$ @PcMan Your #1 can be accomplished by tuning the D term in a PID controller. $\endgroup$ Commented Jul 8, 2021 at 11:58
  • 1
    $\begingroup$ People coming from a non-GNC control theory background tend to want to use the tools they were taught in college / used in industry -- PID or PD. For thrusters that can only be commanded on or off and that point in a fixed body-fixed direction, phase plane control is demonstrably better than PID or PD. $\endgroup$ Commented Jul 8, 2021 at 16:01
  • 2
    $\begingroup$ @Innovine Thrusters that are not throttleable are called on-off thrusters. The valves that control propellant flow to such thrusters are either commanded to be open or to be closed. These will inevitably have a build-in and trail-off time period. I would suggest not modeling that at first. I would also suggest not modeling navigation errors at first. The first step in designing a vehicle with a simulation is to start simple: A vehicle with perfectly behaving simple thrusters, perfect navigation, perfect knowledge of vehicle mass properties. If you can't handle that, back to the drawing board. $\endgroup$ Commented Jul 9, 2021 at 13:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.