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,

10 hainvd@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

  1. Introduction

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.

  1. mathematical model

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.

  1. Modeling the system [3]

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)

  1. Controller

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 ψ.

  1. PID

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.

  1. 2-DOFs block diagram of PID control

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.

  1. Diagram illustrating simulation blocks for a PID

(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)

  1. Fuzzy-PID

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.

fuzzy_E

  1. Input variable E

  1. Input variable DE

  1. Output variable U

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.

  1. Fuzzy rule

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

  1. Simulation of Fuzzy-PID

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].

  1. Result and discussion

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.

  1. Simulation Result

Parameters used for the system [3] are listed in Table 2. The initial conditions for the simulation are:

  1. PID Values

θ

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 .

  1. The PID‘s response to the signal remains consistent

The requested angles are  is a square pulse with an amplitude of 5°, , and then .

  1. The PID‘s response to the signal follows a waveform pattern
  1. System specifications

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

  1. Performance comparison in simulation

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.

  1. Experimental Model

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.

  1. Experimental model

Device’s components:

  1. 12V beehive power source.
  2. Front brushless motor.
  3. Behind the brushless motor.
  4. Arduino Uno R3 microcontroller.
  5. Mpu 6050 rotation sensor.

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.

  1. System feedback pitch angle

  1. Coefficients , ,  of the pitch angle

  1. System feedback yaw angle

  1. Coefficients , ,  of the yaw angle

The requested angles are , a square pulse with the largeness is  ,  and then .

  1. System feedback pitch angle

  1. Coefficients , ,  of the pitch angle

  1. System feedback pitch angle

  1. Coefficients , ,  of the yaw angle

Table 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.

  1. Experimental performance comparison.

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.

  1. Discussion

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.

  1. conclusion

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 

References
  1. A. C. Aras and O. Kaynak, "Trajectory tracking of a 2-DOF helicopter system using neuro-fuzzy system with parameterized conjunctors," 2014 IEEE/ASME International Conference on Advanced Intelligent Mechatronics, pp. 322-326, 2014, https://doi.org/10.1109/AIM.2014.6878099.
  2. M. Hernandez-Gonzalez, A. Y. Alanis, and E. A. Hernández-Vargas, “Decentralized discrete-time neural control for a Quanser 2-DOF helicopter,” Applied Soft Computing, vol. 12, no. 8, pp. 2462-2469, 2012, https://doi.org/10.1016/j.asoc.2012.02.016.
  3. S. Labdai, L. Chrifi-Alaoui, S. Drid, L. Delahoche and P. Bussy, "Real-Time Implementation of an Optimized Fractional Sliding mode Controller on the Quanser-Aero helicopter," 2020 International Conference on Control, Automation and Diagnosis (ICCAD), pp. 1-6, 2020, https://doi.org/10.1109/ICCAD49821.2020.9260546.
  4. A.P. S. Ramalakshmi, P. S. Manoharan, and P. Deepamangai, “PID tuning and control for 2-DOF helicopter using particle swarm optimization,” In Swarm, Evolutionary, and Memetic Computing: 4th International Conference, SEMCCO 2013, Chennai, India, December 19-21, 2013, Proceedings, Part I 4, pp. 662-672, 2013, https://doi.org/10.1007/978-3-319-03753-0_59.
  5. A. P. S. Ramalakshmi and P. S. Manoharan, "Non-linear modeling and PID control of twin rotor MIMO system," 2012 IEEE International Conference on Advanced Communication Control and Computing Technologies (ICACCCT), pp. 366-369, 2012, https://doi.org/10.1109/ICACCCT.2012.6320804.    
  1. S. K. Pandey and V. Laxmi, "Control of twin rotor MIMO system using PID controller with derivative filter coefficient," 2014 IEEE Students' Conference on Electrical, Electronics and Computer Science, pp. 1-6, 2014, https://doi.org/10.1109/SCEECS.2014.6804451.
  2. M. I. Uddin, R. K. Sharma, R. Kumar and E. Deenadayalan, "Adaptive Backstepping Control of 2-DOF Helicopter System Under Parametric Uncertainty," 2023 International Conference on Power, Instrumentation, Control and Computing (PICC), pp. 1-6, 2023, https://doi.org/10.1109/PICC57976.2023.10142491.
  3. W. Gao and Z. -P. Jiang, "Data-driven adaptive optimal output-feedback control of a 2-DOF helicopter," 2016 American Control Conference (ACC), pp. 2512-2517, 2016, https://doi.org/10.1109/ACC.2016.7525294.  
  4. Q. Ahmed, A. I. Bhatti, S. Iqbal and I. H. Kazmi, "2-sliding mode based robust control for 2-DOF helicopter," 2010 11th International Workshop on Variable Structure Systems (VSS), Mexico City, Mexico, 2010, pp. 481-486, 2010, https://doi.org/10.1109/VSS.2010.5544531.
  5. S. S. Butt, R. Prabel and H. Aschemann, "Multi-variable flatness-based control of a helicopter with two degrees of freedom," 2014 International Conference on Control, Decision and Information Technologies (CoDIT), Metz, France, 2014, pp. 321-326, 2014, https://doi.org/10.1109/CoDIT.2014.6996914.
  1. H. Tahersima and A. Fatehi, "Nonlinear identification and MIMO control of a laboratory helicopter using genetic algorithm," 2008 Annual IEEE India Conference, Kanpur, India, 2008, pp. 286-291, 2008, https://doi.org/10.1109/INDCON.2008.4768841.
  2. N. Johnson and S. K. Kannan, “Adaptive trajectory control for autonomous helicopters,” Journal of Guidance, Control, and Dynamics, vol. 28, no. 3, pp. 524–538, 2005, https://doi.org/10.2514/1.6271.
  3. L. Zhang, Shaojie Bi and Hong Yang, "Fuzzy-PID control algorithm of the helicopter model flight attitude control," 2010 Chinese Control and Decision Conference, pp. 1438-1443, 2010, https://doi.org/10.1109/CCDC.2010.5498216.
  4. I. Anshory, I. Robandi, W. Wirawan, and J.  Jamaaluddin, “Identification and implementation hybrid fuzzy logic and PID controller for speed control of BLDC motor,” In Journal of Physics: Conference Series, vol. 1402, no. 3, p. 033080, 2019, https://doi.org/10.1088/1742-6596/1402/3/033080.
  5. Maouche and I. Eker, “Adaptive Fuzzy Type-2 in Control of 2-DOF Helicopter,” International Journal of Electronics and Electrical Engineering, vol. 5, no. 2, pp. 99-105, 2017, https://doi.org/10.18178/ijeee.5.2.99-105.
  6. M. Öztürk and I. Özkol, “Comparison of self-tuned Neuro-Fuzzy controllers on 2 DOF helicopter: an application,” SN Applied Sciences, vol. 3, no. 1, p. 124, 2021, https://doi.org/10.1007/s42452-020-03984-5.

Thanh-Do Huynh, Implementation of Fuzzy-PID Controller for 2-DOF Helicopter