User Stories

NASA Interns Develop Guidance, Navigation, and Control Software for Quadcopter with Model-Based Design

Challenge

Give engineering interns hands-on work experience in the aerospace field

Solution

Create a program in which interns use Model-Based Design to model, simulate, implement, and fly GNC algorithms for multirotor aircraft

Results

  • GNC algorithms developed and implemented in 10 weeks
  • Hardware integration streamlined
  • Practical engineering experience acquired

Model-Based Design makes both working engineers and interns at NASA MSFC more productive. The students have more fun because they can run the GNC algorithms they create in Simulink on a real processor and quickly get things done.

NASA intern working with the quadcopter vehicle and ArduPilot Mega 2.5 hardware.

Internship programs at NASA provide engineering students with opportunities to work on engaging aerospace projects and introduce them to the tools and processes used by practicing engineers.

NASA’s Marshall Space Flight Center (MSFC) meets these objectives with a program in which interns and junior engineers use Model-Based Design with MATLAB® and Simulink® to develop guidance, navigation, and control (GNC) software for small multirotor aircraft.

With Model-Based Design, young engineers can build hardware, write flight software, and conduct flight tests to validate their models and control design in a 10-week program. They use the same tools the NASA MSFC team used to develop the GNC algorithms for the Mighty Eagle robotic lander and other systems.

Challenge

The NASA MSFC team sought a realistic yet economical way to give their interns opportunities to work directly with flight software and hardware. They selected a quadcopter vehicle and ArduPilot Mega 2.5 hardware for the program, but this approach brought several challenges.

First, they needed to provide undergraduate engineers, many of whom had little control design or programming experience, with easy-to-learn tools that they could use to rapidly develop GNC algorithms. Second, to avoid damaging the aircraft, they needed a simulation environment that would enable the interns to verify their algorithms before flight testing. Lastly, they needed an easy way for the interns to deploy algorithms to the ArduPilot hardware and interact with the accelerometers, gyroscopes, and other sensors on the ArduPilot board.

Solution

The NASA MSFC team selected Model-Based Design with MATLAB and Simulink for their engineering internship program.

Interns learn modeling, simulation, and control design in Simulink by viewing the Simulink tutorials on mathworks.com and attending training sessions conducted by NASA engineers.

After assembling the quadcopter from a kit, they build a six-degree-of-freedom model of the quadcopter in Simulink, using Aerospace Blockset™ to model the equations of motion.

Working in Simulink, they create a controller model to provide stability augmentation for the quadcopter. To access input from ArduPilot sensors, including accelerometers, gyros, and the magnetometer, they add blocks from the APM2 Simulink Blockset to their controller model.

They acquire a linear model from Simulink, analyze the gain and phase margin with the SISO Design Tool from Control System Toolbox™, and then run simulations to verify the control system performance. Using a block from Aerospace Blockset, they connect the model to FlightGear flight simulation software to visualize simulation results, and then refine their design based on those results.

Using the Run on Target Hardware feature of Simulink, the interns load their controller model directly onto the ArduPilot Mega hardware for flight testing.

They postprocess recorded flight data in MATLAB and use the results to fine-tune their control algorithms and plant model.

NASA MSFC engineers are currently revising their internship program. The new version will use a hexacopter. The ArduPilot Mega hardware will be replaced with the more powerful Pixhawk processor, which will enable interns to incorporate Kalman filtering, implement sliding mode controls, and handle engine out conditions. They will generate C code for the Pixhawk target from their Simulink models using Embedded Coder®.

Results

  • GNC algorithms developed and implemented in 10 weeks. For working aerospace engineers, it can be a daunting task to develop a high-level control algorithm, write it in C, and integrate it with other code needed to fly the aircraft. With Model-Based Design, NASA interns develop their control algorithms and have them flying in 10 weeks.

  • Hardware integration streamlined. With a single click, the interns deployed their Simulink model to the Arduino and were ready to test their algorithms in flight. Using the APM2 Simulink Blockset simplified communication with ArduPilot hardware.

  • Practical engineering experience acquired. One of the interns used the knowledge he gained at NASA to design an advanced Kalman filter for flight control on his fourth-year engineering design project. Another was offered a job simulating quadcopters, in part because of his Model-Based Design experience.