I finally got back into the garage and set up properly with the AC controller, battery pack, motor and laptop.
I have some video and some pictures of the setup. When I get it edited and posted it should be detailed enough to remind me how to set it up. If anyone stays awake until the end, and it's not detailed enough for you to follow, let me know
New results for Paul with Kp-id 2000, Ki-id starting at 0 and going through 2,4,6,8,10,15,20,30,40,50,75,100,125,150,175,200
Log files start at 110 and go up to 127. Looks like I should have stepped Kp-id up from 10 to 20 in increments of 1 instead of increments of 5?
Pack is about 126V, so the controller sagging below 40VDC during the test should no longer be a problem.
My thinking is that KP-ID 2000 is too big. Notice the first graph of Kp = 2000, Ki = 0, the error VERY QUICKLY goes to zero, but then zooms past and slowly goes to zero from the negative side. That overshoot of zero means Kp is too aggressive. My understanding is, when you double the voltage with PI loop tuning, that you have to cut Kp and Ki in half to get the same response time. And with a different, very large motor, maybe the current can change very fast due to very low resistance in the 3 stator coils? Try this:
Kp = 100 Ki = 0
Kp = 200 Ki = 0
Kp = 300 Ki = 0
...
And see if you get ZERO overshoot, meaning the error numbers don't zoom from + to - like this sample:
+0259
+0259
+0179
+0179
+0099
-0109
-0285
-0349
-0285
-0253
-0205
-0173
-0173
-0253
-0301
-0269
-0269
-0221
-0189
If you see it go from + to -, that's a sign that your Kp (or Ki or both) number is too big. We may have to increase the resolution of Kp and Ki in the software too. Your motor is a very interesting test case. I've never tried tuning the loop on such a big AC motor.
My thinking is that KP-ID 2000 is too big. Notice the first graph of Kp = 2000, Ki = 0, the error VERY QUICKLY goes to zero, but then zooms past and slowly goes to zero from the negative side. That overshoot of zero means Kp is too aggressive. My understanding is, when you double the voltage with PI loop tuning, that you have to cut Kp and Ki in half to get the same response time. And with a different, very large motor, maybe the current can change very fast due to very low resistance in the 3 stator coils? Try this:
Kp = 100 Ki = 0
Kp = 200 Ki = 0
Kp = 300 Ki = 0
...
And see if you get ZERO overshoot, meaning the error numbers don't zoom from + to - like this sample:
+0259
+0259
+0179
+0179
+0099
-0109
-0285
-0349
-0285
-0253
-0205
-0173
-0173
-0253
-0301
-0269
-0269
-0221
-0189
If you see it go from + to -, that's a sign that your Kp (or Ki or both) number is too big. We may have to increase the resolution of Kp and Ki in the software too. Your motor is a very interesting test case. I've never tried tuning the loop on such a big AC motor.
Good - we're getting to "rules of thumb" and being able to recognize good data and bad data. I like this kind of stuff
Starting at Kp-id=2000 was too high .. OK. Being me, I'll likely do the double/half thing and try 1000, then 500, then 250 until we get no overshoot, then go back up until we get just a bit of overshoot. That's what we do to tune a loop at work ... does that apply here?
So at that point I begin to raise the Ki-id from 0 to converge as quickly as possible, getting rid of the overshoot (perhaps allowing maybe 1% overshoot for the first half cycle?)
My testing will be done with 125VDC, since I can run both the DC motor controller and the AC motor controller at this voltage, off the same pack. When my stepson puts the Siemens motor into his RX8 (in maybe 2 years?) I expect that it will be running with at least 250VDC ... more if he can fit the batteries in. So a complete re-tune would be required, right?
The Following User Says Thank You to thingstodo For This Useful Post:
No retune will be needed at the higher voltage. I tried it out with my motor at 48v. It was tuned, and then I tested it at 96v, and cut the Kp and Ki values in half and sure enough, I got the exact same convergence curve. I think your tuning idea of half/double rather than linear increase sounds much better. It's probably a lot faster to do it that way.
By the way, It's OK if the PI loop doesn't converge to zero with Kp = xxx, and Ki = 0. You just don't want it going negative. It should level off to some fixed value close to zero though. Then, slowly increment Ki 1 at a time to get it to converge to zero. And I think a 1 or 2% overshoot wouldn't be a big deal. Also, There's going to be some noise, so if it's going +27, -35, +13, -12, -40, +31, that wouldn't count as overshoot. It's just noise.
We are concerned about going from positive to negative, where it is more negative than say, -60.
I have a couple of questions; I'm trying to catch up here.
Is the PI loop for overall motor control or specifically for induction motor control, IE controlling the slip?
Also, thingstodo: Does your stepson need a Siemens motor? I've got one. It's practically brand new - first it sat in Brammo's shop, where they were going to do a 4 motor AWD racecar. Then I got it and it sat in my shop. (I've decided to go with the Toyota MGR).
- E*clipse
The Following 2 Users Say Thank You to e*clipse For This Useful Post:
The PI loop is so you can command Id and Iq to be whatever you want (and they will listen! haha). They are the 2 "dc" components that are responsible for field strength and torque. It's the same thing with brushless DC. But when you have the magnets, you normally want Id to be 0, since there's already a field from the magnets. But when you want to weaken the magnets, you command Id to be negative to fight the magnet strength. For the MGR, you will also command Id and Iq to be various things, but I think the ideal Id and Iq changes as the RPM and load changes. But you still need to command Id and Iq, so even for the MGR, you would go through this process.
I already tuned a brushless DC motor too, and the code for running that motor was basically identical to the code for the induction motor, except for how to know the rotor flux angle. But in each case you still need the PI loop to be able to command Id and Iq.
Also, thingstodo: Does your stepson need a Siemens motor? I've got one. It's practically brand new - first it sat in Brammo's shop, where they were going to do a 4 motor AWD racecar. Then I got it and it sat in my shop. (I've decided to go with the Toyota MGR
Andrew has a siemens motor, from EVTV, along with the adapter plate to make it fit netgain motor/transmission adapter plates.
I, on the other hand, could use a Siemens motor.
But looking at this holistically, it would be better for both of us if you could find someone local to purchase it .. the shipping to Canada will be nasty .. it was nasty from EVTV .. and the forms to get it through customs are not pleasant to fill out.
I think I'm dreaming of using a TESLA drivetrain (motor/gearbox/controller) with an EVTV CAN interface (to feed the controller the codes that it wants) for my next build. But that assumes that I can find someone to solve the problems of mating a TESLA rear-end to the axles and suspension of a one ton truck. I'm not really a car guy .. I like trucks. And if I'm going to do a conversion, it may as well be able to haul my boat. It just doesn't need to do that at 130 mph (if I don't increase the tire size ... maybe 160 mph if I do)
This, of course, assumes that I finish:
1 - my Mazda build (DC netgain 11, maybe P&S controller)
2 - my grandson's go-cart-like vehicle (48V, Curtis controller),
3 - a side-by-side quad that is based on the WIKISPEED open source design
... so any new project, including the truck, is a ways into the future!
The Following User Says Thank You to thingstodo For This Useful Post:
I can't get any lower than 1 ... and there is still some MEAN overshoot ... so how bad does using decimals mess up your code, Paul?
Umm ... dumb question ...
Can you test for a larger (much larger) current instead of the target 20 amps (I think that's what you said the target was)?
Like .. maybe .. 200 amps? Or 2000 amps? That's sorta like having on decimal place (200) or 2 decimal places (2000) on Kp and Ki, right?
The motor is rated for 400 amps continuous, so pushing 200 amps is no problem. 2000 may be a bit more of a challenge, depending on how much energy is stored in that big ring-cap .. instead of messing with your math code.
Let me know!
The Following User Says Thank You to thingstodo For This Useful Post:
It should be pretty easy to increase the resolution, so that 1 would become 10000. I'll do that some time tomorrow. we could also up the current some for better resolution. I'll do that too.