OK we need a new rule for how to tune the motor. I thought I understood when to go up or down, but when I started with numbers that work well for me, set Ki to 0, and then gradually reduced Kp, the error started to oscillate around zero. It didn't matter how small I made Kp. So, "does it oscillate around zero" seems to be a terrible test for Kp being "too big".
To give an example, Kp = 15000, Ki = 240 works very very well for my motor. Even Kp = 15000 by itself converges pretty fast to zero. And yet Kp = 500 gave oscillations around 0.
We need Ki to be nonzero, so I wonder what would happen if we just insisted on Ki being some fixed fraction of Kp, and then ramping Kp up until you get good convergence? For example:
Kp = 500 Ki = 500/fixedNumber
kp = 1000 ki = 1000/fixedNumber
...
We need Ki to be nonzero, because the field weakening automatically comes in through that. I'm starting to wonder if there are a variety of pairs of Kp and Ki that would work equally well. I'll read up on this and let you know what I come up with.
By the way, I've tested the auto-find for the rotor time constant. You just have to let the motor run for a couple minutes. It's a new test called
run-rotor-test
Then it outputs the steady state speed of the motor at each candidate rotor time constant. I guess you then just pick the biggest number. at least that works. I'm going to also do acceleration tests to see if one time constant has better acceleration, but lower top speed.
Last edited by MPaulHolmes; 09-07-2015 at 01:40 PM..
|