take a look at mpaulhomes inverter.
https://github.com/MPaulHolmes/AC-Controller
https://github.com/MPaulHolmes/AC-Controller
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.take a look at mpaulhomes inverter.
https://github.com/MPaulHolmes/AC-Controller
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]
}
Hi, I will leave the float stuff out of the question...Thanks it's helpful, but actually I'm trying to use float variables ]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.
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.
fyi, that doesn't sound like nearly enough pulses to even bother with an encoder. Or is that a separate index pulse? You might want to spell out your project in a bit more detail (i.e. source code repository, equipment and part numbers, schematics, etc) if you need help with it, otherwise it is a big, unfun, guessing game for anyone trying to help.1 pulse per 1 revolution.
Ok, you need to do some work before starting with FOC
- 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.
- I have calculated Rr and Lr values by locked shaft and no-load motor test so I don't need to estimate it.
Quote from: http://web.eecs.utk.edu/~tolbert/publications/ipemc2006_im.pdf.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.
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....
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.
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.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.
Basic hysteresis effect.dcb said:who knows if it is right or not: http://www.vias.org/matsch_capmag/ma..._chap5_02.html
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-functionok, 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).
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 ....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)