Author
Topic: autonomous RC helicopter (Read 10387 times)

hey I have question for you guys Me and a friend are trying to build a helicpter 1 to 1.5 foot long and we want to balance itself by using a three axis accelerometer

eventually I was thinking on using the the board that I have a from the $50 robot tutorial.

Eventually I will have two DC motors to make the robot fly (like in the normal RC helicpters) and then the two servos (probably the mini-servos) that will make the helicopter turn right, left, go forward or backward and balance itself

I am thinking on upgrading the microcontroller from the atmega8 to the atmega328

I dont know if I will need a clock on the microcontroller, and initially I was going to use a propeller demo board from parallax that I have, but apparently is such a pain in the neck to do a2d convertions. The propeller is pretty much all digital. Besides it comes with a small breadboard included and I only have 7 I/O pins available to use out of the 32 that is suppose to have (since it is a demo board). Anyways, this propeller comes with a 5 Mhz crystal included and I was thinking on taking that crystal and put it in the $50 robot expanded microncontroller. Is this crystal ok or do I need a higher one for the atmega328???

Well first off, do you have any experience doing robotics already? If not, you may want to start small. An autonomous Heli might be a pretty darn tough project to tackle as your first or one of the first youve ever done.

One thing that I would suggest starting off though if you do decide to go through with the project is to take it a little bit at a time. Do one system at a time to fully understand each part and make sure all systems work perfectly.

For doing the auto balance I would suggest you first hook up the accelerometer to your MCU and then hook up some kind of indicators to your MCU and start slowly moving the accelerometer around and have the MCU turn on some LEDs accordingly or something. That way you can fine tune how the MCU interacts with the Accelerometer and also with how it sends out the data to any servos or anything...

I dont have any experience with accelerometers yet so Im not really qualified to answer and technical Questions but I do know how to start trying to get a handle on something I have no idea about :-p

Hope these suggestions helped at all

-EDIT-Oh, and you will want to incorporate fuzzy logic into the stabilization so that when your heli leans a little bit to the right it doesnt send the servos into a hard left lean and over compensate.

this is going to be my third robot...first time working with an accelerometerI am actually going to start learning how to work with the accelerometer and the MCU in the same way that you suggested, but the thing is that, as I said, I was going to use the propeller microcontroller demo board that I already have, but I cannot do ADC beacuse this propeller is all digital it does not do that type of jobs. Powerful MCU, but I decided not to use it in this project anymoreNow, I have an atmega 8 from the $50 robot that I have, and now I wanna recycle this expanded microcontroller in order to use it with the helicopter. the quaestion is if I need to upgrade to atmega16 or 32 or something like that, and If I have to, the next question would be (since I need a clock once I upgrade) do you suggest to use the 5MHZ clock that comes with the propeller and use it with the $50 robot MCU or do I need a higher one (for example, 8MHZ or something like that)

Just use the built in xtal, you can always add an external xtal later if you found the processing speed insufficient.

The issue you will find with using the accelerometer for balance is helicopter vibrations. Vibration will make your accelerometer go whack (its a word cause I said so). Also, what if your robot heli is in a free fall? It can't measure its angle if its falling . . . You should look into using gryos.

ps - I'm also strongly interested in building a robot helicopter, but haven't started cause I haven't yet worked out all the details in my head. I'm just going to hack a RC helicopter for the mechanics.

Ive recently come into a good second hand r/c helicopter called the Sabre. Its fixed pitch meaning that the altitude is controlled by the main motor. It has a built in gyro already to correct yaw (or spinning). It seems to me that even with this correction its extremely difficult to fly it seems to just have a mind of its own. Most people say this is quite normal and after a few months practising every day i'll get the hang of it.

I happen to have a spare 3d accelerometer, and mcu's etc... so i was thinking of making completely self balancing and only move from location when the levers are pushed on the transmitter. Including when putting it into forward flight, it should keep altitude correction. (because of how they work if you want to move forwards it starts losing altitude so you would also have to increase the main rotor speed to compensate, im after a mcu to correct this so all i have to do is press forwards.)

Has anybody attemted this kind of thing on a 4 channel helicopter before? and what problems should be reasonably expected.

Problems that I can see at the minute:

-additional electronics = additional weight. Solution: there are 7 nimh batteries on board, swapping these for lithium polymer batteries will greatly reduce battery weight allowing for extra weight to be added to electronics. (It will also increase flight times and keep optimal power for longer).

