

The benefit of adding this extra step is that I think the Simulink code is easier to understand, plus over the next two videos, we’ll talk about how we can build a model of the drone and the environment in Simulink so that we can simulate the performance of our flight controller and use existing tools to tune the controller gains. With this option, we’ll develop the flight controller in Simulink, then auto code it into C code, where if we wanted to we could make changes manually, then compile that C code and load it onto the minidrone. So we’re going to use a second option, describing the flight controller graphically using block diagrams. But my experience is that designing and modeling control systems in C code makes it hard to explain the architecture to other people and it’s more difficult to understand how changes impact the whole system than it is with graphical methods. We could develop our own tuning tools and a model of the system and simulate how it would behave that way. With this method, we don’t have an easy way to tune the controllers except by tweaking them on the hardware. This is a perfectly reasonable approach to creating flight code, but it has a few drawbacks when developing feedback control software. One option to implement the flight controller would be to write the C code by hand and then compile the entire flight code with your changes to the flight controller and finally load the compiled code to the minidrone. There’s code to manage the batteries, the Bluetooth ® interface, and LEDs, there’s code to manage the motors speeds, and so on, there’s a bunch. There’s also code to operate and interface with the sensors and process their measurements. I’m Brian, and welcome to a MATLAB Tech Talk.įlight control software is just a small part of the overall flight code that will exist on the Parrot minidrone. In this video, we’re going to explore the flight code in more detail. So we’ll have two different bits of software that we’ll write: the actual flight code that runs on the quadcopter, and the model code that we use to simulate the real world. To do that we’ll use Model-Based Design where we’ll use a realistic model of the quadcopter and the environment to design our flight code and simulate the results. And second, we’ll need to tune and tweak the flight code until the hover performance is what we’re looking for.

First, we need to code the control logic in a way that we can put it on the minidrone. However, there are still a few more steps we need to take before we can actually get the drone up and flying. At this point in the series, we’ve learned how quadcopters generate motion with their four propellers and we’ve stepped through a control system architecture that we think is capable of getting our drone to hover. We are well on our way to designing a control system for a quadcopter.
