Embedded control system for three-degree-of-freedom helicopter

Publisher:幸福梦想Latest update time:2011-05-24 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The three-degree-of-freedom helicopter can be used in semi-physical simulation tests and performance tests of aircraft control systems to simulate the state of a horizontal helicopter, i.e., a tilt-rotor aircraft [1]. Its control system is a typical multi-input-multiple-output system with nonlinearity and strong cross-coupling. It is not easy to describe with transfer functions and state equations and is a relatively complex controlled object in the control system [2, 3]. The three-degree-of-freedom helicopter platform equipped in the laboratory adopts a control scheme of PC + motion control card. The motion control card measures and controls the flight attitude of the three-degree-of-freedom helicopter platform in real time, and the calculation of the control quantity is completed by the PC [4]. This scheme deviates from the flight control system scheme of a real helicopter. To this end, this paper redesigns the control system of the three-degree-of-freedom helicopter using an embedded design method. On this basis, the pitch angle and lateral angle of the external flight joystick are changed and used as command signals to control the flight attitude of the three-degree-of-freedom helicopter platform in real time. By controlling the shortcut keys on the flight joystick, the system can switch between the three working modes of "assisted control", "full automatic driving" and "leveling".
1 System working principle
1.1 Overall scheme of the system
The overall scheme of the system is shown in Figure 1. The three-degree-of-freedom helicopter is driven by two DC brushless motors, simulating the helicopter state of a horizontal helicopter, that is, a tilt-rotor aircraft [1].

The three-degree-of-freedom helicopter can rotate around three mutually perpendicular axes, which correspond to the pitch angle, lateral angle and heading angle of the helicopter model. The flight joystick uses the Mirage 318 flight joystick of Beitong Company. The pitch and lateral rotation of the joystick is used to output a DC voltage corresponding to the pitch angle and lateral angle of the joystick, which is used to control the pitch angle and lateral angle command signal of the three-degree-of-freedom helicopter; the button on the joystick handle is used to output a pulse signal to control the three-degree-of-freedom helicopter to switch between different working modes.
1.2 System working mode
The system has three working modes: auxiliary control (with manual operation), full automatic driving (unmanned operation), and (forced) leveling [5]. The switching of various working modes is realized by several shortcut buttons on the flight joystick.
1.2.1 Auxiliary control
The pitch and tilt of the flight joystick are manually controlled as the command signals of the pitch angle and lateral angle of the three-degree-of-freedom helicopter, and the embedded controller realizes the overall control according to the PID control law of closed-loop feedback.
This working mode is used to simulate the manned state of the aircraft. At this time, the flight control system assists the pilot in manipulating the aircraft through the joystick, which can reduce the operator's workload; at the same time, the aircraft is controlled and stabilized, which not only ensures the stability of the aircraft, but also resists external interference such as gusts, and reduces the impact of disturbances on flight quality.
1.2.2 Fully automatic driving
The control of the system by the flight joystick is shielded. The system uses the current values ​​of the pitch angle and lateral angle of the three-degree-of-freedom helicopter at the time of entering this working mode as the command signal, and the embedded controller realizes the overall control according to the PID control law of closed-loop feedback.
This working mode is used to simulate the unmanned fully automatic flight state of the aircraft. When the pilot manually controls the aircraft to the ideal flight attitude, enter this mode by switching the button, and the flight control system stabilizes the current value of the flight attitude to ensure that the aircraft flies according to the various attitude angles, speeds, altitudes, and headings when it just enters this state; at the same time, the aircraft is controlled and stabilized to improve flight quality. This working mode highlights the function of the flight control system, which can greatly reduce the workload of the pilot and reduce fatigue.
1.2.3 Leveling
The system forces the command values ​​of the pitch angle and the lateral angle to be 0, and the control of the flight stick to the system is shielded, so as to force the pitch angle and lateral angle of the three-degree-of-freedom helicopter to be 0, and realize the horizontal stable operation of the three-degree-of-freedom helicopter.
This working mode is used to simulate the leveling function of the flight control system. When the pilot encounters an emergency (such as the pilot is injured, etc.), this function can be used to easily change the aircraft from any attitude to a stable state of uniform level flight. Of course, this function can also be used in the process of the pilot leveling the aircraft at ordinary times, that is, the "leveling" mode can facilitate the pilot's operation.
1.3 System Function Module
Based on the scheme in Figure 1, the overall strategy for the system to realize the "auxiliary control" function can be formulated, as shown in Figure 2.
As shown in Figure 2, the embedded controller of the three-degree-of-freedom helicopter platform as a whole includes two functions: interface and control. The interface function corresponds to the three functional modules of ADC sampling, rotary encoder decoding, and PWM output in Figure 2. The control function is to calculate the control signal using the PID control method based on the feedback system, which corresponds to the PID control function module in the figure.

