MP2128g autopilot integration and verification for stabilization and control of mini-UAV aircraft in autonomous flight

Aleksander Olejnik*, Robert Rogólski*, Tomasz Mosiej*, Grzegorz Chmaj**

*WAT Military University of Technology, Department of Mechatronics and Aeronautics, Institute of Aviation Technology

**AGH University of Science and Technology, Department of Robotics and Mechatronics

Abstract: The article describes the MP2128g autopilot integration issues regarding light small UAV aircraft. The paper contains shortened autopilot capabilities and installation description in reference to stabilization and autonomous flight accomplishment. In addition to air segment, ground control station software description is also included. The article contains feedback loop adjustment process for several phases of flight. As the study result can be found report of the conducted autonomous flight over preprogrammed route. The study confirms possibility of use of tested avionic equipment for reconnaissance with application of mini-UAV.

Keywords: UAV, autopilot, flight control system

1. Introduction

This paper is devoted to one of the main topics of research project: Autonomous Unmanned Aerial Vehicles Equipped with Monitoring and Inspecting Means Destined for Aiding Police and Fire Department Operations. The project was carried out between 2010 and 2012 in cooperation of three contractors: AGH University of Science and Technology (Department of Robotics and Mechatronics), Military University of Technology (Institute of Aviation Technology) and EC Engineering company. The task for Institute of Aviation Technology of MUT was to design and construct the mini-UAV system with small, about
10 kg airplane, capable to conduct day-or-night reconnaissance missions at low altitudes and small distances. The main topics to perform in project investigations were the following:

– airframe design and construction with consideration of specific manufacturing technology,

– electric power plant optimization,

– application of self-made parachute recovery system,

– design and integration of on-board avionic system – including automated control subsystem (MP2128g autopilot), day or night vision subsystem with camera sensor, transmission and power supply equipment,

– small portable ground control station developing.

From above aspects the fundamental one was to apply light and reliable autopilot and to integrate its component with UAV airframe. The MP2128g was applied here as one of the most popular commercial solutions. The “integration” term quoted here has in fact double meaning: integration as assembling structural and electrical components (in mechanical context) and integration as fully-developed functionality of control elements properly and successfully controllable in applied program loops (in automation context). The final project product, that means UAV technology demonstrator, had to be equipped with autopilot system tested and verified both in steady-flight conditions and in manoeuvrability arising from keeping heading to go through user-imposed navigation points.

a)

b)

Fig. 1. Virtual airframe geometry model of mini-UAV designed in CAD environment (UG-NX) (a) and its structural components before assembling (b)
Rys. 1. Geometryczny model wirtualny mini-BSP wykonany w środowisku CAD (UG-NX) (a) oraz wytworzone elementy struktury płatowca przed montażem (b)

2. MP2128g – components and operation

The MP2128g autopilot enables stabilization and control for wide range of UAVs. High amount of on-board sensors support the fully autonomous operation – from takeoff to landing. The autopilot module can work in several modes, like altitude hold, airspeed hold, heading hold, GPS/INS navigation, turn coordination. With use of an additional magnetometer, the autopilot can calculate the wind
correction vector useful during crosstrack flights.

All feedback loop gains can be adjusted manually by user during the integration process.

2.1. Main components

The autopilot system consists of MP2128g core (40 × 100 mm /28 g), servoboard module (40 × 39 mm/ 18 g), ultrasonic altitude sensor (95 × 55 mm/92 g), compass module (43 × 13 mm/29,5 g), GPS antenna (38 × 34 mm/40 g), telemetry radio modem and small RC servomechanism devices (Hitec HS5125MG). All listed elements are ESD sensitive, good anti-static procedures are needed to be followed.

For proceeding first flights with autopilot, there is a standard RC transmitter/receiver needed.

Fig. 2. Autopilot component modules
Rys. 2. Moduły składowe systemu autopilota

Fig. 3. Autopilot setup diagram
Rys. 3. Schemat konfiguracji połączeń autopilota

2.2. Operation basics

The integration process can take place after the airframe has already performed flights in manual radio controlled mode. All servos need to be set up with the moving surfaces in the neutral positions. Then aircraft control surfaces do not have to be trimmed to assure stable flight performance.

After installation process there is a needed to perform flights with autopilot working as a flight data recorder.

This operation ensures user about proper installation and functioning.

Recorded data verification should include the following aspects:

– low vibration level measured from –x, -y, -z accelerometers,

– fluent airspeed read,

– fluent altitude read,

– no noises on the RC link.

In normal operation all of the RC control signals (PWM standard) are being detected by autopilot inputs and transmitted to actuators when the AP is in PIC mode (Pilot In Command). Switching the Autopilot into the CIC mode (Computer in Command), the feedback loops become active and the airplane starts its own navigation and control programmed procedures.

All servo mixes are performed by autopilot itself. To control the aircraft with MP2128g device, only simple outputs from RC transmitter sticks are needed. Further signal conditioning can be modified in autopilot software.

In autonomous flight the autopilot controls the aircraft behavior using feed-forward feedback loops. Each flight state (climb, turn, navigation, etc.) is controlled by a certain combination of these loops. Basic feedback loops of MP2128g are listed below:

– elevator from pitch,

– rudder from -y accelerometer,

– ailerons from roll,

– pitch from airspeed,

– roll from heading,

– pitch from altitude,

– throttle from altitude,

– throttle from airspeed,

– rudder from heading,

– heading from crosstrack.

When setting feedback gains, it is convenient to set the autopilot into throttle override mode. It means that the operator can manually control the throttle and reduce quickly rate of rotation if the airplane behavior seems to be unstable. After setting gains in all listed feedback loops, the autopilot is able to perform a fully autonomous flight plan.

2.3. Autopilot operation software

The MP2128g autopilot comes with powerful software set. Communicating with autopilot is possible through RS-232 compatible terminal or dedicated HORIZON Ground Control Station (GCS) Software. Parallel port terminal makes easy to generate reports from the various sensors mounted on the device, giving the user very useful diagnostic tool. During inspection works indoors, when GPS fix cannot be locked, user can fake the GPS receiver to make it work with autopilot shielded by building walls.

Fig. 4. UART terminal listing
Rys. 4. Listing terminalu szeregowego

Two types of files are loaded into the autopilot memory storage. The *.vrs files contain settings of the autopilot dedicated for specific airplane – control surface configurations, feedback loops gains, speed limitations. The .fly extension corresponds to a fly file including flight plan to be performed by autopilot during mission time.

Fig. 5. Sample of *.fly file
Rys. 5. Przykładowy plik *.fly

Both files configuration is performed with use of the HORIZON software. The GCS application enables the user to configure all flight parameters and plight plans in the real time of operation.

Fig. 6. Horizon software GUI
Rys. 6. Panel użytkownika interfejsu naziemnego

Fig. 7. The setup terminal for *.vrs file configuration
Rys. 7. Panel ustawień i konfiguracji plików *.vrs

2.4. Installation

All autopilot components must be installed in strictly specified airframe areas. The core needs to be placed as close as possible to aircrafts center of gravity. That location ensures INS module to work properly during the flight. The static and dynamic pressure ports placed on the MP2128g core are needed to be connected to the Pitot or Prandl tube using silicon hose connection.

Fig. 8. MP2128g core
Rys. 8. Moduł główny MP2128g

Autopilot can be mounted inside the airframe in different orientation to the one show above, this operation requires some configurations in autopilot software. When using optional compass module- (operating speed lower than 3 m/s), magnetometer must be placed far from electromagnetic influence sources like high voltage engine wires or steel elements, which would cause some shielding effect. The GPS antenna must be placed with good visual sky facing contact.

The autopilot require at least 4.2 V DC power supply (maximum 27 V), radio modem input voltage range is between 730 V DC. It is important to provide separate power sources for autopilot and the servos. Servos can draw large amounts of current for short periods of time and these fact can cause autopilot reset due to significant voltage drop.

Fig. 9. On-board devices powering diagram
Rys. 9. Schemat pokładowego układu dystrybucji energii

This powering setup avoids all possible ground loops in wiring connection that can introduce noise into the system.

Engine high performance batteries are placed on the fuselage mounting tray sliding in storage side guides.

Fig. 10. Storage tray with mounted on-board devices
Rys. 10. Płyta nośna zasobnika z zamontowanym wyposażniem

In above figure from the left is shown back cover with inside mounted magnetometer and radio modem antenna. In the center there is a fuselage tray with mounted radio modem, autopilot and the servoboard module. On the bottom of the tray are mounted high power LiPo engine batteries. The right side shows the front storage cover with inside mounted RC receiver and datalog DB-9 type connector.

Fig. 11. Under-fuselage storage for avionic equipment
Rys. 11. Zasobnik z wyposażeniem awionicznym

