IPM Motor Simulation and FOC Software

User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: IPM Motor Simulation and FOC Software

Post by Ev8 »

Bigpie wrote: Mon Sep 19, 2022 3:52 pm No trips on this test
That’s good news
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Bigpie wrote: Mon Sep 19, 2022 3:52 pm No trips on this test
No idea what's going on there :? there are numbers in the data that shouldn't be possible (196.12 and 1150 for potnom for example). Either they are data capture artefacts and not real (but then in previous plots they coincided with trips which indicates that they are real) or there is a noise problem in your install that can affect multiple ADC channels (Id, Id, resolver, potnom). Are there any other potential noise sources on the car?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Ev8 wrote: Mon Sep 19, 2022 2:47 pm Have done some quick runs this afternoon, turns out with mtpa off I can use field weakening, but performance is pretty lacking (this is with synof centered) but everything behaves. With mtpa on I can’t go more than fwki=1 without getting unwanted throttle when f/w comes in. Regardless of where syncof is at. And also regardless of my mtpa settings I’ve tried between 0.5-3mH 90-150
Is this with both motors running? Can't help wondering whether you need to simplify the problem a bit by running one at a time while tuning.

The unwanted throttle on fw suggests that either the Mtpa parameters are wrong (it needs more -Id which means a larger value for lqminusld) or syncofs is still out. Might be worth upping lqminusld a bit more (I think Bexander did use 6 at one point), it shouldn't do any harm. Keep increasing it till it stops improving performance (although I'd be getting pretty suspicious above 10mH)
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: IPM Motor Simulation and FOC Software

Post by Ev8 »

Yes both motors running but mg1 with no f/w and power dialed back down. Ok mtpa settings next on my list of things to try.
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

Pete9008 wrote: Mon Sep 19, 2022 4:04 pm No idea what's going on there :? there are numbers in the data that shouldn't be possible (196.12 and 1150 for potnom for example). Either they are data capture artefacts and not real (but then in previous plots they coincided with trips which indicates that they are real) or there is a noise problem in your install that can affect multiple ADC channels (Id, Id, resolver, potnom). Are there any other potential noise sources on the car?
Possibly duff data over the serial connection.
Screenshot 2022-09-19 at 5.38.20 pm.png
Just looking at the moving.csv and the iq overshoots a fair bit some times, but looking at the stationary they looks good (ignoring the middle where what appears to be duff data)
Screenshot 2022-09-19 at 5.43.37 pm.png
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Ev8 wrote: Mon Sep 19, 2022 4:24 pm Yes both motors running but mg1 with no f/w and power dialed back down. Ok mtpa settings next on my list of things to try.
Are you still having problems with the stability and motor shaking with mg1 dialed back?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Bigpie wrote: Mon Sep 19, 2022 4:42 pm Possibly duff data over the serial connection.

Screenshot 2022-09-19 at 5.38.20 pm.png Just looking at the moving.csv and the iq overshoots a fair bit some times, but looking at the stationary they looks good (ignoring the middle where what appears to be duff data)
Screenshot 2022-09-19 at 5.43.37 pm.png
They all look pretty good, still a bit surprised how low a kp and ki you need though. Is it still tripping when moving?
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: IPM Motor Simulation and FOC Software

Post by Ev8 »

Pete9008 wrote: Mon Sep 19, 2022 5:01 pm Are you still having problems with the stability and motor shaking with mg1 dialed back?
Not with syncof centered
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Ev8 wrote: Mon Sep 19, 2022 5:05 pm Not with syncof centered
:D
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

Pete9008 wrote: Mon Sep 19, 2022 5:03 pm They all look pretty good, still a bit surprised how low a kp and ki you need though. Is it still tripping when moving?
It is, not identified a reason yet. Will have to log further and see if anything jumps out.
When moving it looks to still have 100 ish amps difference between min and max if looking at the overshoot, and that's almost 50 ams over.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Bigpie wrote: Mon Sep 19, 2022 5:31 pm It is, not identified a reason yet. Will have to log further and see if anything jumps out.
Does it seem better or worse with either set of kp/ki values or is it fairly independent of them?
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

These logs are with MTPA disabled, fw disabled, ramping at 100, other params in the filenames. Interestingly at certain p values I'd get no motor movement at all and I'm also able to get cutouts as such a low throtcur.
Attachments
p400-i200-tc2-nomovement.csv
(3.83 KiB) Downloaded 33 times
p40i200-tc2-nocut.csv
(3.69 KiB) Downloaded 42 times
p40i100-tc2-nocut.csv
(3.72 KiB) Downloaded 37 times
p2000i0-tc2-wouldntmove.csv
(2.52 KiB) Downloaded 33 times
p40i0-tc-1-cutout.csv
(1.91 KiB) Downloaded 35 times
p100i0-tc1-cut.csv
(3.73 KiB) Downloaded 37 times
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Just having a look at the first one, is this with the rotor locked or not?

What does the -tc refer to?
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