By modifying Figure 2, we can obtain the implementation method of the "full automatic control" and "leveling" working modes of the embedded controller. The difference lies in the different sources of the closed-loop control system command signal. In these two modes, the command signal in Figure 2 is no longer given by the joystick, and the function of the joystick is shielded. In the "full automatic control" mode, the command signal is the measured value output by the three-degree-of-freedom helicopter platform when it just enters the working mode; in the "leveling" mode, the command signals of the pitch angle and the lateral angle are both 0.
2 Hardware and software design
2.1 Hardware design
The main body of the hardware part is the embedded control box. The control box consists of three parts: EasyARM1138 development board [6], signal conditioning board and chassis shell.
2.1.1 EasyARM1138 development board
EasyARM1138 uses a 32-bit ARM Cortex-M3 core and has rich interface resources. The specific configuration is as follows:
(1) Use the two ADC ports (ADC0, ADC1) of EasyARM1138 to measure the analog voltage signal input by the flight stick, and use software to proportionally convert it into the corresponding angle signal, thereby realizing the measurement of the command angle signal of the flight stick.
(2) Use the three GPIO ports (PB0, PF6, PF4) of EasyARM1138 to measure the output pulse of the pitch angle signal of the three-degree-of-freedom helicopter, and the three GPIO ports (PB2, PF1, PF2) to measure the output pulse of the lateral angle signal of the three-degree-of-freedom helicopter. Through software programming, the interrupt method is used to realize pulse counting, thereby realizing the measurement of the flight attitude of the three-degree-of-freedom helicopter.
(3) Use the Time2 module of EasyARM1138 to generate PWM signals, configure TimerA and TimerB in the Timer2 module as 16-bit down counters, and use the PWM outputs of the two GPIO ports (PF7 and PC4) on the corresponding EasyARM1138 as control signals for the two DC brushless motors of the three-degree-of-freedom helicopter. By adjusting the matching values ​​in TimerA and TimerB, the input voltage of the two DC brushless motors is equivalently adjusted, thereby achieving the control of the speed of the two DC brushless motors.
2.1.2 Signal conditioning board
Since the 8 signals measured by GPIO (6 pulse signals corresponding to the angle signals of the three-degree-of-freedom helicopter and 2 angle signals corresponding to the flight stick) inevitably have noise during actual measurement, the noise-contaminated signals directly sent to EasyARM1138 will cause large errors in the measurement, thus adversely affecting the system. In severe cases, the motor of the three-degree-of-freedom helicopter will run at the maximum speed. At this time, the system has actually diverged and cannot be balanced.
The 8 signal quantities that the GPIO of EasyARM1138 needs to measure are first conditioned by the signal conditioning circuit and then sent to EasyARM1138. After actual testing, it was found that the system can run stably and has ideal dynamic performance.
2.1.3 Control box
The exterior of the embedded controller uses a universal plastic chassis shell, and the side opening is used to place various interfaces. The control box is powered by an external 5 V, 2 A power supply, and the box retains the socket for the external voltage-stabilized rectifier power supply. A power switch is placed on the box to control the power supply of the control box, and an LED diode indicator is used to indicate the power switch status.
An orange lock-free switch is placed on the end face of the control box to reset the EasyARM1138. There is also a DB9 jack on this end face for connecting to the DB9 plug from the flight joystick (modified Beitong Shunfeng 318 flight joystick). A DB25 jack is placed on the other end face for connecting to the DB25 plug from the three-degree-of-freedom helicopter.
2.2 Software Design
All software is based on the IAR Embedded Workbench for ARM programming platform [7] and is developed in C language in the μC/OSII operating system. All generated software is downloaded to EasyARM1138 via an external USB cable. The software is generally divided into two functional modules: interface and control.
2.2.1 Implementation of interface functions
(1) ADC sampling
The flight stick is shaken up and down to give a pitch signal, and the left and right shake gives a lateral signal. The two signals are shaped by the filter capacitor and sent to the ADC of the EasyARM1138 development board. The ADC converts the two continuous analog voltages into discrete digital quantities. The pitch and lateral angles given by the flight stick are calculated by voltage ratio conversion. The
maximum voltage provided by the ADC sampling module of the EasyARM1138 development board is 3.3 V. The voltage range of the joystick input is set to 0 V to 3.3 V, and the ADC sampling rate is 125 kS/s. The conversion resolution of the ADC module is 10 bits, and its conversion range is 0 to 1 024. When the analog signal of the joystick is input to the ADC, the ADC converts it into the corresponding digital value ulVal0, then the voltage value of the joystick input ulVal1=(ulVal0/1 024)×3 300. Then, according to the pitch angle range of the three-degree-of-freedom helicopter from 0° to 60°, the voltage value of the joystick is converted into the corresponding angle value, that is, the pitch angle of the joystick input angle02 =ulVal1/3 300×60. Similarly, the lateral angle of the joystick input can be calculated.
(2) Rotary encoder decoding
The real-time attitude signal of the three-degree-of-freedom helicopter is transmitted to the control box through three photoelectric rotary encoders. In order to detect the pitch and lateral angles, it is necessary to count the encoder pulses and calculate the current pitch and lateral angles.
The encoder outputs two pairs of differential pulse signals of phase A and phase B with a phase difference of 90°. The direction of encoder rotation can be determined from the phase relationship (leading or lagging) of the two output signals A and B. When the encoder disk rotates forward, the pulse waveform of channel A leads that of channel B by π/2, while when it rotates backward, the pulse waveform of channel A lags that of channel B by π/2[8]. The waveform signal output by the rotary encoder is shown in Figure 3.