The equipment storage shown above holds together all three parts which have been mentioned earlier. Front and back covers are putted together with the fuselage using 50 mm Velcro straps. Fuselage cargo bay disassembly takes only a few seconds, hence it is very easy to replace or recharge inside mounted batteries. The rest of accumulators are placed inside the fuselage, next to the shown autopilot key switch.

In the fig. 12, GPS antenna is visible (the smaller black box with wiring). At the wing trailing edge is mounted the GPS/UMTS tracker. All accessories must perform a safety influence check before flight tests. In case of loss of control the GPS/UMTS module sends to the operator a message containing present GPS UAV coordinates. During flight tests there was no influence noticed into the RC link quality.

Fig. 12. GPS antenna and GPS tracker mounted on upper skin of center-wing
Rys. 12. Antena GPS wraz trakerem umieszczone na górnym pokryciu centropłata

2.5. Compass calibration process

The magnetometer module measures the aircraft actual compass heading. This module is very useful during
autonomous takeoff and landing procedures with possibly occurring crosswinds. This device is very sensitive to any magnetic field changes. It is well known that any ferromagnetic materials can cause magnetic field measurement distortions. On the UAV airframe are also installed
electronic devices which can influence some local magnetic field changes. The calibration process compensates for the effect of the fixed ferrous metals in the aircraft.

During the calibration process it is important to keep the aircraft in horizontal position and then in 90° vertical position. The calibration environment must be examined before any calibration procedures. It is very important to use analog compass to create North-South line as a baseline. Calibration procedure is supported by any serial port terminal application. All UAV systems must be switched on before getting started with the process.

Using serial port terminal, autopilot must be set up into the compass calibration mode by typing the KKKK command. With leveled aircraft there must be done a 360° rotation in the horizontal plane. The full rotation must be confirmed. In the next step the same rotation must be performed with a 90° roll. The compass calibration process can be verified by checking compass output values in the serial port terminal after autopilot restart.

Fig. 13. Second rotation with 90° roll – one of many position of UAV to set during compass calibration process
Rys. 13. Kolejny obrót BSP z 90° przechyleniem  jedno z wymaganych w procesie kalibracji ustawień kompasu

3. Verification program

Verification flight tests begin after autopilot installation process. Good safety procedures must be followed during preparation and flights. Secured safe flight area is obligatory. Normal flight path is very similar to a real flight traffic pattern with upwind takeoff leg.

The main purpose is to make manual turns and switch the autopilot into the computer in command mode along the upwind and downwind legs. The autopilot commands are changed in each flight in case to tune all of the feedback loops one after the other. After loop adjustment aircraft is ready to perform autonomous flights.

3.1. Feedback loop adjustment

First flight with switching between CIC and PIC modes begins like a normal radio controlled flight.

It is important to begin setting gains with the elevator from pitch, aileron from roll, and rudder from y accelerometer loops firstly. These loops are the inner loops, the most important to drive own basic stabilization.

Fig. 14. Climb feedback loop *.fly file
Rys. 14. Plik tupu *.fly służący do strojenia pętli wznoszenia

The pClimb command holds a constant pitch while attempting to hold the wings level and reduce sideslip to zero. With climb pitch set to zero the aircraft will not climb, so the pClimb command will never get close to specified altitude of 9994 m. By setting thoverride to 0 the user can control the throttle manually from the ground. The downwind and upwind legs may be flown in various speeds. This procedure makes possible the gain adjustment for various speed ranges.

All feedback loops work based on PID controllers. Gains can be changed in the *.vrs file after each flight. There is also another, more suitable way.

In the horizon software there is a tool – status monitor. This application allows the user to follow in the real time aircrafts flight parameters on graphs and change the PID regulation parameters. All of them are transmitted to the autopilot via radio modem immediately, and the aircraft response is visible on the graph in short time. All gain changes must be written again by user into the *.vrs after aircraft landing. All status monitor changes are temporary, they only stay into the autopilot’s memory until the next initialization.

Fig. 15. UAV logged position points displayed as flight path
Rys. 15. Zarejestrowany tor lotu BSP

PIC flight mode is marked by red, CIC flight mode is marked by blue color.

The CIC flight heading was set close to the wind direction in case to avoid possible wind influence into the basic aircraft stabilization.

When the aircraft is flying in the computer in command mode, there should be constant visual observation if all angles are being stabilized in the right way with no oscillations. If the plane’s nose seems to pitch up and down then the gains in the elevator from pitch loop should be reduced. The same operation should be done with ailerons from roll and yaw from y accelerometer feedback loops.

