Intro

I've been eyeing MikroKopter for a while and finally descided that I need to build one as my first RC project.

The biggest problem with MK (other than it's non-free and closed source) is that it's done by germans who seem very insular with their obscure language and reluctance to write documentation in english, this has caused very few people outside germany to build one: See the map of MK instances for a hint, so I hope this page will help anyone, but mostly the non-german speaking folks, building a quad rotor helicopter with the problems that I've run into.

Alternative Quad rotors

MK isn't the only game in town, in fact there is a great deal of quads:

NameFreedomComment
MikroKopter non-free, with some code available.Very german, little english documentation, but the code is in C and runs on an AVR.
PaparazzI (see: NoVa) 100% Free and Open SourceThis is just the guidance system, a very powerful ARM7 MCU and 4Hz GPS with all sensors off-board (I'm thinking IMU 5 + 1 axis gyro from sparkfun will come in around the same price as the MK IMU around 100 EUR, without the breakout boards the price will be even lower) It's a very promising design with several competing suppliers of finished main boards as well as many real science and business users.
Draganflyer Very closed, very commercialToyish one-size fits all, not much to do.
UVAP (old) GPLPIC based, so eventhough the source is in C, it needs a non-free compiler, uses gyros from sparkfun, slightly germano-phile forums.
NG UVAP ? not released yetReimplementation using a proper ARM7 CPU

Shopping

This is my shopping list:

PartsShopTotal
BL-Ctrl PCBs, Flight-Ctrl, Robbe motors, ACT DSL-4 receiver, props, MOSFETs. mikrocontroller.com 504 EUR
Lipos, MPX Cockpit SX radio, servos, connectors, charger. Dan-tech 470 EUR
Parts for BL-Ctrl, tools. Reichelt.de 111 EUR
Super flux 5mm RGB LEDs. n/a 13 EUR
More connectors. Redbaron-rc 38 EUR
MPX charging cable and crystal for ACT DSL-4top S. W. Hobby 19 EUR
Balancer converter cable BRC hobbies 3 EUR
Extra props (8x 10x4.5 + 4x 12x4.5) RC toys 57.54 EUR

Note that I'm starting from scratch, so this total will be much lower if you have things like a radio, some lipos and a charger around to start with.

Detailed Cost breakdown

The cost of the Quad can be split into 3 distinct groups: The flight controller (Sensors, main MCU), The rest of the flying hardware (Motors, ECUs, Lipos, airframe) and The ground equipment (transmitter, charger, tools).

The Flight controller consists of about 111 EUR worth of sensors and 88 EUR worth of PCB and MK markup, this means the part I'd have to dump if moving to PaparazzI would be about 8% of the entire cost, which is not too bad given the overall cost of the project.

Ordering from Reichelt.de

Getting the parts for the brushless drivers is a bit of a hassle, Farnell is very expensive and I know no other parts supplier that allows ordering of small numbers of components as needed, so I had to deal with Reichelt.de.

Reichelt.de has two problems, one it's a german company that would like the rest of the world to go away entirely (no english version of the site and no option to pay by visa) and they have a minimum order of 150 EUR.

I hit the minimum order amount because they had some tools that I wanted, but I would rather not have spent the money right then if I had a choice.

My advice is to convince people around you that they have to build their own quads so you can hit the minimum just by ordering BL-ctrl parts for all of you.

The ACT DSL-4top receiver

Like many german companies ACT tries very hard to ignore that not everybody speaks german, so it was very hard to figure out what crystal to buy for the receiver.

The english manual says that DSL-6 + DSL-4: works with ACT, JR, Futaba or MPX crystal, but it fails to mention what that means.

ACT has a list of crystal frequencies online that seems like a nice way to verify what crystal to buy, however, there is no mention in the manual or on the frequency page of what column is appropriate for the DSL-4 receiver.

I finally broke down and guessed what crystal to buy, so now I know that the crystals for the DSL-4 are the ones listed in the E-Quarz-Aufdruck FM Quarz column of the frequency list page.

The ACT receiver weighs 7 g, the MPX RX-7 that came with my radio weighs 23 g, so buying the ACT receiver (at a cost of 45 EUR) saved only 16 g, if that seems like a steep cost to you, then it's possible to avoid the cost of the special receiver and fish the PPM signal out of just about any RC receiver, simply look for the clock pin (13) of the 4017 IC that invariably does the de-multiplexing, like in this example.

Building a frame

I broke down and ordered the frame from the mikrokopter shop, I was planning on building something out of CF rods, but I realized that I just didn't want to spend so long on the mechanics, maybe I'll do something with CF for the next version.

In circuit programming the FC and the BL-Ctrl

In the AVR world there are two standards for ICSP headers; 10 pin and 6 pin, so when you see the 10 and 6 pin headers labeled ICSP in the mk designs you would think those are the standard pinouts, but you'd be wrong.

The BL-CTRL and Flight CTRL boards both use ICSP headers that are different from the established standards, so remember that when hooking up your existing programmer.

I ended up making a small converter on a protoboard with headers for the normal 6-pin connection coming from my programmer, the bastard 6 and 10 pin connections going to the mk boards and a TTL-level serial to usb converter, so I can debug the bl-ctrl boards.

BTW I can really reccomend Lady adas USBtinyISP, it's cheap, easy to build and once the zener diodes have been exchanged with 3.6 V types it's also very reliable.

Building the Brushless controllers (BL-CTRL or ESC)

I have assembled the first controller and I must say I have no love for the tiny 0805 components, I'm half tempted to reimplement the controller with traditional through-hole resistors.

Setting the fuse bits

Note that the BL-CTRL make file doesn't set the fuses, so nothing will work out of the box, but I managed to find a screen shot of a terminal where they had run avrdude to set the fuses, I was unable to get those fuse values to work reliably, so I upped the BOD level to 4V and gave it the 64 ms timeout that helped start the AVR every time it was powered up. To set the fuses run this command for each BL-CTRL:

avrdude -c usbtiny -p m8 -U lfuse:w:0x24:m -U hfuse:w:0xda:m

Debugging code 'a'

With the esc all assembled I hooked it up to an ATX psu (my lab PSUs would not supply enough current to get through the initial self test) I got error code 'a' from the selftest, this means that there is a problem with one of the outputs.

The NA- FET checked out, it faithfully reproduces the signal at its gate at the output, so that's not the problem.

The phase sensor resistor network also checks out with 14.08 KOhm between phases and 7.82 kOhm between either phase and ground.

In the end I noticed that one phase at GND and another at VCC gave an ADC reading of 0x0108 on the grounded phase, which indicated that the ADC was using the internal band gap as a reference and not the external one.

According to the datasheet the AREF pin (which is basically tied to AVCC and +5V in this application) is wired directly to the ADC, so when the internal band gap rerefrence gets switched to the AREF something undefined happens; in my AVR the ADC used VBG, in everyone elses the +5V at AREF seemed to override the band gap, so their engine controllers worked.

Anyway, find the line that says IntRef = 0xc0 in main.c and replace 0xc0 with 0x40.

The next problem is that the motor test is actually very unreliable, it does many transistor tests, but only the last one actually counts, so I was getting random code 'a' failures until I upped the low voltage limit from 0.63 V to 0.8 V (ADC value changed from 128 to 163) in the low-side FET tests.

Success!

The initial assembly of my first ESC took about 5 hours worth of cursing the 0805 parts and in the end it was dwarfed by the 3 days(ish) of debugging it took to find the VBG-bug.

The code is a horrendous mess and it has plenty of german obfuscation layered on top to twart anyone who might want to fix it, I suspect I'll need to rewrite it all from scratch at some point.

Fuck ROHS!

I got the second ESC working in a little more than 3 hours after starting assembly, probaly because I now had some practice with 0805 parts, but also because I switched from lead free to the good old 60/40 leaded type solder.

Well, I guess I should go and wash this lead off my hands, neurotoxin and all...

Long live the right tools

I have just negated the suckyness of lead free solder, simply by upgrading my toolset, the simplest part was a new tip for my 80W Ersa RDS80 digital soldering station, it's a simple angled face tip (832NDLF/SB) which is much better than the chisel style tip I was using.

The second new tool is an AOYUE 850C hot air rework station, which makes it easy to use solder paste and reflow half a pcb side at a time.

Flying, crashing and rebuilding

I have been flying on and off for about a month now, so far I've destroyed (in order of failure):

Gyro calibration

The gyros can drift over time and in crashes so it's good idea to check them from time to time, especially if there are sudden jittery movements, as that can be a sign of drifting.

Each gyro amplifier output should be at 1.5V when idle, to calibrate follow this procedure:

  1. Check Test point, If the voltage is inside 1.2V - 1.8V, it's ok and you are done.
  2. Unmount the two resistors that control the amplification (see table below)
  3. Check Test point, If the voltage is inside 1.2V - 1.8V, it's ok and you are done.
  4. Look up the correcting resistor in the last table and mount it.
  5. Check Test point, if the voltage is outside 1.2V - 1.8V, fiddle with it.
  6. Curse the designers for not including trimpots for this.

See the FlightController manual: Gyro Amplifier Calibration for the locations of the test points on the board.

Gyro amplifier resistors and testpoints

GyroTPIC2 pinBoost RLower R
Roll TP57R13R20
PitchTP41R9R29
Yaw TP38R17R15

Correcting resistors

VoltageCorrecting resistor
less than 0.8VBoost: 150k
less than 1V Boost: 220k
less than 1.2VBoost: 470k
over 2.2VLower: 150k
over 2.0VLower: 220k
over 1.8VLower: 470k

Naming

It occured to me that I hadn't named the flyer yet, so I've descided to call it: Enterprise, not after the Startrek tradition, but after the qualities it shares with software that gets the same label:

Aluminium arms

The mikrokopter shop charges almost 10 EUR for one aluminium arm, the material cost of that arm is less than 0.31 EUR, so if you are willing to do a bit of drilling yourself you can save quite a lot.

The only real problem is getting the aluminium profile, for Danes there is Sanistål, order nr.: 654921 (sorry you have to use their search to find it as their shitty website doesn't make it possible to link to products), they have shops all over .dk and 6m cost me 56 DKK, bring a hacksaw, because you will get one 6 meter piece.

The next problem is accurately marking the holes, I used OOo draw to make some templates: alu-arms-250mm.odg [20K]/alu-arms-250mm.pdf [12K], I then cut out the paper templates and used double sided tape (3m spay-mount would be easier) to fix it in place, so I could use a center punch to mark the aluminium.

© Flemming Frandsen