I have been fiddling around with the ESAT kit from Theia Space for some weeks now. I have a few improvements to propose to the ADCS PID controls, namely anti-windup of the integral term and setpoint glitch correction (following the « PID for dummies » blog post here).

Wheel PID controller:

  • Setpoint glitch. You’ll have to edit the ESAT_WheelPIDController.cpp file and put the integral gain inside the integral error computation (instead of outside, when computing the « control » term). This will suppress the setup glitch when changing the valuse of the PID gains.
  • Windup glitch. You’ll have to set maximum and minimum values for the integral error as well as for the control value. This prevents the integral term to have an overkill value, giving the impression that the PID does not respond anymore. I had to figure out that the control value is given in units of RPM and not duty cycles as would the GUI give the impresion.

Attitude controller:

  • I could implement the windup correction but not the setpoint change glitch correction (more time reading the code woul likely help finding the right way).

I have put these corrections in a zip file following the link below. Just include it as a library in adruino and it does compile and run correctly on my ESATs. No more annoying windup!