MR60

How-to guide: Pixhawk with 6S batteries (> 4S)

3689574013?profile=originalHi,

1. Introduction:

Pixhawk 3DR kit is delivered by default with a 4S maximum power module. For those wanting to use 5S or 6S or higher voltage batteries there is currently, to my best knowledge, no “how-to” guide for the Pixhawk board. I therefore decided to document it for others who might need it too.

For those who would like the same “how-to guide” for APM 2.x , here is a link I wrote a while ago:

http://www.diydrones.com/profiles/blogs/powering-your-apm-drone-or-how-not-to-shutdown-apm-like-the-us

Pixhawk comes standard with three (redundant) ways to powered it up:

1-USB : not used to fly obviously; just useful on the ground for connection on a ground station software.

2-The power module port accepting a maximum input voltage of 5.7volts (and will not get destroyed up to 20 Volts input)

3-The RC input pins. Will accept a maximum voltage of 5.7volts also (and is also protected up to 20 Volts)

This guide assumes a use of Pixhawk’s power module port which provides not only a way to power the board but also the pins to measure current and voltage values of the main battery.

This guide assumes a use of a 6S battery in combination with a Attopilot current & Voltage sensor board. This Attopilot “power module” replaces the 3DR 4S limited power module. The Attopilot board comes in three flavors: 45 amps, 90 amps or 180 amps.

3689573992?profile=originalThe choice of the right Attopilot board (45A, 90A or 180 A) will depend on your motor/props combination: take the Attopilot version that has the smallest amps capacity above your max multicopter current consumption. However we will introduce in this guide a way to use the 90 amps Attopilot board to measure up to 150 amps, still using Pixhawk’s power module port.

 

2. Attopilot description:

An Attopilot board provides three wire soldering pads to solder : a current measurement wire, a voltage measurement wire and a ground wire. See picture below:

3689574026?profile=original

Attopilot 90A support up to 50Volts for a maximum of 90A. However the resistor specifications exceed the 90A limitation which makes it possible to use it for measuring 150 amps (we will take this as a assumed max current as our example for the rest of the explanation).

The datasheet of Attopilot specifies that the Voltage measurement wire outputs an analog voltage of 63,69 milliVolt per Volt. Similarly the current measurement wire outputs an analog voltage of 36,60 milliVolt per Volt.

So for a 6S battery the maximum analog voltage values will be:

-For voltage measurement: [min 0V -  max 1.6V]

-For current measurement: [min 0V – max 3,3 V]

 

3. Pixhawk power port description (pinout):

3689574113?profile=original

Reusing the excellent pixhawk infographics published in the wiki, the image shows circled in yellow where the power port is on the pixhawk board.

The power port is a so-called DF13 connector with 6 pins.

The six pins of this connector are assigned in the following order, starting by the red wire on the leftmost pin:

Power Port Pinout Description:

  • 1- Vcc (5V input)
  • 2- Vcc (5V input)
  • 3- I (Battery current measurement analog voltage input)
  • 4- V (Battery voltage measurement analog voltage input)
  • 5- Ground
  • 6- Ground

 

4. Wiring Case 1 : to measure up to a maximum of 90 amps

The connections between Attopilot and Pixhawk are shown in the illustration below:

3689574082?profile=original

We have added an optional BEC in the illustration that would be connected to the Vcc and Ground wires of the power module. It is optional as Pixhawk could alternatively be powered via the RC inputs.

4. Wiring Case 2 : to measure up to a maximum of 150 amps

The connections between Attopilot and Pixhawk will integrate resistors to be able to measure up to 150 amps.

Indeed the ADC of this power port on Pixhawk has a range of 0-3.3V. This means that for the maximum true current of 150 amps, we want the current analog wire of Attopilot to output maximum 3.3Volts (as it is the case in case1 for 90 amps max without additional resistors).

Note : this part has been updated with a resistor scheme simplification (only one resistor to add in parallel rather than the originally classical R1, R2 resistors divider) thanks to a contribution of Bo, a diydrones member who analyzed in depth the Attopilot circuitry.

So we will build a small resistors divider on wire 3 (current measurement) & wire 5 or 6 (Ground) as follows:

3689574212?profile=original

The Attopilot current measurement output masks a circuit that contains an existing output resistor called Rl. According to the Attopilot datasheet, the following equation links to measured current I (called MeasuredCurrent in the equation), the output analog voltage for current measurement Vout, and an existing Rs resistor in Attopilot:

