Journal of Fuzzy Systems and Control, Vol. 2, No 2, 2024 |
Implementation of Fuzzy-PID Controller for 2-DOF Helicopter
Thanh-Do Huynh 1,*, Ngoc-Thanh Bach 2, Quang-Dao Le 3, Duong-Dong Le 4, Viet-Hoang Bui 5,
Hoai-An Vo 6, Viet-Nhat-Long Nguyen 7, Phi-Hung Pham 8, Huu-Dat Nguyen 9, Van-Dong-Hai Nguyen 10
1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Ho Chi Minh city University of Technology and Education (HCMUTE), Ho Chi Minh, Viet Nam
Email: 1 20151083@student.hcmute.edu.vn, 2 21142174@student.hcmute.edu.vn, 3 21142512@student.hcmute.edu.vn,
4 21151095@student.hcmute.edu.vn, 5 20142333@student.hcmutee.du.vn, 6 21151064@student.hcmute.edu.vn,
7 20151060@student.hcmute.edu.vn, 8 20145448@student.hcmute.edu.vn, 9 20161179@student.hcmute.edu.vn,
*Corresponding Author
Abstract— This article presents the model and control of a 2-DOF helicopter, a multi-input multi-output (MIMO) system that is set up in the laboratory. The conventional mathematical model, employing the Euler-Lagrange method, is utilized in this study to conduct the system modeling process. The transfer functions derived from this model are then incorporated into diverse control methodologies to optimize PID gain coefficients. The PID controllers are employed to control this system. In addition, we use a Fuzzy controller to adjust the Kp, Ki, and Kd coefficients of this PID. As a result, we obtain a fuzzy PID controller with superior control quality than a PID controller. Under Fuzzy-PID, the system operates more stably, overcoming some weaknesses of the PID linear controller. The state space model is built by considering specific design assumptions and simplifications. Results are obtained through simulation and testing on the model.
Keywords—Fuzzy-PID control; PID Control; 2 Dof-Helicopter; Brushless Motor
In robotics, there has been a notable increase in the use of Unmanned Aerial Vehicles (UAVs) in recent years. The most prominent of which is the helicopter system. Helicopters have diverse applications such as transportation, firefighting, traffic management, and entertainment [1]. However, it should be noted that helicopter systems pose significant challenges due to their nonlinear, highly interactive, and inherently unstable nature, making them particularly difficult to model. In this paper, we rely on [2],[7]-[10] with different rotation direction settings to create a different dynamic model. In addition, determining system parameters is a complex problem requiring multiple experiments. Therefore, most of the system parameters are referred to in [3], combined with the engine parameters we investigated. Helicopter systems provide a valuable foundation for the study of control algorithms.
Hence, this scientific article focuses on researching and developing the PID control system [4]-[6] and developing the Fuzzy-PID controller [2]-[16] for 2-DOF helicopters. By combining a mathematical model that is based on the Euler-Lagrange method and using a brushless motor, this study presents a control method for a MIMO system in simulation and experimental environments.
The research results are confirmed through simulations and experiments, thereby investigating and evaluating the quality of the Fuzzy-PID controller compared to the PID controller. This article not only employs a traditional PID but also formulates a fuzzy-PID nonlinear to address nonlinear and uncertain scenarios more adaptable.
In Fig. 1, the modeling of a 2-DOF helicopter into a mathematical model. The A coordinate axis represents the coordinate axis on the fuselage with accompanying x, y, and z axes.
The system comprises two identical propellers and brushless motors, which generate thrust
and
at distances
and
correspondingly, calculated from the origin of the vehicle body fixing frame. The front motor is placed vertically to create a force that moves the system's pitch angle. The engine at the rear is placed horizontally to create yaw angle motion. θ stands for the pitch angle, while ψ stands for the yaw angle. The input comprises the torque applied to two axes (
for pitch angle θ,
for yaw angle ψ) and uses
, and
to calculate the angular velocity for two Brushless to generate torque (w1 signifies the angular velocity of the front motor, while
represents the angular velocity of the rear motor), and the system outputs are the pitch and yaw angles. We have
as the moment impact on the yaw angle and
as the moment impact on the pitch angle. The motor's input is measured in amperes and exhibits an almost linear correlation with the torque produced by the rotating rotor. The system's mass is labeled as
, The distance from the center of gravity to the origin of the symbolic system is referred to as
. The moment of inertia when moving around two axes is
and
for tilt and horizontal motion. Thrust coefficient b, drag coefficient d gravity constant g, viscous friction coefficient μp and μy. viscous friction coefficients
and
, and thrust coefficient
, drag coefficient
.
Based on Lagrangian mechanics [4], we derive the modeling of the system using the following nonlinear equations. In which these abbreviations are used:
and
,
,
,
,
. The input of both motors is limited to approx. [0,10] N.
| (1) |
| (2) |
To ensure the 2-DOF helicopter can work, and conduct assigned tasks properly, a controller is required to be implemented into the system. This article designs and simulates PID and Fuzzy-PID algorithms to control two kinematic variables of the 2-DOF helicopter, which are θ and ψ.
PID controller is commonly applied in process control and industry, where it can be claimed to be one of the most favorable controllers. The advantage of PID is that it is easy to implement and tune. For the 2-DOF Helicopter, the PID controller works based on input signals to adjust the speed of all propellers to obtain the desired pitch angle. The PID controller acts as an error corrector, minimizing the difference between the set point and measured output. Fig. 2 represents a closed-loop system with two input signals, and output is the system response. In this diagram, the PID controller receives error signals between the set angles and the current angles of the system to calculate the control signal.
The error
is defined in (4) and the output
defined in (3),
is the set value,
is the present state or measured value [-90 – 90] degree. Simulation blocks of the PID are shown in Fig. 3.
| (3) |
| (4) |
PID structure is built based on (3). U1 is the control input of pitch, θ, and U2 is the control input of yaw, ψ.
| (5) |
| (6) |
| (7) |
| (8) |
The Fuzzy PID is implemented, which functions with two inputs and one output for each control angle in this investigation. The complete structure of this controller is illustrated in Fig. 3. In a fuzzy PID controller, a single output is associated with Kp, Ki, and Kd. Real variable intervals are determined through scaling factors denoted as E, DE, and U. The Fuzzy rules take the form of
. Table 1 encompasses all the rules employed in this study. The rule-based architecture adheres to the Mamdani style.
We have 2 inputs and 1 output in FLC: error (E), derivative error (DE), and output signal. The linguistic variables characterizing the input are categorized as NB, NS, ZE, PS, and PB. Meanwhile, the output linguistic variables are classified as NB, NM, NS, ZE, PS, PM, and PB. All of them are normalized internally in a range of values [-1, 1], as indicated in Fig. 4, Fig. 5, and Fig. 6.
Linguistic labels used to describe fuzzy sets include 'Large Negative' (NB), 'Mean Negative' (NM), 'Small Negative' (NS), 'Zero' (Z), 'Small Positive' ' (PS), 'Positive Means' (PM) and 'Large Positive' (PB). From these labels, we construct the rule table described in Table 1. The fuzzy rules are based on background knowledge and expert understanding of the system. They represent the relationships between inputs and outputs, thereby determining control rules. With each control input consisting of five fuzzy sets, up to 25 fuzzy rules can be generated. A complete diagram of the controller in the system is depicted in Fig. 7.
DU | E | |||||
NB | NE | ZE | PO | PB | ||
DE | NB | NB | NB | NM | NS | ZE |
NE | NB | NM | NS | ZE | PS | |
ZE | NM | NS | ZE | PS | PM | |
PO | NS | ZE | PS | PM | PB | |
PB | ZE | PS | PM | PB | PB | |
The inputs consist of E (Error) and DE (Derivative Error), while the outputs include
,
,
.
| (9) |
| (10) |
| (11) |
Inputs normalized in the range [-1;1] and output
interval [-0.2;0.2],
interval [-0.1;0.1],
interval [-0.05;0.05].
Based on the derived model and designed PID controller, simulations for 2-DOF Helicopter tracking are developed in MATLAB/Simulink environment. The time step for each simulation is set to 0.1s. Simulation is operated with constant input signal and square wave signal.
Parameters used for the system [3] are listed in Table 2. The initial conditions for the simulation are:
|
|
| |
θ | 2.15 | 1.26 | 0.845 |
ψ | 6 | 2.5 | 3.5 |
| (12) |
| (13) |
To assess the system's performance, a series of measurements has been conducted. Table 4 depicts how control quality differs between PID and Fuzzy-PID for 2-DOF helicopters. To evaluate in detail, we consider the following indicators: Rise time
, Overshoot
, and Stability time
.
Table 4 indicates that the Fuzzy-PID outperforms PID control. Fig. 8 and Fig. 9 further illustrate that the Fuzzy-PID controller exhibits faster rise time, low overshoot, and faster settling time than the PID controller in all the cases. This shows that a Fuzzy-PID controller will stabilize the system more than a PID controller and respond more effectively to system changes. From there, we have a basis to deploy the Fuzzy-PID in experiments.
The requested angles are
after then
.
The requested angles are
is a square pulse with an amplitude of 5°,
, and then
.
Parameter | Value | Unit | |
Jp | Pitch angle's moment of inertia | 0.0384 | kgm2 |
Jy | Yaw angle's moment of inertia | 0.0432 | kgm2 |
lcm | The distance from the body's reference point to the center of mass. | 0.186 | m |
m | Mass of system | 1.3782 | kg |
μp | Pitch viscous damping coefficient | 0.8 | N/V |
μy | Yaw viscous damping coefficient | 0.318 | N/V |
b | Thrust coefficient | 1.27x10-5 | Ns2 |
d | Drag coefficient | 1.23x10-7 | Nms2 |
g | Gravity | 9.81 | m/s2 |
Setpoints | PID controller | Fuzzy-PID Controller | |||||
Pitch | Yaw |
|
|
|
|
|
|
after then
|
after then
| 1.4 | 7.5 | 7 | 5 | 1 | 6 |
0.6 | 40 | 15 | 4 | 50 | 20 | ||
Square |
after then
| 2.7 | 50 | 10 | 4.5 | 20 | 5 |
0.66 | 50 | 21 | 2.8 | 10 | 4.9 | ||
*In each case, the characteristic of the pitch angle is first-order and that of the yaw angle is second-order.
The experimental model is reproduced in Fig. 10, the model design is based on reference [3]. In this model, there are 2 parts: The base is used to fix the fuselage and the plane is mounted on the base with the electrical circuit mounted on the base and along the body of the model.
Device’s components:
Desired angles are
after then
:
Fig. 11, Fig. 13, Fig. 15 and Fig. 17 show responses of two angles of the system with two controllers: Fuzzy-PID and PID according to each case of the set signal. Set-point signals are represented by the blue lines labeled "PITCH" and "YAW". The system responses under each controller are shown with the red line for PID and the green line for Fuzzy-PID. Fig. 12, Fig. 14, Fig. 16, and Fig. 18 shows the coefficients
,
, and
of the Fuzzy-PID according to time in each set signal case. In this scenario, the PID coefficients are fine-tuned using Fuzzy logic to enhance control quality in contrast to conventional PID control.
,
,
of the pitch angle
,
,
of the yaw angleThe requested angles are
, a square pulse with the largeness is
,
and then
.
,
,
of the pitch angle
,
,
of the yaw angleTable 5, derived from a set of measurements with similar characteristics as Table 4, serves to compare and validate the efficacy of PID and Fuzzy-PID. According to Table 5, Fuzzy-PID controller exhibits superior performance compared to PID controller, showcasing improved characteristics. With a fuzzy-PID controller, the system response improves in response to input changes due to lower system processing errors, shorter settling times, and reduced overshoot compared to the PID controller. By utilizing the error and error rate, the Fuzzy controller generates an adjustment coefficient for the PID controller, thereby enhancing system responsiveness. Addressing certain weaknesses of the PID controller, replacing PID with Fuzzy-PID may result in better system control.
Setpoints | PID controller | Fuzzy-PID controller | |||||
Pitch | Yaw |
|
|
|
|
|
|
after then
|
after then
| 4.5 | 7.5 | 7 | 5 | 1 | 6 |
2 | 40 | 15 | 4 | 50 | 20 | ||
Square |
after then
| 4.7 | 50 | 10 | 4.5 | 20 | 5 |
6.2 | 50 | 21 | 2.8 | 10 | 4.9 | ||
*In each case, the characteristic of the pitch angle is first-order and that of the yaw angle is second-order.
Based on the results, the total quality of the Fuzzy-PID tends to surpass that of the PID in Table 4 and Table 5, with the Fuzzy-PID controller showing significant improvement in control quality in two surveyed cases compared to the PID controller. Additionally, because the 2-DOF helicopter is nonlinear, a Fuzzy-PID controller can mitigate the drawbacks of a linear PID controller.
In the presence of substantial wind, helicopter fuselage experiences direct wind force, leading to altered aerodynamic forces on the rotor blades at high wind velocities. As a result, the system may deviate from its equilibrium position, particularly in Yaw. Nonetheless, all deviations remain manageable within the control range. Once the disturbance intensity stabilizes, the system promptly reverts to its equilibrium position.
Moreover, the application of Fuzzy PID has yielded positive and noteworthy results. This algorithm has outperformed traditional PID in controlling 2-DOF helicopters. Particularly, it has achieved significant improvements in overshoot reduction and system stability. The ability to adjust based on the level of error and error rate has significantly enhanced control performance compared to traditional PID.
The optimization process and parameter tuning of the Fuzzy PID controller have demonstrated flexibility and effectiveness in achieving optimal system performance. This method has high potential for application in various fields beyond 2-DOF helicopter balance, including automatic control systems, robotics, and industrial automation.
In summary, this study has demonstrated that replacing PID with Fuzzy PID yields better results in controlling 2-DOF helicopters. However, further research and development are needed to overcome the limitations of Fuzzy PID and optimize its performance under different operating conditions. Future directions may include combining Fuzzy-PID with other control algorithms to enhance flexibility efficiency. The operation of the model is shown in the link:
https://www.youtube.com/watch?v=XCX6zP0UwCI
Thanh-Do Huynh, Implementation of Fuzzy-PID Controller for 2-DOF Helicopter