cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED]HFI parameters tuning on IPMSM

jlondero
Associate II
Posted on May 21, 2016 at 00:03

Hi!

I'm developing software to control a small, sensorless IPMSM at very low speeds (0-90RPM) using STM FOC SDK v4.2 on a STM32F4xx.

I've already got the motor (using a custom board), but I'm having trouble making it run.

I know I won't be able to control it using the lib in Speed Control Mode (due to the 6 RPM resolution), but I'm planning to control it in Torque Control Mode with an external loop. My efforts are right now in successfully getting a precise rotor position feedback.

I've seen the steps I should follow to tune the HFI algorithm, and it's quite clear I must first of all tune the B-EMF State Observer parameters. My first question comes here:

1) Does the HFI algorithm really need it, or is it just for changing to the STO estimator (assuming most applications do need high speed ranges) after the speed threshold? If that were the case, I wouldn't need it.

When I try to tune the STO, I always get a ''start-up failure''. I guess that means the STO does not get a proper speed feedback because of wrong parameters, which I'm not finding exactly easy to tune (especially at such low speeds!). The WB does not give G1, G2, F1, F2, etc automatically when generating files. It even leaves F1 and F2 as 0 (which causes an error when compiling).

2) Is this normal? I only read how to tune K1 and K2, but I don't know how they are related to F1, F2, G1, G2, etc...

3) I left that step for later today, and tried the next steps using the DAC and an oscilloscope. The Ia and the HFI Debug current signals are not as they should be (HFI Debug current is quite flat), and changing HFI amplitude would not help here. Is this because of my first question?

However, if I plot the Electrical Angle estimated by HFI, I do see some encouraging results (which I guess would be much better if the algorithm was correctly tuned).

Unfortunately I don't have the evaluation boards, so the motor profiler and the on-the-fly tuning features are almost impossible in my case. Any additional tuning tips will be very useful.

Thank you very much in advance!

#ipmsm-hfi-tuning-sto
4 REPLIES 4
jlondero
Associate II
Posted on May 26, 2016 at 18:31

Well, I've already found the answer to question 2. There seems to be a little bug on the WB, which doesn't let me change the B-EMF constant if I choose IPMSM. This constant default value was responsible for the F1, F2 = 0, and as I didn't have that option in my IPMSM project, I had to temporarily set S-PMSM for setting that constant.

Now, the STO works somehow better and I've tuned the parameters so as to have a nice B-EMF signal through the DAC. I'm now getting a Speed Feedback error after Startup (as soon as it reaches RUN state) and I'm trying to figure out why.

I'd be very grateful if someone could give me a few tips to tune the algorithm. Thanks in advance.

Gigi
ST Employee
Posted on May 26, 2016 at 18:46

Ciao JPL

Regarding he first question, you are right. The tuning of the state observer is required only to switch to this sensor at higher speed (the HFI works from 0 to a maximum speed that is in the middle of the electrical frequency and injected frequency)

I think you have resolved your second point

Regarding the last question, if the motor response to the injection isn't the one expected by the FW, I don't think that the procedure can finish good, no matter how you tune it.

Ciao

Gigi

jlondero
Associate II
Posted on May 28, 2016 at 06:58

Ciao Gigi!

Thank you very much for your answer. Regarding my third question, I had a mistake when measuring the signals. I hadn't interpreted that they had to be measured right before the algorithm finds the angle...

The waveforms have their periods as described, but they're not exactly the same as in the example images shown in the instructions. Could you please have a look at my picture and tell me if it's suitable for HFI? I assumed it is, and I could tune the parameters and the magnitudes seem to be ok.

Anyway, I still have some issues:

While it is in Debug mode the algorithm finds the angle quite fast, informs rotor position very precisely (low noise), even speed seems to be shown fine in the WB's Monitor (when I move the rotor with my hand, of course). Sometimes it takes two or three attempts (after each one of which it sends a Speed Feedback error), but after I acknowledge the fault, tries again and finds the position successfully; I might have to tune it a little more so as to have always the right angle at the first attempt. The initial angle is successfully found after 50 ms or so; I assume those are good parameters for the HFI PI.

However, as soon as I untick ''Debug mode'' and program it, it only keeps returning a ''Speed Feedback'' error immediately after I run the motor. It's like the speed feedback finds that the rotor is not going in the commanded direction, or something like that, I guess. Could you please guide me a little there? I couldn't find much detail about why exactly that fault could happen. And if I try to run in STO+PLL I get more or less the same results: Startup inits, the motor turns slowly a couple of degrees and then fails with a ''Speed Feedback'' fault. Anyway, I guess this is to be expected due to the low speed (even though I have a very high Ke).

At first I thought it could be a problem with a swapped phase and just in case I tried changing the order of the ADC pins and swapping phase connectors, but the results are the same. I also changed the speed tolerance values (no success) and then I started changing the current loop gains through the Monitor, but I'm not sure the problem is there...

I think I'm almost there... Thank you very much again!!

EDIT: My custom board is one designed specifically some years ago for an application using a STM32F103 (with encoder). One relatively big (and meaningful, I think) difference I found compared to the EVAL boards is that the current sensing circuit has an inverting configuration and you always use (in fact only allow in the WB) a non-inverting configuration. The hardware engineers are already working on that modification in the board, just in case that's the problem. If you feel that would not affect the behaviour (it definitely worked in the sensored application) I'd be very grateful if you could give me some hints to get nearer to a solution. Thanks!

EDIT2: Well, that was the problem (the board config). HFI is now working.

________________

Attachments :

HFI_debug_current.JPG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzJE&d=%2Fa%2F0X0000000bJc%2FQsSJ9WSqzp7syoV8UCpgBsEKynM5edjGkx8mxmOZx80&asPdf=false
Laurent Ca...
Lead II

The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK). 

Best regards