You are on page 1of 60

Application to Concrete

Projects
Control in Smart Grids and Distributed Generation
University Master (UPV/EHU-ESTIA)

2020/21 academic year

Patxi Alkorta Egiguren


Summary
0. Introduction to rotating electrical machines
1. Modelling and speed control of Induction Machine (IM)
2. Modelling and speed control of Permanent Magnet
Synchronous Machine (PMSM)
3. C programming language for S-Functions of
MatLab/Simulink. Discretization of continuous time
regulators
4. Simulations and real experimets for wind energy
generators based on IM and PMSM machines
5. Generalized Predictive Control applied at IM speed
control

2
Application to Concrete Projects - P. Alkorta
0. Introduction to rotating electrical machines

• The rotating electrical machine converts the Electrical


Energy (EE) to rotating Mechanical Energy (MEr), or
vice versa
– Electrical Motor: electrical machine that converts EE to MEr
– Electical Generator: electrical machine that converts MEr to EE

Electrical Generator
Electrical Motor
Stator
(static part)

Rotor
(rotating part)
3
Application to Concrete Projects - P. Alkorta
0. Introduction to rotating electrical machines

• Brief clasification of electrical machines:


– Alternating Current (AC)
• Three phase:
– Asynchronous: Squirrel Cage Induction Machine (SCIM or IM), Double
Fed Induction Machine (DFIM)
– Synchronous: Permanent Magnet Synchronous Machine (PMSM),
Double Fed Synchronous Machine (DFSM), Switched Reluctance
Machine (SRM), etc
• Single phase: asynchronous machine
– Direct Current (DC)
• Separately excited machine: permantent magnet, double fed
• Self-excited machine:
– Shunt machine, serial machine, compound machine

4
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Asynchronous Machine (Nikola Tesla, 1888).


Phisycal structure:
– stator: three phase (III) winding
– rotor: 1. squirrel cage (brushless)
2. three phase winding + access brushes

1. Squirrel Cage Induction Mot./Mach., SCIM. Generator, SCIG


2. Double Fed Induction Mot./Mach., DFIM. Generator, DFIG

Asynchronous Machine: as a motor or as a generator


5
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Physical structure
1. Three ph. asynchronous machine
squirrel cage (brushless)
2. Three ph. asynchronous machine
wound rotor
squirrel cage rotor (aluminium’s bars)

stator slip rings

wound rotor (cc,..)


slip rings

three phase winding

6
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Squirrel cage three phase asynchronous motor

Anillos
rozantes

7
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• ideal model of squ. cage asynchronous motor


– stator: balanced three phase winding + ideally distrib. by magn. crown
– rotor: equivalent to a III winding with same poles as stator
– NO magnetic hysteresis
– INFINITE permeability (iron parts and rotor)
– NO current density shift effects
– NO harmonic effects of slot and pole

8
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Operating principle
– stator generates Ψs rotatory flux, at synchronous speed (ωe)
– rotor generates Ψr rotatory flux to track the stator’s flux, at same speed
(ωe)
“Variable Ψs ,generates E.M.F. in rotor
which generates currents (ir), these
generate variable Ψr ,that rotates in
same sense that Ψs , and as a conse_
quence, rotating the rotor at asynchro_
nous speed (ωr)”
cause-effect principle:
“the effect is opposed to the cause”
ωe> ωr for every t (balance) ωe> ωr
if ωr == ωe cause disappears 
9
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Operating principle (detailed I)


– Generation of the Ψ electromagnetic flux when for an electrical
conductor an i electrical current drives along (corkscrew’s rule):
• corkscrew’s advancement sense (i )
• corkscrew’s rotation sense (Ψ )

10
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Operating principle (detailed II)


– Generation of the Ψs estator’s electromagnetic flux in a three phase
winding when for that is circulating the is three phase electrical current
(corkscrew’s rule):
• corkscrew’s advancement sense (i )
• corkscrew’s rotation sense (Ψ )
• flux of each conductor is adding with neighbooring fluxesΨs (total)
• III net with sinusoudal feeding voltage  Ψs rotates at grid frequency ωe

stator

11
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Operating principle (detailed III)


– Generation of e.m.f. (electromotive force) in a three phase winding rotor
(SC) when it is crossed by a moving flux, Ψs (Right hand’s rule):
• sense of the conductor’s relative movement respect to the flux, thumb
finger
• sense of the stator flux (Ψs ), index finger
• sense of the e.m.f. generated in winding, produces i , medium finger
Ψ
movement

12
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Operating principle (detailed IV)


– Generation of the linear movement in three phase winding rotor (SC)
located into a Ψs magnetic field, when it is crossed by an i electrical
current (left hand’s rule):
• sense of the conductor-flux couple’s relative movement, thumb finger
• sense of the stator flux (Ψs ), index finger
• sense of the e.m.f. generated in winding, produces i , medium finger
(i current’s sense ) Ψ
movement

13
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Operating principle (detailed V)


– Generation of the linear movement in three phase winding rotor (SC)
located into a Ψs magnetic field, when it is crossed by an i electrical
current (left hand’s rule):
• sense of the conductor’s movement,thumb
• sense of the stator flux (Ψs ), índex
• sense of the current i, medium

rotor

stator

14
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Cassic electrical model (Electrical engineering)


– Exact equivalent circuit referred to the stator (per fase)

XL
Rs=R1s=Re: stator resistance X  2 f L L
L
2 f1
Rr=R2r=m2Rr: rotor resistance referred to the stator
Xsl=X1s=Xe: stator leakage (dispersion, loss) reactance Lsl , Ls=Lsl+Lm
Xrl=X2r=m2Xr: rotor leakage (dispersión, loss) reactance referred to the stator Lrl , Lr=Lrl+Lm
Xm: magnetizing reactanceLm
Rfriction+iron=Rp: resistance of friction and iron loss n1  n2 60 f1
s n1 
NOTE
n1 P
italics: motor data given by the manufacturer (referred to the stator)
bold: motor data neccessary to implement vector control