-finding a way of utilising the original board to include the gyro and receiver. Solution: dont know yet. Any ideas anybody? The only outputs from the board are to the 2 servo's and the pwm outputs to the 2 motors. (one of the motors is yaw corrected already by the gyro) and both are at ~8.4v from the batteries i think..

To the original poster: I would recommend buying a prebuilt or a helicopter kit to modify rather than build your own from scratch.

Another thing to look into is the CC BEC. Use a 3s lipo (11.1v nominal) and regulate it using the CC BEC to 9 volts.

The hardest part about doing that is reading the pulses from the receiver of the helicopter, processing them in the MCU, and outputting them out again in a timely manner (20 milliseconds). Also if you are planning to use accelerometers, you will need to learn Kalman filters to get usable data. To compensate for the spin a compass sensor can be used. Now with all these components you are basically building the electronics for a full-house UAV, so later you can buy better airframes and reuse the electronics

The Sabre has a single 4-in-1 unit, but inside is a receiver board, and the "other stuff" board. You need to connect the receiver to the MCU, and then the MCU into the "other stuff" board. That way you can read the data coming in, and still use the motor drivers/mixers/gyro on the "other stuff" board.

Just one small thing. There is such a thing called "additive error" with accelerometers. You may be able to use plain accelerometer to balance heli for a minute or so, after that additive error will grow so big, the thing will fall for sure. To overcome that people use such thing as IMUs... or, basically accelerometer + gyro with closed loop feedback...

There is such a thing called "additive error" with accelerometers. You may be able to use plain accelerometer to balance heli for a minute or so, after that additive error will grow so big, the thing will fall for sure.

You mean gyro, right?

There are optical horizon detectors that one may use to correct for gyro drift. I haven't used one myself, but I'm sure someone here could recommend you a few.

one good question... how do you intend to let it know when to stop.....because even set on timer i mean thirty seconds it can get pretty far... i had a cheap remote control airplane that flew like somewhere betweeen .25-.5 mile in about 1 minute....so yeah stability is going to be important but navigation to me would seem to be my issue...

Logged

my english teacher once said, "dont talk about what you dont know in public...."

so I replied the truth, " Exactly why I dont ever talk about English."

I fly helicopters, I have a blace CP pro (kinda trashed now) and a Trex 450sa. One thing I have learned is they are hard to fly, they break a lot, and cost $$$ to fix. I have never tried a coaxel heli but have heard they are pretty easy to fly.

I would buy the smallest heli you can fit your stuff into. No larger then the blade cx. I say this because it will be out of your control. You could cause some damage with a heli.

Also don't expect to add a lot of weight to the heli. They must be balanced almost perfectly to fly well and the little ones don't have much lift to spare. My Trex is a beast compared to the CP pro but cost me $700, not something you want to leave up to a little micro.

All I can tell you is buy spare blades and some protective gear.

Also be careful with Li-Po batteries. I had two go bad on me, they swell up. If you charge/use them after they show signs of swelling you run a very high risk of a fire. Go on youtube and search for lipo fires.

Holy cow, the same project as me. I've been working on it for quite a while now. I've been flying 60 size nitro choppers for about 12 years. The one thing that really helped other than already knowing how to fly it around, is to put yourself a datalogger on it and fly it. Record the servo movements and the gyro compensation. Great place to start programming the "hover" subroutine. My first heli didn't even have a gyro. they are nice to have, but all they really do is compensate for the throttle thrust at the rudder. I made a simple artificial horizon out of 2 variable resistors and a small weight at the bottom. The resistance values on the 2 inputs helped me compensate the cyclic servos to maintain near level. GPS helps to when doing auto hover. Remember during hover, the chopper leans a bit to one side. I'm new here, once I get my $h!t together I'll share some info with ya. I think I still have video somewhere of the fly by wire weedwacker chopper I made

Can you use range finders? I haven't played with them yet, but I was thinking you could use 3 or 4 rangefinders pointed down. You would know the attitude & altitude of the copter.... or at least the attitude in relation to the ground.

Can you use range finders? I haven't played with them yet, but I was thinking you could use 3 or 4 rangefinders pointed down. You would know the attitude & altitude of the copter.... or at least the attitude in relation to the ground.

