Current Sensor Calibration in Betaflight
Having an accurate current sensor on your FPV drone allows you to determine how much battery is left and what the current draw the motors are drawing in real time. In this article I will show you how to calibrate current sensor in Betaflight.
Benefits of Current Sensor
If you have a current sensor, you can display “Battery current draw” and “Battery current mAh drawn” in OSD.
Knowing your “amp draw” and how much “mah” has been used can be extremely useful.
- LiPo battery consumption (aka “Battery current mAh drawn”) tells you how much battery has been used. In my opinion, it’s just as a good battery indicator as voltage (VBAT), sometimes even more reliable because voltage can sag when you punch throttle
- The real time current draw is a good indicator how power hungry your motor and propeller combo is, you can use this to test different combo. You can also use this to test how well different batteries handles voltage sag
Virtual Current Sensor
If you don’t have a physical current sensor in your flight controller or ESC, then you can try setting up a virtual current sensor. Virtual current sensor is a feature in Betaflight, current consumption is estimated by how much you move your throttle, therefore it’s not the most accurate in the world, but it might be good enough for some people.
How to Calibrate Current Sensor
Betaflight uses a simple equation to allow users to adjust/calibrate the current sensor output:
y = ax + b
“a” is the scale, “b” is the offset. In most cases, offset is usually zero, and you only need to change scale.
There are a few different ways to calibrate current sensors.
Trial and Error
This is my “go-to” way of current sensor calibration, it’s not the fastest, but safe and doesn’t require additional equipment.
- fly a fully charged battery
- write down the “Battery current mAh drawn” that is displayed in your OSD after you landed (OSD_mAh_consumed)
- fully charge the battery and see how much mAh is put back (mAh_charged)
Use this formula you can calculate the new current sensor scale:
new_scale = old_scale x (OSD_mAh_consumed / mAh_charged)
You might want to repeat this process some more times to ensure you have an accurate enough scale number.
Note that the current sensor scale in Betaflight works backwards, i.e. to make the current sensor read lower, you need to increase scale. For example, if the OSD is reading 10% too high, we need to INCREASE the scale by 10%, this will make the OSD to read 10% lower… I know, it’s confusing 🙂
Let me give you an example:
- Your current sensor scale is 400
- You fly a fully charged battery and at the end of the flight (doesn’t matter what the voltage is), Betaflight OSD shows 1100mAh drawn
- When you fully recharge the battery, the charger shows 1000mAh was put back into the battery
- You can calculate the new scale value: New scale = 400 x (1100/1000) = 440
- Now repeat this process until you are happy with the accuracy
Low Current Test Using Multimeter
Using the motor tab in Betaflight, you can spin the motors without props and get some current measurements from the flight controller (same as the value displayed in OSD). You only need 3 to 5 measurements below 5A, so it’s relatively safe to perform.
However you do need a multimeter and crocodile clip cables for this test. Also the amp draw readings tend to jump around quite a lot so it’s very hard to take precise measurements. That’s why I still prefer the trial and error method described above. Anyway I thought I’d mentioned it in case someone is interested.
Take the current draw measurements from the FC and multimeter, then put them in this spreadsheet and it will return the offset and scale values: https://docs.google.com/spreadsheets/d/1lkL-X_FT9x2oqrwQEctDsEUhgdY19upNGc78M6FfJXY/edit#gid=0
If you have an adjustable bench power supply like the ToolkitRC P200, it’s even easier as you can read the current draw off the screen.
High Current Test Using Power Meter
This way can be much quicker to work out the scale and offset values for your current sensor. You need to strap your quad to the bench (with propellers mounted), attach a power meter (watt meter) to the quad (between the quad’s XT60 and the battery) so you can measure the actual current draw while running the motors.
Powering your drone on the bench with spinning propellers can be dangerous, do this at your own risk. You can make it safer by putting the opposite props on so they don’t push up but down.
Get a watt meter here:
You are going to notice there is small current draw even when the motors are idle, that’s normal because your FC, RX, ESC etc are all drawing a small amount of current. The current sensor on our FC/ESC isn’t super accurate when measuring small current. I’d normally ignore any difference in current draw when the motors are idle.
It’s more reliable to use the motor tab in Betaflight to spin up the motors as it doesn’t get affected by PID and the motor outputs and current draw are more stable. Increase throttle slowly, watch the current meter and aim for a whole amp value on your power meter, such as 30A.
If you get a higher or lower value on the OSD, you should adjust the scale. Change it by a small amount at first to see how much it affect the result.
For example if you have 30A on the watt meter, but you get 35A in your OSD, then try to increase the scale by 50. If now you get 27A in the OSD, then you need to decrease scale a little. You can calculate how much you need to decrease exactly by using this equation: (27-35)/50 = -0.16A, this is how much change in amp draw for per increment in scale value.
In this example, we are still 3A lower than what we get in the watt meter, so we know we need to lower the scale in this example just a little bit more by 3/-0.16 = -18.75.
And that’s it!
Voltage Sensor Calibration
You don’t normally need to calibrate the voltage sensor as it should be accurate out of the box.
Take a battery, check its voltage either using a battery checker or multimeter. Then plug it in to the drone.
If the reported voltage in the configurator (circle in red in below image) is far off from your measured voltage, then you should calibrate the voltage sensor.
Click the calibration button, and enter the measured voltage, click Calibrate and it will ask to apply a new voltage scale. That’s it.