Professional Documents
Culture Documents
DIGITAL INTEGRATIVE LQR CONTROL OF A 2DOF HELICOPTER
DIGITAL INTEGRATIVE LQR CONTROL OF A 2DOF HELICOPTER
DIGITAL INTEGRATIVE LQR CONTROL OF A 2DOF HELICOPTER
Fernando dos Santos Barbosa∗, Giovanni Gallon Neto∗, Bruno Augusto Angélico∗
∗
Laboratório de Controle Aplicado
Dept. Eng. Telecomunicações e Controle
Escola Politécnica da Universidade de São Paulo
São Paulo, SP, Brazil
Abstract— A two-degree-of-freedom helicopter is a simple and interesting plant, with nonlinearities and out-
put coupling, allowing the study of several subjects, such as Kalman Filters, sensor fusion, different modeling
techniques and usage of classical and modern control. Our main is to develop a digital robust multivariable
control for this plant. Therefore, the plants complete model development is shown using Lagrange’s method
followed by its linearization around an operating point (small angles). Next, a digital LQR controller is projected
using anti-windups, since integrators are used at the input of the plant in order to increase the system order and
to guarantee null error for the step inputs. Lastly, the controller obtained is simulated and tested on the built
helicopter.
Resumo— Um helicóptero com dois graus de liberdade é uma planta simples e interessante, apresentando
não-linearidades e acoplamento entre suas saı́das, possibilitando o estudo de diferentes assuntos, tais como o
uso do Filtro de Kalman, fusão de sensores, emprego de várias técnicas de modelagem e de controle clássico e
moderno. O principal objetivo deste artigo é desenvolver um controlador robusto digital multivariável para uma
planta deste tipo. Apresenta-se a modelagem completa do sistema com o uso do Método de Lagrange seguido
pela sua linearização em torno de um ponto de operação (pequenos ângulos). Em seguida, um controlador LQR
digital é projetado fazendo uso de anti-windups, dado que integradores são colocados na entrada da planta para
aumentar sua ordem e garantir erro nulo para entrada degrau. Por fim, o controlador obtido é simulado e testado
no helicóptero construı́do.
• ψ̇ is positive when the helicopter rotates CW; Vm y are the pitch and yaw motors signal percent-
age. The generalized forces vector is given by
• As the system is fixed, it cannot rotate
h
around the roll axis or move along the axes. Q = [Q1 , Q2 ] = Kpp Vm p + Kpy Vm y − Bp θ̇,
i
Figure 1 shows a simple free-body diagram Kyy Vm y + Kyp Vm p − By ψ̇ (5)
of the helicopter model. However, the notation
shown in this figure is not the same used in the
modeling. with Bp and By being the air resistance acting on
the pitch and yaw axes, respectively. Lagrange’s
equation is written as:
∂ ∂L ∂
− L = Q1
∂t ∂ q˙1 ∂q1
∂ ∂L ∂
− L = Q2 , (6)
∂t ∂ q˙2 ∂q2
1 1 1 2
γ = 2mheli lcm sin(θ) cos(θ)ψ̇ θ̇ (11)
EK = Jeq p θ̇2 + Jeq y ψ̇ 2 + mheli
2 2 2
2
− sin(ψ)ψ̇ cos(θ)lcm − cos(ψ) sin(θ)θ̇lcm By linearizing the system for small angles, as
2 this is the operating point, the equations of motion
+ − cos(ψ)ψ̇ cos(θ)lcm + sin(ψ) sin(θ)θ̇lcm are defined by
i
+ cos(θ)2 θ̇2 lcm
2
. (2) Kpp Vm p + Kpy Vm y − Bp θ̇ − mheli glcm
θ̈ = 2
Jeq p + mheli lcm
Jeq p and Jeq y are the helicopter moments of (12)
inertia around pitch and yaw. As aforementioned, Kyp Vm p + Kyy Vm y − By ψ̇
the system is controlled by two BLDC electric mo- ψ̈ = 2
. (13)
Jeq y + mheli lcm
tors, each generating torque to both axes. For ex-
ample, the pitch motor directly controls the pitch
angle using the force generated by its propeller, A state-space system is written based on these
creating torque in the yaw as an effect of air re- equations, resulting in:
sistance. Then, the torques for each axis can be
written as: ẋ(t) = Ax(t) + Bu(t)
y(t) = Cx(t) (14)
τp = Kpp Vm p + Kpy Vm y (3)
τy = Kyy Vm y + Kyp Vm p (4) where x(t) corresponds to the states of the system
and u(t) to the percentage inputs of the motor,
wherein Kpp is the pitch motor torque constant defined by:
on the pitch axis, Kpy is the yaw motor torque
constant on the pitch axis, Kyp is the pitch motor T
x(t) = θ(t) ψ(t) θ̇(t) ψ̇(t) (15)
torque constant on the yaw axis, Kyy is the yaw T
motor torque constant on the yaw axis, Vm p and u(t) = Vm p (t) Vm p (t) . (16)
3 The Helicopter
The integrator state equation may be written choosing diagonal matrices such that:
as follows:
1
Qii = ,
v[n + 1] = v[n] + r[n] − y[n] (max xi )2
= v[n] + r[n] − Cx[n] (21) 1
Rjj = , (27)
(max uj )2
and the closed-loop equation is (Fadali and Visioli,
2013) in which i is the state and j the control input.
By using ts = 10s and the following Q and R
x[n + 1] = (Φ − ΓK) x[n] + ΓKi v[n]. (22) matrices
Therefore, the complete augmented system 1 0 0 0 0 0
has the following equation: 0 1 0 0 0 0
0 0 5 0 0 0
Q= (28)
x[n + 1] Φ − ΓK ΓKi x[n] 04,2
0 0 0 5 0 0
= · + ·r[n],
v[n + 1] −C I2,2 v[n] I2,2
0 0 0 0 0 0
| {z }
x̂[n] 0 0 0 0 0 0
(23)
−2
90 0
wherein x̂[n] is the new augmented states vector R= (29)
0 50−2
and the state matrix expands as
the resulting gain matrix was:
Φ 04,2 Γ
− · K −K (24)
−C I2,2 02,2 | {z i}
418.8146 71.8968 233.6604 ...
K̂ =
57.3546 −243.4466 36.9813 ...
| {z } | {z }
K̂
Φ̂ Γ̂
... 35.8345 −1.9874 −0.3618
and each matrix stands for new augmented Φ̂, Γ̂ . (30)
... −110.8521 −0.2527 1.1461
and K̂.
As matrices Q and R are weakly connected
to performance specifications, the pincer proce- 5 Simulation and Results
dure (Franklin et al., 1997) creates a new degree
The first step was simulating the complete sys-
of freedom for the controller to keep the closed-
tem with Simulink. The control commands were
loop poles inside a 1 /α radius circle, with α > 1.
manually programmed, as would be done in a mi-
Assuming the following modified cost function
crocontroller; here is where the anti-windup part
∞
1 Xh n was considered. Not considering the anti-windup
T
J= (α x̂[n]) Q (αn x̂[n]) may seem good initially but its usage guarantees
2 n=0
i that the integral error will not grow beyond the
T
+ (αn u[n]) R (αn u[n]) , (25) motors limits, causing a slow response after the
system gets back to the normal conditions of op-
then eration. Motors saturations and dead-zones were
also included.
αn+1 x̂[n + 1] = αn+1 Φ̂x̂[n] + Γ̂u[n] The simulation procedure was as follows:
= αΦ̂ (αn x̂[n]) + αΓ̂ (αn u[n]) , • During the first seconds, wait for the system
(26) to stabilize at θ = 0 and ψ = 0;
and the optimal control problem may be formu- • at 20s, give a step reference of 0.35rad for the
lated as αn u[n] = −K̂ (αn x̂[n]), i.e., u[n] = pitch and at 35s a step reference of −0.35rad
−K̂x̂[n]. Finally, α is defined as 100Ts /ts , with for the yaw;
Ts the sampling time and ts the settling time cho-
sen for a 1% criteria (Franklin et al., 2001). • at 50s, give a new reference to take the pitch
Lastly, to determine the Q and R matri- back to zero and do the same to the yaw at
ces, Bryson’s rule (Franklin et al., 2001) suggests 65s.
Motor %
The next step was uploading the controller to
the development board and controlling the real 40
helicopter. The same test procedure presented for
the simulation was used.
20
Figure 6 presents the real system response, in
which it is possible to verify the stabilization capa-
bility of the controller developed. Figure 7 shows 0
the respective motor percentage. The main differ- 0 10 20 30 40 50 60 70 80
t (s)
ences from the simulated system may be caused by
poor system identification as well as by the power Figure 5: Motors percentage for non-linear model
cable position, causing unmodeled dynamics. simulation.
6 Conclusion
0.4
It was presented the complete development of the θ
digital integrative LQR controller using Bryson’s 0.3 ψ
rule and pincer procedure. This optimal controller
0.2
was capable of not only stabilizing the helicopter
Amplitude (rad)
0.4 100
Vm p
0.3 Vm y
80
0.2
Amplitude (rad)
0.1 60
Motor %
0
40
-0.1
-0.2 θ
ψ 20
-0.3 θ̇
ψ̇
-0.4 0
0 10 20 30 40 50 60 70 80 0 10 20 30 40 50 60 70 80
t (s) t (s)
Figure 4: System states for non-linear model sim- Figure 7: Motors percentage used to control the
ulation. θ and ψ are in rad, θ̇ and ψ̇ in rad/s. built helicopter.