Page 5 of 5

Re: FOC low speed stuttering

Posted: Mon May 17, 2021 7:23 pm
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"?

Re: FOC low speed stuttering

Posted: Tue May 18, 2021 4:55 am
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?

Re: FOC low speed stuttering

Posted: Tue May 18, 2021 12:51 pm
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

Re: FOC low speed stuttering

Posted: Tue May 18, 2021 4:01 pm
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

Re: FOC low speed stuttering

Posted: Tue May 18, 2021 5:20 pm
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.

Re: FOC low speed stuttering

Posted: Wed Jun 16, 2021 12:13 pm
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?

Re: FOC low speed stuttering

Posted: Wed Jun 16, 2021 6:30 pm
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

Re: FOC low speed stuttering

Posted: Thu Jun 17, 2021 4:53 am
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?

Re: FOC low speed stuttering

Posted: Thu Jun 17, 2021 8:50 am
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.

Re: FOC low speed stuttering

Posted: Thu Jun 17, 2021 5:28 pm
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

Re: FOC low speed stuttering

Posted: Sat Jan 15, 2022 5:08 pm
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).

Re: FOC low speed stuttering

Posted: Sat Jan 15, 2022 7:27 pm
by johu
Are you running 5.13.R?

Re: FOC low speed stuttering

Posted: Sat Jan 15, 2022 9:36 pm
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.

Re: FOC low speed stuttering

Posted: Sun Jan 16, 2022 10:35 am
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

Re: FOC low speed stuttering

Posted: Sun Jan 16, 2022 12:56 pm
by tom3141
Ah great. I’ll update it then :-)
Does 5.13 have fixes that should help with the stuttering?

Re: FOC low speed stuttering

Posted: Sun Jan 16, 2022 1:09 pm
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?

Re: FOC low speed stuttering

Posted: Sun Jan 16, 2022 3:46 pm
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.

Re: FOC low speed stuttering

Posted: Sun Jan 16, 2022 6:55 pm
by tom3141
Great. Updated it and from a brief test seems to be much better. :-)

Re: FOC low speed stuttering

Posted: Sun Jan 16, 2022 9:12 pm
by johu
Nice, now just field weakening to solve :)