15
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Mechanical model
– Electromagnetic torque equation (Te)
  KT’: torque constant of the motor
Te  K T ' r  is 
 r : rotor flux space vector

is : stator current space vector

– Mechanical equation
J : moment of inertia of the motor (rotor, shaft)
d m
J  Bv m  TL  Te Bv : viscous friction coefficient of the motor (shaft)
dt
TL : load torque or perturbation torque
ωm : mechanical rotating speed (rotor)
r ωr : electrical rotating speed (rotor)
m  P : number of pair of poles of the motor
P
p : number of poles of the motor

16
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Induction motor model expressed in d-q rotating


or synchronous reference frame


 dψ s         
   d   d rg  
vsg  RvssisgRs is sg  j e sg
ψψsgs  LLmmirgir  LLssiisgs v rg  0  Rr irg  vr  Rr ir j(deψr  r ) rg ψ rgr  LLmmissg LLrriirrg
dt dt dt dt

1  Lm  1  Lm  1  Lm 
2
disd 1
  Rs  Rr 2 isd   eisq   Rr 2  rd      v sd
Ls  Lr  Ls  Lr  Ls  Rr  Ls state equations (matrix form)
r rq
dt
.......
disq 1  Lm 2  1  Lm  1  Lm  1 x  Ax  Bus
 eisd  R
 s  R i 
2  sq   r rd   Rr 2  rq  vsq
dt  Ls r
Lr   Ls  Ls  y  Cx
  Rr   Lr  Ls

d rd Rr R
 Lmisd  r  rd   e   r  rq states vector / states variables
dt Lr Lr

x  isd isq  rd  rq T

d rq Rr R
 Lmisq  r  rq   e   r  rd
dt Lr Lr input vector / input variables

Te 
3 p Lm 


 rg  isg  
3 p Lm
 rd isq  rqisd  
us  v sd v sq 
T

4 Lr 4 Lr
output vector / output variables
d m L
2
J  Bv m  TL  Te   1 m
dt Ls·Lr y  isd isq  rd  rq 
T

σ: leakage coefficient (coeficiente de dispersión) 17


Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
• Induction motor model expressed in d-q rotating or
synchronous reference frame
3 p Lm  
Te 
4 Lr
 
 rg  isg 
3 p Lm
4 Lr
 rd isq  rqisd 
d m d r P  Bv 
J  Bv m  TL  Te     r  Te  TL 
dt ....... dt J P 

  Rs Rr Lm 
2
Lm Rr  r Lm   1  1 0 0 0

   
2 
  0 
L 0
  Ls Ls Lr  Ls L2r Ls Lr  1 0 0
e

 s  C 
  Rs Rr Lm 
2
 r Lm Lm Rr  1 
  e      B 0 0 0 1 0
2  2   Ls 
A  
 sL  L L
s r   L L  L L
s r 
 
s r  0 0  0 0 0 1
 Lm Rr Rr   
 0  ( e   r )   0 0 
 Lr Lr 
 Lm Rr Rr 
0  ( e   r ) 
 Lr Lr 

18
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

Control of separately excited DC motor


• Te electromagnetic torque of DC motor depends of 2 independent
variables, with which it can be controlled in independent way:
ia : armature current (controlled by va armature voltage source)
ψf : inductor flux (controlled by vf inductor voltage source)

armature

inductor / field

Te  K T ' f ia  f  K i f ia  f K ( v a ) if i f  cte  f  cte Te  K T ia


d m
i f  f K (v f ) v f  cte J  Bv m  TL  Te
dt
19
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

d-q synchronous reference frame linked to the ψr


• vector control uses d-q rotating reference frame
• interesting to find 2 variables to make a similar control like separately
excited DC motor
• it is neccessary to use a d-q rotating reference frame linked to some
flux: ψr , ψs , ψm
• the most employed is the d-q reference frame linked to the ψr

20
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

d-q synchronous reference frame linked to the ψr


• In practice of vector control, it is based on that the quadrature component of rotor
flux is null. This is achieved placing ψr vector on the real axis (d)
  dψ rq
ψ rg  ψ rd  ψ rq j ψ rq  0 ψ rg  ψ rd 0
dt
• Then ψr rotor flux is formed only by its direct component. When it is thus, it is
said that d and q components of is stator current are decoupled and the III
induction motor works as a separately DC motor

DC motor Te  K T ' f ia if  f  cte, Te  K T ia

Induc. Mot. Te 
3 p Lm
4 Lr
 rd isq  rqisd 
3 p Lm
Te   rd isq
4 Lr
Te  K T ' rd isq if  rd  cte, Te  K T isq

21
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

d-q synchronous reference frame linked to the ψr


• when d and q components of the stator current are decoupled, it means
that theoretically the control and the variations on each component of the
stator current (isd, isq) does not provoque any variation in the other
• in practice, it is usual that appear a slight couple/influence between the both
components d and q, due to the getting of θe angle is depending on the
motor parameters’ values, and the values employed in calculations do not
match with the real motor’s.
• Induction Motor: controlled in current (DC Motor: controlled in voltage)
Te  K T ' rd isq  r  Lmisd  ψr linked/controlled by isd
Te  K T isq  Te linked/controlled by isq

• stator voltaje equations that are employed


disd Lm d rd
v sd  Rsisd  Ls    eLsisq
dt Lr dt
disq Lm
v sq  Rsisq  Ls  e  rd   eLsisd
dt Lr

22
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

Vector control of induction motor in d-q rotating


reference frame: to calculate θe
1) Indirect method (indirect vector control)
calculate ψr , ωs , measure/calc./estim. ωr (=P·ωm)
Lr d r Lm Rr
  r  Lmisd  r  Lmisd s  i e   s  r  e   e dt
