Chasing down id oscillation
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Chasing down id oscillation
I want to split this topic off the simulator thread.
So in steady state there is a very strong oscillation of id which likely causes torque ripple and thereby audible noise.
I am running a Nissan Leaf EM57 motor with its accompanying inverter.
My spouse meanwhile protests against longer trips because of the noise which is audible at different frequencies across all gears (I run a 6-speed gearbox). This means: the problem must be solved!
The oscillation runs at 2x the electrical motor speed:
It happens on positive and negative torque and at any speed. I've taken the measurements by engaging cruise control and driving uphill or downhill.
2000 rpm regen: 4000 rpm regen: 2000 rpm uphill 4000 rpm uphill The 4000 rpm plots even show a zero crossing. I remember at higher load this goes away
Here I plotted against il1 And here we see the P-controller tries very hard to counteract, using 15% voltage swings I also plotted with fwcurmax=0 and syncadv=0 but that didn't change anything.
I'd like to implement some feed-forward compensation for this but the magnitude is really quite scary. If you have any ideas what else to plot or would even like to plot yourself, please chime in. I'm using 500/500 plot settings
So in steady state there is a very strong oscillation of id which likely causes torque ripple and thereby audible noise.
I am running a Nissan Leaf EM57 motor with its accompanying inverter.
My spouse meanwhile protests against longer trips because of the noise which is audible at different frequencies across all gears (I run a 6-speed gearbox). This means: the problem must be solved!
The oscillation runs at 2x the electrical motor speed:
It happens on positive and negative torque and at any speed. I've taken the measurements by engaging cruise control and driving uphill or downhill.
2000 rpm regen: 4000 rpm regen: 2000 rpm uphill 4000 rpm uphill The 4000 rpm plots even show a zero crossing. I remember at higher load this goes away
Here I plotted against il1 And here we see the P-controller tries very hard to counteract, using 15% voltage swings I also plotted with fwcurmax=0 and syncadv=0 but that didn't change anything.
I'd like to implement some feed-forward compensation for this but the magnitude is really quite scary. If you have any ideas what else to plot or would even like to plot yourself, please chime in. I'm using 500/500 plot settings
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: Chasing down id oscillation
So plot at 500/500, ID, IL1 and angle? I can try to get a plot from mine this weekend.
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
It's a tradeoff. Sample rate drops the more items you plot. Just id is ok or id and il1
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
Just linking this one in for reference: https://ietresearch.onlinelibrary.wiley ... .2018.6303
It could be that what we're seeing is the cogging torque that you can also feel when spinning the motor manually.
It could be that what we're seeing is the cogging torque that you can also feel when spinning the motor manually.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: Chasing down id oscillation
Okay, here's what I got. No cruise control so I was just trying to maintain a steady input to hold speed. Roughly 4700 rpm. This should be id on the left and il1 on the right. I see now that I probably should have plotted both of them on the left, sorry about that. I might be able to take a quick trip out again tomorrow with my laptop and try again if it would help.
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
I take it that blue is id and red is il1? (Include the labels in your screenshot)
So same situation like mine, unsurprisingly. Are you running the EM57 as well?
I'm trying to write some code today that tries to quantize the cogging in phase and amplitude and then counteract with ud in feed-forward fashion.
So same situation like mine, unsurprisingly. Are you running the EM57 as well?
I'm trying to write some code today that tries to quantize the cogging in phase and amplitude and then counteract with ud in feed-forward fashion.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: Chasing down id oscillation
Yeah, EM57 and blue is id. The legend got covered when I zoomed in for the screenshot, sorry. I'll be able to bring my laptop next time.
Cogging torque would make sense given what I've read, though I'll also note that I don't hear much of an audible whine while driving. Nothing that seems out of the ordinary, at least, and I've got the motor rigidly bolted directly to the frame of the car.
Cogging torque would make sense given what I've read, though I'll also note that I don't hear much of an audible whine while driving. Nothing that seems out of the ordinary, at least, and I've got the motor rigidly bolted directly to the frame of the car.
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
I did a first cut of the firmware: https://github.com/jsphuebner/stm32-sin ... nticogging
I'm not yet happy with the result: You can see it creates a good correction value but the oscillation is still there. Not sure if the code is correct or if it's just a matter of tuning.
If you want to test please compile yourself. There are two new parameters
- cogkp - the gain between cogging current and correction value
- cogph - the phase between cogging current and electrical rotor angle
The way I tuned it was setting cogkp=5 and then adjusting cogph until anticog is opposite of the cogging current as shown above. To arrive at that I had my test driver (thanks Markus) drive 30 kph on CC while I was plotting id and anticog in a 500/500 plot. I arrived at roughly 12000 dig (65°C) for my EM57
EDIT: there was an integer overflow so any gain above 22 was ignored
I'm not yet happy with the result: You can see it creates a good correction value but the oscillation is still there. Not sure if the code is correct or if it's just a matter of tuning.
If you want to test please compile yourself. There are two new parameters
- cogkp - the gain between cogging current and correction value
- cogph - the phase between cogging current and electrical rotor angle
The way I tuned it was setting cogkp=5 and then adjusting cogph until anticog is opposite of the cogging current as shown above. To arrive at that I had my test driver (thanks Markus) drive 30 kph on CC while I was plotting id and anticog in a 500/500 plot. I arrived at roughly 12000 dig (65°C) for my EM57
EDIT: there was an integer overflow so any gain above 22 was ignored
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- muehlpower
- Posts: 637
- Joined: Fri Oct 11, 2019 10:51 am
- Location: Germany Fürstenfeldbruck
- Has thanked: 12 times
- Been thanked: 117 times
Re: Chasing down id oscillation
I only marginally understand what is being discussed here. Is this problem only with the EM57 motor or with all permanent magnet motors and are sine wave motors not affected?
- uhi22
- Posts: 934
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 135 times
- Been thanked: 529 times
Re: Chasing down id oscillation
Same for me, I do not really have a clue what is discussed, but maybe can contribute with stupid questions:
- Is this noise issue just new or was it ever present or did it become worse over the time?
- The cogging torque is (from my experience with smaller motors) quite small compared to the actual torque. I would guess much below 5% of a normal driving torque. I do not think this is the root cause for the large ripple.
- The id is a calculated value, based on two measured phase currents, right? There is a long list of possibilities that this shows oscillations, e.g.
- PWM generation for the three phases is not accurate symmetrical, so that e.g. one phase gets physical more current as the other two.
- Wiring of one phase is loose and has more resistance.
- (Partial) shortcut inside one of the windings
- One of the current sensors has a deviation from the other.
- Angle measurement is inaccurate (mechanically loose position detector, delay in software, whatever)
And a completely different direction: If the same ripple is present on the setups of different users, but the noise is only in one, then the analysis of the ripple is more academical.
- Is this noise issue just new or was it ever present or did it become worse over the time?
- The cogging torque is (from my experience with smaller motors) quite small compared to the actual torque. I would guess much below 5% of a normal driving torque. I do not think this is the root cause for the large ripple.
- The id is a calculated value, based on two measured phase currents, right? There is a long list of possibilities that this shows oscillations, e.g.
- PWM generation for the three phases is not accurate symmetrical, so that e.g. one phase gets physical more current as the other two.
- Wiring of one phase is loose and has more resistance.
- (Partial) shortcut inside one of the windings
- One of the current sensors has a deviation from the other.
- Angle measurement is inaccurate (mechanically loose position detector, delay in software, whatever)
And a completely different direction: If the same ripple is present on the setups of different users, but the noise is only in one, then the analysis of the ripple is more academical.
Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
From the papers I've read this seems present in all PM motors.muehlpower wrote: ↑Tue Oct 01, 2024 8:58 am I only marginally understand what is being discussed here. Is this problem only with the EM57 motor or with all permanent magnet motors and are sine wave motors not affected?
It has always been there. The first time I saw it was on the trip to London. Janosch was driving and I was plotting random quantities. The ultimate test is whether the noise that my wife complains about is now diminished
Yes. But so is iq and that shows less ripple. I think the little ripple it does show could be carried over from the d-axis because it changes the flux strength.
If I feed a perfect speed signal and sinusoidal currents with my signal generator the ripple is not present. Of course these currents are no longer the result of the PWM. When I do an AM modulation with a triangle signal I can trigger the ripple on the desk as well.
So like said, the issue is known so I think it is actually a physical phenomenon in the motor. Also Ziegs plot is identical.
I tested with the compensation enabled and you can see the ripple is now less pronounced: It was 45A before and is now 25
With some more tuning I arrived at this Before tuning: So it's not perfect yet but going in the right direction I think. Wife test drive coming up
EDIT: cogkp=90, cogph=14000, cogmax=3000
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
First test drive with wife, but only 17 km she says she can't hear the whining anymore!
In two weeks we will drive a longer distance, lets see how it goes!
In two weeks we will drive a longer distance, lets see how it goes!
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- uhi22
- Posts: 934
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 135 times
- Been thanked: 529 times
Re: Chasing down id oscillation
Maybe put a white-noise mp3 on the speakers, no complaints anymore
Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
- uhi22
- Posts: 934
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 135 times
- Been thanked: 529 times
Re: Chasing down id oscillation
Some thoughts about potential root cause. The ripple is synchronous to the electrical motor revolution, and it has peak twice per electrical revolution, right? This is not 3 per revolution, like the 3 phases, also it is not 6, like twice per phase. The "2 peaks per revolution" means, that it is synchronous with the absolute value of *one* phase current. This would mean, that one phase is different to the other two phases.
The workaround is, to inject a higher voltage twice per revolution, right? This seems to compensate the "excentric" behavior.
But what could be the root cause, that one phase needs a higher voltage than the other two phases, to get an equal torque? I have three ideas:
- The PWM generation could be excentric, so that one phase needs more "digital voltage" to provide the physically identical voltage like the other two.
- The voltage on one phase gets lost on the way to the motor, e.g. by a voltage drop on a bad connection on one phase.
- The motor windings are not identical, e.g. one winding has one turn more than the other two.
To find the root cause, one possibility would be to measure (at a test bench) the phase currents and voltages while turning the motor from outside and just having a symmetric resistive load. This should show whether all three phases have identical values.
Or: To measure the three phase voltages in the running car (using externally equipment, not the calculated values from the inverter).
The workaround is, to inject a higher voltage twice per revolution, right? This seems to compensate the "excentric" behavior.
But what could be the root cause, that one phase needs a higher voltage than the other two phases, to get an equal torque? I have three ideas:
- The PWM generation could be excentric, so that one phase needs more "digital voltage" to provide the physically identical voltage like the other two.
- The voltage on one phase gets lost on the way to the motor, e.g. by a voltage drop on a bad connection on one phase.
- The motor windings are not identical, e.g. one winding has one turn more than the other two.
To find the root cause, one possibility would be to measure (at a test bench) the phase currents and voltages while turning the motor from outside and just having a symmetric resistive load. This should show whether all three phases have identical values.
Or: To measure the three phase voltages in the running car (using externally equipment, not the calculated values from the inverter).
Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
So I'm doing some experiments on this.
Here we have the amplitude of il2 about 20% lower than il1. This also creates a 2nd order harmonic but it is sinusoidal. Same result when il1 has lower amplitude than il2.
Here we have a periodic disturbance on just il1: This causes dips in id but no rises. In between the disturbance id stays calm.
Now we put that same disturbance on il2: Still no symmetric triangle pattern
It's only when we change the phase of the disturbance such that il1 becomes greater il2 (or vice versa) that we see the triangle pattern Ok. Lets plot with the actual motor. First we disable anti cogging Indeed il2<il1
Now with anti cogging Oh wow, that makes il2>il1 and changes the shape of both slightly away from sinusoidal
Ok, lets turn off anti cogging and instead change the gain of il2 so that it has the same magnitude as il1 OK, that kind of worked but it looks like the 0-point of the two is skewed (keep in mind we do an offset calibration at standstill, so its not that)
Now hows the id oscillation? Like 45A peak-to-peak.
Let turn anti-cogging back on Ok, diminished to 25A peak-to peak and the triangle shape is disturbed.
In the paper I linked above the anti-cogging signal saturates, so has a flat top. cogmax gives me a parameter to achieve that. Worth a try as well.
Anyway, what do we conclude now?
Here we have the amplitude of il2 about 20% lower than il1. This also creates a 2nd order harmonic but it is sinusoidal. Same result when il1 has lower amplitude than il2.
Here we have a periodic disturbance on just il1: This causes dips in id but no rises. In between the disturbance id stays calm.
Now we put that same disturbance on il2: Still no symmetric triangle pattern
It's only when we change the phase of the disturbance such that il1 becomes greater il2 (or vice versa) that we see the triangle pattern Ok. Lets plot with the actual motor. First we disable anti cogging Indeed il2<il1
Now with anti cogging Oh wow, that makes il2>il1 and changes the shape of both slightly away from sinusoidal
Ok, lets turn off anti cogging and instead change the gain of il2 so that it has the same magnitude as il1 OK, that kind of worked but it looks like the 0-point of the two is skewed (keep in mind we do an offset calibration at standstill, so its not that)
Now hows the id oscillation? Like 45A peak-to-peak.
Let turn anti-cogging back on Ok, diminished to 25A peak-to peak and the triangle shape is disturbed.
In the paper I linked above the anti-cogging signal saturates, so has a flat top. cogmax gives me a parameter to achieve that. Worth a try as well.
Anyway, what do we conclude now?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 447
- Joined: Mon Jul 03, 2023 3:17 pm
- Location: CT, central shoreline, USA
- Has thanked: 134 times
- Been thanked: 122 times
Re: Chasing down id oscillation
On your last image, it looks like it might be resonating with something. Starts with a high and low peak, then lessens the peaks in the middle, then starts increasing amplitude up again. Or I might be reading into it. Does a pattern show up with a longer log?
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
I don't know, I'm thinking it's because the anti-pattern doesn't fit perfectly so there is still some of the original oscillation left. Or do you mean there is a hull curve around the HF pattern?
On a side node the project now build again and we have binaries: https://github.com/jsphuebner/stm32-sin ... 1166583434
On a side node the project now build again and we have binaries: https://github.com/jsphuebner/stm32-sin ... 1166583434
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 447
- Joined: Mon Jul 03, 2023 3:17 pm
- Location: CT, central shoreline, USA
- Has thanked: 134 times
- Been thanked: 122 times
Re: Chasing down id oscillation
It looks like the amplitude +/- is highest on the first and last waveform and lessens towards the middle. So, I think a hull curve. And maybe 2 with a higher peak in the middle. I'm looking at the peaks protruding past the hf pattern / noise.
Could just be artifacts from the logging speed / resolution or like you said, might be from it not being fine tuned yet. Might be too small to worry about too.
Could just be artifacts from the logging speed / resolution or like you said, might be from it not being fine tuned yet. Might be too small to worry about too.
-
- Posts: 56
- Joined: Sun Apr 12, 2020 2:02 pm
- Location: EU Estonia
- Has thanked: 13 times
- Been thanked: 15 times
- Contact:
Re: Chasing down id oscillation
2012 original Nissan Leaf makes whining noise when driving around 70km/h
-
- Posts: 447
- Joined: Mon Jul 03, 2023 3:17 pm
- Location: CT, central shoreline, USA
- Has thanked: 134 times
- Been thanked: 122 times
Re: Chasing down id oscillation
I agree, I have a 2015 and a 2019. The gen3 / 2019 inverter is much quieter, I think because of switching frequency. The 2015 inverter is very audible with it's switching frequency. I can try to get the audible frequency of both if you think it would help at all.
Also, wondering now if switching frequency might be part of the gen3 drop in board struggles..
Also, wondering now if switching frequency might be part of the gen3 drop in board struggles..
- johu
- Site Admin
- Posts: 6258
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 236 times
- Been thanked: 1286 times
- Contact:
Re: Chasing down id oscillation
Do you know the oem switching frequency of the gen3?
Initially I tried 8.8 kHz that works well for the gen2 but the gate drive supplies got alarmingly hot. Also it needs around double the dead time. Hence why I recommend 4.4 kHz.
Would be good to know if the whining frequency is two times stator frequency.
Initially I tried 8.8 kHz that works well for the gen2 but the gate drive supplies got alarmingly hot. Also it needs around double the dead time. Hence why I recommend 4.4 kHz.
Would be good to know if the whining frequency is two times stator frequency.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 447
- Joined: Mon Jul 03, 2023 3:17 pm
- Location: CT, central shoreline, USA
- Has thanked: 134 times
- Been thanked: 122 times
Re: Chasing down id oscillation
I don't know the switching frequency of the gen 3. I'd guess the 2019 is double the frequency that the 2015 uses by ear.
I'll try to get some recordings / spectrum analyzer runs of both cars in the next few days.
The 2019 also has some odd resonances at times. I think it's the tires but not 100%. We have snow rims and tires coming so I can rule those in or out soon.
I'll try to get some recordings / spectrum analyzer runs of both cars in the next few days.
The 2019 also has some odd resonances at times. I think it's the tires but not 100%. We have snow rims and tires coming so I can rule those in or out soon.