Put my batteries thru the ringer today. Scrounged the internet and began to experiment with some heuristics for PID tuning. Finally landed on a method that I am committing to. I think I am near the ballpark value I want to be at for `P`, I need to see how high I can take `D` such that I reduce overshoot / oscillations given a step input. I added in a little bit of `I` at the end, I think I need to reduce it or take it out until I dial in P and D. I should note, I am only tuning the pitch rate controller right now, so that's what these plots are.
I am prefiltering the gyro data used for the control signal using a low pass filter with a cutoff of 80Hz. The gyro itself has a hardware DLPF at 92Hz. I am sampling the gyro at 1kHz, I might want to think about using a different kind of filter for the prefiltering.
P = 0.3
I = 0.06
D = 3.0
Step input: 10 degree step with angular rate of 60 dps
Step input: 45 degree step with angular rate of 80 dps
I need more `I` gain clearly, however I am not sure how to add it in without inducing oscillations. It looks like I overshoot quite a bit initially, which means the `P` gain could probably come down a little bit.