Masters Degrees (Mechanical and Mechatronic Engineering)
Permanent URI for this collection
Browse
Browsing Masters Degrees (Mechanical and Mechatronic Engineering) by Author "Amadi, Chinedu Amata"
Now showing 1 - 1 of 1
Results Per Page
Sort Options
- ItemDesign and implementation of a model predictive control on a pixhawk flight controller.(Stellenbosch : Stellenbosch University, 2018-12) Amadi, Chinedu Amata; Smit, Willie. J.; Stellenbosch University. Faculty of Engineering. Dept. of Mechanical and Mechatronic Engineering.ENGLISH ABSTRACT: Quadcopters have undergone a steady rise in popularity in the last decade. They have been adopted in the military, fire and rescue missions, security systems and photography, just to list a few. The rate of adoption of quadcopters is on the rise as more applications for their use are discovered. At the Solar Thermal Energy Research Group (STERG), Stellenbosch University, quadcopters are used in the calibration and inspection of heliostats and to improve point focusing of the heliostats. Therefore, it is necessary to use quadcopters with excellent performance to achieve these objectives. STERG uses the Pixhawk autopilot, one of the most popular open source flight controllers available, for quadcopter research. The Pixhawk runs on the PX4 firmware comprised of modules used for state estimation, positionand angular control and others. A Proportional Derivative (PD) controller is implemented on the PX4 firmware to control the angular rates of a quadcopter. However, previous studies show that this controller is inadequate and necessitates a need for an alternative. Model Predictive Control (MPC) was chosen as the alternative, due to its ability to generate a sequence of inputs needed to control a system by minimising the error between reference values and predicted outputs and also its ability to handle constraints. Nevertheless, MPC has not been implemented on the PX4 firmware before, as it requires a mathematical model of the specific quadcopter to be used. Thus, the aim of this thesis is to evaluate the feasibility of implementing MPC on the Pixhawk, running the PX4 firmware, to control the angular rates of a quadcopter. The MPC angular rates controller was designed and implemented in MATLAB. The controller was then programmed in C++ for compatible inclusion in the relevant PX4 module. A multicopter simulator was used to run the modified PX4 firmware on a simulated quadcopter to control its angular rates. Subsequently, the PX4 firmware was uploaded onto the Pixhawk. Several challenges were encountered in this stage, with the most prominent, being the size of the memory on the Pixhawk. Measures such as code optimisation, stack size adjustment and disabling unused modules were necessary to ensure a successful firmware upload. A quadcopter running the modified PX4 firmware the Pixhawk was flight tested and thereafter, the angular rates flight data was plotted and analysed. The plots show that the MPC angular rates controller is able to achieve close reference tracking of angular rates. The findings from this novel approach demonstrate the feasibility of implementing model predictive control on the PX4 firmware, and proposes using a Pixhawk with a larger memory in order to integrate MPC into other PX4 control modules.