MechJeb2

MechJeb2

4M Downloads

Automatic tuning of PID values during flight

M4KC opened this issue ยท 3 comments

commented

This might be a bit too complex (what with staging and all the changing variables like CoM) but I think it would be really neat if MechJeb could automatically tune the PID parameters (in flight) based on the observed steering errors.

I wouldn't even dare call myself an amateur in controllers as I barely know anything about them other than their function, but he tuning sequence could look something like this:

  1. Minimize ocillations
  2. Minimize overshoot
  3. Minimize settle time

The changing variables might be accounted for (post-tuning) by a user-specified error threshold. If the average % of steering errors (post-tuning) has exceeded the threshold, MechJeb could reinitialize the tuning process.

Maybe MechJeb could even predict the change in CoM by counting the parts, their mass and drymass, calculating the CoM and predicting how it will change based on fuel consumption / staging.

http://support.motioneng.com/downloads-notes/tuning/pid_overshoot.htm

commented

Can you upload a .craft for which this feature would be useful? In my experience, MechJeb does a great job with attitude control, and overshoot and oscillations are usually due to unstable rockets.

commented

I've had some large, heavy craft designs where the center of mass was fairly close to the engines, and quite a distance back from the geometric center, where Jeb would lose control because it was simply applying far too much steering force. Disabling it and flying manually worked perfectly fine in the cases I'm referring to, as long as you kept a light touch on the controls.

I'd have to build or modify something specifically to illustrate this, though, because I generally redesign and/or discard craft files which don't perform as desired... ;) And, to be fair, I haven't actually tested MJ2 with any such rockets.

commented

Duplicate of #1050