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.
MK isn't the only game in town, in fact there is a great deal of quads:
|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 Source||This 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 commercial||Toyish one-size fits all, not much to do.|
|UVAP (old)||GPL||PIC 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 yet||Reimplementation using a proper ARM7 CPU|
This is my shopping list:
|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.
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.
|Group||Part||Cost||% of total||Group cost||% of total (group)|
|The flight controller||217.9||18.41|
|Air pressure sensor||17.95||1.52|
|Lipo 3200 mAh||51.12||4.32|
|Lipo 2500 mAh||44.39||3.75|
|Servos for camra mount (4x)||43||3.63|
|Connectors + cables||7||0.59|
|Crystal for receiver||11.97||1.01|
|ACT DSL-4top receiver||44.95||3.8|
|4 x prop-mounts||31.8||2.69|
|8 x EPP1045 props||15.56||1.31|
|MOS-FETS for BL-ctrl||29.8||2.52|
|PCB for BL-ctrl||31.6||2.67|
|Components for BL-ctrl||50||4.22|
|Extra propellers (4x 1245 and 8x 1045)||57.54||4.86|
|Frame and extra FETS||86||7.26|
|Multiplex Cockpit SX transmitter||262.19||22.15|
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.
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.
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 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.
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.
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
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.
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.
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...
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.
I have been flying on and off for about a month now, so far I've destroyed (in order of failure):
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:
See the FlightController manual: Gyro Amplifier Calibration for the locations of the test points on the board.
|Gyro||TP||IC2 pin||Boost R||Lower R|
|less than 0.8V||Boost: 150k|
|less than 1V||Boost: 220k|
|less than 1.2V||Boost: 470k|
|over 2.2V||Lower: 150k|
|over 2.0V||Lower: 220k|
|over 1.8V||Lower: 470k|
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:
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 [12K]/alu-arms-250mm.pdf [4.0K], 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.