Now that I have it working again, time for some testing.
The text files are attached with a couple of spreadsheets to show the graphs. I don't see a bunch of difference in the graphs myself. The graphs may be a lot easier to read, or show much more change with the changing parameters, with a higher voltage pack.
When I tune a loop at work, the drill is:
- increase the gain (kp) until you see over-shoot and oscillation
- decrease the gain until you get about 10% overshoot
- raise the integral (ki) until the oscillation drops to 3 or 4. Initial overshoot is the first half-wave, smaller overshoot below, another smaller overshoot above, and then it hits target
I think I've been assuming too many things on this process. I need to stop thinking and just follow instructions .. but I'm an engineer and this is *DIFFICULT* for me!
If any of these numbers is acceptable, I'd like to get the motor to spin and see if the encoder signal is acceptable to the controller. Once I've got the 5 HP motor to spin and the controller is reading position, I am comfortable moving to the larger Siemens motor at a higher voltage (in the garage). That's where the interesting stuff is going to happen (I hope).
You don't have enough voltage, so it is ramping up the pwm beyond what it should go to to vainly attempt to achieve 20amps on a line. Evidently, that 39 or 40v point is right on the edge. I should either reduce it to 10 amps for tuning the loop, or increase voltage. I can email you a 10amp version (that is hard wired into the code) if you want to go that route, but I think higher voltage would be better.
No need for a code change. 36V is what I had handy, but I can install more.
I can patch in the smaller 48V pack quite easily. 20A is already quite low compared to the 300A scale on the LEM.
Voltage - 84V, 40.1V from 3 x 12V lead, 44V from 4 x 12V gel cells
Kp-id 2000
Ki-id 0
run-pi-test
file 40
Kp-id 2000
Ki-id 2
run-pi-test
file 41
It seems to me like:
- my little 48V gel cell pack can't supply enough current
- the test goes OK for a short time and then it can't sustain the current
- the PWM algorithmn gives up
Get a glass mat 12V battery out of my sprayer, remove the 48V gel cell pack, add the glass mat into the pack (with a charger on it since it is likely a bit low). 4 x 12V lead, 40.1V plus the new battery (on a charger - 14.1V)
Battery pack voltage is 54.2V
Hopefully one of these sets of parameters is 'close enuf' and I can use the settings to spin the motor soon. I don't understand what Paul is looking for in the response graph, so I've posted all of the tests.
Sorry about the span of the tests - I get impatient when I'm running tests and end up doubling instead of going up 2 at a time
I added two older batteries (I think they came from a floor sweeper about 5 years ago) to the pack. That brings the voltage to 79.1V. A charger on the weakest ... by the end of the testing the voltage was up to 79.3V
I re-ran the pi-test with the same parameters as yesterday, but with the larger pack (higher voltage).
The results look *VERY* much different. I guess the voltage was just too low for the Kp and Ki values to make a lot of difference!
I think the Kp-id=2000, Ki-id=320 looks like the best fit from me.
The Following User Says Thank You to thingstodo For This Useful Post:
That is looking good. You should now try maybe 3000 or 4000 (or more?) for kp, and gradually increase ki in that situation too (starting small). haha. I bet you can get even faster convergence.