Fig. 16. Current roll/desired roll graph
Rys. 16. Przebieg wartości zadanej/ bieżącej przechylenia

Fig. 17. Current pitch/ desired pitch graph
Rys. 17. Przebieg wartości zadanej/ bieżącej pochylenia

The feedback gains at the beginning were set up for a similar airframe to the one used in study because of unknown dynamic behavior of used aircraft.

Along the time, it easy to notice that in the following CIC intervals the regulation process is being improved.

High values in red color represent the turns done in manual PIC mode. When reducing gains, it is best to reduce gain by around 25 %. The P term represents the proportional segment and refers to gain that acts directly on the difference between the desired and actual pitch. This gain refers to Kp mathematic symbol.

Mathematical expression for the P term contribution is shown below:

(1)

The I term represents the integral segment and refers to gain that acts on the sum of all the errors since the feedback loop was started. The I term can be applied to the sum of all pitch errors, so it trims the aircraft’s elevator position. Mathematical expression for the I term contribution is shown below:

(2)

The D term represents the differential segment and refers to gain that acts on the rate of change of error. In this example the D term acts on the rate of change of pitch. Mathematical expression for the D term contribution is shown below:

(3)

All other feedback loops need to be adjusted in the above mentioned way. To get all loops ready for autonomous flights, it is required to make around eight full stop
landing flights.

After each flight all logged data must be downloaded from the autopilot memory, this process rakes about 25 minutes to be done.

3.2. Autonomous flight

Mp2128g autopilot supports autonomous flights from takeoff to recovery. There are many types of possible takeoff and landing procedures, including winch, launcher or classic runway takeoffs, and parachute, deep stall or classic landings.

In this study the UAV performs manual takeoff’s and continuous autonomous flights along the preprogrammed route.

Fig. 18. Autonomous flight *.fly file
Rys. 18. Plik typu *.fly do realizacji lotu autonomicznego

Using this fly file the UAV can perform autonomous flight over four listed waypoints. The waypoint input format are lengths from aircraft’s takeoff point in rectangular coordinate system. There are also added three patterns with preprogrammed conditions. To make them active, there is needed a request from the user done on the GCS.

The last pattern is responsible for taking the UAV back to the takeoff area when RC signal is lost. This is called a safety procedure.

Fig. 19. GCS in-flight view
Rys. 19. Widok w locie panelu naziemnej stacji kontroli

On the Horizon GCS software are shown four waypoints. Each of them is flexible to user’s requirements. All of them can be moved or deleted in each time during the flight. The MP2820g can perform flights with up to 1000 programmed waypoints.

Fig. 20. Current/desired altitude vs flight time
Rys. 20. Przebieg wartości zadanej / bieżącej wysokości

During this flight the desired altitude was mostly set for 100 m. The severe turbulences caused altitude stabilization error of around 5 m along the flight.

Fig. 21. Current/desired heading, roll
Rys. 21. Przebieg wartości zadanej/ bieżącej kursu i przechylnia

Even though the strong turbulences, roll and heading stabilization was very close to the desired values. On the graph upper side are shown the desired and current heading values during the left turns. Heading error is never bigger than 10°.

During this flight the autonomous landing was not possible because of wrong ultrasonic altimeter readouts. The aircraft manual control was overtaken at the height of 12 m and the manual landing was done in PIC mode. Even with strong partial crosswind the flight path legs are very similar to each other during the flight.

4. Summary

This simple autonomous flight shows only a little part of MP2820g capabilities. This flight was done in case of signal loss on short range, flying around 340 m away from ground control station. The UAV is able to fly without any connection with the operator, but these tests unfortunately require very wide and safe secured area, what during this studies was impossible to reach. The airframe with described autopilot can carry on board additional payloads like for example day or night vision camera. HORIZON software supports several kinds of gimbal stabilized cameras, what enables the user to perform fully autonomous observation over wide range areas. Even with GPS signal loss, the autopilot can continue the flight based on its own INS navigation.

Fig. 22. Autopilot integration team with mini-UAV Rybitwa deveoped at the Military University of Technology
Rys. 22. Zespół badawczy podczas lotów próbnych mini-BSP Rybitwa opracowanym w Wojskowej Akademii Technicznej

References

1. Austin R., Unmanned Aircraft Systems – UAV Design, Development and Deployment, John Wiley & Sons Ltd., 2010.

