DIY Electric Car Forums banner

Induction motor - calculating rotor flux angle.

8K views 21 replies 8 participants last post by  amandio.miguel 
#1 ·
Hello.
I'm trying to write my own soft for Field Oriented Control of induction motor. I have finished 3ph 3kW inverter, controled by STM32F4, and V/F open loop algorithm to control ACIM - it works. Now I'm trying to implement FOC algorithm.
As we know we need to do Clark&Park transformation.
To calculate Park transformation it's necessary to know rotor angle flux position. Here some details:
ftp://ftp.ti.com/pub/dml/DMLrequest.../HVACI_Sensored/~Docs/Sensored FOC of ACI.pdf
http://ww1.microchip.com/downloads/en/AppNotes/ACIM Vector Control 00908a.pdf
Another note propose to use speed integration to do this:
http://tinyurl.com/y9lrb4cr
Could anyone expalin how to do this exactly?
I'm measuring currents (5kHz sampling), calculate Clark and measure speed, slip also.
Thanks for any response.
 
#4 · (Edited)
Thanks it's helpful, but actually I'm trying to use float variables (all more clearly to read). I suppose there is no floats due to no FPU in CPU used in this project.
Here is part of my code:

Code:
void ClarkPark(float L1_curr, float L2_curr)
{
    vector.Ialpha = L1_curr;
    vector.Ibeta = (L1_curr + 2.0*L2_curr) / 1.732;
    //Id =  Ialpha*cos(Angle) + Ibeta*sin(Angle)
    vector.Id = vector.Ialpha*cos(vector.AngleFluxDeg) + vector.Ibeta*sin(vector.AngleFluxDeg);
    // Iq = -Ialpha*sin(Angle) + Ibeta*cos(Angle)
    vector.Iq = (-1.0)*vector.Ialpha*sin(vector.AngleFluxDeg) + vector.Ibeta*cos(vector.AngleFluxDeg);
}


//qdImag = qdImag + qKcur * (qId - qdImag)      ;; magnetizing current
void curModel(void)
{
    //qdImag = qdImag + qKcur * (qId - qdImag)      ;; magnetizing current
    vector.Imag = vector.Imag + (LOOP_PERIOD / ROTOR_TIME_CONST) * (vector.Id - vector.Imag);
    if(vector.Imag == 0) {
        return;
    }
    // VelSlipRPS = (1/fRotorTmConst) * Iq/Imag / (2.0*pi)
    vector.VelSlipsRPS  = (1 / ROTOR_TIME_CONST ) * (vector.Iq / vector.Imag) / (2.0*PI);
    //VelFluxRPS = iPoles * VelMechRPS + VelSlipRPS
    vector.VelFluxRPS = 2.0 * speed.perSec + vector.VelSlipsRPS;
    //AngFlux = AngFlux + fLoopPeriod * 2.0 * pi * VelFluxRPS
    [B]vector.AngleFluxRad = vector.AngleFluxRad + LOOP_PERIOD * 2 * PI * vector.VelFluxRPS;[/B]
[B]    vector.AngleFluxDeg = vector.AngleFluxRad * (180.0 / PI);[/B]
}
Please tell me If I'm wrong:
I have to keep an eye on vector.AngleFluxDeg variable to be value between 0 - 360 degree? (back to 0 if 360 overflowed).
It will be correct?

Thanks for any reply.
 
#3 · (Edited)
I was reading through some of the docs did not see much on slip.
Slip has a tremendous effect on torque.

Here is more reading on AC 3 phase motors for electric vehicles.
Here is the numbers after the locked rotor test. The motor optimized at 7.00 on slip.

slip -- torque -- amps
7.00 - 142 - 260
6.00 - 160 - 270
5.00 - 180 - 280
4.00 - 220 - 270
3.50 - 225 - 254

Looks like 3.50 is the best on slip gain. Had to turn brake pressure up all the way to hold it.

http://ivanbennett.com/forum/index.php?topic=17.msg1482#msg1482

-
 
#6 ·
yah induction motors is a bit trickier, pm motors the rotor flux angle is basically the rotor angle, and why they use a position resolver vs a speed encoder.

If you look at mpaulholmes example (proven, as in it is in use) he has a switch statement by motor type, and induction is the biggest case. Seriously, take a look at it, a real nice piece of work, lookup tables for everything, auto parameter identification, uart interface, still fairly easy to follow and well packaged, nice work. He's been at it a while. http://ecomodder.com/forum/showthre...eap-3-phase-inverter-ac-controller-10839.html and IIRC is at least loosely based on http://ww1.microchip.com/downloads/en/AppNotes/00908B.pdf

re:floats, just scale it up or down as you need, this is the performance approach even with a fpu.

So for me the problem conceptually with integrating speed to rotor flux angle is where do you start, and how do you account for drift. I mean you can inject dc at 0 rpm to establish rotor flux angle, and the Rr/Lr time constants (inverse of slip gain) can be estimated, but I need to look more closely at how that is implemented.
 
