View Single Post
Old Nov 16, 2009, 06:38 PM
kapteinkuk is offline
Find More Posts by kapteinkuk
Quad Whisperer
Joined Jul 2008
953 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