( Applies to versions back to xmlauto.cxx )
Quoting Roy Vegard Ovesen in:
https://flightgear-users.narkive.com/Gs0Caxh5/problems-with-autopilot-in-737
Note that the preferred way to eliminate interator action is to set Ti to zero
(the code will detect this and skip the integrating).
Our code doesn't do that, if Ti is set to zero then no updating of output value is done, follow the conditional clause at pidcontroller.cxx at line #159 .
It would seem good to fix this in order that, by setting Ti to zero, the pidcontroller may be used as both a P- controller and PD- controller without any distractions from integrator term.
- Too, I'd like to see the ability to pass the separate P- I- D- accumulated values out to the property tree
- at most doing that adds a couple of multiplies and summing into accumulated terms. Offset against that penalty would be the saving of all the computation involved at present with configurations that set Td to zero and follow each PID implementation with a rate of change filter; seeing the D-term on scope and updating in props / console is a great help in figuring PID tuning. Attached is an updated pidcontroller.cxx with both of the above changes in place, together with one-line console debug output. Updated source tree on github :
https://github.com/bitwisetech/flightgear-pid
Tks
So this doesn't go un-answered: I'm in the middle of some other code changes right now, and some bug hunting. I think I'll need a bit of a mental run-up to understand all the pieces of this, so please remind me in a couple of weeks, if I don't check back in about this.
I'd definitiely want to Ti=0 and the 'output P/I/D values' split into seperate changes. As far as I can guess, the first one has a compatability issue (if someone relied on setting Ti=0 to disable the whole controller, and suddenly gets output) and the latter one has a potential performance impact, so probably should be controled by the 'debug' flag we already have. (I.e in debug mode P/I/D are written, in normal mode they are not). Anyway, these are just quick thoughts, based on what you wrote above.
Understood, The repo on github already has companion changes so that configuration tag: <show-terms> enables this extra processing. I'm running other changes too ( tag supported Kp-Only_ affects-P-gain ) to support tuning. I will be pushing them to github in the meantime.
Tks </show-terms>