3689574168?profile=original

 What we want is to get Vout = 3,3 when Current =150 amps. To do this we will add a new external resisto (Rx) in parallel with the existing Attopilot Rl resistor, so that the new resulting Rl resistor (called Rl’) must be (knowing that Rs = 0.5Mohm as per Attopilot specs):

3689574150?profile=original

Therefore we can calculate the Rx resistor value we need to add in parallel as follows:

 3689574221?profile=original3689574230?profile=original

So, Rx must be ~ 110kohm to have a Vout at 3.3V when the measured current is 150 amps.

You can choose another max amp output (but I would not advise higher than 150 amps with the 90 amps Attopilot, otherwise use the 180 amps version instead) and calculate the resulting Rx resistor

As a result, when the current is 150amps, Vout will have value of 3.3Volts.

 

5. Mission planner / parameters configuration in battery monitor screen:

In the battery monitor parameters screen, you can manually select which current and voltage sensor you are using. In the present case, you will select the power module and modify the following parameters to make the mission planner voltage and current display match the real values (measured using a wattmeter for example). The explanation below is an extract from the Arducopter parameters list.

Battery monitoring (BATT_MONITOR)

Controls enabling monitoring of the battery’s voltage and current

Value

Meaning

0

Disabled

3

Voltage Only

4

Voltage and Current

Battery Voltage sensing pin (BATT_VOLT_PIN)

Setting this to 0 ~ 13 will enable battery current sensing on pins A0 ~ A13. For the 3DR power brick on APM2.5 it should be set to 13. On the PX4 it should be set to 100. On the Pixhawk powered from the PM connector it should be set to 2.

Value

Meaning

-1

Disabled

0

A0

1

A1

2

Pixhawk

13

A13

100

PX4

Battery Current sensing pin (BATT_CURR_PIN)

Setting this to 0 ~ 13 will enable battery current sensing on pins A0 ~ A13. For the 3DR power brick on APM2.5 it should be set to 12. On the PX4 it should be set to 101. On the Pixhawk powered from the PM connector it should be set to 3.

Value

Meaning

-1

Disabled

1

A1

2

A2

3

Pixhawk

12

A12

101

PX4

Voltage Multiplier (BATT_VOLT_MULT)

Used to convert the voltage of the voltage sensing pin (BATT_VOLT_PIN) to the actual battery’s voltage (pin_voltage * VOLT_MULT). For the 3DR Power brick on APM2 or Pixhawk, this should be set to 10.1. For the Pixhawk with the 3DR 4in1 ESC this should be 12.02. For the PX4 using the PX4IO power supply this should be set to 1.

This is a parameter to adjust to match the real Voltage value with the displayed mission planner value.

Amps per volt (BATT_AMP_PERVOLT)

Number of amps that a 1V reading on the current sensor corresponds to. On the APM2 or Pixhawk using the 3DR Power brick this should be set to 17. For the Pixhawk with the 3DR 4in1 ESC this should be 17. Units: A/V.

This is a parameter to adjust to match the real Voltage value with the displayed mission planner value.

There you go! I hope this will help you configure your pixhawk with higher than 4S batteries.

Cheers,

Hugues

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • MR60

    Hi Liu, it is better and easier to use a 180amps atto instead of a 90amps if you need to measure more amps. Indeed, it has been highlighted by the maker himself of attopilot that adding resistors dividers on the attopilot output is not advised as it interacts with the "inside" components of Attopilot and could make the readings unreliable.

    Cheers

    Hugues

  • Hi, can you explain the calculation part ?

    I thought Rl suppose to be 0.44 micro ohms instead of 44 k ohms ?

    and where did you get the 73.2 k ohms ?

  • Thanks to all of you: My case is that I have just purchased from Steadydrone a big quad powered with 4 x 6s batteries in two series, so I guess it is like a 12S2P "power plant", but the Pixhawk has its own 2S battery

    It's likely I cannot monitor both at the same time, isn't it? in that case, should I better use a frsky smart port voltage sensor to monitor the autopilot battery in the transmitter and one of those suggested 180A attopilot voltage sensor to keep the Pixhawk aware of the volts that matter? Thanks for any comments

  • MR60

    Thx for posting this from the Attopilot chip creator.

    It would be nice if he could come discuss on this thread because many have still lots of questions remaining opened about Attopilot.

    I notice a contradiction between the Attopilot instructions manual, that is delivered by Sparkfun (and others), where it is advised to add a resistor in series on the I ouput to stabilize the Attopilot readings. But here the creator of Attopilot says the opposite ? Confusing...

  • I recently started flying bigger rigs, went from hexa to octo, and eventually bought into the Pixhawk ecosystem. Problem was, like some people posted here, was making it work with 6S LiPos and still monitoring voltage/current.

    I got in touch with Dean, the creator of the Attopilot chip, to ask about the 90 A chip monitoring 150 A, and his reply to me is below. I'm no EE, but is it impled that with an ADC amplifier this solution works? I really wish 3DR had an official solution for heavy lift copters.

    Hi R.J., 
    WHOA!!! No way - thank you for bringing this to my attention.  The shunt resistors are rated to 2 Watts each... the 90A sensor uses two of these shunts in parallel and therefore can dissipate up to 4 Watts maximum which occurs close to 89.4 Amps.  If 150 Amps is pass through the shunts, the heat power generated in the shunts would be 11.25 Watts which is almost 3X the maximum!!!  The shunts use a metal film and if you look closely at them it is amazing how narrow the traces are under that green masking.  I'm not sure what alloy is used in that metal film... and it is true that if the shunt heats up a lot then resistance will increase which would choke back the current increase, not to mention cause potentially HUGE error in the sensed current value.  Worst case, which is quite likely, is the shunt resistor fails.  It could be prettier as in no fire or melting or explosion but still an abrupt cessation of flight power (bad for a quad) and/or all power to servos and autopilot (depending how everything is wired up)... or a fire.
    Because Sparkfun sells the 90A and 180A sensors for the same price ($20) there is no price advantage to doing this as if extending the range of a cheaper sensor instead of buying a more expensive sensor.
    It's true that there's some zero offset that grows as the sensors range is increased due to the way the sensing IC (Texas Instruments INA169) works.  In fact the AttoPilot sensor can have up to a 9 or 10 Amp zero offset because of how the INA169 may apply an offset to the voltage drop across the shunt between 0.2mV and up to 1 mV.  The 90A sensor would have at most up to a 5 Amp zero offset, but typically it is around 1 A.  In all cases and depending on accuracy required, the end-user is encouraged to perform their own calibration of the sensors and apply offsets and/or scaling factors in their code as required.  This is simply to correct for normal tolerances of the components. However, once the offset and scaling factor are accounted for the sensor is extremely trustworthy due to the excellent linearity.  In fact I find that linear fits typically have R^2 of 0.999 and better.
    Another huge issue, is in the example of adding the two new resistors, the R1 is 10k Ohms and is a series impedance between the INA169 and the autopilot's ADC input... NOT GOOD!  As designed, the AttoPilot sensors do not have any series impedance between the output pin of the INA169 and the "I" pin.  I have seen some complaints that the AttoPilot sensor can be inaccurate, and that a 'fix' was to use an ADC amplifier between the Atto "I" pin and the autopilot.  ADC amplifiers are a MUST if someone is going to add series impedance by an R1 as shown on the Pixhawk forum page.
    I don't have an account on that forum, but would be grateful if you would copy my reply to the forum.  This is a pretty serious matter from both a safety and accuracy standpoint!!
    Thank you,
    Dean

  • So I'm following case 1 with the BEC on 180AMP Attopilot. I did not put the ground loop in between wire 5 and the BEC. Could this be the cause of extra heat produced? My tiger ESC do not have a bec. Reason for adding BEC.

  • Sounds silly but I think they call it a common ground?
  • MR60

    Hi Jeremiah,

    What BEC r u using? If it heats up, it might not be a switching BEC. Check it out.

    About ground, it should always be used/connected (a common ground). But impossible to answer your question without your schematics.

  • So my BEC is getting very hot. 6s to 5v 1.5 amps to feed Pixhawk. Do I need to ground between BEC and Attopilot?
  • It might be in the works - I remember seeing a "HV" version of the PM listed in Mission Planner. It might not be there now, but yes - the call for a HV PM module has been consistent for at least two years, and there are numerous posts on it here.

    For what is essentially a simple component I'm surprised why 3DR has not updated it. Has anyone asked Chris why this component has not been updated? An nice "pro" version would be cool - 8-10S, 150A capable. Please 3DR...

This reply was deleted.