Design of vertical flight control system for fixed-wing aircraft

Publisher:chenxiaohong68Latest update time:2010-04-21 Source: 中国电子网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

The most common flight state of a fixed-wing aircraft is horizontal flight. If it is allowed to fly at a large angle, the action cannot be maintained all the time. If it is allowed to fly perpendicular to the ground, the time it can maintain is even shorter. This project aims to realize a control system that allows the aircraft to fly perpendicular to the ground and stabilize at a fixed altitude. The three-axis acceleration sensor added to the fuselage is used to detect the attitude of the aircraft flying perpendicular to the ground. When the aircraft is detected to be swaying forward and backward, the horizontal tail is controlled to keep the aircraft stable in the forward and backward directions; when the aircraft is detected to be swaying left and right, the vertical tail is controlled to keep the aircraft stable in the left and right directions; when the aircraft is detected to be moving up and down, the throttle size (i.e. the speed of the propeller) is controlled to maintain the stability of the aircraft's flight altitude. When these controls are very precise, the fixed-wing aircraft can also hover steadily in the air like a helicopter. Using the control system designed in this article, the aircraft can turn 90° clockwise or counterclockwise (with a very small projection area) while decelerating in vertical flight, so as to reduce the projection area exposed to the aircraft behind and reduce the chance of being hit.

Design Overview

In order for the aircraft to fly vertically, the control circuit needs to have the following functions:

To determine whether the aircraft is flying vertically, for a real aircraft, it may be just a toggle switch to prevent false triggering; in the experimental remote control aircraft of this project, it is the pulse width signal of a certain channel. When the pulse width is greater than a certain set value, the control circuit knows that it is time to go into action.

Determining the aircraft's own attitude is one of the core parts of this control circuit. Before controlling the aircraft to maintain vertical flight, the aircraft's own attitude must be determined first. This project uses the MMA7260QT sensor to detect the aircraft's attitude.

Control This is the most time-consuming part of the design and production process of this project, but its principle is easy to understand: the attitude circuit has already understood the attitude of the aircraft, and the control circuit only needs to make corresponding actions. If the aircraft tilts forward, it will move the aircraft forward a little, and if it tilts backward, it will move it backward a little. There is another quantity that needs to be controlled - the altitude. The altitude of the aircraft should be kept stable when doing this action. The throttle should be reduced when the fuselage is rushing up, and the throttle should be increased when descending. To complete such control, two MC9S08QG8s are required. In order to achieve the above functions, this project should have a circuit block diagram as shown in Figure 1.

Two MC9S08QG8 chips are selected because there are two places in this project that have strict time requirements: one is to read the pulse width sent from the remote control; the other is to accurately send out the calculated pulse width. Both places must have an error within 10μS. If one chip is used, there will be conflicts even if interrupts are used. The general distribution of the work of the two MC9S08QG8 chips in this project is: one chip is used as the main control, which is used to read the pulse width sent by the remote control and received by the receiver (high real-time performance), read the aircraft attitude (low real-time performance), control calculation (PID calculation) and data transmission (send the data on how to control the aircraft, that is, the result of PID calculation, to another MCU); the other chip is used as an auxiliary chip, and only needs to send the read data to the aircraft's actuator in real time.

Hardware Description

The hardware circuit is shown in Figure 2.

The data of the three axes output by the sensor MMA7260QT are respectively sent to the three A/D input terminals ADP0, ADP1 and ADP2 of the main control MCU. The power supply is connected to a resistor and an inductor to prevent the power supply from interfering with the sensor.

The power supply of the whole circuit is introduced from the receiver through J1, and then converted to 3.3V by 78FC33 to power the MCU and sensor. J2, J3, and J4 are for left and right, throttle, and front and rear control respectively.

The capture input terminal TPMCH1 of the second TPM of the main control MCU is connected to the signal output terminal of the receiver. This remote control system is 9-channel, that is, it can control 9 mechanisms at the same time. The signal of this 9-channel is shown in Figure 3. It is composed of pulse trains with an interval of 20ms. Each pulse train has 9 pulses. The interval between the rising edges of two consecutive pulses is the effective control signal sent by the remote control. This interval is at least 1ms and at most 2ms. After TPM captures the width of 9 pulses, it can be sent directly to the servo according to needs or after PID calculation. As for how to identify whether a pulse is the end of the previous pulse train or the beginning of the next pulse train, this involves the concept of a synchronization pulse, which belongs to the software content and will not be explained here.