Rr dt ,  r Lr sq
stationary estate
ωs: slip speed
(velocidad de deslizamiento)

2) Direct method (Direct vector control)


 r
 e  tan 1
 r

23
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

Open loop estimation of variables to make ind. vector control


Open loop means that the estimator is sensitive to parameters’ variations.
The estimator can not correct their variations.
• Rotor flux, ψr (p. 23)
Lr d r  r ( s) Lm Lm Lm
  r  Lmisd   r ( s )  I sd ( s ) r  isd
Rr dt I sd ( s ) Lr Rr s  1 Lr Rr s  1 Lr Rr s  1

• Electromagnetic torque, Te (p. 17/18)


3 p Lm
Te   rd isq Te  K T ' r isq Te  K T isq
4 Lr
• Load torque, TL (p. 17/18)
– from the mechanical equation
d m d m
J  Bv m  TL  Te TL ( s )  Te ( s )  ( Js  Bv ) m ( s ) TL  Te  J  B v m
dt dt

Measured variables Variables in d-q Estimated variables Known variables


isA, isB, isC, ωm θe , isd , isq Ψr , Te , TL isd , isq , ωm , Ψr , Te , TL

24
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

Vector control of induction motor in d-q rotating reference


frame:  
 0 
  isA   1
is  1 0 0   isA  Clarke’s (1) K=2/3 is  I s Clarke’s inverse   1 3  is 
1 1  isB  i     
i   0 Transformation transformation  sB  2  is 
    2
 s   isC   1
3  isC 
(2) isA+ isB + isC =0 3
3
  2 
2 

ABC(III)  α-β  d-q, make control, d-q  α-β  ABC(III)

isd   cos e sin e  is  is  cos e - sin e  isd 


i    i     
 
cos e  is   s   sin e cos e  isq 
 sq   sin e
Park’s Park’s inverse
transformation transformation
25
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
PI speed control. Design in frequency domain (N. Mohan 2001)
• Based on complete diagram of vect. ind. control with mod. SVPWM and VSI

Objective:
Generate an appropiate isq* to get
an optimal speed tracking
(ωm ωm*)

• Supositions:
– dynamics associated to SVPWM, VSI y PI current controllers are neglected because
they are much faster than mechanical dynamics of induction motor and PIω controller
– TL =0 and Bv=0 (usually small)
– d and q components disacoupled, and isd  isd , isq  isq
* *

– rotor flux (stationary)  r  Lmisd


– electromagnetic torque (stationary) Te  K T isq

26
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
PI speed control. Design in frequency domain (N. Mohan 2001)
• taking mechanical equation of motor
d m Really, the Transfer Function of motor
d m
J  Bv m  TL  Te J  Te is this (external representation)
dt dt
PI
m ( s) KT

I sq ( s ) ( Js  Bv )

ωGC and PM are chosen


• taking
JGC
2
Ki 
OLTF ( s ) s  j  1 K T 1  tg ( PM  ) 2
 Ki  1
in ωGC
GC

OLTF ( s )   Kp    KT
 s  sJ
argOLTF ( s )  s  j  180º  PM  tg ( PM  ) Ki
GC Kp 
GC

OLTF: Open Loop Transfer Function (FTLA: Función de Transferencia en Lazo Abierto)
ωGC: gain crossover frequency (frecuencia de ganancia crítica)
Ned Mohan calls ωC: crossover frequency (frecuencia de corte)
PM: phase margin (margen de fase)
27
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
PI current control. Design in frequency domain (N. Mohan 2001)
• Based on complete diagram of vect. ind. control with SVPWM mod. and VSI
Objective:
generate appropiates vsd* and vsq* to get
an optimal voltage control
vsABC  vsABC * isd*  isd and isq*  isq

• Suppositions:
– dynamics associated to
SVPWM and VSI are neglected
because they are much faster than
stator dynamics and PIi controllers
– same control design for d and q
– equations of d and q voltages (p. 22)
disd Lm d rd disq Lm
vsd  Rsisd  Ls    eLsisq vsq  Rsisq  Ls  e  rd   eLsisd
dt Lr dt dt Lr
28
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
PI current control. Design in frequency domain (N. Mohan 2001)
• taking the stator equations of motor

disd Lm d rd
v sd  Rsisd  Ls    eLsisq These are considered
dt Lr dt
as disturbances (pert.)
disq Lm
vsq  Rsisq  Ls   e  rd   eLsisd vsd,pert vsq,pert
dt Lr

PI

chosing ωGCi and PMi


  GCi Ls 
  tg  PM i   arctg 
• taking  2 Rs 
FTLA( s )isq 1 GCi Rs 2  (GCi Ls ) 2
 Ki  1  s  jGCi Kii 
FTLA( s )isq   Kpi  i   in ωGCi 1  2
s  Rs  sLs 
 
arg FTLA( s )isq   180º  PM i
s  jGCi
Kii
Kpi 
GCi
29
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Speed and Currents control: PI controlers design in


frequency domain (N. Mohan 2001)
– Practical recomendations (Simulink and real experiments)
Control_PIspeed_currentsSCIM.m
ωGC ≈ 300÷400 rad/s, PMω ≈ 80º (·π/180º) % PI speed loop
ωGCi ≈ 10·ωGC rad/s, PMi ≈ 70÷80º (·π/180º) % PI current loop
closed loop system is stable: PMω > 0º and PMi > 0º
– PIω
• Output limited to ±Isq_max (Saturation) value
• Anti-windup, kb≈100
Look Under Mask

– PIi
• Output limited to ±Vs_max (Saturation) value
• Anti-windup, kbi≈2
30
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

Modulation: 3) Current control by SVPMW


• Simulations (Simulink)
– Block SVPWM (modulator+VCI) (N. Mohan)
– inputs vabc (from PIcurrentsdq/ABC vsABC*)
– outputs Out1÷6 ( pulses for VSI)
WITH SimPowerSystem
– outputs Vs_phase_A÷C(ABC/dqmodel inductionmotor_dqC7)
WITHOUT SimPowerSystem

