Chasing down id oscillation

Post Reply
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Chasing down id oscillation

Post by johu »

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:
Image

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:
2000rpm regen.png
4000 rpm regen:
4000rpm regen.png
2000 rpm uphill
2000rpm uphill.png
4000 rpm uphill
4000rpm uphill.png
The 4000 rpm plots even show a zero crossing. I remember at higher load this goes away

Here I plotted against il1
3000rpm uphill.png
And here we see the P-controller tries very hard to counteract, using 15% voltage swings
3000rpm uphill idud.png
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
Zieg
Posts: 205
Joined: Mon Apr 25, 2022 3:31 am
Has thanked: 94 times
Been thanked: 85 times

Re: Chasing down id oscillation

Post by Zieg »

So plot at 500/500, ID, IL1 and angle? I can try to get a plot from mine this weekend.
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Re: Chasing down id oscillation

Post by johu »

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
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Re: Chasing down id oscillation

Post by johu »

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.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Zieg
Posts: 205
Joined: Mon Apr 25, 2022 3:31 am
Has thanked: 94 times
Been thanked: 85 times

Re: Chasing down id oscillation

Post by Zieg »

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.
Attachments
Screenshot_20240929_112833_Chrome.jpg
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Re: Chasing down id oscillation

Post by johu »

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.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Zieg
Posts: 205
Joined: Mon Apr 25, 2022 3:31 am
Has thanked: 94 times
Been thanked: 85 times

Re: Chasing down id oscillation

Post by Zieg »

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.
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Re: Chasing down id oscillation

Post by johu »

I did a first cut of the firmware: https://github.com/jsphuebner/stm32-sin ... nticogging

I'm not yet happy with the result:
Screenshot 2024-09-30 at 16-42-10 Huebner Inverter Management Console.png
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
User avatar
muehlpower
Posts: 631
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 114 times

Re: Chasing down id oscillation

Post by muehlpower »

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?
User avatar
uhi22
Posts: 865
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 123 times
Been thanked: 508 times

Re: Chasing down id oscillation

Post by uhi22 »

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.
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Re: Chasing down id oscillation

Post by johu »

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?
From the papers I've read this seems present in all PM motors.
uhi22 wrote: Tue Oct 01, 2024 10:32 am Is this noise issue just new or was it ever present or did it become worse over the time?
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
uhi22 wrote: Tue Oct 01, 2024 10:32 am The id is a calculated value, based on two measured phase currents, right?
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:
2000 rpm uphill.png
It was 45A before and is now 25

With some more tuning I arrived at this
phase 14000.png
Before tuning:
quick uphill.png
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
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Re: Chasing down id oscillation

Post by johu »

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!
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
uhi22
Posts: 865
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 123 times
Been thanked: 508 times

Re: Chasing down id oscillation

Post by uhi22 »

Maybe put a white-noise mp3 on the speakers, no complaints anymore :-D
Zieg
Posts: 205
Joined: Mon Apr 25, 2022 3:31 am
Has thanked: 94 times
Been thanked: 85 times

Re: Chasing down id oscillation

Post by Zieg »

That's great! Will this have any impact on efficiency?
User avatar
uhi22
Posts: 865
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 123 times
Been thanked: 508 times

Re: Chasing down id oscillation

Post by uhi22 »

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).
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Re: Chasing down id oscillation

Post by johu »

So I'm doing some experiments on this.

Here we have the amplitude of il2 about 20% lower than il1.
image.png
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:
image.png
This causes dips in id but no rises. In between the disturbance id stays calm.

Now we put that same disturbance on il2:
image.png
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
image.png
Ok. Lets plot with the actual motor. First we disable anti cogging
1727881273592.jpg
Indeed il2<il1

Now with anti cogging
1727881273581.jpg
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
1727881273569.jpg
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?
1727881273556.jpg
Like 45A peak-to-peak.

Let turn anti-cogging back on
1727881273531.jpg
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
jrbe
Posts: 407
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 125 times
Been thanked: 112 times

Re: Chasing down id oscillation

Post by jrbe »

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?
User avatar
johu
Site Admin
Posts: 6129
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 222 times
Been thanked: 1234 times
Contact:

Re: Chasing down id oscillation

Post by johu »

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
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jrbe
Posts: 407
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 125 times
Been thanked: 112 times

Re: Chasing down id oscillation

Post by jrbe »

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.
Post Reply