I used 3 methods for determining chopper relationship to the ground. 1st. GPS, it dumps out lots of info including latitude, longitude, heading, and elevation. This is really handy because before you take off you know the elevation of the ground compared to sea level. 2nd. The range finders helped to more accuratly determine where the ground was during landing. (gps wasn't accurate enough for me to tell where the ground was during landing). My chopper started to wash around 5 feet off the ground which affected the hover. The range finders did nothing for me while flying at 100feet, but the gps gave the distance off sea level +/- a meter or 2. 3rd. I had a micro switch on the skids to trigger a "i'm on the ground" signal.

The 3 methods worked well for me. I suppose if your going to only fly indoors, range finders would be fine. Not sure how they'd work if you pointed one up through the rotor blades so you don't smack the ceiling

Goal:Fly by high speed internet through use of the onboard cameras, gps, etc... The end goal for me, kinda nuts and way out there lol, is to fly a large scale rc plane from illinois to my buddys house in New Jersey All from my garage PC.

Well, I have been doing some research about the helicopters for quite a while now...probably two months already looking for a good oneNow, I ended up buying a Blade CX2 apparently a lot of people say is the best in the marketI was concerned about the size, but eventually I wont have trouble since I am planning on using an IR sensor in the bottom in order to measure height and the expanded microcontroller which is the same as in the $50 robot tutorial, so it does not weight that much

My first step is going to be, as I said, make it hove. I am will try to use the built in gyro to get dat and I wont use an accelerometer anymore...I dont think is neccesary...probably in the future once I learn how to work with the helicopter and the programming, etc

To complete this project is going to take me a while since I have to learn a lot of stuff, among them how to interface the receiver with the microcontroller, and how to pre adjust the helicopter so then the microcontroller and the gyro wont have that much trouble controlling the helicopter, and also getting data from the gyro, etc.

This is probably a very hard project for me, but eventually I am very exited about it, and I think is worth

I will keep you guys update about this

I am going to use the atmega328P...does anyone knows which external clock can I usedoes it have to be a 20MHz or what??? I am just concern about the power consumption

then I guess initially, while I learn how to control the helicopter, I tune the helicopter so the servos are going to be at a fixed position to stop the helicopter from moving forward or backwards, or something like that, and then with the mcu and an ir sensor control the distance from the floor

then I guess initially, while I learn how to control the helicopter, I tune the helicopter so the servos are going to be at a fixed position to stop the helicopter from moving forward or backwards, or something like that, and then with the mcu and an ir sensor control the distance from the floor

You have to realize that helicopters don't *want* to fly, you can't "tune" the servos to be at a fixed position. Trying to keep a helicopter hovering still takes alot of tiny correction inputs every second, which is why you do need an accelerometer.

EDIT:BTW, you might want to use a dual counter-rotating propeller helicopters. Those are much more stable and easier to control.

about the accelerometer...I was thinking about using one at the beginning, but I have seen people doing this type of projects using just the gyro that comes with the helicopter, and then adding the mcu and sensors etc

but I dont know I am still doing some research...I might take your advice and use the accelerometer + gyro combo

Accelerometers are prone to mechanical noise... At least most of them...Gyroscopes come with gyro drift... And unfortunately you can't change this...So the best way to eliminate gyro drift in the readings is by the help of an accelerometer...

You need to combine gyro and accelerometer data for every axis... So you best need 3 gyros and3 accelerometer (or a three axis accelerometer)...

Even better configuration is the two "two axis accelerometer" The will always be an axis with more noise...Cause the helicopter mechanics aren't the best, or at least they aren't perfect... For this axis, you can get an extra reading (usually the X axis or the axis with goes from the noise to the back...) which can help a lot...I have worked with Analog Devices accelerometers so far. Analog Devices accelerometers can vary sensitivity in noise (or to be accurate: they vary their "I give you a reading" time) with filtering capacitors. So in X axis which is the axis you want the more details since your helicopter is going to base it's whole movement in this axis, you can have a standard 50Hz output accompanied with a high frequency output... Since time doesn't matter for microcontrollers ('cause they do every step in fixed time) you can effectively cancel noise by mixing the two outputs with a quite easy math...

I mentioned math... yes... unfortunately you are going to need more than you expect...First of all, the most important job is filtering... Filtering is well... although easy it is confusing...Starting with filtering, you can't just relay, on what the sensor says... it would be hopeless... make you heli want to rock!!! and that all... Well, seriously, it will begin to react to every reading noise or not... But the worse is that after some time it will start to oscillate... It will come to a point that can not recover to it's home position so it will.... finally be clipped down.... So you need to get many many readings and decide with area of this readings is good... Fortunately, a 8bit 16MHz computer (microcontroller) can do this with easy... But for three four sensors... So you will need a quite a nice network of microcontrollers connected to various sensors, just for stabilizing your flight... I, personally, try to employ a neuron like system in my every project.... One microcontroller for a sensor, one for a executing mean (like a servos)

I'm in University now and I gotta jet....

Logged

For whom the interrupts toll...

P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

You might want to use IMUs instead of getting gyros and accelerometers separately.

Also, a helicopter generates a lot of mechanical noise. You probably want to filter the data before using them. The people I know who use IMU/accelerometers usually use kalman filters (http://en.wikipedia.org/wiki/Kalman_filter)

try Analog Devices IMU's... check out Sparkfun... I got a 5 degrees of freedom IMU's with 3 axis accelerometer and 2 axis gyro for around $100... or you could buy them separately and just combine them... I recommend investing on a breakboard with gyro and accelerometer already than buying them separately and combining because you end up using less space and weight...

if you're thinking of tackling this project, then you have to learn about filters... these devices have inherent noises built in them plus noises from mechanical vibrations from your heli, noises from electric/magnetic signalfrom your heli and mcu's... etc... so the question is, how are you going to figure out the actual signal fromthe noises?... the actual signals are actual angles and rate of change... you could use analog filters using simple resistor/capacitors, etc... or digital filters using programming... one of the most famous digital filter isthe kalman filter... in order to use kalman filter you need really higher complicated math involving statistics, physics, and linear algebra... or you could just go ahead and cut and paste some kalman codes into your programming and see if it works... as for me, I made it as a rule not to put any codes in my programming that I do not fully understand...

so once you tackle the filtering issues, you have to figure out how you're going to use your data... i recommend combining your accelerometer and gyro signals together... accelerometers do well in measuring angles when the object is not in motion but messes up the values when there's acceleration involved (i know, ironic huh?)... gyro on the other hand is pretty accurate in calculating rate of change of angles but susceptible to drift big time!... so you have to figure out how to harness the good qualities in each device to diminish their weaknesses... gyro gives you rate of change of angle and accelerometer gives you the angle... in calculus, if you end up integrating the rate of change (gyro), you'll end up getting the actual angle...

so once you end up getting your actual angles from combining both accelerometer and gyro signals, what are you planning to do with it?... this one deals with "control"... usually they refer to this as "proportional integral derivative" or PID... for example, if you try to build a balancing two wheeled robot by simply doing a simple trigonometry and making the robot travel the distance needed for the wheel to move in order to keep itself vertical, it won't really work... i know it seems simple but it's not... not a lot of people were able to balance a two wheeled robot successfully... so anyway... i recommend you research PID... sometimes things will work just by using the proportional and the integral part of it without having to use derivative...

so my recommendations?

1. figure out what kind of helicopter you want... quad roter, coaxial, or conventional... they said that quad is pretty popular in this kind of project (check out draganflyer)... coaxial is also popular because of it's stability... if you're daring, then go conventional but good luck...2. learn how to fly it!!!... that way you have an idea what you want your robot to do... plus you also want to "save" your heli from crashing while you're testing it... get a "trigger switch" in an extra channel in your transmitter to turn your microcontroller on and off...3. research on your IMU's (gyro and accelerometer)... 4. research on your filtering techniques... what are you going to use? analog filtering using capacitors/resistors? u gonna use filtering in your programming? or are you going to combine both?5. combine your gyro and accelerometer signals to get a more precise angle...6. research on your control theory... PID, PI, Kalman (if you're daring).. =) (if u decided to do this analog style, try researching op-amps... it's a neat trick)... =)7. try incorporating your IMU's and microcontroller with servos and see how it works...8. figure out how you're going to incorporate your microcontroller signal along with the receiver signal to control the servos in your heli... 9. then tweak tweak tweak until you could get your heli to hover...

check out the Heli Command too... it's a pretty cool device but expensive... i didn't know about robotics until June of last year... with lots of coffee and googling/yahoo, the robotsuccessfully balanced by September of last year... with hard work and lots of coffee, it's possible... if i could do it, you could too!... don't try to tackle so many things at once, break it down into smallerparts, then combine each parts together... then if you managed to make your robot hover successfully,let me know how you did it!!!.. =)

Hi I am just wondering if you got through with this project if so. Could you tell me what helicopter you used. And any advise because i am looking into make an autonomous RC helicopter actually using the arduino UNO. And some Sharp IR or Ultrasonic devices to stop it form hitting into stuff.