• Real Experiments (Simulink and real time target dS1103)


– Block SVPWM (S-Function Builder, in C program. lang. C)
SVPWM_DSP_TexasInstruments.c
– ftri=10 kHz TsSVPWM=100 μs, then TsCONTROL≥100 μs
– Deadband =1 μs (delay time to switch the electronic
switches of the same branch)

31
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
• Diseño de controlador PI para sistemas de 1º orden en el dominio temporal.
Método de cancelación polo-cero
– Tomando la función de transferencia de controlador PI (donde Ki=Kp/Ti)
K i K p ·s  K i K p ·s  K p / Ti s  1 / Ti T ·s  1
GC ( s )  K p 
   Kp  Kp i
s s s s Ti ·s
y teniendo en cuenta que el sistema en lazo cerrado es

y su función de transferencia (Ti ·s  1) K


Kp
(2º orden y 1 cero) C ( s ) m ( s ) Gc ( s )G ( s ) Ti ·s ( s  1)
 *  
R( s ) m ( s ) 1  Gc ( s )G ( s ) H ( s ) 1  K (Ti ·s  1) K
·1
Ti ·s ( s  1)
p

se toma Ti = τ y se simplifica a 1º orden y sin cero (cancelando polo con cero)


K
Kp
C ( s ) m ( s ) Ti ·s K pK 1
 *   
R ( s ) m ( s ) 1  K K Ti ·s  K p K Ti
·s  1
p
Ti ·s KpK

siendo τ’ la constante de tiempo del sistema controlado,  '  Ti  1


K pK Ki K
32
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
• Diseño de controlador PI para sistemas de 1º orden en el dominio temporal.
Método de cancelación polo-cero
– se impone la condición para que el sistema en lazo cerrado tenga un tiempo de estable-
cimiento ts dado, donde en sistemas de 1º orden sin cero es habitual tomar ts = 5· τ’
– de ahí se obtiene τ’ y así Ki , y de Ti = τ finalmente Kp
A tener en cuenta que:
– Se debe garantizar estabilidad del sistema en lazo cerrado (Routh-Hurwitz, PM, u otro mét.)
– Este método es aplicable a sistemas cuyos parámetros no varían o lo hacen muy poco

Ejemplo: diseñar un controlador PI para el lazo de velocidad del motor de inducción 1 (7.5 kW)
para que su tiempo de establecimiento ante una entrada escalón de 100 rad/s sea de 0.1 s
– la respuesta de este sistema de primer orden ante ese escalón es c(t)=100·(1-e-t/τ’), y su
respuesta se estabiliza al transcurrir t=5·τ’ segundos,
– primero hay que hallar los parámetros K y τ de función de transferencia del motor (ec. mec.)
KT KT / Bv KT / Bv K
G( s)     K=163.21 y τ =3.8 s (J=0.057, Bv=0.015, KT=2.4483)
J ·s  Bv ( J ·s  Bv ) / Bv J / Bv ·s  1 1   ·s

1 1 1
5·τ’=0.1 s  τ’=0.1/5=0.02 s,  '   Ki    0.3063
Ki K  ' K 0.02·163.2182
– como Ti = τ
Kp
Ti     K p  Ki ·  0.3063·3.8  1.1641
Ki
33
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
• Diseño de controlador PI para sistemas de 1º orden en el dominio temporal.
Método de cancelación polo-cero
sigue Ejemplo: diseñar un controlador PI para el lazo de velocidad del motor de inducción 1
(7.5 kW) para que su tiempo de establecimiento ante una entrada escalón de 100 rad/s sea de
0.1 s
– se comprueba su estabilidad en el dominio frecuencial (PM, etc). Para ello se representan
los diagrama de Bode del sistema en lazo abierto y se comprueba que PM>0 (positivo)
– Esto sirve también para establecer la relación entre los dos métodos de sintonización de
controladores PI (dominio temporal y frecuencial)
1. Ancho de banda (BW):
(FTLA) ωGC≈ ωC (FTLC)
(diseño en frec, canc. pol-cer)
2. Siempre PM=90º>0 (BW ωC=1/ τ’ ):
siempre estable (ventaja)
K pK Ki K
FTLA  
Ti ·s s
no es posible variar Kp y Ki (desv.)

3. ts=5·τ’ pero en la práctica existen


saturaciones (valor_máx), anti-
windup, etc.

34
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)
• Diseño de controlador PI para sistemas de 1º orden (lazo cer. 2 polos+1 cero)
Métodos que NO cancelan polo-cero:
– Diseño en dominio temporal, fijar: ts , ωn y δ (ζ) despr. cero Kp y Ki
¿cómo influye el cero? ¿y las saturaciones? ¿y el anti-windup? Comprobarlo por simulación.

– Diseño en dominio frecuencial, fijar: ωGC y PM, no despr. cero Kp y Ki


¿cómo influye el cero? ¿y las saturaciones? ¿y el anti-windup? Comprobarlo por simulación
· El cero es dominante, introduce un rebose y hace que la respuesta sea más rápida.
· Pero al añadir la acción de las saturaciones y anti-windup, el rebose dism. o desaparece,
y la respuesta es más lenta (disminuye mucho el efecto del cero)
· Reduciendo el PM (y manteniendo cte. ωGC ),
se consigue reducir un poco Kp , aumentar mucho Ki  respuesta más rápida y efectiva (TL)

– Para cualquier diseño, una buena forma de compensar el efecto de la perturbación es aña_
diendo la acción feedforward. De todos modos, comprobarlo simulando (igual no merece).
· Para el lazo de velocidad es añadir isq_ff (t) = 1/KT ·TL , TL se puede estimar (ec. mec.)
y así isq_ref (t)= isq_pi (t) + isq_ff (t)
· Para los lazos de corrientes es añadir los términos de acoplo de las tensiones (consid.
perturbaciones p. 29) y así vsd_ref (t)= vsd_pi (t) + vsd_pert(t), y vsq_ref (t)= vsq_pi (t) + vsq_pert(t),
Lm d rd Lm
vsd _ pert   eLsisq si  rd  cte vsd _ pert  eLsisq vsq _ pert  e  rd  e ·Lsisd
Lr dt Lr
35
Application to Concrete Projects - P. Alkorta
1. Modelling and speed control of Induction Machine (IM)

• Cálculo del Isq_nom, Isd_nom y ψr_nom (modelado) del motor de inducción


– Método 1 (exacto): (K=2/3), se toman las ecuaciones (1) y (2)
Is 2  isd 2  isq 2 (1)
3 Lm Te
Te  p  risq  KT '· risq (2) , rég. est.  r  Lm isd ,  sust. isd  en (1) ec. bicuadrada
4 Lr KT '·Lm isq
% Cálculo de Isq_max, Isd_max y Phir_nom
In=15.3; % corriente de estator (de línea) eficaz de motor de inducción 1
a=Ktp*Lm;b=Tn;Is_max=In*sqrt(2);c=Is_max; % coeficientes de la ec. bicuadrada
Isq_max2=roots([a^2 -a^2*c^2 b^2]) % resolución de la ec. bic. : Isq_max^2
Isq_max=sqrt(Isq_max2(1,1)) % obtención de Isq_max (la mayor)
Isd_max=sqrt(Is_max^2-Isq_max^2);
Phir_nom=Lm*Isd_max; % Flujo de rotor nominal (Wb)
Kt=3*P/2*Lm/Lr*Phir_nom; % constante de par de motor, ( Nm/A )

– Método 2 (aproximado): es un buen método, emplea el circuito equivalente exacto (p. 15),
donde supone el motor trabajando en vacío a Vn y fn, y sin pérdidas, la corriente consumida
se emplea solamente para generar el flujo
v f _ max v f _ max
I sd _ max  
2 2 2
Rs  ( X sl  X m )2 Rs  X s
2 2
I sq _ max  I s _ max  I sd _ max

 r _ max  Lm I sd _ max
36
Application to Concrete Projects - P. Alkorta
2. Modelling and speed control of Permanent Magnet Synchronous Machine
(PMSM)

• Permanent Magnet Synchronous Motor (PMSM)


– Rotor: los polos permanentes están rígidamente sujetos al eje y
generan un campo magnético constante.
– Cuando los devanados del estator se alimentan con corriente alterna
senoidal, generan un campo magnético giratorio de forma senoidal.
Este flujo de estator es el resultado de la combinación de cada uno
los tres flujos producidos por cada devanado
– La tendencia del flujo magnético NS del rotor es
alinearse con el flujo electromagnético SN del
estator, y como el rotor es giratorio, ωr
entonces el rotor gira a la misma velocidad que
ωe
el estator.
– Los dos flujos giran a la misma velocidad ωe,
velocidad de sincronismo o velocidad síncrona ωe = ωr

Application to Concrete Projects - P. Alkorta


2. Modelling and speed control of Per. Magnet Synchronous Machine (PMSM)

• Sistema de referencia bifásico giratorio d-q (direct-quadrature)


 
ψ  ψ 
ligado al flujo de rotor r rd rq ψ j ψ rq  0  ψ r  ψ rd

– Modelo d-q del motor PMSM


motorpmsm_dqC6.m
Los polos permanentes
di sd

1
 Rs isd   r Lsqisq  v sd  Te 
3P
 sd isq  sqisd  proporcionan el flujo de
dt Lsd 2 rotor ψr = ψM =ψf
Por ello no es necesario la
di sq 3P

1
 Rs isq   r Lsd isd   r M  v sd  Te 
2
 risq  KT ' risq corriente de flujo de rotor,
dt Lsq isd  0
Te  K T i sq
d r B P
  v  r  Te  TL 
dt J J

 sd  Lsd ·isd   M
 sq  Lsq·isq
3P Sup. Lsd = Lsq = Ls
Te   risq P, número de par de polos
2 ωr , velocidad eléctrica de rotor
 x  Ax  Bu ωm , velocidad mecánica de rotor
 ωr = P ωm
 y  Cx  Du
Application to Concrete Projects - P. Alkorta
2. Modelling and speed control of Per. Magnet Synchronous Machine (PMSM)

Control de velocidad: diseño de controlador PI en el dominio


frecuencial (N. Mohan 2001)
– Se parte del diagrama completo con +2 PI, SVPWM y VSI
– Objetivo: generar la isq* adecuada para obtener un seguimiento óptimo de
velocidad (ωm ωm*).
– Mismas aproximaciones que Motor Inducción (mismo diagrama de bloques)
– Mismo diseño que motor de inducción,
pues se basa en ecuación mecánica del
motor (diseño para cualquier motor)

elegir ωGC y PMω hallar Kiω y Kpω

– Más sencillo calcular θe , debido a que


no hay deslizamiento (ωs=0)
 e   s   r , e  P·m  e   e dt
r  P·m
2. Modelling and speed control of Per. Magnet Synchronous Machine (PMSM)

Control PI de corriente. Diseño en frecuencia (N. Mohan 2001)


• Se parte del diagrama completo de control vect. ind. con mod. SVPWM y VSI
Objetivo:
generar vsd* y vsq* adecuadas para obtener
vsABC  vsABC * isd*  isd y isq*  isq

• Se supone (igual que Mot. Induc.):


– que las dinámicas asociadas a
SVPWM y VSI despreciables
frente a las dinámicas contrls. PIi
– mismo diseño para contrl. d y q
– ecuaciones tensiones d y q (algo distintas a MI, pero se procede del mismo modo)
disd disq
vsd  Rsisd  Lsd   r Lsqisq vsq  Rsisq  Lsq   r ( Lsd isd   M )
dt dt
40
Application to Concrete Projects - P. Alkorta
2. Modelling and speed control of Per. Magnet Synchronous Machine (PMSM)

Control de corrientes: diseño de controlador PI en el dominio


frecuencial (N. Mohan 2001)
Nota:
• entonces las ecuaciones de estator muchas veces se toma
Se consideran Ls=Lsd=Lsq ó Ls=(Lsd+Lsq)/2
di PI
vsd  Rsisd  Lsd sd   r Lsqisq perturbaciones
dt vsd,pert vsq,pert
di
vsq  Rsisq  Lsq sq   r ( Lsd isd   M )
dt

se toma el caso de la corriente isq


Se eligen ωGCi y PMi
• tomando (forma similar que en el lazo de velocidad)   GCi Lsq 
  tg  PM i   arctg 
 2 Rs 

 Ki  1  FTLA( s )isq 1 GCi Rs 2  (GCi Lsq ) 2


FTLA( s )isq   Kpi  i   en ω s  jGCi Kii 
 s  sLsq  Rs  GCi
1  2

arg FTLA( s )isq  s  j GCi
 180º  PM i
Kii
Kpi 
• expresiones muy similares a MI: σ·Ls Lsq GCi
2. Modelling and speed control of Per. Magnet Synchronous Machine (PMSM)

• Control de Velocidad y de Corrientes: diseño controladores


PI en el dominio frecuencial para PMSM (mismas que SCIM)
– Recomendaciones prácticas (Simulink y experimentos)
Control_PIvel_corrientesPMSM.m
ωGC ≈ 300÷400 rad/s, PMω ≈ 80º (·π/180º) % PI speed loop
ωGCi ≈ 10·ωGC rad/s, PMi ≈ 70÷80º (·π/180º) % PI current loop
sistema estable en lazo cerrado: PMω > 0º eta PMi > 0º
– PIω
• Salida limitada al valor ±Isq_max (Saturation)
• Anti-windup, kb≈100

Look Under Mask

– PIi
• Salida limitada al valor ±Vs_max (Saturation)
• Anti-windup, kbi≈2

42
Application to Concrete Projects - P. Alkorta
3. C programming language for S-Function Builders of MatLab/Simulink.
Discretization of continuous time controllers and estimators, other calcs.

• Discretization of:
– PI controllers (speed, currents), estimator of rotor flux ψr , calculation θe
angle, calculation Clarke’s and Park’s transformations, saturarions, etc.
– Ts=2e-6s (2 µs) simulation, Tsc=1e-4s (100 µs) controllers & others,

43
Application to Concrete Projects - P. Alkorta
3. C programming language for S-Function Builders of MatLab/Simulink.
Discretization of continuous time controllers and estimators, other calcs.

• S-Function Builder of PI speed controller (without discr. states)

44
Application to Concrete Projects - P. Alkorta
3. C programming language for S-Function Builders of MatLab/Simulink.
Discretization of continuous time controllers and estimators, other calcs.

• S-Function Builder of PI current controllers I (without discr. sts.)

45
Application to Concrete Projects - P. Alkorta
3. C programming language for S-Function Builders of MatLab/Simulink.
Discretization of continuous time controllers and estimators, other calcs.

• S-Function Builder of PI current controllers II

46
Application to Concrete Projects - P. Alkorta
3. C programming language for S-Function Builders of MatLab/Simulink.
Discretization of continuous time controllers and estimators, other calcs.

• S-Function Builder of limitation to Vs_max and inv. Park

47
Application to Concrete Projects - P. Alkorta
3. C programming language for S-Function Builders of MatLab/Simulink.
Discretization of continuous time controllers and estimators, other calcs.

• S-Function Builder estimation of rotor flux ψr and θe angle

48
Application to Concrete Projects - P. Alkorta
4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)

• Model Predictive Control (MPC, Control Predictivo basado en


Modelo)
– Existen diferentes formulaciones:
• Model Predictive Heuristic Control (MPHC), 1978.  Model Algorithm Control (MAC)
• Dynamic Matrix Control (DMC), 1980.
• Generalized Predictive Control (GPC), 1987.
• …
– Permiten abordar casos muy diversos:
• sistemas SISO (monovariables, Función Transf.), sistemas MIMO (multivariables, Ecs. Estado)
• sistemas inestables, sistemas de fase no-mínima (ceros positivos)
• sistemas con restricciones (saturaciones, etc): permite integrarlas en el algoritmo
• sistemas con retardos
• sistemas lineales, sistemas no lineales
– Desventajas: algoritmo de control complejo, coste computacional alto
– GPC aplicado sistema monovariable con retardo (τd=d). Modelo del sistema:
Función de Transferencia en tiempo discreto (discretizado el de t. continuo)
B( s )  d ·s 1 B( z 1 )  d
G( s)  e   G( z )  z
A( s ) A( z 1 )

49
Application to Concrete Projects - P. Alkorta
4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)

• GPC aplicado a sistema monovariable con retardo


– Cualquier sistema lineal/linealizado se puede representar por el modelo
CARIMA (Controlled Auto-Regresive Integrated Moving-Average, sistema con
ruido dentro del mismo):
 (t )
A( z 1 ) y (t )  B( z 1 ) z d u(t  1)  C ( z 1 )

  1  z 1, inversa del integrador.
d, el retardo.
(t), el ruido blanco de media cero.
A(z-1), B(z-1), denominador y numerador de la
función de transferencia de la planta.
-1
C(z ), numerador del bloque generador de ruido.
Polinomio del ruido coloreado.

– Polinomios expresados con el operador z-1


A( z 1 )  1  a1 z 1  a 2 z 2  ...  a na z  na
B( z 1 )  b0  b1 z 1  b2 z 2  ...  bnb z nb
C ( z 1 )  1  c1 z 1  c2 z 2  ...  cna z nc

– Normalmente se considera el caso más sencillo: C(z-1)=1


 (t ) B ( z 1 )  d 1
– 1 1 d
A( z ) y (t )  B ( z ) z u (t  1)  1·  y (t )  1
z u(t  1)   (t )
 A( z ) A( z 1 )
50
Application to Concrete Projects - P. Alkorta
4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)

• GPC aplicado a sistema monovariable con retardo


– El algoritmo de control GPC consiste en aplicar una secuencia de control que
minimiza la función de coste Jc:
N2 2 Nu 2

Jc    ( j )yˆ (t  j t )  w(t  j )    ( j )u(t  j  1)


j  N1 j 1
ŷ(t+j|t), la óptima predicción del paso j hacia adelante
de la salida del sistema calculado en el instante t
N1 , el horizonte de coste mínimo (1+d).
N2 , el horizonte de coste máximo (N+d).
Nu , el horizonte de control (1).
N, el horizonte de futuro (3, 5, etc).
δ(t) y λ(t), los coeficientes de ponderación, seguimiento
de salida y control.
w(t+j), la trayectoria de la referencia futura

Fig. d=0, N=5, N1=1+0=1, N2=5+0=5, Nu=1

– El objetivo del control predictivo es calcular la secuencia de control futura


u(t), u(t+1), … de tal forma que la futura salida del sistema y(t+j) sea lo más
próxima posible a la referencia futura w(t+j). Esto se lleva a cabo
minimizando Jc(N1, N2, Nu) 51
Application to Concrete Projects - P. Alkorta
4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)
• GPC aplicado a sistema monovariable con retardo
– La predicción óptima de la salida tiene la expresión,
yˆ (t  j t )  G j ( z 1 )u (t  j  d  1)  F j ( z 1 ) y (t )
donde G j ( z 1 )  E j ( z 1 )B( z 1 ) y G j ( z 1 )  g j ,0  g j ,1z 1  ...  g j , j 1 nb z  ( j 1 nb)
para lo cual hay que resolver la ecuación diofantina 1  E j ( z 1 ) A~( z 1 )  z  j F j ( z 1 )
~
es decir 1 / A( z 1 ) siendo A( z 1 )  A( z 1 )
– La división 1 / A( z 1 ) se realiza N2=N+d veces, y es necesario que el Tsc
(periodo de muestreo del controlador) sea igual (o submúltiplo) a d.
– En cada instante t se calculan los N pasos hacia adelante,
yˆ (t  d  1 t )  Gd 1 ( z 1 ) u (t )  Fd 1 ( z 1 ) y (t )
yˆ (t  d  2 t )  Gd  2 ( z 1 ) u (t  1)  Fd  2 ( z 1 ) y (t )

yˆ (t  d  N t )  Gd  N ( z 1 ) u (t  N  1)  Fd  N ( z 1 ) y (t )

y  Gu  F ( z 1 ) y ( t )  G ' ( z 1 )u(t  1)
y  Gu  f

G: matriz dinámica del sistema


f: términos del presente y pasado
(respuesta libre) 52
Application to Concrete Projects - P. Alkorta
4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)
• GPC aplicado a sistema monovariable con retardo
– Asumiendo que la secuencia de control δ=1 en la ecuac. Jc , entonces,
J c  (Gu  f  w )T (Gu  f  w )   uT u

y suponiendo que no hay restricciones (saturaciones), el mínimo de Jc se


puede calcular de forma analítica, igualando su gradiente a 0
u  ( G T G   I ) 1 G T ( w - f ) λ ↓ (control + agresivo), λ ↑ (control + suave),
y como se usa una estrategia de horizonte deslizante, la señal de control que se
aplica realmente al sistema, u(t), proviene del primer elemento del vector u,
u(t )  K (w - f ) u(t )  u(t )  u(t  1)  u(t )  u(t )  u(t  1)

donde K=[K1 K2...KN] es la 1ª fila de (GTG+λI)-1GT

53
Application to Concrete Projects - P. Alkorta
4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)
• GPC aplicado a sistema monovariable con retardo
– Planta: motor de inducción (7,5 kW), control de velocidad. Func. Transf:
m ( s ) KT Bv  d ·s  m ( z 1 ) B ( z 1 )  d b0
 e   z  z d
τm=J/Bv τd=d
I sq ( s ) (1  s m )
*  
I sq ( z 1 ) A( z )
* 1
(1  a z )
1

a) suponiendo que d=0, N=3, N1=1+d=1, N2=N+d=3, no hay restricciones


(saturaciones), el mínimo de Jc se calcula de forma analítica
u  ( G T G   I ) 1 G T ( w - f ) λOPT ≈ m·trace(GT·G), m=f-1(Ts_gpc), m=2 (700µs), m=60 (100µs)
sustituyendo las variables y(t), w(t) y u(t), por ωm, ωm* e isq*, respectivamente, se
obtiene
*
isq (t )  K (ωm - f )  isq (t )  K (ωm  f )  isq (t  1)
* * * *

Application to Concrete Projects - P. Alkorta 54


4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)
• GPC aplicado a sistema monovariable con retardo
– Planta: motor de inducción (7,5 kW), control de velocidad:
b) suponiendo que d=1, N=3, N1=1+1=2, N2=N+1=4, no hay restricciones
(saturaciones), el mínimo de Jc se calcula de forma analítica
u  ( G T G   I ) 1 G T ( w - f )

• GPC sin restricciones imponiendo restricciones fuera del algoritmo


predictivo: funciona bien en control de velocidad motor inducción

• GPC con restricciones:


– solución no analíticasolución numérica (método numérico):
• función quadprog(), MatLab/Simulink
• función tnc(), lenguaje C
– coste computacional alto. Sin embargo, tanto en el caso analítico como en el
numérico, siempre que sea posible, los parámetros son calculados off-line

