Chapter 4. SYNCHRONIZATION CONTROLLER FOR QUAD-ROTOR UAV
4.3 Numerical simulation
52 Substitute Eq. (4.29) into Eq. (4.23),
3
1 i
j j
i ij
t K w t q t t
w t
(4.30)Substitute Eq. (4.30) into Eq. (4.22),
3
3 1
2 2
1 3
1
3 3 3 3 2
2 2 2
1 1 1 1
1 2
1 2
i
j j
i ij
j i
j
i ij
i i
j j j
j i ij j i ij
t K w t q t t
w t V t
K w t q t t
w t
w t w t
t K q t t K q t t
w t w t
Following Lyapunov stability theorem, the stability of the closed-loop control system using the PIDNNC is guaranteed if V t2
0. Therefore, the learning rate
t can be chosen by
3 3
1 1
3 3 2
2
1 1
i
j j
j i ij
i j
j i ij
t K w t
w t t
K w t q t
w t
(4.31)
Eq. (4.31) is essential for the stability of the system. By selection the learning rate is calculated from Eq. (4.31) in each sampling time, the SYNC errors can be asymptotically converged to zeros and therefore, the system is stable.
53 motor parameters are given in the experimental setup [67] which are given in Table 4.1. The schema control is shown in Fig. 4.3. The example code in the listing below describes for the DC motor model, SMC and PIDNNC plugins in the Gazebo.
//DC model plugin
DC_Motor_Y.Omega = DC_Motor_X.Integrator1_CSTATE;
DC_Motor_B.Integrator = DC_Motor_X.Integrator_CSTATE;
DC_Motor_B.Gain4 = ((DC_Motor_P.Kt * DC_Motor_B.Integrator - DC_Motor_P.B
*DC_Motor_X.Integrator1_CSTATE)-C_Motor_U.Disturbance)*1.0 /DC_Motor_P.J);
DC_Motor_Y.Omega_Dot = DC_Motor_B.Gain4;
DC_Motor_B.Gain5 = ((DC_Motor_U.Voltage - DC_Motor_P.Kb *
DC_Motor_X.Integrator1_CSTATE)-DC_Motor_P.R* DC_Motor_B.Integrator)
*(1.0/DC_Motor_P.L);
//SMC plugin
rtb_Derivative1 = SMC_DW.TimeStampA_k;
lastU = &SMC_DW.LastUAtTimeA_d;
rtb_Derivative1 = (SMC_B.Derivative - *lastU) / (SMC_M->Timing.t[0] - rtb_Derivative1);
rtb_Sum17 = SMC_P.C * SMC_U.Wr + SMC_B.Derivative;
SMC_Y.u1 = (((((SMC_P.B / SMC_P.J + SMC_P.R / SMC_P.L) - SMC_P.C) * omega_dot+ (SMC_P.C * SMC_B.Derivative + rtb_Derivative1)) + (SMC_P.B *
SMC_P.R / (SMC_P.J * SMC_P.L) + SMC_P.Kt * SMC_P.Kb / (SMC_P.J * SMC_P.L)) * omega) + rtb_Sum17 / (fabs(rtb_Sum17) + SMC_P.gama) * SMC_P.K) *(SMC_P.J * SMC_P.L / SMC_P.Kt);
//PIDNNC plugin
x1=w11*in1+w12*in2+w13*in3;
x2=(w21*in1 + w22*in2 + w23*in3) + x2_last;
H3=w31*in1 + w32*in2 + w33*in3; x3= H3 - H3_last;
u = w1*x1 + w2*x2 + w3*x3 ;
TS=-(e1*K1*(w1/w11+w2/w12+w3/w13) + e2*K2*(w1/w21+w2/w22+w3/w23) + e3*K3*(w1/w31+w2/w32+w3/w33));
MS = K1^2*(w1/w11+w2/w12+w3/w13)^2 + K2^2*(w1/w21+w2/w22+w3/w23)^2 + K3^2*(w1/w31+w2/w32+w3/w33)^2;
MS=MS*qk;
nuy = TS/MS;
Second, the control algorithms were applied to the developed model to drive the quad- rotor UAV to track the desired trajectory. For a comparative study, the proposed SYNC in Fig.
3.1 (denoted as SYNC1) has been considered with non-synchronization slide mode controller (denoted as NONSYNC).
For simulation, the SYNC1 was designed in Section 3 which the gain for sliding surface was chosen as K=5 and C=2 while the initial weights of synchronization control were set as
54 wi=1; wjk=0.1; (i,j,k=1,2,3). The NONSYNC uses only the three independent SMC controller of the SYNC2.
Fig. 4.3 Schema control configuration for simulation
Table 4.1 Setting parameters for the quad-rotor UAV
Component Specification Value
Geometry l1, l2 0.23m
Brushless DC motor Kt 6.3e-3 Nm/A
Ke 6.3e-3V/rad/s
B 54.2e-6N.m.s
J 0.4e-06kgm2
R 0.6
L 0.00008H
Mass Quad-rotor UAV 0.64kg
55 In order to assess the capability of the compared controllers, different working conditions of the simulated system were generated by using two test cases established in Table 4.2. For test case 2, the disturbances were represented as load torques which were externally added to the actuators as plotted in Fig. 4.4. Each simulation was then performed for a period of 40 seconds.
Table 4.2 Simulation test case for the quad-rotor UAV
Test case Content of simulation
1 Ideal condition (No disturbance)
2 Disturbances are attached to all actuators
0 10 20 30 40
-0.06 -0.04 -0.02 0.00 0.02 0.04 0.06
Load tourque (Nm)
Time (s)
Added disturbance at actuator 1 Added disturbance at actuator 2 Added disturbance at actuator 3 Added disturbance at actuator 4
Fig. 4.4 Diagram disturbance generation for the quad-rotor UAV
By employing test case 1, the controls were performed in the ideal condition to evaluate the efficiency of the actuator controllers. As the results in Figs. 4.5(a)(b), the quad-rotor UAV could track accurately the desired trajectory and maintains station-keeping hovering mode by
56 using any of the compared controller. This indicate that the position controller and attitude controller were well established to ensure generate the targeted profiles for each actuator and the actuator controllers were properly designed to enhance their given tasks. By using the SYNC1 with SMC and PIDNNC in which the learning rate was adaptively adjusted in each sampling time, the actuator could follow their trajectory more accurately than NONSYNC (see Fig. 4.5(d)).
Due to working in the ideal condition, the synchronization errors reached to zeros simultaneously as in Fig. 4.5(c).
Next, the compared controllers were evaluated in second test case. The disturbances were added to the actuators, which are the sinusoidal signals with different frequencies and sinusoidal signals with white noise. As the results in Figs. 4.6(a)(b), during the first time, the quad-rotor UAV could reach the desired trajectory by using the NONSYNC. However, the performance of quad-rotor UAV is increasingly degraded due to the controllers lacks the compensation between the actuators (Fig. 4.6(a)). Meanwhile, the SYNC1 could ensure the good tracking with remarkably small errors as in Figs. 4.6(a)(b)(d). Because of the SYNC1 was built based on PIDNCC to compensate the error between the actuators. Therein, the PIDNCC with dynamic learning rate, regulated by Lyapunov stability constraints allowed the system to response quickly to any changes. Consequently, the disturbances could be compensated effectively(Figs. 4.6(c)(d) and Fig. 4.7). The result proved convincingly that the proposed SYNC control approach could provide accuracy tracking for the quad-rotor UAV in the environment containing large noises and disturbance.
57
-0.0010 -0.0005 0.0000 0.0005 0.0010
Position (m)
NONSYNC SYNC1 X-Ground position (X Desired=0)
-0.0010 -0.0005 0.0000 0.0005 0.0010
NONSYNC SYNC1
Position (m)
Y-Ground position (Y Desired=0)
0 10 20 30 40
0 1 2 3 4 5
Time (s) Time (s)
Desired Altitude NONSYNC SYNC1
Position (m)
Time (s) Altitude
-0.0010 -0.0005 0.0000 0.0005 0.0010
Angle (rad)
NONSYNC SYNC1 Roll angle
-0.0010 -0.0005 0.0000 0.0005 0.0010
NONSYNC SYNC1
Angle (rad)
Pitch angle
0 10 20 30 40
-0.0010 -0.0005 0.0000 0.0005 0.0010
Time (s) Time (s)
NONSYNC SYNC1
Angle (rad)
Time (s) Yaw angle
(a) Performance of tracking trajectory (b) Angle response
-0.0010 -0.0005 0.0000 0.0005 0.0010
Sync error e12 (rpm) NONSYNC
SYNC1
-0.0010 -0.0005 0.0000 0.0005 0.0010
Sync error e23 (rpm)
0 10 20 30 40
-0.0010 -0.0005 0.0000 0.0005 0.0010
Sync error e31 (rpm)
Time (s)
-0.0010 -0.0005 0.0000 0.0005 0.0010
Sync error e23 (rpm) NONSYNC
SYNC1
-0.0010 -0.0005 0.0000 0.0005 0.0010
Sync error e24 (rpm)
0 10 20 30 40
-0.0010 -0.0005 0.0000 0.0005 0.0010
Sync error e34 (rpm)
Time (s)
0 50 100 150
Error Traj Actuator 1 (RPM)
NONSYNC SYNC1
0 50 100 150
Error Traj Actuator 2 (RPM)
0 50 100 150
Error Traj Actuator 3 (RPM)
0 10 20 30 40
0 50 100 150
Error Traj Actuator 4 (RPM)
Time (s)
(c) Synchronization error (d) Tracking speed error of actuators Fig. 4.5 Response of the quad-rotor UAV without disturbance using different control
58
-1.0 -0.5 0.0 0.5
Position (m)
NONSYNC SYNC1 X-Ground position (X Desired=0)
-2 -1 0 1
NONSYNC SYNC1
Position (m)
Y-Ground position (Y Desired=0)
0 10 20 30 40
0 2 4 6
Time (s) Time (s)
Desired Altitude NONSYNC SYNC1
Position (m)
Time (s) Altitude
-1.0 -0.5 0.0 0.5 1.0
NONSYNC SYNC1 NONSYNC SYNC1
Angle (rad)
NONSYNC SYNC1 Roll angle
-0.5 0.0 0.5 1.0
Angle (rad)
Pitch angle
0 10 20 30 40
-0.01 0.00 0.01
Time (s) Time (s)
Angle (rad)
Time (s) Yaw angle
(a) Performance of tracking trajectory (b) Angle response
-400 -200 0 200 400
Sync error e12 (rpm) NONSYNC
SYNC1
-400 -200 0 200 400
Sync error e13 (rpm)
0 10 20 30 40
-400 -200 0 200 400
Sync error e14 (rpm)
Time (s)
-200 -100 0 100 200
Sync error e23 (rpm) NONSYNC
SYNC1
-200 -100 0 100 200
Sync error e24 (rpm)
0 10 20 30 40
-200 -100 0 100 200
Sync error e34 (rpm)
Time (s)
-100 0 100 200 300 400
Error Traj Actuator 1 (RPM)
NONSYNC SYNC1
-100 0 100 200
Error Traj Actuator 2 (RPM)
-100 0 100 200
Error Traj Actuator 3 (RPM)
0 10 20 30 40
-100 0 100 200
Error Traj Actuator 4 (RPM)
Time (s)
(c) Synchronization error (d) Tracking speed error of actuators Fig. 4.6 Response of the quad-rotor UAV with disturbance using different control
59 (a) 3D view position of NONSYNC (b) 3D view position of SYNC1
Fig. 4.7 3D view the position of the quad-rotor UAV using different control