For the two pairs of differential signals A+ and A- and B+ and B- output by the encoder during pitching, only the three signals A+, B+, and B- can be used to measure the pitch angle. The edge-triggered interrupt of the GPIO of the EasyARM1138 development board is used, and the rising edge of the pulses of B+ and B- is set to trigger an interrupt. When the B+ pulse generates an interrupt, the high and low levels of the A+ pulse input are detected, and the B+ pulse is counted at the same time. As shown in Figure 4, if A+ is high, it can be judged that A leads B, and the counting variable FA1 automatically increases by 1 (the initial value of the design variable FA1=30 000); if it is low, it can be judged that A lags behind B, and the counting variable FA1 automatically decreases by 1. In order to eliminate the pulse counting error caused by the jitter of the balance bar of the three-degree-of-freedom helicopter, an interrupt count is set for the B- pulse, which is equivalent to counting the pulse B at a double frequency. When the B- rising edge pulse generates an interrupt, the high and low levels of the A+ pulse input are detected, and the B- pulse is counted at the same time. If A+ is at a high level, it can be judged that A lags behind B, and the counting variable FA1 automatically decreases by 1; if it is at a low level, it can be judged that A leads B, and the counting variable FA1 automatically increases by 1.

The number of equally divided stripes on the encoder disk is 600. When the measured shaft rotates one circle, the encoder's A and B phases send out 600 pulses respectively. The pulse equivalent of the A and B phases is the corresponding angle P=360°/600. Since the B pulse is counted twice in one cycle, the angle corresponding to each pulse counted by FA1 is P/2. The encoder's rotation angle is the pitch angle of the three-degree-of-freedom helicopter angle00=(FA1-30 000)×P/2.
Similarly, the three signals output by the encoder when the three-degree-of-freedom helicopter is lateral are measured to calculate the lateral angle.
(3) PWM output
The voltage calculated by PID control is used to generate a PWM square wave signal through Timer2 of the EasyARM1138 development board to output the voltage input for controlling the two brushless DC motors.
The initial values ​​of TimerA and TimerB in the Timer2 module are set to 6 000, and the output voltage range is 0 V to 3.3 V. The voltage V00 calculated by PID control changes linearly with the matching value loaded by TimerA and TimerB, and the proportional coefficient is K=0.3. Matching value MP1=V00×K×6 000 (0≤V00×K≤1). The matching value changes with the voltage calculated by PID control, and then the two motors of the three-degree-of-freedom helicopter are controlled according to the voltage corresponding to the PWM duty cycle output.
2.2.2 Control law generation method
The control law generation method is divided into two parts: system modeling and PID control. For the specific process of system modeling, please refer to the product manual of Googol Corporation [4].
The output voltage of the two motors adopts an incremental digital PID control algorithm, which is implemented in C language programming:


