7. Performance evaluation

only error in control signals are calculated. Here we see that the backpropagation calculation

The reasons for the first approximation are twofold: firstly, we want the controller ANN to learn as if the plant emulator ANN got its prediction correct for better learning, and secondly, as the system converges ymodel will very nearly equal yplant making the approximation asymp-

The reason for the second approximation is that it was experimentally found that without information of velocities the controller was not able to distinguish whether the plant was converging to or diverging from the reference when error was the same. This information was encoded into the controller by this modification and supplying the derivative of the reference error to each controller segment. Overhauling the network to incorporate the derivative terms as part of the output of the plant emulator ANN would make the system slower due to the increased complexity as it would have to learn the relation between a state and its derivative. This way the two error terms are additive and embody our intuition well - let us assume the error in z is moderate but the error in velocity of z is large, a larger correction would be effected in that iteration of learning, speeding it along. Conversely, if the reference error is large and the craft is approaching the reference too fast, the additive nature of the derivative term would negate any further positive adjustment due to the error in z thereby covering up the gap in

1. Feature Scaling: The inputs to the controller are divided by their respective standard deviations, since the values expected vary in magnitude and the weights of the network are regularized regardless of magnitude of input. In order to calculate the standard deviation in an online setting without losing significant information to truncation in data

Initialize M<sup>1</sup> ¼ x<sup>1</sup> and S<sup>1</sup> ¼ 0 (35)

<sup>k</sup> , Sk <sup>¼</sup> Sk�<sup>1</sup> <sup>þ</sup> ð Þ� xk � Mk�<sup>1</sup> ð Þ xk � Mk (36)

, k E ½ � 2; n (37)

storage the following equations are used (as presented in Ref. [9]):

while not magnifying higher order effects in the control signal.

Current value <sup>σ</sup> <sup>¼</sup> Sk

k � 1

The scaling is done selectively on the reference error and derivative of the reference error in each controller segment. This is done to scale up and give equal weight to the two errors

2. Directed Initialization: Since there are no hidden layers and a single output for each segment there is no risk of redundancy in uniform initialization. Initializing all weights to

Compute Mk <sup>¼</sup> Mk�<sup>1</sup> <sup>þ</sup> ð Þ xk � Mk�<sup>1</sup>

1. ymodel is the output of the network, not yplant yet we backpropagate using yplant

plant is being backpropagated through the network meant for yplant

remains the same with two approximations:

2. y\_

totically accurate.

154 Adaptive Robust Control Systems

intelligence.

6.4. Speed-ups for online learning

The testing was carried out as outlined above and the results were plotted. Figure 9 depicts the first episode of training of the z controller, which converges within 10 seconds (at 100 Hz) and accurately follows the reference thereafter. α ¼ 0:01.

Figure 10 depicts the first episode of training of the pitch controller. Deviation from the reference is only due to the limitation on the maximum thrust the controller can demand (5 mN) due to bounding sigmoid function on control signal. α ¼ 10.

Figure 11 depicts the first episode of training of the yaw controller. Oscillations steadily decrease as training proceeds and the entire range of �π to π is covered. α ¼ 3.

Figure 12 depicts simultaneous control of all four states, with controller weights continued forward from the first episode of training and plant ANN weights reset to initial estimate derived from offline training (accounting for the initial overshoot in z.) This result shows that the controller tracks well under simultaneous control signals from all four channels.

Figure 13 demonstrates the controller's robustness to mass and moment of inertia variations. At t ¼ 25 sec the mass of all four motors are increased by 50 g leading to a 40% increase in total mass. The plant emulator learns these changes mid-flight enabling the controller to maintain tracking. The deviations in yaw are due to the inability of motors to meet increased thrust demands with increased moment of inertia. At t ¼ 75 sec the mass and moments of inertia are reset to original values.

<sup>0</sup> <sup>500</sup> <sup>1000</sup> <sup>1500</sup> −4

ms)

0.05 0.1 0.15 0.2 0.25 0.3 0.35

−3 −2.5 −2 −1.5 −1 −0.5 0

Height (in m)

Figure 12. Simultaneous control of roll, pitch, yaw and z shows tracking with minimal error; yaw deviates slightly due to

Pitch angle (in radians)

Yaw actual Yaw reference Roll and Pitch actual

http://dx.doi.org/10.5772/intechopen.71487

