Implementation of A Low-Cost Prototype of Twin Rot
Implementation of A Low-Cost Prototype of Twin Rot
net/publication/317084889
CITATIONS READS
2 1,147
3 authors, including:
All content following this page was uploaded by Marcos Rogério Fernandes on 08 February 2018.
Abstract— This paper presents some design aspects related with Q and R being matrices of appropriate size, it is
to the construction of a Low-cost Prototype of Twin Rotor called the linear quadratic regulator (LQR) problem, and the
MIMO System (TRMS) for the purpose of academic studies. optimal control solution is known and given by uk = −Mk xk ,
Filtering and data fusion are used to extract reliable angles
measurements from the sensors. The mathematical modeling as long as Q is symmetric and semidefinite positive, and R is
of the prototype is done, and its parameters are obtained with symmetric positive definite. In this case, Mk is the solution of
linear identification, allowing the design of a feedback LQG the Discrete Riccati Equation and it is known as the feedback
controller. The proposed LQG controller is compared with a gain of the system [1].
PID controller tuned by Genetic Algorithm (GA) in preliminary The application of deterministic control to everyday prob-
tracking experiments. The advantages of the LQG control is
showed both in simulation and on the real set-up. lems runs counter to the possibility of guaranteeing good
results, due to noises and disturbances affecting the system
I. INTRODUCTION and also the difficulty of modeling and measuring vari-
Essentially, a controller aims to eliminate the error be- ables of interest. The point is that LQR requires a perfect
tween the value of the output variable and its desired one. knowledge of the dynamics of the control system and a full
In a more comprehensive sense, it needs to meet design state feedback. Thus, to make it an attractive option, it is
requirements and ensure system robustness to external pertur- essential the use of techniques to address such deficiencies,
bations. For this task, there are several ways and techniques providing support for its implementation. In this context, the
to approach a control problem. One of the classic control Kalman Filter (KF) — a recursive state estimation algorithm
technique is the PID controller, widely used for controlling — can predict the states of a linear system in an optimal
industrial process, due to its simplicity and efficiency in manner to provide the full state feedback. The combination
different types of applications. On the other hand, it may of the LQR with the KF is called Linear Quadratic Gaussian
not provide good results to MIMO applications. Besides, a (LQG) controller, and it has been the center of countless
PID controller design is focused on satisfying some desired implementations in the last decades.
characteristics of the system time response, and consequently We highlight here the use of LQG controller in Twin Rotor
it usually does not take into account the control effort. MIMO Systems (TRMS), such as in [2], [3], or other optimal
However, there are many situations that a minimization control techniques, e.g., [4], [5]. Although they are nonlinear
of the control effort plays an important role for the proper and complex systems with a high coupling effect between the
functioning of the system. We can mention rocket launch propellers, they can be approximated by linear models. Such
processes (optimization of the weight-to-fuel ratio for take- systems resemble a helicopter and they are used for several
off) and self-performance systems (e.g. airplanes and radars). control experiments and researches in dynamic modeling for
This points out to a need to apply in some systems more related works, see [6], [7], [8], [9], [10], [11], and references
sophisticated control techniques, such as the optimal control. therein.
The discrete optimal control problem consists of finding an Although there are some commercial TRMS developed
optimal policy uk that minimizes an arbitrary cost functional by companies, we have chosen to build our own system
J = ∑N−1
k=0 f (xk , uk ) + g(xN ) for a certain time horizon N > 0 to serve as a platform for our academic studies in system
and satisfy the state equation xk+1 = Axk + Buk , where xk ∈ identification and optimal control. Figure 1 shows the 2
Rn is the state vector and uk ∈ Rm is the control signal, both degree of freedom (DOF) TRMS developed in our laboratory.
evaluated for each time instant k ∈ N. In addition, A ∈ Rn×n After finishing the construction in a few days, a dynamical
and B ∈ Rn×m are constant and perfectly known matrices that nonlinear model was derived for the prototype and approxi-
represent the dynamic model of the system. In the particular mated by a linear one. Several measurements were done and
case where the cost functional is the unknown model parameters were obtained by means of
N−1 the linear least squares identification approach. Afterwards,
J(x0 , u) = ∑ (xkT Q(k)xk + uTk R(k)uk ) + xNT QxN , (1) it was validated against real data, i.e., a comparison was
k=0 made between simulated time responses from the identified
*This work was not supported by any organization. model and real time responses obtained directly from the
The authors are with the Department of Electrical Engi- prototype by sensing and filtering. Since the linear model
neering, Federal University of Technology - Paran, 80230-901, does indeed represent the prototype well, the LQG controller
Curitiba, PR, Brazil. [email protected],
[email protected], can be implemented.
[email protected] Even presenting preliminary results of the application of
optimal control in our prototype, the main motivation of some appropriate characteristics to the design, such as high
this work is to stress that it is possible to build a relatively resistance to mechanical shocks and relative lightness. We
simple and inexpensive prototype of a TRMS for educational opted to work with bearings on all rotary joints, which gave
purposes that allows students to carry out relevant control the system a more linear dynamics from the mechanical point
experiments in an academic setting. of view, since additional mechanical stresses are generally
Classical control techniques such as combinations of pro- sources of non-linearities for the system.
portional, integral and derivative controllers are commonly
used to control TRMS, so that we also implement the PID B. Actuators
control, in addition to the LQG, both for the same plant Both actuators are brushless motors, commonly used in
conditions. The advantages of LQG against PID are evident aeromodelism. For this particular design, we chose the model
in the experiments, and the good performance of the LQG XA2212 manufactured by EMAX. Connected to each motor
also suggests that the identification technique used and the are an Electronic Speed Controller (ESC) and a nylon
stochastic filtering were successful. It is noteworthy that for propeller (type 1045 for front propulsion and type 835 for
the LQG/PID comparison, the Matlab R Genetic Algorithms rear). The motor assembly, the ESC and the propeller are
(GA) toolbox was used to tune the PID controller. shown in Figure 3.
This paper is organized as follows. Section II consists
of the construction and selection of prototype peripherals.
Section III develops the KF as an estimator for angle
measurements. Section IV proposes the dynamic model for
the prototype. Section V presents both controllers, LQG
and PID, and it is possible to compare the results of their
implementation in Section VI. Finally, the conclusions are
presented in Section VII.
II. T HE P ROTOTYPE OF THE T WIN ROTOR S YSTEM
The built prototype consists of a beam pivoted on its base
in such a way that it can rotate freely both in the horizontal
and vertical directions producing yaw and pitch movement.
At both ends of the beam there are two rotors driven by two
brushless motors. The main rotor produces a lifting force, Fig. 3. Motor Assembly, Eletronic Speed Controller and Propeller
allowing the beam to rise vertically and making a rotation
around the pitch axis, while the tail rotor (the smaller one)
C. Microcontroller
is used to make the beam turn left or right around the yaw
axis. Figure 2 presents the 3D graphic design of the prototype We used the Launchpad platform Tiva R C 123C manufac-
structure developed in the computational tool SolidWorks R . tured by Texas Instruments R . This platform works with 32-
bit Cortex M4 microprocessors from the ARM R family with
A. Mechanical Structure Overview operating at up to 80MHz clock, besides features like PWM
To define some design issues, we consider a short time generator, Floating Point Unit, converters analog to digital,
availability for the construction stage, low cost, the pref- among others. The control signal for the motors is generated
erence for materials easily found in the market or even by the microcontroller through the PWM module. The PWM
the reuse of materials. The body of the prototype is made signal has a period of 20ms, but the motors speed is changed
of rigid wire of 3.4mm diameter and a 2.11mm is used by varying the duty cycle between 1ms and 2ms, that is,
for both propeller protection structures. This wire presents between 1ms and 2ms, the rotation varies proportionally, in
Observing the sign conventions stated at Figure 8, New- A. Linear Quadratic Regulator
ton’s law for the rotations gives the following nonlinear For small angles, one can approximate sin θ ≈ θ and
differential equation, cos θ ≈ 1, so that (9) can be simplified to
Iy θ̈ = −mgR sin ψ cos θ − mgR cos ψ sin θ + F1 r1 + βy θ̇ , (7) x2 (k) = H0 x2 (k − 1) + H1 + H2 x1 (k − 1) + H3 u1 (k − 1), (11)
which describes the dynamics of the prototype for 1 DOF. and a possible state space representation is given by
Iy is the inertia with respect to y-axis, m is the mass of
x1 (k + 1)
1 T
x1 (k)
the mobile set, g is the gravitational acceleration, R is the =
x2 (k + 1) H2 H0 x2 (k)
distance from the axis of rotation y to the center of mass,
Ψ is the angle formed between R and the z-axis, F1 is the 0 0
+ u1 (k) + ,
force generated by motor 1, r1 is the distance from motor 1 H3 H1
to z-axis and βy is the coefficient of friction on y-axis. The xk+1 = Axk + Buk + F. (12)
dynamics of the motor is approximated by a static system,
The state equation (12) is non-homogeneous, due to the extra
in such a way that F1 = k1 u1 , where k1 is the static motor
term F = [0 H1 ]T . Thus, it is necessary to carry out a
coefficient and u1 is the control signal.
variable exchange in order to eliminate it. For this purpose,
In order to estimate these parameters, let us set x1 = θ and
let us define
x2 = θ̇ = ωy , where θ is the pitch angle and ωy is the angle
rate in y-axis. Thus, the continuous-time model (7) can be uk = ulqr + ud , (13)
Angle (°)
Angle (°)
Angle (°)
Angle (°)
-20 -20 -20 -20
θ θ θ θ
-40 Setpoint -40 Setpoint -40 Setpoint
-40
Setpoint
-60 -60 -60 -60
0 2 4 0 2 4 0 2 4 0 2 4
Time (s) Time (s) Time (s) Time (s)
150 150 100 100
Velocity (°/s)
Velocity (°/s)
Velocity (°/s)
Velocity (°\s)
ωy ωy ωy ωy
100 100
50 50
50 50
0 0
0 0
-50 -50 -50 -50
0 2 4 0 2 4 0 2 4 0 2 4
Time (s) Time (s) Time (s) Time (s)
Control effort Control effort Control Effort Control Effort
Duty cycle(%)
Duty cycle(%)
Duty cycle(%)
Duty cycle(%)
40 40 40 40
20 20 20 20
0 0 0 0
0 2 4 0 2 4 0 2 4 0 2 4
Time (s) Time (s) Time (s) Time (s)
Fig. 11. Closed loop system response with LQG. Fig. 12. Closed loop system response with PID.
exceeded 40% of the duty cycle. It is also noted that the R EFERENCES
calculation of the cost functional (1), with Q and R given [1] R. E. Kalman, “A New Approach to Linear Filtering and Prediction
by (16), yields JLQG = 990.6 and JPID = 1008.6, indicating Problems”, ASME Journal of Basic Engineering, vol. 82, no. 1, pp.
in this case an advantage of the LQG even when the actual 35–45, March 1960.
[2] S. M. Ahmad, A. J. Chipperfield, and M. Tokhi, “Dynamic Modeling
dynamics of the system is not perfectly known. and Optimal Control of a Twin Rotor MIMO System”, in Proc. of the
IEEE 2000 NAECON, Dayton, Ohio, USA, Oct. 2000, pp. 391–398.
VII. CONCLUSIONS [3] A. Q. Khan, G. Mustafa, and N. Iqbal, “LQG/LTR Based Controller
Design for Three Degree of Freedom Helicopter/Twin Rotor Control
The application of control theory in the most diverse System”, in Proc. of the IEEE 2005 Pakistan Section Multitopic
Conference, December 2005, pp. 1–5.
simulation prototypes of real systems is essential for the [4] S. K. Pandey, and V. Laxmi, “Optimal Control of Twin Rotor MIMO
development of future control engineering professionals, pro- System Using LQR Technique”, in Proc. of the 2014 ICCIDM, Odisha,
viding means to develop in practice concepts and phenomena India, December 2014, pp. 11–21.
[5] A. Phillips, and F. Sahin, “Optimal Control of a Twin Rotor MIMO
predicted by theory, and stimulating the creativity of students System using LQR with Integral Action”, in Proc. of the IEEE 2014
in favor of complete understanding of the subject. For this WAC, Big Island of Hawaii, USA, August 2014, pp. 114–119.
reason, the availability of prototypes in experimental control [6] S. M. Ahmad, Modeling and Control of a Twin Rotor Multi-Input
Multi-Output System, PhD Thesis, Department of Automatic Control
laboratories is quite important. However, investing in control and Systems Engineering, University of Sheffield, UK, 2001.
laboratories requires a high cost to obtain educational proto- [7] D. Rotondo, F. Nejjari, and V. Puig, “Quasi-LPV Modeling, Iden-
types, which is one of the great obstacles to their creation. tification and Control of a Twin Rotor MIMO System”, Control
Engineering Practice, vol. 21, no. 6, pp. 829–846, June 2013.
In this sense, this paper shows the feasibility of developing [8] S. M. Ahmad, A. Chipperfield, and M. Tokhi, “Modelling and Control
a low cost prototype of a twin rotor for students in the areas of a Twin Rotor Multi-Input Multi-Output System”, in Proc. of the
of system identification, control theory and correlates, which IEEE 2000 ACC, Chicago, Illinois, USA, June 2000, pp. 1720–1724.
[9] P. Wen, and T.-W. Lu, “Decoupling Control of a Twin Rotor MIMO
can be replicated in other universities and thus disseminating System using Robust Deadbeat Control Technique”, IET Control
such academic topics in the practical scope. Theory and Applications, vol. 2, no. 11, pp. 999–1007, 2008.
The prototype developed was used for system identifica- [10] F. M. Aldebrez, I. Z. M. Darus, and M. O. Tokhi, “Dynamic Modelling
of a Twin Rotor System in Hovering Position”, in IEEE First ISCCSP,
tion experiments and controller comparison experiments, and Hammamet, Tunisia, March 2004, pp. 823–826.
the results allowed us to validate the use of the identified [11] I. Z. M. Darus, F. M. Aldebrez, and M. O. Tokhi, “Parametric
model for a LQG controller design, as well as to compare Modelling of a Twin Rotor System using Genetic Algorithms”, in
IEEE First ISCCSP, Hammamet, Tunisia, March 2004, pp. 115–118.
the performance of such controller with a PID tuned by [12] M. Pedley, Tilt Sensing using a Three-axis Accelerometer, Freescale
Genetic Algorithm. The LQG controller proved to be more Semiconductor Application Note, 2013, pp. 2012-2013.
appropriate in these early experiments. As future work, we [13] L. Ljung, System Identification: Theory for the User, Prentice Hall,
New Jersey, 1999.
suggest the implementation of a robust controller such as H2 [14] A. E. Bryson, and Y.-C. Ho, Applied optimal control: optimization,
or H∞ . estimation, and control, Hemisphere, Washington, DC, 1975.