A brief introduction of quadrotor aircraft

Due to its advantages of vertical takeoff and landing, strong maneuverability and convenient operation, the four-rotor aircraft has been widely used in military and civil occasions, thus becoming a research hotspot of many scholars. Quadrotor aircraft is an underactuated, nonlinear and strongly coupled system with four inputs and six outputs. Its attitude control precision and anti-interference are always the focus of research. At present, the most common aircraft control algorithms in China mainly include backstepping, adaptive control, H control, sliding mode control, active disturbance rejection control, etc., which has important theoretical and practical significance for attitude control of quadrotor aircraft. In the literature, backward step algorithm is used to configure the control laws for the four subsystems of the aircraft, namely up and down, forward and backward, left and right, and yaw, so as to realize the accurate tracking of the set trajectory of the quadrotor aircraft. In the process of constructing Lyapunov function, its derivative is less than zero, so its application is limited. In order to solve the problems of large tracking error, slow response speed and limited time convergence caused by the traditional discrete linear sliding mode applied to the control of quadrotor aircraft, an adaptive discrete terminal sliding mode control based on disturbance observer compensation is proposed to make the response time faster, the tracking effect more ideal and the robustness stronger. In this paper, linear extended state observer is used to estimate the internal and external disturbance of the quadrotor aircraft in real time, and linear state feedback control is adopted to compensate the estimated value of disturbance online, so as to realize the attitude control of the quadrotor aircraft.

A dynamic model of quadrotor aircraft 1. 1 Stress analysis of quadrotor aircraftFor each rotor of the aircraft, the profile is asymmetrical. Once the rotor rotates, the air velocity on the upper surface is faster than that on the lower surface, so the air pressure on the upper surface is less than that on the lower surface, and the pressure difference between the upper and lower surfaces forms lift, as shown in Figure 1. Rotor 1 and 3 rotate counterclockwise, while rotor 2 and 4 rotate clockwise. According to the theory of blade element momentum, the lift force Fi generated by each rotor is proportional to the square of motor speed ω I, that is, Fi=kFω2i(I =1,2,3,4), where kF is the lift coefficient.FIG. 1 Stress analysis of quadrotor Aircraft When the rotor rotates, air resistance will hinder its rotation. This resistance forms an anti-torsional moment applied to the body. When the four rotors rotate at the same speed, the anti-torsional effects of the rotors cancel each other out. The motion control of quadrotor aircraft is realized by changing the rotational speed of two pairs of positive and negative propellers. When the four rotor speeds are equal, the aircraft can rise or fall by increasing or decreasing the four rotor speeds simultaneously. If the sum of the lift force produced by the four rotors is equal to the body gravity, the aircraft can hover in the air. The aircraft can achieve pitching motion under the action of torque L (F3-F1) or L (F1-F3) (where L is the distance from the motor axis to the center of the aircraft) by keeping the rotational speed of rotor 2 and 4 unchanged and changing the rotational speed of rotor 1 or rotor 3. Keep the rotational speed of rotor 1 and 3 unchanged, change the rotational speed of rotor 2 or 4, and the aircraft can achieve rolling motion under the action of torque L (F4-F2) or L (F2-F4). If the rotational speed of rotor 1 and 3 is changed at the same time, or the rotational speed of rotor 2 and 4 is changed at the same time, and the total lift force of the aircraft is equal to the body gravity, the aircraft will achieve yaw motion under the action of counter torque. Thus, it can be seen that the lift force to achieve the vertical movement of the aircraft and the rotation moment to achieve the pitching, roll and yaw motion can be expressed asWhere: F — lift force of vertical movement of aircraft; Mx, My, Mz — torque of rotation for pitch, roll and yaw motion of quadrotor; KF — lift coefficient; KM — Rotational moment coefficient.

