Introduction: Safetly Use CLONE APM Power Modules
Ok so if you have bought a power module from ebay or somewhere else and its not an official 3DR module, it may not work exactly as it should. It may fry your flight controller.
In the photos is a power module I got on eBay, It looks almost exactly like what I needed to power my Hobby king Crius AIO clone for my tricopter. Look closely at this and a picture of an official one - there are some parts missing!
This one was $7.16 (AUS) on ebay, good deal if you don't blow up you FC with it.
Hobby king sell one that works perfectly, it will also power your flight controller unlike these ebay ones
International Warehouse Part: http://www.hobbyking.com/hobbyking/store/uh_viewit...
Australian Warehouse: http://www.hobbyking.com/hobbyking/store/uh_viewit...
USA Warhouse Part: http://www.hobbyking.com/hobbyking/store/uh_viewit...
Of course you could buy the 3DR one as well : https://store.3drobotics.com/products/apm-power-mo...
however its more expensive before shipping and for what should could easily be 3 resistors (current shunt & voltage divider) its expensive.
Step 1: So Whats Wrong With the EBay Specials?
So whats wrong with the eBay specials?
They have been produced at a cheaper price because they are not the same spec and will not work in exactly the same way as the 3DR part. The photo above is of an official 3DR module and you can see the big old smt capacitor that is clearly missing from ours, but thats not all - keep reading for the main issue!
Q: Why will these eBay specials might potentially destroy your flight controller?
A: They (probably) don't have a regulator on them and so may pass your battery voltage, possibly 16 volts or more, straight to the flight controller which expects, and can only handle, 5 to 5.5 volts.
I am re writing this as I may have jumped to some conclusions. It appears that I may be wrong and that the full battery voltage may be due to reverse leakage through the diode that will not exist once its plugged into the APM but IM NOT GOING TO BE THE FIRST ONE TO TEST THAT THEORY:) I think its safer to simply remove some wires like I explain further in.
Look at the second picture in step one, notice a big old empty space with a square printed on it and 5 empty through holes? Its where a regulator would be if we weren't so cheap and bought an official one:) You will probably notice a capacitor missing in step ones first photo too, there are two big pads where a tantalum cap is supposed to go. Apparently there maybe a resistor or two missing as well from the full spec but ... doesn't seem to stop it from supplying the voltage and amperage values.
Q: Why don't they have the regulator?
A: Cheap linear regulators waste to much power as heat in order to do a large drop from 16'ish or more volts to 5'ish volts, more expensive switching regulators do a great job at around 90% efficiency and so create little wastage in heat, but are expensive! 3DR spec the official power module with a http://www.ti.com/product/pth08080w which cost probably $5 + each (in bulk, more like $10 to you or me at 1 piece prices).
Q: Can I still use the cheapie I bought
A: Yes, but don't plug it in yet, test everything and make sure you realise that you cannot power your flight controller with this unit you can only pass battery voltage and current usage values into the flight controller! We have to remove a few wires from the cable and move others around a bit so to get everything in the right order.
Step 2: Using Your Clone Module Safetly
Look closely at the image above, Ive marked 1 to 6 on the pins we need to concern with.
Pin 1: Battery Voltage (Remove! supposed to be 5v not full bat voltage).
Pin 2: Battery Voltage (Remove! supposed to be 5v not full bat voltage).
Pin 3: Current Usage Indicator (Very small voltage as measured across 0.5 ish ohm shunt resistor, maybe amped).
Pin 4: Battery Voltage Indicator (Battery voltage as seen through a 1:10 ish voltage divider).
Pin 5: Ground.
Pin 6: Ground.
1) First make safe - remove wire from pins 1 and 2 from both ends of the suppled cable. We don't want, at any stage, to be passing full battery voltage to the flight controller.
2) Remove wire pin 6, we don't need two ground wires one is sufficient.
You should now only have 3 wires left in the supplied harness - which correspond to pins 3, 4, and 5 in my photo. Remove as in carefully lift the retaining clip and withdraw the wire, don't just cut it and leave a stub waiting to short out on something.
3) Test Battery voltage indicator - Pin 4.
Plug your battery in to the power module and set your multimeter to DC voltage measurement.
Across pins 5 (negative) and 4 (positive) you will see a voltage value of approx. 10 times less than your battery voltage. Using a fully charged 4s battery at 16.75v I read a 1.651 voltage between pins 5 & 4 (yes it should be 1.675 but there is some calibration to do in software). Using a 3s lipo at 11.1v you will see something more like 1.11 volts etc ect. The flight controller will read this voltage, times it by 10 in code and know your battery voltage. Its done this way as the flight controller would like to know battery voltage but cant handle more than 5 volts and so we give it something smaller and tell it how to scale it back up.
4) Test Current usage indicator - Pin 3.
Same as above, measure between pins 5 (ground) and pin 3 (positive) to see what voltage is coming out, at this point it will probably be 0v or something very small. You wont get any indication of current until you actually draw some by loading up the power module - ie by flying your quadcopter! With no load its 0v * amp factor which is still 0.
I can see a big old resistor with a very low resistance so I assume its a shunt. Also what I suspect is an INA169 ic which reads voltage drop across the shunt and amplifies it - http://www.ti.com/lit/ds/sbos181d/sbos181d.pdf
So without caring to much if that chip is or isn't what I think it is I moved on, the instructions I have compiled work either way. So from here on this is how I think this thing is working and how I have set it up and it seems to work this way.
The shunt resistor marked 0M50 has a very low resistance and so will have a very small voltage drop across it even when you load up this power module with 8 motors it likely wont be very much, its going to be read by the flight controller, probably after being amplified by quite an amount (in the suspected INA 169 IC) and then again in code some simple ohms law maths will deduce how much current you are using at the point in time.
If you don't have some voltage values similar to the described above, don't move on. You absolutely don't want to be able to find more than 5 volts across any combination of any of the 3 pins left in your harness or something is wrong. In fact more than a few volts and something is wrong.
3DR state their power modules are good for up to a 4s battery, this is I believe because of the voltage regulators maximum input voltage specification. The INA169 has a max of 60v. Since we don't have this regulator, its feasible to assume we can use a higher cell count battery with this setup. Being that the voltage divider scales battery voltage down by 10, and the FC can (probably- depending on what kind of ADC its using, and yes I haven't looked into this but I think the mega 2650 they are based on is happy with 5v, they are in my Arduinos anyway:) accept 5 volts to its analog to digital converter it makes sense that we could use a supply voltage of 50 volts (50/10=5). So maybe up to an 11s battery if such exists, without going over the (assumed) 5 volt input limit to the FC analog 0 pin. There is a diode with a 20 v rating in there on the 5 volt line which doesn't work anyway which might be less than happy with the extra battery voltage? So with that said maybe, since we dont use the 5v out from these 'reg less' units we could use big cell count batteries. Please put more thought into that idea than I just did before trying it.
Step 3: Connecting to Your Flight Controller
So now you have only 3 wires on your cable, on the power module end these are connected to pins 3, 4 and 5.
On the other end of the cable which goes to the FC, we need to change the pinout.
1) The wire going from power module pin 3 needs to goto the FC pin for voltage sensing, On the AIO boards its marked A1 current sensor. In the image above of my Hobby King MultiWii and Megapirate AIO FC (hobby kings Crius AIO clone) its the second bottom pin on the connector in the top white female plug.
2) The wire going from power module pin 4 needs to goto the FC pin for current sense, on AIO boards its marked A0 voltage sensor/divider. In the image above of my Hobby King MultiWii and Megapirate AIO (hobby kings Crius AIO clone) its the bottom pin on the connector in the top white female plug.
3) Ground, pin 5 from the power module side, needs to connect to a ground on the flight controller. There are no ground pins in that female connecter on the AIO FC however the board is littered with them so just goto any spare.
The pictures above show the wiring, its tough to see, sorry, but there is only 3 wires so follow carefully and it shouldn't be to hard to be sure you've done it right. I added one pic with wires drawn in paintbrush to try and make it clear.
Clearly, regarding power, your battery goes in one end and the other end goes off to your usual power distribution, your speed controllers and such. The direction of flow is marked on the board, in from the battery, out to the multirotor/plane or what ever.
Step 4: Programming the Flight Controller
So now the flight controller needs to know its got these connections.
There are methods for instructing the Arducopter code based flight controller to A) listen on these analog pins and B) calibrate to valid values. The Calibration is important - maybe with a 3DR power module you could consider being lazy and skipping it, however chances are the tolerance or spec'd values of the divider and shunt resistors in our cheapies are different than those supplied by 3DR and so are all the more in need of calibration from default values!
These steps are fairly well documented on 3DR's Page ( http://copter.ardupilot.com/wiki/common-measuring-...) . Remember not to follow any pinout or connection instructions on that page, thats for people with official power modules which wont blow up flight controllers, just follow the steps to enable and calibrate the readings within the mission planner software or the steps below.
Basically, in APM Planner:
1) Download your current params (obviously with fc connected via usb or 3dr radio so mavlink can communicate).
2) Goto Initial setup / Battery Monitoring section
3) Under Monitor: choose "3 Voltage and Current"
4) Under Sensor: choose "0 other"
5) Under APM: choose "0 APM1"
6) Voltage Pin: 0
7) Current Pin: 1
8) Then measure your battery voltage with multimeter (don't disconnect battery, do it in place, you can do it across the balance leads measuring from the end pins, furthest from each other. Its important to have some kind of load on a battery even though the FCs load is quite minimal its all we've got right now, its also important to have the flight controller listening to its signals on A0 and A1 so when you give it the correct value it can compare it with its A0/A1 voltage values and make the decision about what the error is and how much to change the divider value).
9) Then on the right under calibration you can add the value you measured into "Measured battery voltage". This will update the voltage divider values. As I suggested every module, and in fact every resistor worth less than $10 itself, is a little bit different and needs to have this done.
10) A bit more tricky is to calibrate the current shunt values, it is the 'ameres per volt' value.
What its eluding to is that for every volt it can see on pin A1, its going to assume that there are 'some constant value' times that many amps in play. So for example my value is 18, meaning that for every volt the power module delivers to the A1 pin, the arducopter software is going to believe that 18 amps are being drawn. This is where the 90 amp maximum for the power module sensing comes from I guess, 18 volts per amp * 5 volts = 90. Would be interesting to see whether the sensor will provide a damaging voltage value of over 5v to the APM board if you somehow managed to draw over 90 amps?
You'll need to put a multimeter in current sense mode between in series between the positive of the battery and the positive input of the power module. Its difficult cause then you also have to connect ground straight through from battery to power module. So some alligator clips or a specially setup lead with xt60s on it will help.
Then you have to measure the current being drawn, but it gets more difficult again cause you kind of want to be measuring it under a good load (ie motors spinning up hard). You can do it under the small load that the flight controller places on the battery but its (i think, in my quick guess without too much actual thought) probably more accurate to do it with a larger value (ie larger load) unless you have some fairly good quality ammeters.
Ive actually not bothered with the current calibration yet. I'll wait till a friend is here to hold my tricopter while I do the test under load.
You can see in the image the settings and calibration values that seemed to be quite accurate for me.
For other software, multiwii or other, all previous hardware related tips are still true, just different things to do in software to enable these readings than those that are described on the 3DR link above and my comments - obviously.
Thats it, you should notice the greyed out 'calced' values in this screen of the Mission planner to be updating regularly. Leave your battery connected for 10 minutes and the FC/GPS/LEDs and the rest of the junk you have strapped to to your rig will probably take 1/2 a volt off your battery back. So you can measure your voltage again across the balance leads and see if the Mission planner is telling you the same story.
Step 5: My Tri Just Finished It.
My Tri Just finished it.
3d Printed body and motor mounts. 850mm between prop centres
Yaws entire rear boom from glide bearing and servo mounted in main frame instead of motor mount at end of boom. Trying to keep all the weight centralised.
Flight controller $45 - Multiwii and Megapriate AIO
props $15 - 14*5.5
Booms $45 - 500mm carbon @ 18mm Diam
Frame $0 3d Printed Free:)
motors $90 390KV Multistars
ESC $45 Afros
GPS $20 Cheapie Of ebay
$270 bucks, Add a 6000mah battery I get 30m flights and if i crash it for that price I couldn't care less!
Motivation was for a cheap tricopter to try follow me mode behind my boat to get some good footage. Good probability of it ending up in the salt water at some stage so did it on the cheap.
We have a be nice policy.
Please be positive and constructive.