55
Application to Concrete Projects - P. Alkorta
4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)
• La diferencia en la elección de un horizonte de control (Nu) u otro en el cálculo de y y u,
es decir ŷ(t+j|t) y Δu(t)
– Tomando el ejemplo anterior, a) (N=3, d=0, N1=1, N2=3, con λ=0.0361), si se toma Nu=1, entonces la
matriz dinámica G contiene solamente la 1ª columna desde la izquierda (sin cambiar de tamaño).
Nu=1

 g0 0 0  g0 0 0  yˆ (t  1 t )   g 0 0 0  u (t )   f11   f12 
ˆ  
G   g1 g0 0

 G p   g1 0 0   y (t  2 t )   g1 0 0 u(t  1)  f 21 y (t )   f 22  y (t  1)
    
        
 g 2 g1 g0   g 2 0 0  yˆ (t  3 t )   g 2 0 0  u(t  2)  f 31   f 32 

así, el cálculo de la predicción de la salida más lejana se realiza mediante la expresión


yˆ (t  3 t )  g 2·u (t )  f11· y (t )  f12 · y (t  1) , donde se observa que sólo depende del primer término de u, de
Δu(t) (los otros dos términos no intervienen). Entonces, para el cálculo de Δu(t) sucede lo mismo, y la
matriz KKp contiene solamente la 1ª fila, pudiendo calcularse solamente Δu(t)
u  (G p G p   I ) 1 G p ( w - f )  KK p ·( w - f )
T T

– Pero si se toma Nu=3, entonces la matriz G contiene las 3 primeras columnas desde la izquierda,
coincidiendo con la matriz original. Así, en el cálculo de la predicción más lejana intervienen los 3
términos de u, y consecuentemente también en el cálculo de Δu(t), debido a que el primer término de
la función Jc es el de las predicciones. A pesar de todo, de las tres componentes de u, la que se
aplica finalmente al sistema es la primera, es decir, Δu(t), empleando la 1ª fila de la matriz KK
u  (G T G   I ) 1 G T ( w - f )  KK ·( w - f )

Notar, que aunque la primera fila de la matriz KKp y la de KK son muy similares, no son iguales,
y es precisamente ahí donde radica la diferencia de emplear un horizonte de control de 1 ó 3. 56
Application to Concrete Projects - P. Alkorta
4. Control Predictivo Generalizado (GPC, Generalized Predictive Control)
• Los coeficientes de la ecuación diofantina o diofántica, se pueden obtener de forma
recursiva empleando la función filter() de MatLab. Esta función realiza la división de
dos polinomios. A modo de ejemplo, se muestas algunas líneas de código para el cálculo
recursivo de los polinomios Fj(z-1) y Ej(z-1) :

A=[1 -p1];
Ag=conv(A,[1 -1]);
b=[1 0 0];
for i=1:n+d
[c,r]=filter(b,Ag,[1]);
if(i==1)
E(i)=c;
else
E(1:i)=[E(1:i-1) c];
end
F(i,:)=r;
.
.

57
Application to Concrete Projects - P. Alkorta
2. Modelling and speed control of Per. Magnet Synchronous Machine (PMSM)
• Control Vectorial de Velocidad, de Posición, de Par
– Se aplica del mismo modo a Motores de Inducción (IM), Motores Síncronos
(PMSM), Motores de Reluctancia Variable (SRM), etc. Todas las técnicas
empleadas para el motor de inducción las podemos aplicar a otros motores.
• Controladores, estimaciones/cálculos (θe,Ψr, etc.), transformadas
Clarke y Park,... demandan un procesador con elevada capacidad
de cálculo y mucha velocidad (DSP, Digital Signal Processor)

58
Application to Concrete Projects - P. Alkorta
4. Control vectorial de velocidad, posición y par del SCIM
• μC/μP Texas Instruments
– Familia 2812: manejo de números reales con unidad de coma fija
– Familia C2000 (F28069/335): manejo de números reales con unidad de
coma flotante
– Programación:
• En lenguaje C
• En Simulink
– Otros μC sencillos (Arduinos, 8051, etc) sin unidades de coma fija o flotante
en hardware (los emulan por software) necesitan demasiado tiempo para los
cálculos. P.e. Trasformada de Park en varios ms Vs. varios μs (DSP)
• Herramientas para experimentos reales con motores trifásicos
– MCK2812 Kit C Pro-S (IM, 370 W)
• http://www.technosoftmotion.com/en/tools/professional-kits-with-apps/induction-
motor-control-kits/mck2812-kit-c-pro-s-im
– DRV8312 (F28069), (PMSM, unos 50 W)
• http://es.farnell.com/texas-instruments/drv8312-69m-kit/eval-instaspin-bldc-motor-
kit/dp/2307916?Ntt=DRV8312-69M-KIT
– Plataformas basadas en DSPACE (1103, 1104), EUITI Eibar
• Motores de Inducción (VDC = 540V ), con carga controlada en el eje (TL)
– Industrial de 380V / 7,5 kW (motorinduccion1.m)
– Industrial de 220V / 3 kW (motorinduccion2.m)

59
Application to Concrete Projects - P. Alkorta
4. Control vectorial de velocidad, posición y par del SCIM
• Aplicaciones de máquinas asíncronas y máquinas síncronas
– Tanto las máquinas asíncronas como las síncronas tienen muchas aplicaciones.
Pueden ser empleadas tanto como generadores de energía eléctrica, como motores
eléctricos para producir energía mecánica.
– La mayor parte de la energía eléctrica consumida a nivel mundial está asociada a los
máquinas trifásicas, concretamente a los motores de inducción, aunque los motores
síncronos se están empleando cada vez más debido a sus excelentes prestaciones
(máquina herramienta, vehículos eléctricos, etc).

60
Application to Concrete Projects - P. Alkorta

You might also like