V01 is the current voltage of motor 1, V00 is the voltage of motor 1 at the last sampling, Ee[i] is the angle error value of the three-sample pitch angle;
V11 is the current voltage of motor 2, V10 is the voltage of motor 2 at the last sampling, and Ep[i] is the angle error value of the three-sample lateral angle.
3 System test and results
In order to test the operation results of the system, a digital oscilloscope (Tektronix TDS220) and a multimeter are used to test and analyze the pitch and lateral angle command signals given by the flight joystick, as well as the actual pitch and lateral angle signals output by the rotary encoder of the three-degree-of-freedom helicopter. The test tool also requires the EasyARM1138 debugging development software IAR Embedded Workbench for ARM 5.11 and the corresponding download emulator with an embedded USB interface.
The joystick signal and the three-degree-of-freedom helicopter signal are connected to the two ends of the control box respectively. At this time, the program is loaded into the EasyARM1138 development board to debug the control system as a whole.
3.1 Startup and stable operation of the three-degree-of-freedom helicopter
Turn on the power of the three-degree-of-freedom helicopter motor, keep the rocker in a balanced state and run the program, the pitch axis of the three-degree-of-freedom helicopter will rotate upward steadily, and the pitch angle will change steadily from -30° to 0°. When the pitch angle stabilizes, the pitch axis basically does not rotate. At this time, the ideal value of the measurement signal of the pitch angle axis rotary encoder should be a smooth straight line without any pulses. But in fact, there may be a small vibration, and the corresponding signal graph is a small number of pulse signals.
The time length of each grid in Figure 4 is 1 s. It can be seen from Figure 4 that within the time length of 10 s, the pitch angle rotary encoder outputs a small number of pulse signals, and each pulse corresponds to an angle change of 0.3° (fluctuation up and down).
Based on the understanding of this figure, it is not difficult to understand the figure shown in Figure 5. Figure 5 shows the output waveform of the rotary encoder when the pitch angle changes from -30° to 0°.

It can be seen that when the pitch angle is -30° and 0°, the output of the rotary encoder is approximately a straight line, or there are only a few pulses. In the process of changing from -30° to 0°, the output of the rotary encoder is a dense pulse signal, and the pulses are dense at the beginning and slightly sparse later. Corresponding to the change process of the pitch angle, the angle changes faster at the beginning and slower later.
For this process, the angle data of the rotary encoder is read into the computer using EasyARM1138 serial communication, and then the data change curve shown in Figure 6 is obtained by drawing it through Matlab.

3.2 Stabilization of a three-degree-of-freedom helicopter
When a three-degree-of-freedom helicopter is running stably, if there is an external disturbance, such as a gust of wind or other impact signal acting on the rotation axis of the three-degree-of-freedom helicopter, the system should be able to automatically resist the disturbance under the action of the controller, and the system will return to its original position after the disturbance is eliminated.
Figure 7 shows the output signal waveform of the pitch angle rotary encoder when the pitch axis of the three-degree-of-freedom helicopter is subjected to an impact disturbance. It can be seen from Figure 7 that the rotary encoder begins to output dense pulses at the moment of the disturbance, indicating that the pitch axis is in continuous motion at this time. Before the disturbance occurs and after a certain period of time after the disturbance, the output of the rotary encoder is a small amount of pulse signals, indicating that the pitch axis is basically in a balanced state.

In this process, the EasyARM1138 serial port communication is used to read the angle data of the rotary encoder into the computer, and then the data change curve is plotted by Matlab as shown in Figure 8.
3.3 Discussion
(1) The continuous adjustment process of the system only gives the output channel effect of the auxiliary control process of the system. Because the waveforms of the two channel signals of the Tektronix TDS220 digital oscilloscope used have time deviation when testing the dual-channel signal, it is impossible to give the ideal input signal and output signal comparison waveform at the same time.
(2) For the other two working modes of the system, the effect of "full automatic driving" is similar to Figure 8, and the effect of the "leveling" function is similar to Figure 6, which will not be described here.

(3) Since the rotary encoder of the three-degree-of-freedom helicopter is an incremental rotary encoder, it can only reflect the change in angle. Therefore, the number of encoder output pulses in the steady state is approximately zero. The current angle is calculated as: initial angle + angle change. The stability of the system to the pitch angle and lateral angle is actually the stability to the change relative to the initial angle.
This paper discusses the entire development process of the design of the embedded control system for a three-degree-of-freedom helicopter. The control system has been tested and all functions meet the design requirements. Therefore, the design idea of ​​the overall control system is feasible, and the design results are reasonable and reliable. The method can be extended to realize the flight control system of small unmanned helicopters, provide technical reserves for the development of real digital flight control systems, and can be applied to the embedded design of other motion measurement and control systems.

Reference address:Embedded control system for three-degree-of-freedom helicopter

Previous article:Research on simulation surveying and assembly experiment based on virtual reality
Next article:Design and analysis of IPv6 firewall based on flow filtering technology

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号