The serial output terminal of the main control MCU is connected to the serial input terminal of the auxiliary MCU. If the main control MCU wants to control the aircraft's movements, it only needs to send data to the auxiliary MCU through the serial port. The sending format is shown in Table 1, with a total of 8 characters, of which 0xAA and 0x55 are guide bits...

Three LEDs, D1 is the power indicator, D3 is used to indicate "I am the control circuit, I have started to control the aircraft to fly vertically", and D2 is "something went wrong, be careful of problems, switch back to your control quickly."

[page]

The auxiliary MCU has two tasks: one is to read the serial data sent by the main control MCU, and after finding the guide character, send the front, back, left, right, up, down (throttle) data into the corresponding array for storage; the other is to send the data in the corresponding array in the form of pulses every 20ms. The minimum pulse is 1ms and the maximum is 2ms. After this signal is sent to the aircraft's actuator - the servo, the corresponding output pattern is shown in Figure 4. A 1ms pulse puts the servo rocker arm in the leftmost position, a 1.5ms pulse puts the servo rocker arm in the middle position, and a 2ms pulse puts the servo rocker arm in the rightmost position. The servo rocker arm is connected to the aircraft's actuators, and when the rocker arm is shaken, the aircraft's actuators (such as the tail, etc.) also swing.

Software Description

For the main control MCU part, the flow chart is shown in Figure 5.

·Read remote control signal: This remote control signal is shown in the upper right corner of Figure 5. It is a pulse train composed of 9 pulses, one pulse per 20ms. The reading method is as follows: After the TPM captures the rising edge of the pulse and enters the modulo timer capture interrupt program, first check whether it is the first in the pulse train. If it is, clear the timer and then store the captured value in the array. After 9 times, the array stores the time of each pulse from low to high. By subtracting, the width of each pulse is obtained. In order to prevent errors, pulse number error prevention is added, which is to count the number of pulses. If more than 9 pulses are read in a pulse train, it means interference, and all pulse widths need to be processed as soon as possible according to the middle value of 1.5ms. Although this is different from the instructions issued by the remote control, it reduces the chance of major problems.

[page]

8ms timing interrupt: The system has a modulo timer 18ms interrupt program. Because a normal pulse train of 9 pulses will not exceed 18ms, the timer can be allowed to count at the beginning of the first pulse. When it reaches 18ms, it is considered that a pulse train has ended and the pulse counter is cleared. When the counter is cleared in the modulo timer capture interrupt program, it knows that the next pulse train has started. This interrupt also provides a time mark for the PID timing operation. The mark is set every time an interrupt is entered. The main program performs PID operation when it reads that the mark is set, thus ensuring that the cycle of the PID operation is fixed.

1.67ms interrupt program and A/D interrupt program: In order to read the data output by MMA7260QT, A/D reading is required. Here, an interrupt is entered every 1.6667ms to set the A/D channel. It takes 5ms to read three channels. Within the standard interval of 20ms between two pulse trains, four readings can be made for each channel. The sliding average algorithm can be used to filter out interference.

Main program introduction

Although the sensors are placed horizontally, the outputs of the three axes are different from the calculated outputs due to differences in temperature, voltage, etc., and there will be a slight deviation. To solve this problem, after power-on, the values ​​of the three axes are read 64 times in succession and then averaged. This average value is used as the target value for the aircraft to stabilize, so that the aircraft is basically stable.

PID plays an indispensable role in stability. There are two points to mention about PID in the main program. First, due to the stability of the sensor and the jitter of the aircraft, it is normal for the A/D output value to differ by 2 or 3 numbers, so it is necessary to judge in the main program. If the error value is within 3, the PID operation will not be performed, thus reducing the unnecessary jitter of the servo. Second, because the weight of the front, back, left and right of the aircraft is inconsistent, different P values ​​should be used for calculation when the aircraft tilts forward, backward, left and right.

The main program updates data every 20ms, and the data is the width of the control pulses of front, back, left, right, up and down. Should this data be directly used as the number captured in the modular timer capture interrupt program or the data of PID calculation? This is determined by a pulse width (the pulse width that determines whether the aircraft should fly vertically at this time). The pulse width used here is the pulse width of the 7th pulse, which is the 7th channel of the remote control. This parameter is named Helen. When Helen >1500 (1.5ms), it means that the operator wants to fly vertically and output the PID calculation data; when Helen <1500, it is a normal flight, and the number captured in the modular timer capture interrupt program can be directly output.

To get the width of each pulse, just subtract the time when each pulse occurs from low to high. This subtraction operation is also completed in the main program. After the subtraction is completed, the pulse width must be processed for errors. Check that less than 1ms is counted as 1ms, and greater than 2ms is counted as 2ms. After processing, the send interrupt can be called to send to the auxiliary MCU. The calling method is to arrange the array, clear the send data counter, and turn on the send interrupt enable bit. At this time, the send buffer is empty. Once the send interrupt is enabled, it will immediately enter the interrupt and start sending.

