Need help with CAv3 PID parameters

SRB22

1 mW
Joined
Aug 29, 2022
Messages
19
Yes, I know, "tuning PID controllers is more art than fixed procedure", but I could do with a little help nevertheless.

Some background: this is for a recumbent bike with Grin all-axle motor, baserunner, 52V battery and a CAv3. I've been riding it for more than a year with the max assist speed handled by the controller, which meant I could use the CAv3's max speed parameter to control regen speed (via a potentiometer in analog aux input). Max assist speed regulation was excellent (with the default parameters for the all-axle - P=4 and I=16 IIRW). Regen speed regulation never was very good, but it was good enough that I never was motivated enough to try and fine tune it.

Now I upgraded my CA to firmware 3.2, which allows to set max assist and regen speed separately, so my goal is to have all regulations done by the CA. But the PID parameters I've got are really too bad to get a smooth ride. Huge overshoots, long settling times, instability, I've got them all :-/

I tried to follow the procedure suggested in Appendix F of the unofficial CA guide but that's very time consuming and far from easy. For instance, the suggested initial PSGain already shows a huge overshoot so I'm not sure it makes sense to "Increase PSGain to the point where a single modest overshoot occurs before the speed settles". And instructions like "Increase IntSGain until oscillations die out [...]* are difficult to follow if I have no idea of the approximate value (should I increase 1 by 1? 10 by 10? 100 by 100?).

So if somebody here had an idea of approximate values for P, I and D that should work with this setting, it would help immensely. I could then spend some time fine tuning them, but knowing e.g. if D is supposed to be around 5 or 5000 would make a huge difference!
 
I have done very little PID tuning, as my system has tended to work well enough with the default parameters so far, and as you note, it's a PITA to do PID tuning--whatever I did usually made things worse, so I put it back and left it alone. :lol:

However, some thoughts:

If you're already getting overshoot in that parameter, decreasing it seems to make more sense than increasing it, if the advice to increase it is to cause an overshoot.

If it is useful, there are a few posts about PID tuning in the big CA3 thread
https://endless-sphere.com/forums/search.php?keywords=PID&t=37964&sf=msgonly
I don't think they cover your question, but maybe they'll point you in a direction.

One of them has some info by Teklektik suggesting only tuning one PID system at a time, for instance if tuning speed and power then set power to something that won't limit at all (so the PID doesn't come into play) while tuning speed, then once speed is tuned power can be set to limit and tune it's PID. (possibly delimiting the speed temporarily so it's PID doesn't interfere with the power tuning).


FWIW, the guide was written by Teklektik, who (even if he and I disagreed sometimes) generally was very good at making workable procedures that didn't really have much in the way of wasted steps...so while I haven't used his PID tuning process and thus can't say with certainty, it's probably a good one if you have the patience for it).
 
Thanks Amberwolf for your answer.

I reverted the (speed) PID parameters to the default, and I must admit that it's already a bit better than what I tried to fine tune myself :-/

Thanks for the link to the CA3 thread. It already answers the next question I was probably going to ask on this forum (about the "Regen Gain Adjust").

I guess I'll ride a little bit with the default parameters to see if I really need more, and try to fine tune from there if the answer is yes.
 
Back
Top