Design and implementation of a model predictive control on a pixhawk flight controller.
[摘要] 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 systemsand photography, just to list a few. The rate of adoption of quadcoptersis on the rise as more applications for their use are discovered. At the SolarThermal Energy Research Group (STERG), Stellenbosch University, quadcoptersare used in the calibration and inspection of heliostats and to improvepoint focusing of the heliostats. Therefore, it is necessary to use quadcopterswith excellent performance to achieve these objectives.STERG uses the Pixhawk autopilot, one of the most popular open sourceflight controllers available, for quadcopter research. The Pixhawk runs onthe PX4 firmware comprised of modules used for state estimation, positionandangular control and others. A Proportional Derivative (PD) controlleris implemented on the PX4 firmware to control the angular rates of a quadcopter.However, previous studies show that this controller is inadequate andnecessitates a need for an alternative. Model Predictive Control (MPC) waschosen as the alternative, due to its ability to generate a sequence of inputsneeded to control a system by minimising the error between reference valuesand predicted outputs and also its ability to handle constraints. Nevertheless,MPC has not been implemented on the PX4 firmware before, as it requires amathematical model of the specific quadcopter to be used. Thus, the aim ofthis 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 inclusionin the relevant PX4 module. A multicopter simulator was used to run themodified PX4 firmware on a simulated quadcopter to control its angular rates.Subsequently, the PX4 firmware was uploaded onto the Pixhawk. Several challengeswere encountered in this stage, with the most prominent, being the sizeof the memory on the Pixhawk. Measures such as code optimisation, stacksize adjustment and disabling unused modules were necessary to ensure a successfulfirmware upload. A quadcopter running the modified PX4 firmware the Pixhawk was flight tested and thereafter, the angular rates flight data wasplotted and analysed. The plots show that the MPC angular rates controlleris able to achieve close reference tracking of angular rates.The findings from this novel approach demonstrate the feasibility of implementingmodel predictive control on the PX4 firmware, and proposes usinga Pixhawk with a larger memory in order to integrate MPC into other PX4control modules.
[发布日期] [发布机构] Stellenbosch University
[效力级别] [学科分类]
[关键词] [时效性]