Single Shunt PMSM on Miniboard

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Single Shunt PMSM on Miniboard

1,079 Views
manishsangram
Contributor IV

pachamatejS12 / MagniV Microcontrollers 

Hi

We are trying to use the FOC PMSM code AN5327SW on the Miniboard. The miniboard has all the required hardware to work with this except for 4Mhz XTAL, which we are using internal clock.

We have set up the MCAT and parameters and the appconfig.h is attached below.

As per the PDF we are trying to at least start the motor in    Scalar control.

After a lot many days of work we are able to spin the motor in SCALAR mode. 

The motor stalls when entering any of the sensorless modes. In case of speed FOC we can here the motor vibrating but it has otherwise stalled

In the scalar mode the motor runs very hot and at limited RPM.

Further We are trying to tune using the AN4912 and the first step to getting Sinusoidal wave but the waves look randam and no amount of changing the V/HZ Ration Req is changing this. Please see attached image from Freemaster. 

Also refer to Openloop position and estimated position recorder. they look to be in sync.

Further please see the current oscilloscope from Freemaster. Is this sinusoidal or do we need to tune this? What exact parameter do we need to change?

Urgent help required as we have spent over a week getting this far!

Tags (1)
0 Kudos
2 Replies

725 Views
pachamatej
NXP Employee
NXP Employee

Hi,

I'd like to emphasize how important is to understand the field oriented control and motor construction and behavior. We provide open solution to be adjustable to most of the motors and to enable you to tune it to it's maximum efficiency. However, the price is that more time is needed to get understood the FOC (although it is a standard FOC with cascade structure, known and used for many years).

Please also take sufficient time to learn how to use the FreeMASTER. In your post, you are showing a "random" phase currents waveforms using a "scope" feature, however the "scope" is not capable of capturing such fast waveforms. Use "recorder" feature instead. The FreeMASTER tool has lot's of cool features connected with the recorder, such as triggering, capturing, etc.. You will need it during the tuning.

Unfortunately, my time and also the space here is limited so please let me just note, what I usually do when I tune the sensorless FOC:

  1. I should set the motor parameters. How to get them? There is an appNote describing the process - https://www.nxp.com/doc/AN4680.
  2. Using the scalar control, I make sure the motor can spin and that the currents in recorder are "good". Yes, the scalar control is not designed for PMSMs, therefore I may need to help the motor to spin at start, usually due to the cogging torque. Definitely, I'm not going to higher speed than 10% of nominal speed. I also start with the minimal voltage/rpm ratio, going slowly up. PMSM motors are very likely to run at high currents, which is caused by the magnet being stuck with the stator field. If you load the motor even by your hand, the current should go down (you are changing the load angle towards it's optimal point). Whether the motor is spinning or not, I should be able to see three sinusoidal currents. The shape of the currents may be deformed (depending on the shape of the back EMF and saturation of the core).
  3. The alignment settings are important to let the system know the "ground zero" point. The alignment voltage and duration should be set to let the motor confidently align with the D-axis. If the alignment is not good, the following steps cannot provide reliable otuput.
  4. The next step is to tune up the current controllers. The embedded code contains a switch, keeping the motor steady when Iq_req is set to zero. This allows you to use Id_req to get the step response using Id recorder and to tune the current controller bandwidth and damping factor. It can be found in https://www.nxp.com/docs/en/application-note/AN4912.pdf 
  5. The sensorless part follows - basically I can start with the backEMF observer set with the same settings as the current controller. The Tracking observer is usually 10x slower, thus I can go with the frequency of 0.1times smaller than the backEMF observer. Later on, I can adjust it to get better results if needed.
  6. It is important to set the open-loop to sensorless transition as well. First of all, I set the merging speeds and ramps. There is no clear guidance to that, however if the motor is "big", I usually use ramps of 100 RPM/s, while for the "small" motors I can start with 500 RPM/s and higher. The merging speeds should allow the backEMF observer and the tracking observer to settle between the merge1 and merge2. So, if the startup ramp is slow, the "distance" between the merge1 and merge2 can be even 100 RPM (but let's start with 200 or 300). If the startup ramp is fast, then I suggest to start with some 500 RPM difference between the merge1 and merge2. The merge2 speed is usually at least 10% of the nominal speed, allowing sufficient backEMF to be estimated. For 4000 RPM motor, I suggest to start with merge1 = 200 and merge2 = 400. The merge 2 is obviously the minimal operation point for the sensorless algorithm.
  7. Then I can use the speed loop mode to tune up the transition from open-loop to sensorless. I change the "Mode" variable from Automatic to Manual and I set some low speed (e.g. the merge1) as the demanded speed. The motor should start to spin in the open loop mode. If it doesn't, I change the startup current or the speed ramp. Once I get the motor up and running, I can do another step.
  8. The same setting as (7), but this time I'm looking at the eBMF_tune scope in the Extended BEMF group. The demanded speed may be set anywhere between merge1 and merge2 and after the motor reaches the demanded speed, I change the "Position mode" from "force" to "tracking" manually (which enables the backEMF observer). The key is to let the backEMF observer to be started. The uQReq and eBEMF_Q_Estimated signals should go in the opposite direction (polarity). The iQ Fbck and iQ Estimated should be more or less stable (not oscillating with a visible sinusoidal response), however some noise in the signals is acceptable.
  9. Before doing a step forward, I usually need to set up the speed controller. Again, if the motor is "big", I usually go as slow as 1 Hz for the bandwidth (or even slower), for "small" motors it is ok to start with approx 0.1x of the current loop (so if the current loop is 300 Hz, the speed loop can be 30 Hz). The speed ramp is similar to the open-loop settings, but later on can be changed. Very important is to set the current limit for the speed controller to be the same as the start-up limit - this prevents a step change to be done on transition from the tracking mode to sensorless. Then, using the speed loop control, I set some speed slightly above the merge2 speed and trying to tune up the speed controller as well as adjusting the sensorless options if needed. This takes the most of the tuning time, since the system becomes very complicated and even small things start to affect other small things.
  10. Finally, if I'm successful with getting the motor up and running in the sensorless mode, I can start benchmarking and fine tuning within the whole speed range.

Please also take into consideration:

- if the motor parameters are not correct, the algorithm settings may not follow the real scales and timings - please see the MCAT documentation, mainly the https://www.nxp.com/docs/en/application-note/AN4642.pdf .

- the FOC algorithm provided is based on linear model of the PMSM in the D-Q frame. If the motor is non-symmetrical, appropriate actions have to be taken to cover for these non-linearities (indicated by noise, low performance, low efficiency, etc.)

Best regards,

Matej

725 Views
manishsangram
Contributor IV

Matej

As usual you've given a great response. Thank you.

We are following AN4912. Between your points 3 & 4, as per AN4912, Voltage FOC should work with Uq_req set to some value > 0. But for us it is not working.

Process described in App Note 4680 is too complicated for us.

We already know that the Kv for our motor and we have calculated Ke in V.Sec/rad using the following steps (take a hypothetical motor of 500 Kv)

1) RPM to RPS (500/60 = 8.33)

2) Deg to Rad (8.33 * 360 = 3000, = 314.159265 rad/sec)

3) Ke = 0.00318309886547512771905676568221 ( 1/rad/sec)

Resistance we have measured with accurate multimeter and is 240E (480E/2)

We have directly measured the stator inductance between all three phases using an inductor meter and the average is 155uH. for this measurement we even removed the rotor so there was no influence of magnets. Note that when we enter this value into MCAT, we get an error saying Natural Frequency F0 cannot be less than 127. 

Further it is a tiny motor with rotor mass of only 20 gms. Correspondingly moment of inertial is calculated based on radius etc. as 1.4E-05

Is there anything wrong we are doing?

After much effort and tuning, we are able to run our motor with Speed FOC across the full range of RPM. 

We need you help in understanding the following settings logically because there is no simple explanation we could find....

1) How to calculate Kt from Ke above?

2) The meaning of Loop parameter "Bandwidth"? F0... Our motor runs when F0 for Current Loop is 128 but stalls if we change it to 256. If it's just PI update rate, it should not stall the motor due to higher update right? Also We already have the Sample time which we assume only samples but does not correct... is that right?

3) In control loop, what is the meaning of the attenuation parameter? Does it only attenuate the delta for the PI to see? If so how is this to be used generally?

4)What is the actual meaning of the 2 merging speed parameters? What is the difference between the two exactly (like lower and higher)?

5) We are finding that the motor stalls quickly as we apply load. There is no indication on MCAT about why the motor stopped. None of the error or flags or faults are set. So where do we look for the answer.

For us motor spins reliably under Spped FOC but does not spin at all under Voltage FOC and Current FOC. Is the motor supposed to spin with Current and Voltage FOC or are they only for tuning? 

Finally, we see that that the iABC are not smooth sinusoidal even though the motor is running very smoothly. What could be the reason for this?

Windows 10 x64-2018-08-27-02-54-11.png

Please also see the eBEMF tuning below. Is this good or is this considered oscillating?  My main concern is to rotate the motor as smoothly as possible to make sure it is as silent as possible. So it is not important that the motor is spinning, It is important that there should be minimum vibration. In the screen shot below I switched from 3000 RPM to 4800 RPM and we can see increase in delta of iQFbck vs iQ_Estimated.  However visually, this sinusoidal movement is relative to the scale of iAxis, so need to know what would be a good range? At 4800 we can feel a lot of vibration in the motor.

range.png

You mention

"Very important is to set the current limit for the speed controller to be the same as the start-up limit "

Which settings are you referring to exactly?

0 Kudos