FOC low speed stuttering

User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

I also have a questions about the observer code:

Code: Select all

integrator2 += sum_two/8000; //frequency
What is the meaning of "8000"?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: FOC low speed stuttering

Post by bexander »

I get some cogging when rolling down my driveway but I don't think that's the root cause for the oscillation I have between 2-3km/h.
It is best noticed when reversing up my driveway because then I have light uphill load and usually reversing at just that speed.
I'm thinking this is some kind of tuning issue and not that big of a deal. It is strange that it appears at a very narrow speed band though.
Issues with full stop regen and unwanted regen in deep FW is far more important issues.

I have a plan of replacing the MGR in the near future so will be interesting to see if the issue with oscillation disappears as well or if it is inverter related. Might be caused by some small oscillation in the motor/inverter and then gets magnified by my car/driveshaft setup?
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

So I tested the TI observer code as shown here:
https://github.com/jsphuebner/stm32-sin ... r?expand=1
So I used angle and frequency calculation and also added direction detection. I mapped PWM on/off to my cruise control switch

I observed:
  1. Frequency and angle calculation work as expected
  2. Frequency jitters up to 3 Hz at standstill, no matter if PWM is on or off
  3. syncadv code must remain enabled, otherwise there is quite a performance loss and weird throttle reaction at higher rpm. By weird I mean less throttle could mean more torque. I set sample_delay_comp=0
  4. Low speed operation did not seem much improved, i.e. slow driving in reverse or 1st gear still produces light stuttering. Regen with brkrampstr=10 already worked flawlessly with atan code.
So with #2 fixed I think this code would be superior to the atan code
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: FOC low speed stuttering

Post by mjc506 »

johu wrote: Mon May 17, 2021 7:23 pm I also have a questions about the observer code:

Code: Select all

integrator2 += sum_two/8000; //frequency
What is the meaning of "8000"?
Apologies, got called away from this for a while. The 8000 should be equal to the frequency at which the function is called (equal to resolver pwm frequency?) It is 'only' a constant and doesn't seem to critical (although would be a tuning parameter perhaps)

Strange, I don't get frequency jittering at standstill, but my hardware is atypical... I do have something more normal to test with but haven't got it set up yet.

I'll get back into this asap
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

Ok, suspected that. You can use the local variable "pwmFrq".
I outputted integrator2 for debugging and it is hovering around +-200000 at standstill.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: FOC low speed stuttering

Post by bexander »

I did just find something very interesting.
When I set fwkp to -500 the low speed stuttering becomes very pronounced.
If I set fwkp to 0 I get no stuttering!!
I find this very strange that this parameters have a severe effect on this low speed stuff??

Can someone else that experience the low speed stuttering test if changeing fwkp have the same effect I'm experiencing?
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

I had also tried that, but since I only experience very little stuttering, this did not change it. But it is definitely possible. If you set it to -500 a regulation error in iq of 1A will command -500A id
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: FOC low speed stuttering

Post by bexander »

Ok, so fwkp will have an effect even below FW region then?
Is there any way to have this to 0 below FW and then -100 during FW?
User avatar
celeron55
Posts: 774
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 27 times
Been thanked: 110 times
Contact:

Re: FOC low speed stuttering

Post by celeron55 »

If you take a look at the graphs we've been posting here
viewtopic.php?p=28774&sid=71ecf6921363a ... cac#p28774
you notice with the algorithm used by openinverter Id starts increasing almost from zero amps. Also, the Id-Iq relation is only dependent on motor current, not speed. If you consider Id to mean FW, then FW is happening almost always.

I have almost zero motor design or control knowledge so I can't comment whether it's good or not, but I can see that's what openinverter does.
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

There are two sources for id. One is MTPA. The other is FW. The FW controller might be crude. If the iq control target can not be reached it will increase id. This id is added to the one already calculated by MTPA
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: FOC low speed stuttering

Post by tom3141 »

Was any more progress made on this? I now have my MGR powered Cappuccino back on the road and have exactly the same symptoms as Bexander - stuttering at very low speeds and especially bad when under load (manoeuvring in my sloped driveway).
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

Are you running 5.13.R?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: FOC low speed stuttering

Post by tom3141 »

No. I can’t remember the exact version off the top of my head but it’s a version that you modified to allow me to run the booster while driving. I assume this isn’t a feature of 5.13? I’m running with the voltage permanently boosted up to around 550V which definitely helps with the performance of the MGR.
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

I think that should still work. All I did was lower the user PWM frequency to 8.8 kHz on Prius boards to allow it to clock the booster. That change is also in 5.13.R. The other mod was on hardware, connecting user PWM to the booster
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: FOC low speed stuttering

Post by tom3141 »

Ah great. I’ll update it then :-)
Does 5.13 have fixes that should help with the stuttering?
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: FOC low speed stuttering

Post by tom3141 »

I see that you’ve added a field weakening start parameter. From the previous discussion in this thread I guess playing around with this should help the low speed stuttering?
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

yes, I guess anything above 20 or 30 Hz will make it go away. There's other measures as well, like not allowing negative voltage when positive current is requested. Sometimes happened due to current sensor and/or resolver noise. And finally syncadv uses a filtered frequency. Those 3 things should eliminate it.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: FOC low speed stuttering

Post by tom3141 »

Great. Updated it and from a brief test seems to be much better. :-)
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: FOC low speed stuttering

Post by johu »

Nice, now just field weakening to solve :)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply