HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Nov 16, 2009, 06:38 PM
Quad Whisperer
Joined Jul 2008
942 Posts
Build Log
Build KapteinKUKs Simple and Low Part Count Quad, Hex and Tricopter Flight Controller

.
.
Donate? If you want, you can donate to paypal: modellfly@hotmail.com
I promise that the money will not be used to boring stuff like food, rent or bills, but to buy more RC equipment



.
.
NOTE!: This post contains links to the most current software/hardware and info. Or take a look at Niall's exellent site: http://www.kkmulticopter.com/
Most of the early information in this thread (exept this post) is about earlier versions, and is obsolete.

If you want to read the thread, start at page 23:
http://www.rcgroups.com/forums/showt...143569&page=23




Hello, I have made a quadrocopter and tricopter flight controller.
It is has a low parts count and is simple to make.

I have attatched the source code, written in AVR assembly, and the electronic schematic so that you can make one too!

The controllers uses the gyro element from three HobbyCity HK401B gyros ($13 each).

Total cost is ca. $60

It will work with any transmitter and reciever, but it should have servo reversing and servo travel adjust.

HARDWARE:



Schematic in this zip file:
http://www.rcgroups.com/forums/showp...&postcount=338

V4 (Through hole) part list:

IC1: Atmega48/88/168/328
IC3: LM317LZ

R1: 100 Ohm
R2: 100 Ohm
R3: 100 Ohm
R4: 4.7 Ohm
R5: 10 KOhm trim potmeter
R6: 10 KOhm trim potmeter
R7: 680 Ohm
R8: 10 KOhm trim potmeter
R9: 220 Ohm
R10: 68 Ohm (changed from 39 to 68 Ohm)

C1: 2.2 uF tantalum
C2: 2.2 uF tantalum
C3: 2.2 uF tantalum
C4: 2.2 uF tantalum
C5: 0.68 uF tantalum
C6: 0.68 uF tantalum
C7: 100 uF electrolyte
C8: 0.68 uF tantalum
C9: 2.2 uF tantalum

LED1: Any LED

3 HobbyCity HK401B gyros

4 Male servo leads for connecting to RX

4 Female servo leads or 3 pin connector for connecting to the ESC's


Through hole PCB:
http://www.rcgroups.com/forums/showp...&postcount=657


SMD schematic and SMD PCB
http://www.rcgroups.com/forums/showt...4#post14990640

The roll and pitch gyros is to be glued with hot glue onto the PCB with the silver box facing down. Glue along the edges of the gyro PCB, not only to the silver box. The Yaw gyro can be mounted like intended, the silver box facing the edge of the PCB and the connections facing up. It also can be mounted with the connections facing down, but then the silver box should face the center of the PCB. Also it needs to be reversed. Make sure the wires it not to short and stiff, or else they may break. That is the reason I placed it with the connections facing up.

Soldering the V5 SMD PCB:
http://www.rcgroups.com/forums/showt...9#post15436660


V5 (SMD) Parts list:

IC1: Atmega48/88/168/328 (TQFP)
IC3: LM317LZ (TO-92)

R1: 100 Ohm (0805)
R2: 100 Ohm (0805)
R3: 100 Ohm (0805)
R4: 4.7 Ohm (0805)
R5: 10 - 25K Ohm trim potmeter (3314j) (From the HK401B gyro)
R6: 10 - 25K Ohm trim potmeter (3314j) (From the HK401B gyro)
R7: 680 Ohm (0805)
R8: 10 - 25K Ohm trim potmeter (3314j) (From the HK401B gyro)
R9: 220 Ohm (0805)
R10: 68 Ohm (0805) (changed from 39 to 68 Ohm)
R11: 4.7 KOhm (0805)
R12: 100 Ohm (0805)

C1: 22 - 47uF (EIA 3528-21 / Kemet B) (From the HK401B gyro)
C2: 22 - 47uF (EIA 3528-21 / Kemet B) (From the HK401B gyro)
C3: 22 - 47uF (EIA 3528-21 / Kemet B) (From the HK401B gyro)
C4: 22 - 47uF (EIA 3528-21 / Kemet B) (From the HK401B gyro)
C5: 0.68uF (EIA 3528-21 / Kemet B)
C6: 0.68uF (EIA 3528-21 / Kemet B)
C7: 22 - 47uF (EIA 3528-21 / Kemet B) (From the HK401B gyro)
C8: 0.68uF (EIA 3528-21 / Kemet B)
C9: 22 - 47uF (EIA 3528-21 / Kemet B) (From the HK401B gyro)
C10: 2.2uF (EIA 3528-21 / Kemet B)
C11: 22 - 47uF (EIA 3528-21 / Kemet B) (From the HK401B gyro)