throtcur, car is able to move freely on these plots
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Ok, so I can ignore the angles (the time resolution isn't good enough to use them if the car can move).

There's some very odd stuff going on there, in the first one (p400-i200) on lines 9-11 the throttle is at 100%, Uq is at full scale but there is no current. Was the motor moving/shaking at all during these tests? Ho much did the car move during the test?
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

p400-i200-tc2-nomovement.csv? The was no movement at all, no shaking or jerking, I thought the pitch of the whine changed a little though. p2000i0-tc2-wouldntmove.csv also wouldn't move.

All the others the distance moved was 5meters max.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: IPM Motor Simulation and FOC Software

Post by Ev8 »

Yeah I didn’t get any movement when trying to tune with a value of i=0 I had to set it to some small value
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Bigpie wrote: Mon Sep 19, 2022 6:12 pm p400-i200-tc2-nomovement.csv? The was no movement at all, no shaking or jerking, I thought the pitch of the whine changed a little though. p2000i0-tc2-wouldntmove.csv also wouldn't move.

All the others the distance moved was 5meters max.
Of all those the p40-i100 or p40-i200 do look the best.

It does look like a lot of the spikes and large values might be comms problems.

On the two with no movement it almost looks like the PWM isn't enabled (the controller is asking for volts but the motor amps aren't rising). Is it possible that it tripped out before the test and hadn't restarted yet?

Is it still tripping out when trying to move the car?
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

Shouldn't be the case that it tripped an not restarted yet, I tried stepping on it a couple of times with a good few seconds between to be sure.

The car isn't usable at throtcur 2, needs to be at least 3.5 to 4. Stepping on it p40-i200-tc2 slowly accelerates without cutting and foot down. Will try investigate more though the week

If you are any where near rotherham you're welcome to have a go with the car :D
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

OK, look forward to hearing how you get on.

Just to rule out any angle measurement problems it would be interesting to see a plot showing the motor angle with the car crawling forward as slowly as possible.
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

Recording with a few very slow movement but with my current driving params. EDIT DOH forgot angle plot. Had a cutout trying to set off too quickly towards the end of the plot.
Attachments
log (5).csv
(10.88 KiB) Downloaded 41 times
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

Started with as slow as possible in this log. Then did some coasting then full throttle coasting full throttle.
Attachments
log (6).csv
(49.99 KiB) Downloaded 39 times
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Bigpie wrote: Tue Sep 20, 2022 5:03 pm Started with as slow as possible in this log. Then did some coasting then full throttle coasting full throttle.
That all looks pretty good to me, bit of overshoot on the currents but that could be down to the throttle. Assume there were no cutouts? What kind of max speed (mph) are you getting up to on runs like this?

I'm still struggling to see why you might be getting cutouts. The angle measurement is the only thing I can think of, an error in the angle could cause some large currents to build up pretty quickly. I was hoping that moving as slowly as possible, even allowing for the relatively slow plot update, would show a nice progression on the rotor angle (ramping from 0 to 360, step down to 0 and repeat, or vice versa). Instead this is what the plot looks like:
BP_Angle.png
Really not sure what to make of this, either the motor was going too fast, there is something not right with the resolver setup or I am missing something.

Sanity check - I'm guessing that your gearing will be quite high with the fast spinning motor so say 10:1 (complete guess, the outlander revs to 10k with 7:1 and yours goes up to 14k). In order to plot right the motor electrical speed needs to be < say 0.4Hz (update rate is 0.6sec so 4 graph points per rev), allow for 4? poles so 0.1Hz. Say 60cm wheel so 0.6*pi*0.1/10 (m/sec) = 2cm/sec. So as long as you were going slower than that the plot should show the motor angle OK. Hmm, that's pretty slow! What do you reckon, were you going that slow?

I'm guessing not, doesn't look like that test is going to work well enough :(
User avatar
Bigpie
Posts: 1594
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: IPM Motor Simulation and FOC Software

Post by Bigpie »

I top out at 35 mph maybe 40 in first gear which I have to use to get rolling. Though with 5.20R I can move off in second it's not usable, but I should have used that for the slow logging if not I'll find a downhill and do it in fifth. Pretty sure resolver is good. It holds nicely on hills on the throttle.

Need try the same with the lower PI values from the weekends tests also.
Attachments
Screenshot_20220920-144254_Chrome.jpg
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor Simulation and FOC Software

Post by Pete9008 »

Bigpie wrote: Tue Sep 20, 2022 7:33 pm I top out at 35 mph maybe 40 in first gear which I have to use to get rolling. Though with 5.20R I can move off in second it's not usable, but I should have used that for the slow logging if not I'll find a downhill and do it in fifth. Pretty sure resolver is good. It holds nicely on hills on the throttle.
Ahh OK, I'd been incorrectly assuming that you were using the outlander gearbox, so no gears, but having looked at your build thread you have the outlander front motor coupled to the VW box. The outlander motor looks like it should be pretty potent - in the outlander the motors are responsible for all low speed acceleration so it really surprises me that you can only pull away in 1st. I know you only have the one motor while the outlander has two but your car is only half the weight.

I'd have expected you to be able to pull away in pretty much any gear, just slowly in the higher ones. What happens when you try, does the car move or does the inverter trip out? Have you any feel for what kind of power you are getting out of the motor?

With the resolver I'm clutching at straws a bit. Your stationary tests show that the inverter can control the currents well and can put high currents into the motor, the current measurements look reasonable, so the resolver is the only thing left. Your comments about the car not moving with some ki/kp values also make me wonder a bit whether there could be some kind of rotor angle dependant effect too?

Edit - What would be great to see is a real log showing something similar to this:
BP_SlowStart.png
This should be possible in the real world shouldn't it?
Post Reply