Quadcopter build using APM2 flight controller

3689607109?profile=original

Recently I started to get interested in the Arduino open source micro-controller project. I bought an amazing little sensor board from ebay called the GY-80 which has 10DOF (degrees of freedom) and can be bought for £10.

The GY-80 IMU (Inertial Measurement Unit) has 10 (plus temperature) sensors:

  • 3 axes accelerometer  ADXL345
  • 3 axes gyrometer L3G4200D
  • 3 axes magnetometer HMC5883L
  • barometer BMP085
  • temperature BMP085

My vision at the time was to build an inertial flight control system using my own software running on an Arduino Nano and the GY-80 IMU

I found that the Arduino IDE programming environment didn't give me enough flexibility so I decided to use Eclipse which is a very versatile open source IDE which supports C/C++.

I wrote C++ code for the Arduino and GY-80 which was able to calculate the attitude of the GY-80 board and I was preparing to start on the PID (Proportional Integral Derivative) part which would send the motor control signals based on manual directions and the measured attitude.

At this point I bought an X525 kit from Ebay for £80 which came with its KK2.5 flight controller and all the bits apart from battery and radio control gear.

I bought a FlySky TH-9X 2.4GHz 9 channel digital radio transmitter and receiver for £63. This transmitter (also branded by Turnigy) has been unceremoniously hacked and there are many mods out there 

e.g.

Lipo battery for powering transmitter

Open source firmware to reflash

Back light for the LCD screen

I built the X525 quad with KK2.5 flight controller but I had many problems calibrating the machine. The cheap kit from ebay was an older version of the KK board. After a lot of trial and error I found the source code (actually Atmel Assembler) for the revision of the board I have and it was possible to figure it all out.

However, at the same time I was looking at Arduino based projects for drones and flight controllers.

FreeIMU

Ardupilot

FreeIMU is a very nice project, conceived by Fabio Varesano, sadly he passed away in Jan 2013, a great loss to open source robotics.

I settled on the Ardupilot. I was looking at the older versions, APM1 and previous, because it is based on the Arduino Mega board and is standard Arduino.

In the end I bought the Ardupilot APM2 board for £60. This controller board is based on the Atmel mega 2560 but is a modification to the standard Arduino mega.

The trouble with buying a cheap clone board from China on eBay is that you may have problems which can be extremely difficult to resolve. Such was the case here. The APM2 controller is designed to be powered with 5 volts derived from a variety of possible sources:

  • Speed Controller Battery Elimination Circuit (ESC BEC). The ESC's can provide 5V to power the APM2 and the radio receiver. I fed a jumper cable from one of the APM2 +5V Output side pins to the +5V Channel 8 pin on the Input side of the APM2 
  • USB port. This is the simplest way to power the board when you are using the mission control software from a PC.
  • Power Module (PM) board. (Power-Module.zip for eagle layouts). This is an external board designed by 3D Robotics and is touted as the best solution for flying the drone.

The problem is that when you go online to buy a clone of the PM board you find you are in a world of confusion. The board itself should have three functions:

1) Connect the Lipo battery to the power distribution harness

2) Power and Current sensing for the main power rails from the Lipo battery

3) Stabilised power supply for the APM2 logic circuits.

I realised that the clone boards come in two types.

The cheaper types do not have function 3).

The "full" versions have a 5V3 regulator board attached which is used to supply 5V3 to the APM2 across a protection Zener which drops 0.3V. The regulated 5V3 is provided on the multi pin connector along with the sensing. 

The forums are full of talk of missing components and I was distracted by this at first. I had the APM2 powered up using the ESC BEC method but I ordered a "full" PM board because it should supply clean regulated power. The first thing I noticed when it arrived was a missing capacitor but the specified voltage regulator on the PM is the PTH08080WAH and it doesn't absolutely require this capacitor at the 5V3 volts it is working at.

I connected the new PM to the quad after disconnecting the ESC BEC jumper and I removed the tiny jumper from the APM2 to isolate the circuit (in fact my cheap APM2 clone didn't have any jumper pins soldered in at all!) . Nothing happened so I measured the output of the PM regulator and it is exactly 5V not the 5.3V I was expecting. I could connect another 489 Ohm resistor in parallel with the voltage selection resistor which would provide 205 Ohms for 5V3 not the 353 Ohms for 5V0 that it is now on the PM board (Ohms Law for parallel resistors), but I went back to the ESC BEC to power the APM2 for now.

The quad is just past first flight. A dry connection on one of the XT60 connectors cause it to drop from the sky after a few seconds of full current load but otherwise it is quite stable in Loiter Mode

The 2200mAH 3S Lipo battery was puffed up a bit due to me overcharging it previously using the iMax B6AC charger.

This was a lesson regarding Lipo safety I shall never forget.

I put it on charge again and forgot about it. The battery exploded with 3 load cracks, one per cell, and nearly set fire to my house. The battery was ablaze with a fierce heat and I had no fire protection equipment of any sort. I used a kitchen spatula to hook the burning block of lithium into a saucepan and threw it outside along with the burning cables and cardboard it had already ignited. Lost in the fire due to burnt cables was a soldering iron, the iMax charger, and my multimeter has a melted case. The kitchen work surface is badly damaged. I had become complacent, ignoring all I had read about Lipo safety. From now on all my Lipo batteries are stored in a heavy pan on sand. I will never leave them on charge unattended, or with other flammable materials close by. In fact I am going to buy a fire proof bag for when I have to transport them. As soon as a Lipo looks a bit puffy its time to be extra cautious.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • mP1, I am using the APM2 controller to drive the esc's. I haven't got my own solution to driving the esc's yet. I will certainly take a look at what you are suggesting if I ever get round to it. The APM2 has so much functionality that I might try developing different sensor fusion techniques (e.g. Kalman, Madgwick) on the APM2 software.

    At the moment I am quite excited about putting a GoPro on the quad and just flying it around. 

  • Rob, I bought the charger from a Singapore eBay supplier and I really dont know if its fake or not. The battery was slightly puffed up and almost charged and I thought I would top it up, then I forgot about it for a couple of hours (there's the problem!). I assume the charger continued to pump electrons into it until it was full and blew up:)

    Thanks for the Loctite advice. I have been quite lucky (I think) because the quad runs quite smoothly and I haven't even balanced the props. I am using a piece of Velcro to fix the APM2 controller to the frame (X525 frame is designed around the KK controller) and I am assuming that the Velcro has some vibration isolation characteristics.

  • How are you driving the esc ? From what i can tell the easiest solution is one of those 16 channel PWM drivers that use a i2c. For reading are you using the ppm encoder which accepts 8 pwm servos ?

  • Clive

    Where did you acquire  your charger? I'm curious if you got a fake IMax charger. The one bit of advice I would add is to locktite all the bolts and screws.

This reply was deleted.