LED1: (0805) (From the HK401B gyro)

3 HobbyCity HK401B gyros

4 Male servo leads for connecting to RX

4 or 6 Female servo leads or 3-way pin connector for connecting to the ESC's


V6 Through Hole 5 x 5 cm double sided PCB



The roll and pitch gyros is to be glued with hot glue onto the PCB with the silver box facing down. Glue along the edges of the gyro PCB, not only to the silver box. The Yaw gyro can be mounted like intended, the silver box facing the edge of the PCB and the connections facing up. It also can be mounted with the connections facing down, but then the silver box should face the center of the PCB. Also it needs to be reversed. Make sure the wires it not to short and stiff, or else they may break. That is the reason I placed it with the connections facing up.

Schema and PCB layout:
http://www.rcgroups.com/forums/showp...postcount=1873

SeeedStudio Gerber Files:
http://www.rcgroups.com/forums/showp...postcount=1926

Parts List:

IC1: Atmega48/88/168/328 (DIL28)
IC3: LM317LZ (TO-92)

R1: 100 Ohm (1/4 Watt)
R2: 100 Ohm (1/4 Watt)
R3: 100 Ohm (1/4 Watt)
R4: 4.7 Ohm (1/4 Watt)
R5: 10 kOhm Potmeter (Bourns 3362P)
R6: 10 kOhm Potmeter (Bourns 3362P)
R7: 680 Ohm (1/4 Watt)
R8: 10 kOhm Potmeter (Bourns 3362P)
R9: 220 Ohm (1/4 Watt)
R10: 68 Ohm (1/4 Watt)
R11: 4.7 kOhm (1/4 Watt)
R12: 4.7 Ohm (1/4 Watt)

C1,2,3,4,9,10,11: 100nF ceramic capasitor.
C7: electrolyte or tantalum with a value of 10uF and upwards.
C5,6,8: 0.68uF Tantalum.

All capacitors have 2.54mm pin spacing. Ignore the values in the schematic.

LED1: any 5mm LED

3 HobbyCity HK401B gyros

4 Male servo leads for connecting to RX

4 or 6 Female servo leads or 3-way pin connector for connecting to the ESC's


Fuse settings:

The atmel microcontroller should run at 8MHz internal oscillator.

SELFPRGEN: unchecked
RSTDISBL: unchecked
DWEN: unchecked
SPIEN: checked
WDTON: unchecked
EESAVE: unchecked
BODLEVEL: 1.8V
CKDIV8 : unchecked
CKOUT: unchecked
SUT_CKSEL: Int RC osc. 8MHz.

Test the clock setting with:
http://www.rcgroups.com/forums/showp...&postcount=154


ESC'S:

I use the Turnigy Plush series. Remember to set the timing to medium, or else the motor might stop in flight with the screaming sound.


TRICOPTER SOFTWARE:
http://www.rcgroups.com/forums/showt...5#post15976330

Note for Tricopter: If the arming stick movement is reversed after setup, (it will depend on the mounting of the yaw servo), set pitch gain pot to zero, turn on FC, LED flashes, turn off FC and reset pot.


QUADROCOPTER SOFTWARE:
http://www.rcgroups.com/forums/showt...2#post15729361


HEXACOPTER SOFTWARE:
http://www.rcgroups.com/forums/showt...1#post15824075


Y6 SOFTWARE:
http://www.rcgroups.com/forums/showt...1#post15212157


ADJUSTING:

Checking potmeter directions, do this first:
Note: most SMD potmeters is reversed.
-Try to enter the reversing mode below. ("Reversing gyros or gain potmeter direction") If sucsessfull the pots are OK.
-If no LED flashing, the pots need to be reversed.
-Put the roll gain pot fully CW, and go to step 2 in "Reversing gyros or gain potmeter direction".


Transmitter throttle adjusting:

