IPM Motor Simulation and FOC Software
Re: IPM Motor Simulation and FOC Software
so the current version on Johannes github wont compile, i get this error:
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
oh, yes, seems I only corrected that locally
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
More combined simulator and car tuning today (Prius that is). Today it seems simulator and car match up quite well.
I struggle to get more than 20kW constant power both in the car and the simulator: Controllers are very smooth now. The code is based on the recent github master commit, slightly modified for the simulator (e.g. export vlim). fwkp means filter constant!
The car starts out very powerful but quickly looses grunt above 40 kph. I saw 120A@360V which is a nice 43 kW. But then when at "speed", say 60 kph, I only see about 70A or 25 kW. So more than in the simulator but similar drop off. Any ideas how to obtain more constant power?
Had one uncontrolled regne event with some delay though, when coming off throttle at 100 kph
I struggle to get more than 20kW constant power both in the car and the simulator: Controllers are very smooth now. The code is based on the recent github master commit, slightly modified for the simulator (e.g. export vlim). fwkp means filter constant!
The car starts out very powerful but quickly looses grunt above 40 kph. I saw 120A@360V which is a nice 43 kW. But then when at "speed", say 60 kph, I only see about 70A or 25 kW. So more than in the simulator but similar drop off. Any ideas how to obtain more constant power?
Had one uncontrolled regne event with some delay though, when coming off throttle at 100 kph
- Attachments
-
- stm32_foc.bin
- (48.39 KiB) Downloaded 40 times
-
- audi 2022-11-06.json
- (1.48 KiB) Downloaded 52 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- 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
Its all down to what the operating point is doing when it limits, could you post the operating point plot for that run?
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
Yes:
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- 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
Couple of assumptions, the vertical bit on the plot is the initial limiting at very low speed and the bit that then goes towards the origin is the limiting as speed increases.
The initial near vertical bit is actually increasing -Id slightly which is going in the wrong direction. The ideal would be to pull some -Id out to move closer to icrit while also allowing Iq to remain higher (this does depend on what ud is doing though) which should help keep torque up.
The initial near vertical bit is actually increasing -Id slightly which is going in the wrong direction. The ideal would be to pull some -Id out to move closer to icrit while also allowing Iq to remain higher (this does depend on what ud is doing though) which should help keep torque up.
-
- 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
Take that back. Just tried it both with the operating point moving to the right initially and then down towards icrit and also with it just moving directly towards icrit and neither is significantly better.
It may be that that is as good as it is going to be without running at a higher voltage?
It may be that that is as good as it is going to be without running at a higher voltage?
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
Yeah, might well be. At 550V I'm getting 48 kW peak and about 35 kW constant power
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- 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
The problem is the wLqIq term in the Ud voltage equation. Essentially the torque producing Iq is generating a large Ud voltage, this isn't affected by field weakening at all and so whatever we do with Id has no effect on it. Without the higher voltage all we can do is reduce Iq as speed increases to keep it in check which reduces torque and power.
-
- 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
Could do with a better handle on the flux linkage value. Setting it to 200mWeber with my controller gives the same results as in your plot, increasing it to 300 gives this:
which seems closer to the numbers you are getting in the car?- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
The latter. Like said, saw 43 kW electrical. Raising icrit to -100A also seems to help
EDIT: just did some quick and dirty math on my plot. At the very end it looks like I'm coasting.
We have: uq=25000, udc=360, fstat=110
uac = uq/37813*udc/sqrt(2)=169V
V/Hz = 169/110=1.5 V/Hz . How can you calculate flux linkage from that?
EDIT: just did some quick and dirty math on my plot. At the very end it looks like I'm coasting.
We have: uq=25000, udc=360, fstat=110
uac = uq/37813*udc/sqrt(2)=169V
V/Hz = 169/110=1.5 V/Hz . How can you calculate flux linkage from that?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- 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
Pete9008 wrote: ↑Mon Oct 31, 2022 9:26 pm Now that syncadv is sorted and uq and ud are representative you can measure it fairly easily. This is the equation:
vq.png
If you are coasting below base freq (Iq and Id are zero) the only term remaining in the above is the last one (the bemf). So measure vq, divide by 2xPIx(electrical motor speed) and you should have the flux linkage
Edit - but only trust the measurements if vd is zero, as well as iq and id, while coasting. If it isn't there is still a sync offset somewhere.
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
Yes, well, sortof - 244 mWeber I suppose then. Not bad, huh
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- 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
Just looked back at your plot, the only bit I can see where iq, id and ud are all zero is at time 19965. This has a uq of nearer 20000 which would then give a flux linkage of 200mWb?
Would be worth measuring at a few frequencies and seeing if the results agree but this does suggest that values of 200 or more are realistic on high L motors.
Would be worth measuring at a few frequencies and seeing if the results agree but this does suggest that values of 200 or more are realistic on high L motors.
- Romale
- Posts: 448
- Joined: Fri May 20, 2022 4:16 pm
- Location: Romania
- Has thanked: 208 times
- Been thanked: 45 times
Re: IPM Motor Simulation and FOC Software
is this assembly also suitable for the Nissan motor, or only for Toyota motors?
On your question about power, and if you add the values of the maximum currents in your settings??
evil neodymium
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
I have only tested on Prius lately but will also test on Leaf soon.
Did another test run with the latest simulator results. Upped fwcurmax (=icrit) too -100A and curkp to 500. More makes it noisy. Also found that sometimes FW current is generated at 0 rpm, not sure why.
Anyway, first the coast run: Note there is 5A FW current to overcome Toyotas 50/50 "intelligence". I don't think it changes flux linkage much, as on some previous test even -20A did not seem to affect uq at all.
Lets repeat:
uq=12000, udc=370, fstat=70
uac = uq/37813*udc/sqrt(2)=83V
V/Hz = 83/70=1.2 V/Hz = 188 mWeber
Then I just drove around not specifically testing anything. The car is slightly more powerful now, about 80A at 360V, so 28 kW. It does become slightly wiggly above 90 kph and ud is almost saturated. Transition to regen is smooth and light throttle is also not an issue. So very well drivable now.
At some point though while regenning down a hill behind a lorry, far away from any controller saturation I got a short jolt of unwanted regen but it fixed itself fairly quickly: Any ideas what could be causing that? Also requesting too much regen seems to easily end up in uncontrolled regen in general.
- Attachments
-
- audi 2022-11-08.json
- (1.48 KiB) Downloaded 78 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- 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
Is the unwanted regen that spike at 60400?
Do you have any plots of the high requested regen turning into uncontrolled regen?
Do you have any plots of the high requested regen turning into uncontrolled regen?
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
yes, that one.
No plots besides that one, will do more driving and try to trigger it
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
I can do more, had it set to 3.5A before but it just gives a jolt of torque on startup and the backoff towards higher speed feels even worse. It doesn't help high speed power and doesn't improve the driving experience. So dialed it down to 2.8A.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 5768
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1009 times
- Contact:
Re: IPM Motor Simulation and FOC Software
On another note I found the actual reason why the car tends to hop about when starting from standstill. It's the idle offset calibration and disabling of PWM. The frequency only starts to measure at 7 Hz. When PWM is disabled motor leads are shorted by the Gen2 logic and current sensor offset calibration is wrong. Afterwards the entire algorithm suffers from the wrong offset even though it doesn't show as much at higher speed.
So I'll add a parameter to turn off the idle function. Offset will be measured once at startup and that's it.
So I'll add a parameter to turn off the idle function. Offset will be measured once at startup and that's it.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9