#8 ·
So for me the problem conceptually with integrating speed to rotor flux angle is where do you start, and how do you account for drift. I mean you can inject dc at 0 rpm to establish rotor flux angle, and the Rr/Lr time constants (inverse of slip gain) can be estimated, but I need to look more closely at how that is implemented.
  1. I'm starting use CurModel() Clarkpark() functions when speed is more than 100 RPM. I measure speed by optic sensor - 1 pulse per 1 revolution.
  2. I have calculated Rr and Lr values by locked shaft and no-load motor test so I don't need to estimate it.
 
#11 ·
Yah, 1 pulse per rev is not enough.
For determining the rotor flux angle, the rotor time constant must be known.
It not only is part of the the equation for the rotor angle speed, but it also affects the Id transfer function of the motor (source video in gunnahrs post).

Here are my conclusions with regard to FOC, EV and ACIM with speed sensor.

1. PWM ripple in the phase current signals can destabilize PI control, so FOC needs a high PWM frequency and filters. Source (for instance): wikipedia.
A low PWM frequency means heavy filtering, hitting the dynamic performance of FOC, and rendering it useless.

2. A bit of temperature drift and the initial fault in the rotor flux angle are additional error signals that are compensated by the PI controller.
Source: basic control systems theory, working FOC implementations and mathematical models.

3. The rotor time constant has to be adjusted. This is very important. The name suggests a constant value under all circumstances, but in fact
the rotor constant not only varies with temperature but it also
satifies a a polynomial equation
whose coefficients are functions of the stator currents, the
stator voltages, and their derivatives. A zero of this polynomial
is the value of the rotor constant.
Quote from: http://web.eecs.utk.edu/~tolbert/publications/ipemc2006_im.pdf.
So what does this mean?. Under steady state conditions the PI controller keeps the rotor constant close to zero. Source: video in gunnarhs post.
But this is not the case under dynamic conditions, for instance when a sudden load change occurs. This makes FOC in an ACIM tricky.

4. The encoder must generate a lot of pulses per revolution for smooth control at low RPM.

So I guess I'm sticking to my earlier conclusion: who really needs the dynamic performance of FOC in an everyday EV with a ACIM?

The conclusions change for an EV with an IPM. Tesla model III?
 
#12 ·
...
3. The rotor time constant has to be adjusted. This is very important. The name suggests a constant value under all circumstances, but in fact
the rotor constant not only varies with temperature but it also ...

So what does this mean?.
Under steady state conditions the PI controller keeps the rotor constant close to zero.
i think "zero" here is a maths term meaning it is a root or solution to the polynomial equation, not that the value is zero.

The time constant is a function of frequency since inductive reactance varies with frequency.
 
#13 · (Edited)
You're absolutely right. I forgot to add "in the equivalent circuit". I was about to edit my post when I saw your post. Thanks.
The inductance in the rotor part of the equivalent circuit (Video in gunnarhs post) is kept zero by the PI controller under steady state.
So it is the time constant of the rotor part of the equivalent circuit that is zero under steady state.

Edit: I'd like to add, from what I have seen so far in working FOC implementations, "tricky" means:
adaptive control, dynamic adjustment of Kp and Ki of the PI controller.
 
#14 · (Edited)
fwiw, I am always missing some basic understanding in these sorts of discussions (probably because the papers all dive in on the deep end). so here is something that challenged one of my assumptions, and who knows if it is right or not: http://www.vias.org/matsch_capmag/matsch_caps_magnetics_chap5_02.html



it is implying (not looking at mutual inductance here, just a single iron core inductor) that the current waveform for sinusoidal flux isn't sinusoidal, but that the voltage is. Is this right?!? I think I need to do some more basics/experiments. And of course what happens in reverse (conductor moving in a field) matters for induction motors.
 
#15 · (Edited)
fwiw, I am always missing some basic understanding in these sorts of discussions (probably because the papers all dive in on the deep end). so here is something that challenged one of my assumptions, and who knows if it is right or not: http://www.vias.org/matsch_capmag/matsch_caps_magnetics_chap5_02.html