2. Bociek S., Gruszecki J., Układy sterowania automatycznego samolotem, Wydawnicza Politechniki Rzeszowskiej, Rzeszów 1999.

3. Gruszecki J., Bezpilotowe aparaty latające. Systemy sterowania i nawigacji, Oficyna Wydawnicza Politechniki Rzeszowskiej, Rzeszów 2002.

4. Abzug M.J., Larrabee E.E., Airplane Stability and Control: A History of the Technologies that Made Aviation Possible, Cambridge University Press, 2002.

5. MicroPilot Autopilot Installation and Operation. MicroPilot Inc., December 2010.

6. Nelson R. C., Flight Stability and Automatic Control, Mc Graw-Hill Book Company, 1989.

7. Puscov J., Flight System Implementation in UAV. Examensarbete utfört vid Fysikinstitutionen, KTH, SCFAB Sommaren-Hösten 2002.

8. [http://www.uvs-international.org/] – UVS International: Terms & definitions applicable to Unmanned Aerial Vehicles (UAV) Systems. Edition VII, 31 October 2006.

9. Valavanis K.P., Advances in Unmanned Aerial Vehicles – State of the Art and the Road to Autonomy, Springer 2007.

Integracja i testy autopilota MP2128g w zastosowaniu do stabilizacji i sterowania mini-BSP w locie autonomicznym

Streszczenie: Artykuł przedstawia problematykę integracji autopilota MP2128g na pokładzie bezpilotowego statku powietrznego klasy mini. W rozważaniach zawarto skrócony opis możliwości i sposób montażu autopilota na potrzeby stabilizacji i wykonywania lotów autonomicznych. Oprócz segmentu powietrznego, zaprezentowano również możliwości dedykowanego oprogramowania służącego do zdalnej kontroli mini-BSP w trakcie realizacji misji. Opisano sposób strojenia pętli sterowania automatycznego w poszczególnych fazach lotu mini-samolotu. Wynikiem rozważań jest opis wykonanego w końcowej fazie badań autonomicznego lotu po wyznaczonej trasie. Przeprowadzony program badań potwierdza możliwość zastosowania opisywanego wyposażenia awionicznego na potrzeby obserwacyjnych bezpilotowych statków powietrznych.

Słowa kluczowe: BSP (bezzałogowy statek powietrzny), autopilot, system sterowania lotem

prof. Aleksander Olejnik, PhD, DSc, Eng

Born in Łódź in 1948, graduated from the Faculty of Mechanics of Military University of Technology (MUT), where he studied from 1968 to 1973 to obtain the title of Master of Science. In this department he also received degrees: PhD (1979) and habilitation (1988). He was honored with Title of professor in 1996. The scientific activity of Professor Olejnik concerns aerolastic issues of surface systems, the construction of a discrete dynamic models of aircraft and turbine aircraft engines and safety engineering of aerial vehicles.

e-mail: aleksander.olejnik@wat.edu.pl

Robert Rogólski, PhD Eng

Born in Warsaw in 1975, graduated from Faculty of Aviation and Armament of Military University of Technology – MUT (Faculty of Mechatronics and Aviation of MUT now), he received the degree of Doctor in 2005. His scientific activities are devoted to problems of aeroelasticity, airframe strength, rotor machine dynamics and UAV prototyping. During his scientific and educational work (since year 2000) he took part in over a dozen research projects. At present he is an assistant professor in Institute of Aviation Technology in FMA MUT.

e-mail: robert.rogolski@wat.edu.pl

Tomasz Mosiej, Eng

Born in Warsaw in 1989, graduated from the Faculty of Mechatronics MUT where he studied from 20082012, with the title of engineer in avionics. Since 2011 he has taken an active part in research projects conducted at the Institute of Aeronautics MUT. His activity relate to issues of automatic flight control systems and miniature avionics equipment used on board unmanned aerial vehicles.

e-mail: mosiej.tomasz@gmail.com

Grzegorz Chmaj, PhD Eng

(born in Rzeszów, 1980) graduated from University of Science and Technology in Cracow, Faculty of Mechanical Engineering and Robotics. He earned the academic degree of Doctor in 2010. His research interests include unmanned aerial vehicles and a self-stabilized payload systems. He collaborates with Department of Robotics and Mechatronics since 2010. He established a spinoff company  UAVS Poland Sp. z o.o., which commercialize the technology had been developed at AGH University of Science and Technology.

e-mail: chmaj@agh.edu.pl