Developing a Real-Time MAV Flight Control System Test Bed Using NI LabVIEW and PXI
"Using LabVIEW and NI PXI hardware, we achieved full dynamic flight control of two vehicles with a team of two developers."
- Christopher McMurrough,
Automation and Robotics Research Institute at The University of Texas at Arlington
Creating a modular test bed for rapid flight control development of autonomous micro air vehicles (MAVs) using real-time motion capture technology.
Using the NI LabVIEW Real-Time Module to develop an application running on a multicore PXI machine for processing incoming motion capture data, executing the vehicle feedback controller, and sending actuator commands to the vehicle radio transmitter.
Christopher McMurrough - Automation and Robotics Research Institute at The University of Texas at Arlington
Kyle French - Georgia Institute of Technology
David B. Doman - Air Force Research Laboratory
While many technical hurdles in MAV development have been addressed, there are still many challenges that have yet to be met. Because the size and maneuverability requirements of many envisioned MAV systems require an unconventional approach to propulsion, such as flapping wings, the design of flight controls in particular remains an unresolved issue.
To facilitate the development and testing of flight controls for future MAV platforms, we created the real-time MAV flight control system test bed for the U.S. Air Force using the LabVIEW development system and NI PXI hardware. The solution consists of a third-party motion capture system, a real-time command and control application running on the PXI, a development PC running LabVIEW software, and a vehicle transmitter interface.
Real-Time Motion Capture
The motion capture system consists of 36 high-speed cameras situated evenly throughout the test environment. We connect each camera to one of four coordinator units through a proprietary high-speed network interface. Each coordinator is connected to the central vision processing server through a standard network connection. We configured the central server to track the position and orientation of predefined bodies using small adhesive markers. Each camera measures the relative positions of the reflective markers within its visual window and forwards this information to the central server, which computes the position and orientation of all defined bodies to within 0.1 mm.
The control application running on the PXI hardware receives real-time position and orientation data from the motion capture system through a standard network connection. We send this data to the PXI at a rate of up to 120 Hz in a TCP packet with each packet containing the spatial data for all tracked objects in the test environment.
Given the critical real-time nature of the flight controller, the incoming data parsing has to keep up with the motion capture sending rate without missing packets. In this application, a missed packet is not only useless, but potentially dangerous if the server attempts to resend lost data. The network communication modules provided by LabVIEW can process the streaming data because the PXI control application is always able to service each incoming packet with plenty of time to spare.
Vehicle Transmitter Interface
In addition to handling the parsing of incoming spatial data and computing the flight control algorithm at each time step, the PXI control application delivers commands to the vehicle radio transmitter. In this application, we use a standard hobbyist radio transmitter to send actuator commands to the vehicle.
The transmitter is equipped with a “trainer port” that allows an external pulse position modulation (PPM) signal to control the actuator command transmission. We generate the PPM signal using a third-party microcontroller-based device that takes input from an RS232 serial port in the form of packets. Each pulse of the PPM signal has a specific length, which is represented as a packet of microsecond values. Each value corresponds to the time that the pulse is allowed to remain at its specific logic level before being inverted. Once inverted, the next pulse time is activated.
The PXI control application sends these RS232 data packets to the transmitter interface at a specific rate. If packets are sent at a rate deviating from 50 Hz, it can result in unpredictable behavior; therefore, a deterministic process is required and the timed-loop structure in LabVIEW enables delivery of the data packets at the required rate.
Rapid Control Law Development
To provide a method for rapid test and development of control laws for MAVs, we used the LabVIEW Simulation Interface Toolkit, which provides a critical real-time link between The MathWorks, Inc. Simulink® development system and the flight control system test bed. We created the PXI application with a timed-loop structure dedicated to processing the flight controller. We also designed and provided wrapper VIs to researchers who wanted to test a new flight controller or vehicle. We set up the system so that the user only needs to import their Simulink model into the wrapper VI and route their controller inputs and outputs to the signals provided within the wrapper VI. Alternatively, the user can also import their vehicle controller designed solely in LabVIEW using the same wrapper VI.
Reliability Using Multicore Technology
The MAV flight control system test bed requires a high degree of determinism during program execution. The distributed nature of this real-time system presents possible points of failure if competition for resources occurs between two or more tasks. The program consists of dedicated loops for processing the incoming spatial data, running the vehicle controller, packaging the transmitter outputs, and displaying graphical information to the user. Because each loop must run at specific intervals without conflicting with each other, we assigned the LabVIEW timed-loop structures specific cores and priorities on the multicore PXI machine. We also gave each process a certain time shift that prevents any two processes assigned to the same resource from conflicting with each other.
Because we designed the system to aid the development of future MAV platforms, we achieved validation using existing radio-controlled aerial vehicles. The first vehicle to fly successfully was a quadrotor-type rotorcraft. We flew the quadrotor within one month of the start of the project. We also tested several flight maneuvers such as stationary hovering, following a secondary moving object, figure-eight flight, and path following.
To prove the modularity of the system, we used a second vehicle for flight testing, which was a standard collective-pitch style helicopter. We quickly designed and loaded a second controller into the wrapper VI. The collective-pitch helicopter successfully completed flight testing the same day it arrived at the test bed, including “tweaking” of the feedback controller, which proved that we met the modularity requirements of the system. Assuming the user arrives at the test bed with a vehicle and functional feedback controller, flight testing can actually commence with less than one hour of setup time.
Benefits of Our Approach
The ambitious goal of this project was to develop a stable hovering quadrotor vehicle within two months. Using LabVIEW and NI PXI hardware, we achieved full dynamic flight control of two vehicles with a team of two developers. Using the timed-loop structures we reduced deterministic programming time. Furthermore, the flexibility of our approach permitted quick interfacing with a multitude of hardware and greatly reduced development difficulty, which helped our team of control design novices meet all of our objectives.
Simulink® is a registered trademark of The MathWorks, Inc.
This material is based on work supported by the United States Air Force under Contract No. F33615-03-D-3307. Any opinions, findings, conclusions, or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the United States Air Force.
Explore the NI Developer Community
Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.
Who is National Instruments?
National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.