-Turn on transmitter and flight controller. Move the left stick in lower right corner to arm it.
-If led does not turn on, lower your trim.
-If still no go, you may need to reverse the throttle channel.

Initial transmitter ATV/servo range settings:

-pitch (elevator): 50%
-roll (aileron): 50%
-yaw (rudder): 100%


Initial gain pot values is 50%. Increase until it starts to oscillate rapidly, then back of until it is stable again. Fast forward flight needs lower gain.

Too low gain is recognized by hard to control and/or always want to tip over.


ESC throttle range:

-Turn yaw pot to zero.
-Turn on transmitter.
-Throttle stick to full.
-Turn on flight controller.
-Wait until the ESC's beeps twice after the initial beeps. (Plush and SS ESC's)
-Throttle stick to off. ESC's beep.
-Turn off flight controller.
-Restore the yaw pot.


Checking transmitter channels:

-Take off the propellers.
-Turn on transmitter and flight controller.
-Set throttle to about 1/4. Motors should start.
-Move pitch (elevator) stick forward. Back motor should speed up. If not, reverse pitch (elevator) channel.
-Move roll (aileron) stick to the left. Right motor should speed up. If not, reverse roll (aileron) channel.
-Move yaw (rudder) stick to the left. Front and back motor should speed up. If not, reverse yaw (rudder) channel.


Checking gyro directions:

-Take off the propellers.
-Turn on transmitter and flight controller.
-Set throttle to about 1/4. Motors should start.
-Tilt quad forward. Forward motor should speed up. If not, reverse pitch gyro.
-Tilt quad to the left. Left motor should speed up. If not, reverse roll gyro.
-turn quad CW. Front and back motor should speed up. If not, reverse yaw gyro.

Reversing gyros or gain potmeter direction:

1: Set roll gain pot to zero.
2: Turn on flight controller.
3: LED flashes rapidly 10 times.
4: Move the stick for the gyro you want to reverse, or the throttle stick for gain potmeter direction reversing.
5: LED will blink continually.
6: Turn off flight controller.
7: If there is more gyros to be reversed, goto step 2, else set roll gain pot back.


Final check:

Hold the quad firmly over our head, give about 1/2 throttle slowly. Hold it steady when you start increasing the throttle, becouse it calibrates its gyros when throttle leaves zero, and then the gyros need to be at rest.

If it tries to twist away, check propeller and motor directions, gyro placement and trim settings. A slight twist is OK.

If not, try to twist the quad. It should resist your movements. And also more gain gives more resistance. If it starts to oscillate, reduce the gain. If you need to reduce the gain below 30%, something might be wrong, like too heavy propellers.

Note: the correct procedure for taking off from the ground is as following:
1: The quad and its propellers needs to be motionless.
2: Arm the controller by moving the left stick to the lower right corner.
3: Increase the throttle (collective). Just as the throttle leaves zero, gyro calibration is performed.
4: Enjoy! And remember to close the throttle if you lose control. Much less damage.
5: Disarm the controller after landing by moving the left stick to the lower left corner.


NOTES:

- No not use bigger propellers than you need. Light propellers gives faster response and more stability.

- Try to get it to hover at about midstick (1/3 to 2/3 throttle). Use smaller/bigger propeller, different motor Kv or more/less cells to achieve that.


The correct procedure for taking off from the ground is as following:

1: The quad and its propellers needs to be motionless.
2: Increase the throttle (collective). Just as the throttle leaves zero, gyro calibration is performed.
3: Enjoy! And remember to close the throttle if you lose control. Much less damage.



QUOTES:

cyborgcnc:
"Man this thing is STABLE!!
Just did about 20 minutes worth of flying, on 3 packs....I can't tell you how well this thing is flying....VERY stable.
Kapteinkuk, if you ever integrate an accelerometer or GPS in your code, this will be the most stable Quad design on rcgroups!
On a 2500 LiPO, 35C pack (Rhino, from hobbyking) I can easily get a 5 ++ minute flight. I land early, cause I do not have an alarm on it yet, and the
battery still has about 300-400ma lefts when I charge it again...very happy with the motors, and props so far. I did some final trimming today with the TX, and I can easily hover this thing almost hands off...obviously, I need to keep on the throttle (but that is why we need GPS!! :-) )
Rolf, again THANK YOU SO MUCH for your code!! You wrote a VERY GOOD set instructions for the Atmel chip, and it is doing an EXCELLENT job at flying my quad!"


420RcPilot:
"I have liftoff Just flew a pack, and need to tune some ATV (almost backflipped when I pulled elevator back) But I cant believe how good it flies - bye, bye 4 gyros and CCPM mix for tricopter stabi. I clearly see a HUGE difference with the 180 Hz update. It reacts so fast to gyro corrections, that my old setup now seems kinda geriatric, although that also flew OK...."


My Videos:

My Homemade HexaCopter Test. (Looping and Crashing :) (3 min 47 sec)


My Homemade Quadrocopter (2 min 24 sec)


My Homemade Tricopter (4 min 42 sec)


My Mini Quadrocopter (1 min 42 sec)


Quadrocopter Aerial Video Snow Landscape (3 min 43 sec)


Quad looping, backflip, inverted, roll and ofcourse crashing :) (2 min 48 sec)


Y6Copter Test, Bad Oscillations and Crash (0 min 58 sec)



Others Videos:

QuadCopter Maiden Flight (3 min 3 sec)


http://www.youtube.com/watch?v=8mOicuwfa3U

http://www.youtube.com/watch?v=Uwx2frO0fpc

Thanh'sQuadFlying.wmv (4 min 27 sec)
kapteinkuk is offline Find More Posts by kapteinkuk
Last edited by kapteinkuk; Jan 14, 2011 at 05:53 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Nov 17, 2009, 06:06 AM
Quad Whisperer
Joined Jul 2008
942 Posts
Some more info:

The code is simple with only one main loop, and no interupts. CPU utilization (ATMega48 at 8MHz) is about 80%, so there is time to add own code.

More CPU time can be freed by adding interrupt driven pulse reading and generation, but for now I wanted to keep things simple and easy.

Any reciever which outputs the channels in the standard sequensial way can be used. No need for a single summed stream.

I use the Futaba Fasst R606FS reciever, which luckily have a frame rate of 16ms, instead of the normal 20ms. This gives a control loop speed of 62.5Hz.

The calculations is done in a 16.16bit (16bit integer with a 16bit fraction) math library for the AVR, also made by me

The math library simulates an array of 16.16bit registers, and is used the same way as the AVR's 32 8bit registers, and the registers can also be given names.

The stabilization is a simple rate dampening. I tried angular velocity (heading hold, attitude hold), but I could not get rid of the severe oscillations. Maybe the PPM output is to slow?

The circuit is kept simple and should be easy to make on a perfboard.

Questions is welcome!
kapteinkuk is offline Find More Posts by kapteinkuk
Reply With Quote
Old Nov 25, 2009, 10:35 AM
It flew...nearly!
Norway
Joined Apr 2006
1,941 Posts
Hells bells, Rolf! You are one talented designer!
matthew
Duck! is offline Find More Posts by Duck!
Reply With Quote
Old Nov 25, 2009, 12:44 PM
Registered User
Austin, Texas
Joined Apr 2009
499 Posts
Quote:
Originally Posted by Duck! View Post
Hells bells, Rolf! You are one talented designer!
matthew
Matthew,
I'm very impressed!

What type of motors are you using? ESCs?

Brent
dmsgodeep is offline Find More Posts by dmsgodeep
Reply With Quote
Old Nov 26, 2009, 02:15 AM
The one and only
dadde's Avatar
Hjo, Sweden
Joined Apr 2004
503 Posts
Wow Awesome job! I definetly want to try and build one. All I need to get my hands on are the gyros :/
dadde is offline Find More Posts by dadde
Reply With Quote
Old Nov 26, 2009, 02:32 AM
Tinkerer
don_cocinero's Avatar
Earth
Joined Oct 2005
388 Posts
Nice work kaptein!

Love the frame...obvioulsy from a previous project?

Cheers
Don
don_cocinero is offline Find More Posts by don_cocinero
Reply With Quote
Old Nov 26, 2009, 02:52 AM
Droner
SebastianJ's Avatar
Denmark, Capital Region of Denmark, CPH
Joined Mar 2006
2,410 Posts
Exellent work, how about programming for a tricopter?

http://www.rcgroups.com/forums/showthread.php?t=959593

Let me know if you want an airframe to experiment with.




