A Model Helicopter at the XV Multidisciplinary Symposium

Written by

in

This is another one of those Off-Topic posts that has nothing to do with anything. Or almost nothing. I think most of you are already tired of knowing that this is my last year at university and that this year I’m all tangled up with our Graduation Project (TG). Those who follow my Twitter have some idea of how much this has been eating up my time. You may be asking yourself: “What does this project do?”. In one word: “Nothing”. We have been working for more than a year developing hardware, firmware, driver, software and control so that the project does nothing. Actually, the goal is that nothing happens to a model helicopter in flight. OK, alright, let’s start from the beginning now.

Once upon a time there was a model helicopter

Some of you already know that besides being a dumb programmer, I also try to spend the time I don’t have as a model-helicopter hobbyist. A model helicopter is a reduced-scale helicopter, equipped with a combustion or even electric engine. With the functionalities of a conventional helicopter, it is capable of performing flights with the same characteristics and freedom of movement. In fact, when it comes to flight capability, a model helicopter can do more than a real helicopter. It is not uncommon to see a model helicopter flying upside down.


A model helicopter is controlled by a radio-control system that determines the movements of servomotors installed on the aircraft. Each servo has its specific role within the model helicopter. One controls the throttle, another the pitch of the tail-rotor blades, and so on.

Is it easy to control a model helicopter?

Not at all. The radio control has two sticks, so there are 4 movements you must command at the same time, on top of the extra switches. The big problem is that gaining the reflexes needed to make the correction takes a certain amount of training time. Believe me, you don’t want a model helicopter flying out of control near you. Besides the risk of getting hurt, it is almost certain that the model helicopter will hit something and split into several pieces. I can tell you this is not cheap equipment, and each crash can mean hundreds of reais to get everything working again. To get started with this hobby we normally use a simulator.


A simulator is very much like a video game. With it you get a special joystick that is a replica of a radio control, but which interfaces with your computer via USB. You use that joystick to control a model helicopter on your computer screen. So, at each crash the model suffers, you just press a reset button on the control itself so you can try again. When I was starting out in the hobby, everyone recommended a simulator to me until I bought one. I kept thinking: “Hard, my foot… Bring it on? Only for those old-timers. I’ve got more than twenty years of video games under my belt”. When I started playing with the simulator I saw it wasn’t so easy after all. Dozens and dozens of crashes. Simulators are really an excellent start. They manage to reproduce a model’s behavior in great detail.


After the simulator, you normally take flight lessons. And for that you hire an instructor. But what can an instructor do besides wishing you good luck? What happens is that radio controls can be connected by a training cable. This cable allows the instructor to control the model helicopter, and by flipping a switch, control passes to the student’s hands. If the student loses control over the model, the instructor can take control back and keep your brand-new model helicopter from turning into a pile of junk.

Cool, but what about the project?

Our project aims to control a model helicopter in flight in order to stabilize it. That is why I say our project is going to do nothing. There was even a professor who said: “Wow! You’re going to do all this to make a helicopter stand still?”. If you are a model-helicopter hobbyist, you know that keeping the model helicopter still is a pilot’s first challenge. Even in windless environments, stabilizing a model helicopter requires a good amount of experience. Our final goal would be to describe a simple flight plan where it takes off, stabilizes in the air, makes a few movements and finally lands. We don’t want to bite off more than we can chew. Let’s see what we can get by presentation day.

To detect the model helicopter’s movements, we installed some sensors on it; the sensor data is gathered by a microcontroller installed on a board also on board the model helicopter. Once gathered, the data is sent to another board on the ground through a ZigBee module. In the photo below you can see our little board. This board on the ground is an Atmel kit that supports several interfaces, USB being one of them. So we wrote the firmware and the USB driver to make those readings now be received by our control software.


To do the control, we will use the new Fuzzy logic Toolkit available in the new LabVIEW 2009 from National Instruments. For those who don’t know it, LabVIEW is one of the main control tools used by modern engineering. It is possible to build control programs just by drawing and dragging components onto the screen; it may seem contradictory for a low-level developer to say this, but all that abstraction gives us time to dedicate to the things that really need time. The tool also offers I/O interfaces, allowing us to work with sensors and actuators directly over the electronic medium.

Another interesting piece of information is that the PID and Fuzzy Logic Toolkit was completely rewritten and reformulated with the help of a Brazilian. That’s right, Bruno Cesar (in the photo beside) works at National Instruments Brazil and was one of the people responsible for this development. Do you think that is a coincidence? Then what would you say if you learned that he also graduated from São Judas Tadeu University? Bruno was on the Mooca campus last week giving a talk about the new Fuzzy logic module. This made us even more certain that Fuzzy logic is ideal for our control problem, since it is perfect for dealing with complex problems where you don’t have the mathematical model that describes a model helicopter’s behavior. Fuzzy logic relies on an operator’s experience to act on the controls. It is quite interesting.

LabVIEW also lets us make calls to DLLs. This was a simple way we found to get the data that was in the driver to reach the control software. So we created a DLL that would abstract many of the complications of interacting with a USB device. LabVIEW just calls functions like LeAmostra() that already return the data ready for use. All that code with CreateFile() and DeviceIoControl() was left up to the DLL, along with other helper functions.

Now you may be asking yourselves: “But how is LabVIEW going to act on the model helicopter?”. Remember that training cable? Our USB board will receive the control actions from LabVIEW through the same DLL. To make those commands be applied to the model helicopter, we made our USB board behave like a radio control, which will use the training cable to apply control over the model helicopter. Obviously we will still have a pilot holding the radio in the instructor’s role, mainly to avoid accidents where a malfunction of our project could turn my model helicopter into a pile of junk.

The Multidisciplinary Symposium

Ever since I started writing about the project on this blog, some people got curious and said: “Let me know when there is a presentation”. Well, this is your chance to take a look at some projects. Our project was accepted to have a space at this event, which will take place from September 18 to 25 at São Judas Tadeu University. There will be several short presentations of 15 minutes each. The projects are not finished yet, and so you still won’t see any model helicopter flying by itself there, but we will be there with our equipment, ready to answer a few questions. The symposium is open to public visitation. You don’t need to be a student to attend; you just need to register for free on the university’s website and that’s it. If you want to chat a bit about sensors, microcontrollers, firmwares, drivers, control or even model helicopters, even over a coffee, just show up.

Well, that is it. I have written too much already. Now I need to get back to my project.
See you!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *