Buletin Ilmiah Sarjana Teknik Elektro ISSN: 2685-9572
Implementation of a Synergetic Controller for a 2-DOF Helicopter on an Embedded Platform Using an STM32 Microcontroller
Nguyen Xuan Chiem 1, Tran Cong Phan 1, Pham Duy Thai 2, Bui Xuan Hai 1
1 Department of Automation and Computing Techniques, Le Quy Don Technical University, Hanoi, Vietnam
2 Department of Biomedical Engineering, Le Quy Don Technical University, Hanoi, Vietnam
ARTICLE INFORMATION | ABSTRACT | |
Article History: Received 01 May 2025 Revised 18 June 2025 Accepted 01 July 2025 | This study introduces the development of a synergetic control scheme for a two-degree-of-freedom (2-DOF) helicopter, integrated into an embedded system utilizing the STM32 microcontroller. A discrete-time controller is formulated for both pitch and yaw motion, relying on stable manifold design within the framework of synergetic control. Lyapunov-based analysis is used to ensure system stability. The controller is implemented on an STM32F4 device and coded in the C programming language. System performance is assessed through numerical simulations and real-time testing, with results demonstrating strong control precision and feasibility on the physical experimental platform. | |
Keywords: 2-DOF Helicopter; Synergetic Controller; Embedded System; Lyapunov Function; ADAR | ||
Corresponding Author: Bui Xuan Hai, Department of Automation and Computing Techniques, Le Quy Don Technical University, Hanoi, Vietnam. Email: buixuanhai.mta@gmail.com | ||
This work is licensed under a Creative Commons Attribution-Share Alike 4.0 | ||
Document Citation: N. X. Chiem, T. C. Phan, P. D. Thai, and B. X. Hai, “Implementation of a Synergetic Controller for a 2-DOF Helicopter on an Embedded Platform Using an STM32 Microcontroller,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 7, no. 2, pp. 253-269, 2025, DOI: 10.12928/biste.v7i2.13410. | ||
In recent years, there has been growing interest from both the academic community and industry in developing high-accuracy control solutions for small-scale aerial platforms such as the Two-Degree-of-Freedom (2-DOF) helicopter. The control challenges arise primarily from the system’s highly nonlinear behavior, strong inter-axis coupling, and vulnerability to external disturbances. These characteristics often limit the effectiveness of conventional control methods in ensuring stable and precise operation [1]–[14].
Since testing control algorithms on full-scale helicopters is not feasible in academic environments, various compact experimental models have been created for education and research in flight control. Among them, the two-degree-of-freedom (2-DOF) helicopter setup has gained popularity due to its simplicity and versatility [10]-[17]. Many control strategies—both linear and nonlinear—have been proposed for managing this system [18]-[69]. Traditional linear controllers such as Proportional-Integral-Derivative (PID), Linear Quadratic Regulator (LQR), and model-driven adaptive or optimal control techniques are frequently applied [18]-[25]. For example, the use of an adaptive LQR method on the Quanser 2-DOF platform is detailed in [22], while [24] presents an optimal LQR design for attitude stabilization. Another contribution [26] utilizes extended linearization techniques for trajectory tracking purposes. In addition, [27] proposes a Multi-step Q-learning (MsQL) approach to address output regulation challenges in the same system. Although linear methods are generally straightforward to implement, their performance often degrades under wide variations in operating conditions.
Due to the complex nonlinear behavior of helicopter systems and their high sensitivity to parameter uncertainties and environmental disturbances, designing effective control strategies presents significant challenges [28]-[50]. Traditional linear controllers often fall short when it comes to meeting the stringent demands of real-world applications [51]-[73]. In response, recent studies have increasingly emphasized the formulation of adaptive and robust nonlinear control approaches to better manage system nonlinearities and external variations. For example, [36] proposed a backstepping method using saturation-based feedback to enhance trajectory tracking. In a related effort [37], an adaptive nonlinear backstepping technique was developed to individually manage pitch and yaw dynamics. Additionally, [60] introduced a fractional-order sliding mode control (SMC) approach applied to the Quanser AERO 2-DOF platform, where a specially designed sliding surface helped reduce chattering effects. Other works [72][73] have explored synergetic control frameworks employing varied manifold structures tailored to this system.
Synergetic control, a contemporary nonlinear control methodology, has proven highly effective for stabilizing complex dynamic systems. By designing appropriate control manifolds, this approach ensures global convergence of system trajectories and offers strong resistance to external disturbances [72]-[89]. The foundational principles of synergetic control were pioneered by Professor A. A. Kolecnikov and his team, as elaborated in works [74]-[79]. Numerous engineering applications have successfully adopted this control framework [80]-[89], consistently demonstrating its advantages over traditional control techniques in terms of robustness and performance. Concurrently, the deployment of advanced control algorithms on high-performance yet cost-effective embedded platforms, such as STM32 microcontrollers, has become increasingly widespread. This trend is driven by the STM32’s powerful processing capabilities, comprehensive hardware features, and ease of integration into real-time systems.
This research aims to develop and deploy a synergetic control approach for a 2-DOF helicopter, implemented on an STM32 microcontroller-based embedded system. The goal is to verify its applicability and performance when subjected to realistic operational limitations. The main contributions of this paper include: (1) constructing a mathematical representation of the 2-DOF helicopter model tailored for the application of synergetic control; (2) designing a discrete-time synergetic controller that ensures both stability and desired performance; (3) coding and executing the control strategy using the C programming language on the STM32 platform, and integrating it with the actual helicopter system; and (4) conducting real-time experiments to evaluate the system’s tracking capability, accuracy, and robustness in practical conditions.
The rest of the paper is organized as follows. Section 2 introduces the mathematical modeling of the 2-DOF helicopter. In Section 3, an in-depth explanation of synergetic control theory is provided, followed by the formulation of a discrete-time controller specifically adapted to the system’s dynamics. Section 4 focuses on the practical implementation of the control algorithm using an STM32 microcontroller, detailing the experimental setup, test procedures, and performance analysis. Finally, Section 5 summarizes the findings and suggests potential directions for future enhancements.
The two-degree-of-freedom (2-DOF) helicopter model comprises a beam mounted on a base that permits independent rotations around both the vertical and horizontal axes, as shown in Figure 1. At each end of the beam, a brushless DC (BLDC) motor drives a rotor—one functioning as the main rotor and the other as the tail rotor. By adjusting the speed of these motors, the system can achieve motion in the elevation (pitch) and azimuth (yaw) directions [65]-[73].
Figure 1. Dynamics of the 2-DOF Helicopter
The structure of a brushless DC (BLDC) motor is similar to that of a permanent magnet synchronous machine. However, due to the placement of the permanent magnets on the rotor, there are certain differences in the dynamic characteristics. The armature winding model of the BLDC motor is described as follows. By applying Kirchhoff’s voltage law to the three-phase BLDC motor and neglecting mutual inductance [89][90], we obtain:
(1) | ||
where ,
,
denote the input voltages for phases
,
, and
, respectively;
,
,
represent the corresponding phase currents; L and R represent the phase inductance and resistance; and
,
,
are the back electromotive forces (EMFs) induced in each phase. The generated torque is affected by the presence of permanent magnets, owing to the trapezoidal nature of the flux linkage. As a result, the torque can be expressed as:
(2) |
The resulting torque can be calculated as follows:
(3) | ||
Where, is rotor angle in electrical degree ;
is rotor speed (rad/sec);
is rotor angle mechanical:
(4) |
The dynamic equation of the motion system, including friction, load torque, and inertia, is:
(5) |
Where, is Electric Torque,
is Load (Mechanical) Torque,
is friction constant,
is Rotor Inertia. The rotational speed of the motor is synchronized with the speed of the propeller mounted on the rotor and generates thrust along the pitch and yaw axes of the 2-DOF helicopter model.
The 2-DOF helicopter system is modeled using a number of simplifying assumptions [18],[73]:
As depicted in Figure 1, the model includes two thrust components: and
, which are exerted along the pitch and yaw directions, respectively. These torques are applied at distances
and
from their corresponding rotational axes. The helicopter experiences a gravitational force
acting downward at the nose. The center of mass is offset by a distance
(m) from the pitch axis along the longitudinal body of the helicopter. By applying coordinate transformations, the location of the center of mass is expressed using generalized coordinates as follows:
(6) |
The formula used to calculate gravitational potential energy is:
(7) |
The formula for calculating total kinetic energy due to moments of inertia is as follows
(8) |
Where:
(9) | ||
Let and
denote the total rotational kinetic energies associated with the pitch and yaw axes, respectively, while
represents the translational kinetic energy due to the motion of the system's center of mass. The terms
and
refer to the equivalent moments of inertia for the pitch and yaw motors. By taking the time derivatives of the equations given in (6), and substituting the resulting expressions into equations (9) and (8), we can derive the complete expression for the system's total kinetic energy as follows:
(10) |
Based on the Euler-Lagrange equations of motion, we have:
(11) | ||
Where the Lagrangian function is defined as
, calculated from (10) and (7), as follows:
(12) |
The corresponding generalized forces are given by
The parameters and
represent the damping coefficients associated with rotational motion about the pitch and yaw axes, respectively. The torques exerted on these axes are given by:
In this context:
These cross-coupling torques arise due to the spatial configuration and aerodynamic interactions between the two rotors. The torque components are identified and quantified as follows:
(13) | ||
From equations (11), (12), and (13), we obtain:
(14) |
Simplifying equation (14), we obtain:
(15) |
Similarly to the pitch axis, the equation of motion for the yaw axis is derived as follows:
(16) |
According to the dynamic behavior of the BLDC motors, when their response times are significantly faster than those of the pitch and yaw axes, the torques exerted on the system can be approximated as:
|
Here, and
represent the input voltages applied to the pitch and yaw BLDC motors, respectively. The constants
and
denote the thrust coefficients for the pitch and yaw motors, whereas
and
account for the cross-axis torque effects induced by the yaw motor on the pitch axis and vice versa. For implementation on embedded digital platforms, the continuous-time model is converted into discrete-time form. Employing a finite-difference approach with a sampling interval
, and based on the equations (15) and (16), the discrete-time representation of the system dynamics is obtained as follows:
(17) | ||
(18) |
The values ,
are calculated from the torques
,
according to the following formulas:
(19) |
The discrete synergetic controller is developed using the Analytical Design of Aggregate Regulators (ADAR) framework. This approach involves a systematic design methodology, which can be outlined in the following key steps. Consider a nonlinear discrete-time system governed by a general difference equation of the form:
(20) |
Where is the state vector, and
is the control input vector.
The initial step involves defining a macro variable (also referred to as a manifold) as a function of the system's state at time step kkk, expressed as . The objective of the control law is to constrain the system dynamics such that the trajectory remains on the manifold, i.e.,
. The structure of this macro variable can be tailored by the designer based on specific performance criteria or control objectives [72]–[79].
In practice, the macro variable may be chosen as a linear combination of the state variables for simplicity. This procedure can be extended to multiple control loops by introducing additional manifolds for each control direction. The evolution of each macro variable is typically governed by a dynamic equation of the form given in (10), which defines the desired closed-loop behavior.
(21) |
Here, is a tunable parameter that governs how quickly the system states converge to the manifold defined by the macro-variable. Equation (10) serves as the foundation for deriving the control input
. To summarize, the introduction of each synergetic manifold imposes an additional constraint within the state-space, effectively lowering the system’s dynamic order and guiding its evolution toward overall asymptotic stability.
The control objective for stabilizing the 2-DOF helicopter system is to ensure the helicopter remains stable at the desired position. In this paper, the synergetic control law synthesis method is applied independently for each pitch and yaw channel. According to synergetic control theory, the authors select the invariant manifold for the pitch channel corresponding to the control objective as follows:
(22) |
As the initial step in the control design, the mathematical model presented in equation (17) is analyzed. It is observed that variations in the control inputs influence the behavior of the pitch dynamics. Consequently, the first synergetic manifold is constructed to reflect this coupling effect and is defined as:
(23) |
Here, the condition ensures that the manifold described in equation (23) asymptotically converges to the target reference value
, while remaining within the operational bounds of the system. Following the control design methodology previously outlined, the macro-variable
is required to fulfill the solution of the associated canonical functional equation, which governs the desired evolution of the manifold dynamics:
(24) |
Substituting expression (23) into equation (24), we obtain:
(25) |
Substituting equation (17) into equation (25), the control law for the pitch channel is obtained as follows:
(26) | ||
Similarly, the control law for the yaw channel is derived as follows:
(27) | ||
From the control laws for the pitch axis (26) and the yaw axis (27), based on equation (19), the control voltage laws ,
for each motor along the respective axes are obtained.
A Lyapunov function is selected in the following form:
(28) |
The variation of 𝑉 along the solution of equations (17) and (18) with the control law is given by:
(29) |
Substituting the manifold form (23) for the pitch and yaw channels into (29), we obtain:
(30) |
Simplifying equation (30), we obtain:
(31) |
According to the condition in expression (24), we have , implying that the system is stable in the Lyapunov sense.
To validate the effectiveness of the proposed control strategy applied through the input signals up,k and uy,k, a series of experiments were conducted. The experimental platform consists of a custom-built 2-DOF helicopter prototype, along with a complete test bench and instrumentation setup. Figure 2 and Figure 3 illustrate the hardware configuration and the experimental arrangement used in the study.
Figure 2. The physical model of the 2-DOF helicopter: (1) Base, (2) Pitch axis BLDC motor, (3) Yaw axis BLDC motor (4) Pitch angle encoder, (5) Pitch angle encoder, (6) BLDC motor drivers (ESC), (7) STM32F411 board, (8) Power 24V, (9) pan-tilt frame
Figure 3. Block diagram of the experimental setup to validate the control law results
The system consists of a 2-DOF helicopter frame, two rotary encoders (AMC3808-001G, 500 P/R), two power amplifier circuits for controlling ESCs (EMAX BLHeli Series 30A), two BLDC motors (EMAX 2213), and a 12V 100A power supply (LITEON). An STM32F411 embedded board is used as the main controller of the system. The STM32F411 operates at a system frequency of up to 100 MHz and features a high-performance 32-bit CPU. Its wide range of peripheral interfaces enables not only efficient data processing but also facilitates the design of real-time embedded control systems. The control program is written in the C programming language using STM32CubeIDE. Experimental data are transmitted and displayed via UART communication at a baud rate of 9600.
The 2-DOF helicopter includes two BLDC motors (labeled 2 and 3), each equipped with a propeller mounted at opposite ends of the shaft along the pitch and yaw axes. These are attached to a pan-tilt frame (9). Two encoders (4 and 5) are mounted on the pitch and yaw axes of the frame to measure angular positions. The pan-tilt frame is rigidly mounted to the support bracket (1) via a motor flange coupling. The STM32F411 embedded board (7) receives feedback signals from the encoders and, based on the control algorithm described earlier, generates PPM pulse control signals to drive the BLDC motor drivers (6). The entire system is powered by a 12V DC source (8).
In this section, we present the implementation of the control law on an embedded control system using the C programming language. To deploy the control law on the embedded platform (STM32F411 microcontroller), the aforementioned formulas are implemented using the following C code snippet:
|
The structural parameters of the 2-DOF helicopter system are approximately identified based on the actual model, as shown in Table 1. The parameters of the proposed controller are selected experimentally through a trial-and-error process, with the following values: = 0.006,
= 0.6,
= 1,
= 0.02,
= 0.4,
= 1. The sampling time used in the embedded control program is
= 0.02 seconds. Two experimental scenarios are designed as follows:
Table 1. System Parameters
Symbol | Parameter | Value | Unit |
Equivalent moment of inertia around the pitch axis | 0.046 | kg·m2 | |
Equivalent moment of inertia around the yaw axis | 0.046 | kg·m2 | |
Mass of the helicopter body | 0.75 | kg | |
Viscous damping coefficient in the pitch direction | 0.01 | N/V | |
Viscous damping coefficient in the yaw direction | 0.01 | N/V | |
Distance from the system's center of mass to the mounting frame point | 0.04 | m | |
Pitch-axis torque constant generated by the pitch motor | 0.198 | N·m/V | |
Pitch-axis torque contribution from the yaw motor | -0.008 | N·m/V | |
Yaw-axis torque contribution from the pitch motor | -0.014 | N·m/V | |
Yaw-axis torque constant produced by the yaw motor | 0.056 | N·m/V | |
Acceleration due to gravity | 9.8 | m/s2 |
In this scenario, the helicopter system is held at its nominal equilibrium position and subjected to simulated external disturbances. These disturbances are introduced manually, following a predefined sequence: an upward force is applied along the pitch axis (positive direction), a forward force along the yaw axis (positive direction), and a combined disturbance in the negative direction for both axes simultaneously.
Figure 4 and Figure 5 illustrate the system’s dynamic response, showing the variations in the pitch angle () and yaw angle (
) alongside the corresponding control signals
and
applied to the motors. A summary of key response characteristics is provided in Table 2, and Figure 6 includes a sequence of images capturing the physical behavior of the system during disturbance events.
Figure 4. Pitch and yaw angle responses of the system under external disturbance
Figure 5. Control signals supplied to the pitch and yaw motors of the system under external disturbance
Figure 6. Illustrative images of the system’s response at moments of external disturbance: (a) around the 10th second; (b) around the 21rd second; (c) around the 34th second
Tabel 2. Response of proposed controllers in Scenario 1
Variable | Time (9-21 s) | Time (21-34 s) | Time (34-45 s) | |||
Pitch | Yaw | Pitch | Yaw | Pitch | Yaw | |
Peak oscillation amplitude (rad.) | 0.213 | 0.031 | -0.022 | 0.3 | 0.443 | 0.09 |
Settling Time (s) | 3.5 | 3.0 | 2.7 | 8 | 4.5 | 6.0 |
Steady-state Error (rad.) | ±0.005 | ±0.005 | -0.005 | 0.01 | ±0.006 | ±0.003 |
From 0 to 10 seconds, the system remains in a stable state with minimal angular oscillations around the equilibrium position. However, noticeable disturbances occur at approximately 10 seconds, 21 seconds, and most significantly at 34 seconds, affecting both the pitch and yaw channels. Specifically, at around 10 seconds, the pitch angle spikes to approximately 0.2 rad. At about 21 seconds, the yaw angle
increases sharply to around 0.3 rad. The most significant response is observed at approximately 34 seconds, when external disturbances drive both pitch and yaw angles down to -0.1 rad. The system immediately reacts by correcting the deviation, with θ peaking at nearly 0.45 rad and
reaching up to 0.15 rad, before gradually returning to a stable state. Despite the presence of disturbances, the system in all scenarios rapidly returns to a stable state within approximately 3–5 seconds, demonstrating the controller’s fast and precise response capability. Corresponding to these responses, the control signals
and
clearly reflect the controller’s efforts to compensate for deviations and maintain trajectory tracking.
The control signal exhibits oscillation amplitudes ranging from 1.8 (V) to approximately 3.5 (V) and contains numerous high-frequency control pulses, which can be attributed to the relatively large quantization interval. At around 34 seconds, a significant control pulse appears in the pitch channel with an amplitude nearing 6 (V), coinciding with the peak deviation of θ. In contrast, the control signal
remains relatively stable, fluctuating steadily within the range of 2–3 (V) without exhibiting large spikes. These results confirm that the control system effectively tracks the desired trajectory and promptly recovers from external disturbances.
The system begins at position A. At 11 seconds, it transitions to position
, then moves to position
after 20 seconds, and finally returns to the initial position A. The system responses are illustrated in Figure 7, Figure 8, Figure 9, and summarized in Table 3.
Figure 7 presents the time responses of the pitch angle and yaw angle
of the 2-DOF helicopter system. The results indicate that the system responds distinctly to the reference changes occurring at approximately 11 s, 31 s, and 51 s. Specifically, at around 11 seconds, the pitch angle
overshoots to more than 0.5 radians before rapidly settling to the target value of approximately
radians, while the yaw angle
remains near zero. Similarly, at approximately 31 seconds, the yaw angle
undergoes a significant step change, rising to nearly 0.4 radians before quickly converging to the steady-state value of
, while the pitch angle remains nearly constant. At 51 seconds, both angles decrease sharply toward 0 radians, demonstrating the system's ability to return to the equilibrium state with accurate tracking performance.
Figure 8 displays the control voltage signals applied to the two motors responsible for controlling the pitch axis () and yaw axis (
). The control signals exhibit a sensitive response to setpoint changes: at each transition point (11 s, 31 s, and 51 s), both
and
show sharp voltage spikes, corresponding to increased torque required for rapid angle adjustments. Following these initial spikes, the signals oscillate slightly around their respective average values, thereby maintaining system stability. Notably, the voltage peaks remain within the control limit (approximately 6 V), demonstrating that the controller operates effectively within a safe and constrained range.
Figure 9 illustrates the system’s trajectory as the setpoints move through positions A, B, and C, before returning to A. The simulation results confirm that the proposed control system can regulate the pitch and yaw angles accurately and rapidly, producing appropriate voltage responses without introducing significant oscillations after the transient phase. These findings validate the effectiveness of the control algorithm in stabilizing and guiding the 2-DOF helicopter system. However, in both experimental scenarios, the control signals at the equilibrium position exhibit pulse-like behavior, which may be attributed to the relatively large sampling period of 0.02 seconds used in the embedded control implementation.
Figure 7. Response of the system’s pitch and yaw angles when the setpoint values change
Tabel 3. Response of proposed controllers in Scenario 2
Variable | Time (10-30 s) | Time (30-50 s) | Time (50-60 s) | |||
Pitch | Yaw | Pitch | Yaw | Pitch | Yaw | |
Settling Time (s) | 3.2 | 2.8 | 2.2 | 4.0 | 3.5 | 3 |
Steady-state Error (rad.) | -0.002 | 0.0 | -0.002 | -0.002 | 0.001 | 0 |
Percent Overshoot (%) | 100 | 67 | 0 | 0 | ||
Peak oscillation amplitude (rad.) | 0.107 | -0.001 | ||||
Figure 8. Control signals of the system when the setpoint values change
Figure 9. Illustration of the system's response to changes in setpoint values: (1)(2)(3) – Movement from A to B; (4)(5)(6) – Movement from B to C; (7)(8)(9) – Movement from C to A
This study has introduced the development, deployment, and experimental assessment of a discrete-time synergetic controller tailored for a 2-DOF helicopter platform. The controller was implemented on an STM32-based embedded system, leveraging the synergetic control framework for its robustness in handling nonlinear behaviors, mitigating external disturbances, and accommodating parameter uncertainties. The method ensures stable system behavior and delivers rapid dynamic response in both stabilization and reference tracking scenarios. Experimental validation demonstrates that the proposed control scheme provides accurate regulation of both pitch and yaw movements. The system operates reliably in real-time conditions and exhibits low computational overhead, making it a viable option for embedded applications with limited processing resources. The integration on the STM32 microcontroller further confirms the practical feasibility of the approach in real-time embedded control environments. Prospective enhancements include the incorporation of high-resolution inertial sensors, the extension of the control framework to address higher-order discrete models, and the adoption of intelligent control paradigms such as fuzzy inference systems or neural network-based adaptation to better handle complex operating conditions. Additionally, refining the controller's sampling strategy and optimizing embedded code execution are expected to mitigate transient oscillations near steady-state conditions.
REFERENCES
AUTHOR BIOGRAPHY
Implementation of a Synergetic Controller for a 2-DOF Helicopter on an Embedded Platform Using an STM32 Microcontroller (Nguyen Xuan Chiem)