Full Text Available

Note: Clicking the button above will open the full text document at the original institutional repository in a new window.

Design and implementation of a model predictive control on a pixhawk flight controller.

Thesis (MEng)--Stellenbosch University, 2018.

Saved in:
Bibliographic Details
Main Author: Amadi, Chinedu Amata
Other Authors: Smit, Willie. J.
Format: Thesis
Language:en_ZA
Published: Stellenbosch : Stellenbosch University 2018
Subjects:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1867613787504246784
access_status_str Open Access
author Amadi, Chinedu Amata
author2 Smit, Willie. J.
author_browse Amadi, Chinedu Amata
Smit, Willie. J.
author_facet Smit, Willie. J.
Amadi, Chinedu Amata
author_sort Amadi, Chinedu Amata
collection Thesis
dc_rights_str_mv Stellenbosch University
description Thesis (MEng)--Stellenbosch University, 2018.
format Thesis
id oai:scholar.sun.ac.za:10019.1/105078
institution Stellenbosch University (South Africa)
language en_ZA
last_indexed 2026-06-10T12:41:42.083Z
license_str Other — see source repository
provenance_str_mv Harvested via OAI-PMH from SUNScholar — Stellenbosch University Repository
publishDate 2018
publishDateRange 2018
publishDateSort 2018
publisher Stellenbosch : Stellenbosch University
publisherStr Stellenbosch : Stellenbosch University
record_format dspace
source_str SUNScholar — Stellenbosch University Repository
spelling oai:scholar.sun.ac.za:10019.1/105078 Design and implementation of a model predictive control on a pixhawk flight controller. Amadi, Chinedu Amata Smit, Willie. J. Stellenbosch University. Faculty of Engineering. Dept. of Mechanical and Mechatronic Engineering. Model predictive control -- Design Px4 firmware Pixhawk Constraints (Artificial intelligence) UCTD Autopilot (Computer program language) Flight control Thesis (MEng)--Stellenbosch University, 2018. 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. AFRIKAANSE OPSOMMING: Hommeltuie het die afgelope dekade meer gewildheid geraak. Hulle word gebruik in die weermag, brand- en reddingsmissies, sekuriteitsisteme en fotografie, om net ’n paar te noem. Hommeltuie word al meer gebruik soos meer toepassings vir hul gebruik ontdek word. By die Son Termiese Energie Navorsingsgroep (STERG), Universiteit Stellenbosch, word hommeltuie gebruik in die kalibrasie en inspeksie van heliostate en om die puntfokus van die heliostate te verbeter. Daarom is dit nodig om hommeltuie te gebruik met uitnemende prestasie om hierdie doelwitte te bereik. STERG gebruik die Pixhawk outoloots, een van die gewildste oopbron vlugbeheerders beskikbaar vir hommeltuignavorsing. Die Pixhawk gebruik die PX4 fermatuur wat bestaan uit modules vir toestandafskatting, posisie- en hoekbeheer en ander. ’n Proporsionele afgeleide (PD) beheerder is ge´’implementeer op die PX4-fermatuur om die hoektempo’s van die hommeltuig te beheer. Vorige studies toon egter dat hierdie beheerder ontoereikend is en ’n alternative beheerder noodsaak. Modelvoorspellende beheer (MVB) is gekies as ’n alternatief, omdat dit ’n reeks intree-waardes kan genereer om ’n stelsel te beheer deur die fout tussen die verwysingswaardes en die voorspelde uitree te minimeer, asook omdat dit die vermoë het om begrensings te hanteer. Nietemin is die MVB nog nie voorheen op die PX4-fermatuur geïmplementeer nie, aangesien dit ’n wiskundige model benodig van die spesifieke hommeltuig wat gebruik word. Dus, die doel van hierdie proefskrif is om die uitvoerbaarheid van MVB wat uitvoer op ’n Pixhawk met PX4-fermatuur te evalueer, waar die MVB die hoektempo van ’n hommeltuig beheer. Die MBV-hoektempo beheerder is ontwerp en geïmplementeer in MATLAB. Die beheerder is in C++ geprogrammeer vir aanpasbare insluiting in die betrokke PX4-module. ’n Hommeltuig-simulator is gebruik om die gewysigde PX4-fermatuur op ’n gesimuleerde hommeltuig uit te voer en so die hoektempo te beheer. Daarna is die PX4-fermatuur op die Pixhawk gelaai. Verskeie uitdagings is in hierdie stadium ondervind, die mees prominente was die grootte van Pixhawk se geheue. Maatreëls soos kodeoptimering, stapelgrootte aanpassing en om ongebruikte modules af te skakel was nodig om ’n suksesvolle fermatuuroplaai te verseker. ’n Hommeltuig wat die gewysigde PX4-fermatuur op die Pixhawk uitvoer, is in vlug getoets en daarna is die hoektempo vlugdata geteken en ontleed. Die plotte toon dat die MVB-hoektempo beheerder in staat is om die verwysing vir hoektempo’s goed te volg. Die bevindinge van hierdie nuwe benadering demonstreer die haalbaarheid om modelvoorspellende beheer op die PX4 fermatuur te ïmplementeer, en stel voor dat ’n Pixhawk met ’n groter geheue gebruik moet word om MVB te integreer met ander PX4 beheer modules. 2018-11-27T18:50:45Z 2018-12-07T06:58:26Z 2018-11-27T18:50:45Z 2018-12-07T06:58:26Z 2018-12 Thesis http://hdl.handle.net/10019.1/105078 en_ZA Stellenbosch University 134 pages : illustrations application/pdf Stellenbosch : Stellenbosch University
spellingShingle Model predictive control -- Design
Px4 firmware
Pixhawk
Constraints (Artificial intelligence)
UCTD
Autopilot (Computer program language)
Flight control
Amadi, Chinedu Amata
Design and implementation of a model predictive control on a pixhawk flight controller.
title Design and implementation of a model predictive control on a pixhawk flight controller.
title_full Design and implementation of a model predictive control on a pixhawk flight controller.
title_fullStr Design and implementation of a model predictive control on a pixhawk flight controller.
title_full_unstemmed Design and implementation of a model predictive control on a pixhawk flight controller.
title_short Design and implementation of a model predictive control on a pixhawk flight controller.
title_sort design and implementation of a model predictive control on a pixhawk flight controller
topic Model predictive control -- Design
Px4 firmware
Pixhawk
Constraints (Artificial intelligence)
UCTD
Autopilot (Computer program language)
Flight control
url http://hdl.handle.net/10019.1/105078
work_keys_str_mv AT amadichineduamata designandimplementationofamodelpredictivecontrolonapixhawkflightcontroller