1. 2 Dynamic model establishmentIn order to describe the attitude and motion state of the aircraft, it is necessary to introduce the geographical coordinate system N (X,Y,Z) and the carrier coordinate system B (X,Y,Z). The geographic coordinate system is also called the northeast sky coordinate system. The carrier coordinate system is fixedly connected with the aircraft, and the origin is the center of the aircraft. The carrier coordinate system can be obtained after the origin of the geographic coordinate system and the carrier coordinate system are overlapped, and the geographic coordinate system is rotated around the X, Y and Z axes three times respectively. The transformation matrix from the geographic coordinate system to the carrier coordinate system can be expressed as According to Equations (5) and (2), the vector of the rotor lift force received by the aircraft in the X, Y and Z axes in the geographical coordinate system N can be obtained: In the process of low-speed flight, the angular velocity vector is small, and the second term on the left of Equation (8) can be approximately considered as zero, then Equation (8) can be simplified asEquation (10) can be converted into:According to Equations (7) and (11), the nonlinear dynamics model of the quadrotor aircraft in low-speed flight can be obtained:According to Equation (12), linear motion of quadrotor aircraft does not affect angular motion, but angular motion affects linear motion. Taking U1, U2, U3 and U4 as system inputs, three linear and three angular displacements of the aircraft can be changed by changing the values of the four input variables, so as to realize the motion control of the aircraft.

Control system construction and simulation of quadrotor aircraftThe classical PID algorithm is simple in structure, based on the deviation design feedback law, does not rely on the specific mathematical model of the controlled object, and has good performance in many process control. Although a variety of new control algorithms continue to emerge, but did not change the dominant position of PID control algorithm in industrial control. In this paper, a PID controller based on small disturbance is designed according to the situation that the quadrotor often encounters uncertain external interference during flight, as shown in FIG. 2.Figure 2 PID controller structure diagram

Two, part of the source code and simulation diagram

function varargout = GUI_Config(varargin)
% GUI_CONFIG MATLAB code for GUI_Config.fig
%      GUI_CONFIG, by itself, creates a new GUI_CONFIG or raises the existing
%      singleton*.
%
%      H = GUI_CONFIG returns the handle to a new GUI_CONFIG or the handle to
%      the existing singleton*.
%
%      GUI_CONFIG('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GUI_CONFIG.M_VALUE with the given input arguments.
%
%      GUI_CONFIG('Property'.'Value',...). creates anew GUI_CONFIG or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before GUI_Config_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to GUI_Config_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one % instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help GUI_Config

% Last Modified by GUIDE v2. 5 18-Dec- 2020. 21:15:22

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @GUI_Config_OpeningFcn, ...
                   'gui_OutputFcn',  @GUI_Config_OutputFcn, ...
                   'gui_LayoutFcn', [],...'gui_Callback'[]);if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end
y_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String'."); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function Izz_value_Callback(hObject, eventdata, handles) % hObject handle to Izz_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of Izz_value as text % str2double(get(hObject,'String')) returns contents of Izz_value as a double % --- Executes during object creation, after setting all properties. function Izz_value_CreateFcn(hObject, eventdata, handles) % hObject handle to Izz_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end % --- Executes on button press in structParamClear. function structParamClear_Callback(hObject, eventdata, handles) % hObject handle to structParamClear (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.m_value,'String', '');
set(handles.g_value,'String', '');
set(handles.L_value,'String', '');
set(handles.Ixx_value,'String', '');
set(handles.Iyy_value,'String', '');
set(handles.Izz_value,'String', ''); % --- Executes on button press in structParam_Default. function structParam_Default_Callback(hObject, eventdata, handles) % hObject handle to structParam_Default (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.m_value,'String', '0.5 ');
set(handles.g_value,'String'.'9.8');
set(handles.L_value,'String'.'0.2');
set(handles.Ixx_value,'String'.'0.114');
set(handles.Iyy_value,'String'.'0.114');
set(handles.Izz_value,'String'.'0.158');
set(handles.progresslabel,'String'.'Use default structural parameters');



function xt_value_Callback(hObject, eventdata, handles)
% hObject    handle to xt_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of xt_value as text
%        str2double(get(hObject,'String')) returns contents of xt_value as a double


% --- Executes during object creation, after setting all properties.
function xt_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to xt_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String'."); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function yt_value_Callback(hObject, eventdata, handles) % hObject handle to yt_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of yt_value as text % str2double(get(hObject,'String')) returns contents of yt_value as a double % --- Executes during object creation, after setting all properties. function yt_value_CreateFcn(hObject, eventdata, handles) % hObject handle to yt_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function zt_value_Callback(hObject, eventdata, handles) % hObject handle to zt_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of zt_value as text % str2double(get(hObject,'String')) returns contents of zt_value as a double % --- Executes during object creation, after setting all properties. function zt_value_CreateFcn(hObject, eventdata, handles) % hObject handle to zt_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end % --- Executes on button press in posParam_clear. function posParam_clear_Callback(hObject, eventdata, handles) % hObject handle to posParam_clear (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.xt_value,'String', '');
set(handles.yt_value,'String', '');
set(handles.zt_value,'String', ''); % --- Executes on button press in posParam_Default. function posParam_Default_Callback(hObject, eventdata, handles) % hObject handle to posParam_Default (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.xt_value,'String', '30 ');
set(handles.yt_value,'String'.'50');
set(handles.zt_value,'String'.'15');
set(handles.progresslabel,'String'.'Positional parameters use default parameters');


function kpx_value_Callback(hObject, eventdata, handles)
% hObject    handle to kpx_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of kpx_value as text
%        str2double(get(hObject,'String')) returns contents of kpx_value as a double


% --- Executes during object creation, after setting all properties.
function kpx_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to kpx_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String'."); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end % --- Executes during object creation, after setting all properties. function kpy_value_CreateFcn(hObject, eventdata, handles) % hObject handle to kpy_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function kiy_value_Callback(hObject, eventdata, handles) % hObject handle to kiy_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of kiy_value as text % str2double(get(hObject,'String')) returns contents of kiy_value as a double % --- Executes during object creation, after setting all properties. function kiy_value_CreateFcn(hObject, eventdata, handles) % hObject handle to kiy_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function kpz_value_Callback(hObject, eventdata, handles) % hObject handle to kpz_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of kpz_value as text % str2double(get(hObject,'String')) returns contents of kpz_value as a double % --- Executes during object creation, after setting all properties. function kpz_value_CreateFcn(hObject, eventdata, handles) % hObject handle to kpz_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function kiz_value_Callback(hObject, eventdata, handles) % hObject handle to kiz_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of kiz_value as text % str2double(get(hObject,'String')) returns contents of kiz_value as a double % --- Executes during object creation, after setting all properties. function kiz_value_CreateFcn(hObject, eventdata, handles) % hObject handle to kiz_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function kdz_value_Callback(hObject, eventdata, handles) % hObject handle to kdz_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of kdz_value as text % str2double(get(hObject,'String')) returns contents of kdz_value as a double % --- Executes during object creation, after setting all properties. function kdz_value_CreateFcn(hObject, eventdata, handles) % hObject handle to kdz_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function kpphi_value_Callback(hObject, eventdata, handles) % hObject handle to kpphi_value (see GCBO) function kdtheta_value_Callback(hObject, eventdata, handles) % hObject handle to kdtheta_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB  % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of kdtheta_value as text % str2double(get(hObject,'String')) returns contents of kdtheta_value as a double % --- Executes during object creation, after setting all properties. function kdtheta_value_CreateFcn(hObject, eventdata, handles) % hObject handle to kdtheta_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB  % handles empty - handles not created until after all CreateFcns called set(hObject,'String', ''); % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor', 'white'); end function kppsi_value_Callback(hObject, eventdata, handles) % hObject handle to kppsi_value (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB %  handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of kppsi_value as text % str2double(get(hObject,'String')) returns contents of kppsi_value as a double






Copy the code

3. Operation results

Matlab version and references

1 matlab version 2014A

[1] Yang Baoyang, YU Jizhou, Yang Shan. Intelligent Optimization Algorithm and Its MATLAB Example (2nd Edition) [M]. Publishing House of Electronics Industry, 2016. [2] ZHANG Yan, WU Shuigen. MATLAB Optimization Algorithm source code [M]. Tsinghua University Press, 2017. [3] ZHANG Ping. Modeling and simulation of attitude control for quadrotor aircraft [J]. Electric machinery and control applications, 2019,46(12) [4] liu yan, Yang mu. Research and Design of flight control System for quadrotor Aircraft [J]. Shandong Industrial Technology, 2019,(07)