The Research of Four-rotor Attitude Simulator Based on Matlab Zhao Zhengxu1, Han Lilong*2, Bai He3, Meng Yunxiu4 School of Information Science and Technology, Shijiazhuang Tiedao University, Shijiazhuang Hebei 050043, China zhaozx@stdu.edu.cn; *2chinahll2008@163.com; 3124998677@qq.com; 4591579756@qq.com
1
Abstract As there exists the instable figureht conditions insides multi-rotor aircraft flights, put forward a simulator method for the research of the four-rotor aircraft attitude. Our research use the Innalabs miniAHRS m2 inertial sensor to gather attitude parameters, and at the same time, uses the Matlab to processing the collecting data, building the four-rotor virtual model by the OpenGL in VC++, designing the simulator program by the motion capture technology, and achieve the virtual simulator of the four-rotor attitude. Then analyze the flight motion attitude under the law of motion of the four-rotor aircraft. The results show that the method can achieve the model’s data-driven and its attitude simulator; and using the collecting attitude data effectively, it could also help us to design and achieve more stable and robust flight control system in the future. Keyword Four-rotor Aircraft; Innalabs miniAHRS m2; Attitude Simulation; Data Drive
by Innalabs, and it could be applied to varieties of environmental. It has the features of high reliability and low cost. Use the sensor to collect the four-rotor’s attitude data, and the 3DR Radio to send the collect data to the computer. The simulation platform achieves the virtual model’s data-driven and attitude-simulation by analyzing the collecting data. The data collection process is shown in Figure 1.
FIGURE 1. INNALABS MINIAHRS M2 INERTIAL SENSOR
Simulation and Analysis of Four-rotor’s Attitude Four-rotor Aircraft Flight Principle
Introduction Recently, four-rotor aircraft is in the good development opportunities, with the development of advanced science and technology, such as new materials, electronic technology, inertial navigation technology, computer technology, etc. Its design and development trend are rendered from some features, such as the self-flight, high intelligence, low power, multi used, etc. For its simple structure, adapting various, flying flexible, etc., the study of four-rotor has important practical significance, and it has been got the attention of all countries in the world. Because the four-rotor operation is complexity and highly, and flight attitude stability is poor, so it has been got the attention of the researchers, with the help of computer simulation and virtual reality technology, to design the flight control system and its simulation of flight.
For the four-rotor, the rotation of the rotor on coaxial has the same direction, and has the opposite direction on axis adjacent, in order to offset the anti torque made by the rotors in its flight process and prevent its spin because of the anti torque, as shown in Figure 2. The change of attitude of the four-rotor is achieved by adjusting the rotors speed. And the basic attitudes of four-rotor’s flight are five: hover, vertical take-off and landing (VTOL), yaw, pitch and roll. Assume that the quality of the four-rotor is m and the rotor speed is Ω. Due to the lift of rotor provides a directly proportional to its speed. So there is Fi= bΩj2, j∈{1,2,3,4}. S1 represents the lift of the rotor generated. In figure 2, suppose the positive direction of the Y axis as the head direction. Here is the formula (1). 4
Four-rotor Flight Attitude Data Acquisition
=i 1 =j 1
Innalabs miniAHRS M2 inertial sensorsis developed 14
4
S1 = ∑ Fi = F1 + F2 + F3 + F4 = ∑ bΩ 2j
=
b(Ω12
+ Ω 22
+ Ω32
+ Ω 24 )
International Journal of Automation and Control Engineering, Vol. 4, No. 1—April 2015 2325-7407/15/01 014-5 © 2015 DEStech Publications, Inc. doi:10.12783/ijace.2015.0401.04
(1)
The Research of Four-rotor Attitude Simulator Based on Matlab
Hover: each rotor’s speed is equal, and provides the lift S1 is equal to the gravity. VTOL: each rotor’s speed is equal, making the hover’s speed as the benchmark, but each rotor has the equal acceleration or deceleration, in order to achieve the vertical rise or fall. Yaw: 1 and 3 rotor’s speed increases (or decreases) appropriately, and the others’ speed opposite; make the bodies’ anti torque imbalanced, and achieve the yaw of the body, in the premise of the hover; and the more different between the rotor’s speed, the anti torque bigger, and the higher yaw rate of the body of the four rotor. Pitching or Rolling: one of the rotor’s speed increase, and the coaxial rotor’s speed decrease appropriately, but the rest remain as before; causing the body’s lift imbalanced in the vertical direction, and then the body tilt, so there will be a lift in the horizontal direction, which make the body produce horizontal displacement, as shown in figure 3.
FIGURE 2. STRESS ANALYSIS OF FOUR
ROTOR AIRCRAFT
15
four-rotor’s flight simulate program, achieve its data-driven and posture simulation. The whole process of the simulation is shown in figure 4. 1) Model Established Accurate simulation model of four-rotor can better realize its flight simulation, which mainly consists of the bodies’ main structure and rotors. In this paper, we give an example of four-rotor, using VC++, OpenGL to draw the main structure model, using 3ds Max to build four-rotor’s 3D simulation model. The data are stored by 3ds format file so that the OpenGL function glCalllist() can call it. According to the four-rotor’s motion law, its simulation model is layered, and shows the tree structure.There is three model diagram of four-rotor in three different forms (Line chart, Plane chart, Stereo diagram). 2) Four-rotor Aircraft Motion Simulation What the research of Four-rotor attitude is using the inertial sensors to collect the four-rotor’s motion attitude data, and reconstructing its structure, and achieving the four-rotor’s data-driven and simulation. In this paper, the collect data are stored in the .bvh file. The simulation program reads the numerical data from the .bvh file, and make the feature point and the numerical data corresponding, and then realize the model’s data-driven. At the same time, it can change the values of the relevant parameters to change four-rotor’s movement posture.
FIGURE 3. PITCHING OR ROLLING STATE DIAGRAM
FIGURE 4. FOUR-ROTOR SIMULATION PROCESS DIAGRAM
Four-rotor Aircraft Attitude Simulation For the four-rotor flight simulation, it must be supported by the accurate data and the realistic simulation model. In this experiment, the data are collected by the Innalabs miniAHRS m2 inertial sensors. Combined VC++ and OpenGL, realized
FIGURE 5. FOUR-ROTOR AIRCRAFT FREE EDITING POSTURE DIAGRAM
In Figure 5, there is the page of the simulation platform. The right upper part is the display area, including three basic forms: line model, plane model and stereo model. The upper left portion is the control area of the Bézier curve, and there are 5 Bézier curve, controlled the multi-rotor
16
Zhao Zhengxu, Han Lilong, Bai He, Meng Yunxiu
characteristics of each rotor points and center controller feature points respectively. The middle left part is the data display part that correspond the feature points on the Bézier curve of the rotation angle, and it can be controlled to edit the model attitude at the same time. The middle right is the relative motion curve of multi-rotor’s feature points, made by Matlab. At the bottom of the screen is the input module of parameter, it can change the motion by changing the value of the parameter, such as speed, rotation angle, etc. Meanwhile the platform can also use the .bvh file to driven the model, achieving the attitude’s playback function. Part of the code implementation procedures is as follows: Typedef struct _position{ int id; int x,y,z; float step; char *info; char *format; }position; void position_draw(position *position); void position_updata(position *position, int updata); void read_bvh_data_(void);
0 0 T= 1 0 0 1
xposition yposition zposition
R = R (rad _ z ) * R (rad _ x) * R (rad _ y )
(3) (4)
Around X axis, the rotation angle is rad_x, and the transformation matrix is show in formula (5). 0 0 1 R (rad _ x) 0 cos(rad_x) −sin(rad_x) = 0 sin(rad_x) cos(rad_x)
(5)
Around Y axis, the rotation angle is rad_y, and the transformation matrix is show in formula (6). cos(rad_y ) 0 sin(rad_y ) R (rad _ y ) = 0 1 0 −sin(rad_y ) 0 cos(rad_y )
(6)
Around Z axis, the rotation angle is rad_z, and the transformation matrix is show in formula (7).
Analysis of Four-rotor’s Attitude For the four-rotor’s low flight-height and small velocity, and meanwhile ignoring the effect of the earth's magnetic field and self-rotation, there is only two coordinates that need to be defined in the space, namely body coordinate system and reference coordinate system . And we also assume that the two coordinate systems are the same initially. From the .bvh file, stored the capture data, we can extract the location, rotation angle value and other information, and achieve the matrix transform between the two coordinate systems through the Euler angle computing. Then obtain the four-rotor’s yaw angle, pitch angle and roll angle, and realize the representation pose at different coordinates. Make the rotation angle of Euler to radian value, and here is the formula (2). rotation=frame_i_channel_j*( π /180 )
matrix. T, R were expressed as formula (3), (4).
(2)
In the formula 2, i∈{1, 2…N}, N represents the total number of key-frame; j ∈ {Xrotation Yrotation Zrotation}. The change of root is the result of joint action of shifting and rotating, and there are different results of the changes for the different order. The transformation matrix can be expressed as M = T*R*M, and T is the translation matrix, and R is rotation
cos(rad_z) -sin(rad_z) 0 R (rad _ z ) = sin(rad_z) cos(rad_z) 0 0 0 1
(7)
Use Euler angle to represent the change between the two coordinate systems. The formula (8) and the formula (9) represent the reference coordinate system to the body coordinate system and the opposite. Cnb = C1C2 C3 bT = Cnb C= C1T C2T C3T n
(8) (9)
C1 = R(rad _ z )
(10)
C2 = R(rad _ y )
(11)
C3 = R (rad _ x)
(12)
The sub node’s rotating-transform is based on the root, the matrix: M*=R*M. Use the Euler angle to analysis the data, and send the result to the matlab, and then make the numerical analysis, and draw the pose variation curve. As shown in the Figure 6, Figure 7, Figure 8, Figure 9. Comparing the Figure 6 and the Figure 7, shows that the regularity of the four-rotor’s flight attitude is basically the same between the hover and the VTOL. And the change rate of the yaw angle, pitch angle, roll angle is approximately zero, but there is a slight oscillation changed with the speed’s change.
The Research of Four-rotor Attitude Simulator Based on Matlab
17
bigger between the 2, 4 rotor’s speed different, the bigger the bodies’ pitch angle. And it also showed a nonlinear trend. Experimental Results
FIGURE 6. THE CHANGE OF THE ATTITUDE ANGLE IN HOVER
FIGURE 7. THE CHANGE OF THE ATTITUDE ANGLE VTOF
FIGURE 8. THE CHANGE OF THE ATTITUDE ANGLE IN YAW
According to the research, the “Four-rotor Attitude Simulation Program”, has realized the four-rotor’s simulation. To process the collect data by Matlab and combine with the simulation results of four-rotor, make an analysis to the four-rotor’s attitude. Because the virtual model is rigid, so there is still a certain gap to the real vehicle motion posture, and failed to simulate each part of the four-rotor’s elastic deformation. But each rotor’s speed is not always remaining the same, in the dynamic adjustment. It reflects a simple rule of the four-rotor’s attitude adjustment. And the research can be widely used in many filed, such as attitude estimation, designing the control system, and so on. Conclusions Four-rotor flight attitude research is an important direction of four-rotor’s research. Through the four –rotor’s attitude research, we analyze and get the rule changes of four-rotor’s flight attitude and its relationship between the rotor’s speed and attitude. Thus, based on the study of the four-rotor’s attitude, it has been widely used in aircraft design, flight attitude estimation, flight control system design and other fields. But improving virtual models, implementing free conversion between the formats file and simulating more realistic outside interference will be the main contents of the future research. ACKNOWLEDGMENT
This author would like to thank Professor Zhao Zhengxu, and its CNV term, and the support of the National Natural Science Foundation of China under Grant No.60873208. REFERENCES FIGURE 9. THE CHANGE OF THE ATTITUDE ANGLE IN PITCH
In Figure 8, the four-rotor’s pitch angle and roll angle is approximately zero, and the change rate of its yew angle varies with the different rotational speed between the different axis of the rotor, and it presents a nonlinear growth trend. In Figure 9, 2 rotor’s change rate is higher than 1, 3 rotor’s, and 1, 3 rotor’s is higher than 4 rotor’s. And the
Bai He (1990-), female, Wuji Hebei, China; postgraduate; main research direction: the virtual reality technology and application. Han Lilong (1988-), male, Xingtai Hebei, China; postgraduate; main research direction: the virtual reality technology and application, the motion capture. Iván González, Sergio Salazar, Jorge Torres, Rogelio Lozano, Hugo Romero, “Real-time attitude stabilization of a
18
Zhao Zhengxu, Han Lilong, Bai He, Meng Yunxiu
mini-UAV quad-rotor using motor speed feedback”,
Raimúndez Cesáreo, Camaño José Luis, “Tracking in scale
Journal of Intelligent and Robotic Systems, Theory and
quad-rotors through adaptive augmentation”, Neural
Applications, Springer Netherlands, Vol.70 (2013), No.
Computign & Application, Springer London, Vol.23
1-4, pp. 93-106.
(2013), No.3-4, pp. 635-643.
Jeong Seungho, Jung Seul, “Design and experimental studies
Xiaojie Liu, “Study and Implementation of Position and
of a disturbance observer for attitude control of a
Attitude Estimation for Four-rotor Mini Rotorcraft Based
quad-rotor system”, Journal of Institute of Control,
on Vision”, Jilin University, Jilin University, Changchun,
Robotics and Systems, Institute of Control, Robotics and
China, (2009).
Systems, Vol.19(2013), No.11, pp. 1004-1010.
Zhao Zhengxu (1960-), male, Qingdao Shandong, China; the
Lilong Han, Zhengxu Zhao, “Research of Multi-Rotor
Yangtze River scholar, Professor, doctoral tutor; main
Attitude Posture based on Inertial Motion Capture”,
research direction: small world network system, virtual
Journal of the Hebei Academy of Sciences, the Hebei
reality technology and its application.
Academy of Sciences, Shijiazhuang, Hebei, China, Vol.30 (2013), NO.2, pp. 1-6. Meng
Yunxiu
(1989-),
Zhengxu Zhao, Lilong Han, Qian Xu. The Analysis of Multi-Rotor Attitude Simulator Based on Matlab. 2014 4th
female,
Wuji
Hebei,
China;
postgraduate; main research direction: Software testing. Nicom Promkajin, Manukid Parnichkun, “Attitude and
International
Conference
on
Applied
Mechanics,
Materials and Manufacturing (ICA3M 2014). Shenzhen, China, 2014, 670-671: 1350-1357.
altitude control of a four-rotor hovercraft using sliding
Zhijun Liu, Qiang Lv, Wang Donglai, “Modeling And
mode control with adaptive sliding surface”, 2011 IEEE
Simulation Control Of a Small – sized Quadrotor
International Conference on Robotics and Biomimetics,
Helicopter”,
IEEE Computer Society, Shanghai, China, (2011), pp.
Simulation, Beijing, China, Vol.27 (2010), No.7, pp. 18-20.
1285-1290.
Computer
Simulation,
Computer