Sebastian.
SebastianJ is online now Find More Posts by SebastianJ
Reply With Quote
Old Nov 26, 2009, 11:00 AM
Registered User
KAMAX-T's Avatar
Powell TN
Joined Jan 2008
735 Posts
Quote:
Originally Posted by bas10an View Post
Exellent work, how about programming for a tricopter?

http://www.rcgroups.com/forums/showthread.php?t=959593

Let me know if you want an airframe to experiment with.




Sebastian.

Now were talkin .......Please
KAMAX-T is offline Find More Posts by KAMAX-T
Reply With Quote
Old Nov 26, 2009, 11:33 AM
WHEN IN DOUBT FLOOR IT!!!
G-unit's Avatar
AZ
Joined May 2006
4,816 Posts
That is some nice work,good job.
How much $ to make this??
G-unit is offline Find More Posts by G-unit
Reply With Quote
Old Nov 26, 2009, 07:55 PM
Quad Whisperer
Joined Jul 2008
942 Posts
Hello and thank you all!

The frame is from a 8 year old old foam toy quad-rotor that I got for free, still new in the box. It had 3 mechanical gyros (see picture) like the early helicopter gyros. It was not R/C, but had a wire to the controller. It had brushed motors with geared foam propellers

Maybe some of you remember it?

The ESC's is from the same time period, GWS ICS50 2Amp.

I'm not too keen on tri-rotors. I like the symmetry and simplicity of a quad-rotor.

I'm not sure about the $, but it is not much.

Gyro sensors can be extracted from the $16 HobbyCity HK401B gyro (also known as the "GYRD", as written on the case )

http://www.hobbycity.com/hobbycity/s...dProduct=10113

The sensor is a Murata ENC-03M GYROSTAR, see attatched datasheet.

As a nice bonus you also get an Atmel ATMega88 and a 8MHz crystal

Any questions, just ask
kapteinkuk is offline Find More Posts by kapteinkuk
Reply With Quote
Old Nov 29, 2009, 01:49 PM
Droner
SebastianJ's Avatar
Denmark, Capital Region of Denmark, CPH
Joined Mar 2006
2,410 Posts
How do you adjust rate?

I don't see any pots.
SebastianJ is online now Find More Posts by SebastianJ
Reply With Quote
Old Nov 30, 2009, 06:59 AM
Quad Whisperer
Joined Jul 2008
942 Posts
The gyro gain is adjusted in the software.
kapteinkuk is offline Find More Posts by kapteinkuk
Reply With Quote
Old Dec 01, 2009, 10:07 PM
Registered User
signguy's Avatar
Swansea, Massachusetts
Joined Dec 2004
2,088 Posts
any chance you could use the mems gyros from a Wii motion plus controller?

Bob D
signguy is offline Find More Posts by signguy
Reply With Quote
Old Dec 02, 2009, 09:58 AM
xxxxxxxxxxxxx
JUERGEN_'s Avatar
Deutschland
Joined Nov 2009
660 Posts
Quote:
Originally Posted by kapteinkuk View Post
Hello, I have made myself a quadrotor (quadrocopter) flight controller.
It is has a low parts count and is simple to make.
Genial.
das ist ja an einfachheit, kaum zu übertreffen.
es schreit ja auch förmlich, nach preiswerte GYROSKOPE. ?
wie zum beispiel "Wii-Motion-Plus" ?

meine analyse dazu.
JUERGEN_ is offline Find More Posts by JUERGEN_
Reply With Quote
Old Dec 02, 2009, 03:14 PM
Quad Whisperer
Joined Jul 2008
942 Posts
Yes, any cheap gyro with analog output should work
kapteinkuk is offline Find More Posts by kapteinkuk
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Quadrotor brushless controller airbotix Multirotor Talk 63 Aug 06, 2010 11:15 AM
Discussion ALPO -Aerobatic Low Parts count Original design. Brian Courtice Foamies (Scratchbuilt) 8 Sep 21, 2009 03:57 AM
Discussion Any tips for my first flight with a low wing plane? Warthog_Fan Fuel Plane Talk 4 Sep 06, 2009 07:53 AM
Help! Need help with Low-cost QuadRotor Hero.sl Coaxial Helicopters 5 Jun 28, 2009 02:26 AM
Question Searching Simple Controller for Free Flight flymax Power Systems 8 Jan 07, 2006 10:07 AM