Serial port sending interrupt program: After the program enters this interrupt, it first sends the number indicated by the sending data counter to the sending buffer for sending. If the sending is completed, the sending interrupt enable bit is cleared to prevent the interrupt from entering again after the data being sent is sent; if the sending is not completed, it exits directly and waits for the next interrupt.

The auxiliary MCU program flow chart is shown in Figure 6.

Serial port receiving interrupt: The key to assisting the MCU program is the serial port receiving interrupt. The received number should be stored in the specified array. This is easy to implement, but it is not so easy to find the boot header, because 0xAA and 0x55 as the boot header may also be data. Only the connected ones are the boot headers. The judgment method is detailed in Figure 6.

Because this MCU has only two timers, but needs to control three pulses, two pulses are implemented using the PWM function of the timer, and the other pulse needs to be simulated by software. The method used in this article is to use a 20ms interrupt, set the I/O port after entering the interrupt, and then loop in the main program to judge the timer value. When the timer value is greater than the pulse value to be sent, reset the I/O.

Reference address:Design of vertical flight control system for fixed-wing aircraft

Previous article:Noise Analysis and Design of Class D Audio Preamplifier
Next article:USB Implementation Solution Based on DSP and Special Interface Chip

Recommended ReadingLatest update time:2024-11-16 23:57

MCU, is it going to start an AI revolution?
Yesterday, a big news happened in the embedded world. IAR announced that it has joined forces with Edge Impulse to provide AI and ML integration capabilities to global customers.  Maybe many people don't know much about this news. You know, Keil and IAR are two giants in embedded/microcontroller development. IAR has
[Embedded]
MCU, is it going to start an AI revolution?
Application and Research of Single Chip Microcomputer Multi-interrupt Processing Technology
introduction With the development of microelectronics technology and computer technology, the original electrical equipment, which was mainly based on strong electricity and electrical appliances and had simple functions, has developed into a new type of microelectronic equipment that combin
[Microcontroller]
Single chip microcomputer controls MC55 module to realize remote wireless data transmission
GPRS (General Packet Radio Service) is the abbreviation of General Packet Radio Service, which is a data transmission technology based on the Global System for Mobile Phones (GSM). GPRS network not only has the advantages of wide coverage, fast data transmission speed, high communication quality, always online and flo
[Microcontroller]
Single chip microcomputer controls MC55 module to realize remote wireless data transmission
Super creative microcontroller controlled LED rainbow waterfall clock
How to make pale, monotonous time colorful? This rainbow waterfall clock project is the answer! After a while of hard work, I finally finished this rainbow waterfall clock :-) This clock was inspired by this DIY project: When I saw Doug's creation, I thought of RGB LED, so I planned to come up with s
[Microcontroller]
Super creative microcontroller controlled LED rainbow waterfall clock
STC89C51 MCU + HX711 weighing module electronic scale program
The electronic scale is based on the STC89C51 microcontroller and the HX711 weighing module. The microcontroller controls the A/D conversion, the screen displays the data, and the keyboard inputs in real time. The design can be easily used in various occasions. The microcontroller source program is as follows: #inc
[Microcontroller]
STC89C51 MCU + HX711 weighing module electronic scale program
Serial port debugging of SH79F168 microcontroller
I've been working on the latest 8-bit microcontroller from Zhongying recently. It was quite tricky at the beginning. There isn't as much information on the Internet as there are on mainstream chips. If a small problem isn't figured out, it takes a long time to debug it. The worst thing is that the chip burned when I wa
[Microcontroller]
Analysis of various arithmetic operation instructions of single chip microcomputer
1. Addition (impact on C, AC, OV, etc.) ADD A, Rn---(@Ri, direct, #data) ADDC ------------------------------------------ 2. Subtraction SUBB A,------------------------------------ 3. Add 1 (does not affect the flag bit) INC A (Rn, @Ri, direct, DPTR) "Read-modify-write" instructions for port Pi : INC, DEC, ANL, ORL
[Microcontroller]
Analysis of various arithmetic operation instructions of single chip microcomputer
The anti-interference measures of the microcontroller itself
  In order to improve the reliability of the MCU itself, in recent years, MCU manufacturers have taken a series of measures in MCU design to improve reliability. These technologies are mainly reflected in the following aspects.   1. Reduce the external clock frequency   The external clock is a high-frequency noise
[Microcontroller]
Latest Security Electronics 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号