it is implying (not looking at mutual inductance here, just a single iron core inductor) that the current waveform for sinusoidal flux isn't sinusoidal, but that the voltage is. Is this right?!? I think I need to do some more basics/experiments. And of course what happens in reverse (conductor moving in a field) matters for induction motors.
Hi you are addressing here an issue which I had a discussion with one member in another thread one ore two years ago about the T(rafo)-model of an induction machine. The basic assumption is that an induction machine behaves like a trafo which is mostly true in ideal state (steady state, nominal voltage, nominal frequence, nominal load). However even in a Trafo where the inductor and reactor are symmetrical, there are inertial effects in material which become a problem when frequency is increased much about nominal. In an induction motor with a squirrel cage this effects will be more evident as the inductor and reactor are totally different (thin copper wire windings in stator, thick metal bars in rotor). So the ideal linear sinus-model and the sinus based transformations become a bit distorted.
The question here which you are implying is how does it affect the FOC?
The basic underlying theory will hold as the distorted induced rotor current will follow the stator current by 90% and we will be able to correct the the flux angle. However if we only use the current-model and not speed-position-feedback we will have a poorer control under very low or very high frequencies / Voltages than we have in nominal state. This is due to the fact that estimated currents are not exactly sinusodial as in the calculation (Note: Park-transformation assumes sinus currents)
The feedback and knowledge of the real rotor speed/position will help us to correct that.
An exact motor model and temperature measurement will improve that further.

In fact we will not realize this distortion effects (except a slightly worse efficiency) until we try to do something like a fast direct torque control where we either switch directly the inverter transistors according to known states or set a voltage/slip combo which is far away from the ideal curve. The most obvious effect is a bad sounding motor.
 
#16 · (Edited)
ok, so aside from the fact that I need a coloring book to get that, what is the effect if you force sinusoidal current in the stator (via hysterisis band or peak pwm termination or whatev) and vary stator current frequency and amplitude? My gross assumption was that sinusoidal current was always preferrable, and that the bulk of VSI complications are in achieving that (without adding additional reactors to make it a CSI).
 
#18 ·
Yes sinusodial excitation and induction is preferable as it induces a smooth circular movement. Under normal conditions (nominal frequency / voltage) the (variable) waveform stator side induces a similar waveform rotor side. There are 3 main components which influence the transfer-function
1)The airgap + the induced magnetic field ensure the 90 degree shift between stator and rotor. this will not change unless the motor shape /winding changes drastically

2) The rotor electrical resistance/inductance (R/L) influences the heat and the harmonics of the system. As the frequency gets higher , the harmonics component (2*pi*f*L) becomes more resistive so the rotor current changes from being the harmonic sinus swinging 90 degrees related with the stator sinus to a more linear current ( first trapez shaped then more triangle ). That means increasing the stator voltage will have less and less effect and increasing the frequency will reduce the torque producing current part.

3) The motor load has an extra effect on the system, mechanical inertia ( a big rotor has a lot of inertia without a load) and back emf (acts as generator when slowed down or reversed).
 
#17 ·
About motor models.
Ever seen the flux distribution in a motor as simulated by for instance FEM?
There are moving images online of an ACIM.
Nowhere close to homogenous as assumed by the commonly used models.
I have done some FEM simulations for a pancake PM motor.
Exact model? Forget it.

dcb said:
Basic hysteresis effect.
The hysteresis effect is there, but thank goodness it isn't as strong as suggested by the image in dcbs post.
Especially in a magnetic circuit with an airgap (as for instance an ACIM) the effect is substantially reduced with regard to the effect on the V/I (inductance) relationship.
 
#19 ·
dcb said:
My gross assumption was that sinusoidal current was always preferrable, and that the bulk of VSI complications are in achieving that (without adding additional reactors to make it a CSI)
You're right: an ACIM is made for low frequency sinus. Long list of unwanted effects from VSI: eddy currents, core losses, EMI, wear on materials and the list goes on ....

But an FOC calculation is the topic of this thread, so I'll leave it at that.
 
#21 ·
fyi: dave wilson recommends having a minimum of 3 to 5 degrees of rotor angular resolution for field oriented control.

https://youtu.be/VI7pdKrchM0?t=2139
Nice, thanks for the hint. A lot of things he does mention which I have had to learn the hard way... It is obviously worth to step through all sessions even if it is not related exactly to the motortype one is working on.
 
#22 ·
Hello.
I'm trying to write my own soft for Field Oriented Control of induction motor. I have finished 3ph 3kW inverter, controled by STM32F4, and V/F open loop algorithm to control ACIM - it works. Now I'm trying to implement FOC algorithm.
As we know we need to do Clark&Park transformation.
To calculate Park transformation it's necessary to know rotor angle flux position. Here some details:
ftp://ftp.ti.com/pub/dml/DMLrequest.../HVACI_Sensored/~Docs/Sensored FOC of ACI.pdf
http://ww1.microchip.com/downloads/en/AppNotes/ACIM Vector Control 00908a.pdf
Another note propose to use speed integration to do this:
http://tinyurl.com/y9lrb4cr
Could anyone expalin how to do this exactly?
I'm measuring currents (5kHz sampling), calculate Clark and measure speed, slip also.
Thanks for any response.
Hi
i'm implementing a simulation in c++ with IFOC, Loss Minimization Algorithm and Rotor Time Constant estimator.

I don't have possibilities to pass to hardware and solve some questions so colaboration is wellcome.

if interested, code: https://github.com/AmandioCordeiro/IMEC

Thanks
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top