157

Model Reference Adaptive Control of Quadrotor UAVs: A Neural Network Perspective

<sup>0</sup> <sup>500</sup> <sup>1000</sup> <sup>1500</sup> <sup>0</sup>

Z (Altitiude)

Pitch

Actual Reference

ms)

Time (x102

<sup>0</sup> <sup>500</sup> <sup>1000</sup> <sup>1500</sup> −3.5

ms)

Actual Reference

Time (x102

Time (x102

Figure 11. Zero initialized yaw controller reduces oscillations over time while tracking throughout.

Actual Reference

<sup>0</sup> <sup>500</sup> <sup>1000</sup> <sup>1500</sup> <sup>0</sup>

Yaw

Rol

ms)

Actual Reference

Time (x102

<sup>0</sup> <sup>500</sup> <sup>1000</sup> <sup>1500</sup> −0.5

ms)

Time (x102

thrust saturation with large roll and pitch, however overshoot is acceptable.

−3

0.1

0 0.5 1 1.5 2

Yaw angle (in radians)

0.2

Roll angle (in radians)

0.3

0.4

−2

−1

Angle (in radians)

0

1

2

3

Figure 9. Starting with random weights the controller stabilizes the quadrotor to follow the reference.

Figure 10. Directed initialized weights of pitch controller follows reference fairly well; any deviations occur due to thrust saturation.

Figure 11. Zero initialized yaw controller reduces oscillations over time while tracking throughout.

Figure 12. Simultaneous control of roll, pitch, yaw and z shows tracking with minimal error; yaw deviates slightly due to thrust saturation with large roll and pitch, however overshoot is acceptable.

Figure 10. Directed initialized weights of pitch controller follows reference fairly well; any deviations occur due to thrust

0 100 200 300 400 500 600

ms)

Z actual Z reference

Time (x102

Figure 9. Starting with random weights the controller stabilizes the quadrotor to follow the reference.

saturation.

−4.5

−4

−3.5

−3

−2.5

Height (in metres)

−2

−1.5

−1

−0.5

0

156 Adaptive Robust Control Systems

In real world systems, such as in UAVs where on-board processing is limited, processing time is a major factor and several methods for speed-ups were discussed which are computationally light. Even dynamically unstable systems such as UAVs could be stabilized using an untrained

Model Reference Adaptive Control of Quadrotor UAVs: A Neural Network Perspective

http://dx.doi.org/10.5772/intechopen.71487

159

Thanks to Mr. Raghu Ramachandran for his tireless efforts day in and day out, without whom

Thanks to all the people at Navstik Labs for the healthy work culture they nurture, setting the foundation for greatness. Thanks to Mr. Nitin Gupta (CEO and Founder of Navstik Labs) for

Thanks to Prof. Andrew Ng, whose ML lectures<sup>4</sup> have been referred to in introducing machine

Thanks to Dr. Bina Bakshi, my mother, whose love, care and support kept me going through

giving me the opportunity to start something new and for his support along the way.

\*Address all correspondence to: nabakshi@iitkgp.ac.in; nikhilangadbakshi@gmail.com

[1] Bakshi NA, Ramachandran R. Indirect model reference adaptive control of quadrotor UAVs using neural networks. In: Intelligent Systems and Control (ISCO), 2016 10th International Conference; 7–8 Jan. 2016; Coimbatore, India: IEEE; DOI: 10.1109/ISCO.2016.

[2] Bouabdallah S, Siegwart R. Full control of a quadrotor. In: Intelligent Robots and Systems, 2007. IROS 2007. IEEE/RSJ International Conference; Oct. 2007; pp. 153-158. DOI: 10.1109/

http://cs229.stanford.edu/materials.html, https://www.coursera.org/learn/machine-learning

the project upon which this chapter is based would not have been successful.

controller in-flight by devising a training regime.

Acknowledgements

learning and neural networks.

the challenging times.

Nikhil Angad Bakshi1,2\*

2 Navstik Labs, Pune, India

1 Indian Institute of Technology, Kharagpur, India

Author details

References

7727123

4

IROS.2007.4399042

Figure 13. At t ¼ 25 sec , the mass of all four motors is increased by 50 g; at t ¼ 75 sec , mass and moments of inertia are reset to original values; results indicate the adaptive nature of the controller.
