Analog input - RC Groups
Thread Tools
This thread is privately moderated by hisroyaldudeness, who may elect to delete unwanted replies.
Mar 08, 2018, 03:34 PM
Registered User

Analog input

Frsky made telemetry affordable and powerful.
Especially for a DLG it is nice to be able to monitor the battery voltage and the strength of the received signal.
New is the G-RX8 which has the vario integrated on the already very small PCB.

Every D16 receiver is capable of sending its battery voltage. This is only useful if you're powering the receiver using a battery. Most RC-models have a BEC (Battery Elimination Circuit) and that voltage is stabilized. If something is happening there you are quite likely to lose telemetry before anything is sent.

Many DLG's end up using a 1S setup. None of the power options are perfect and each one has its specific downsides.
With only a single LiPo cell you will only have 4.2V maximum. Most RC stuff is made for 4.8V. That's the voltage of 4 NiCd cells. When you are structurally underpowering the setup you do need to select all your parts carefully. Especially your servo's. A popular DLG servo is the Dymond D47 and D65. These not only work fine on a 1S-setup, but they even work reliably with 2S.

The low self-discharge, energy/weight ratio and the energy/size ratio make LiPo-cells the only real choice at this moment. A NiMH can still be used, but they are quite heavy. Maybe you need some weight there after all??

The LiPo cell has one big disadvantage though. They like to be treated with care. It doesn't like to be discharged too much nor does it want to be fully charged at its peak voltage of 4.2V. When the LiPo is at 3.7V it really needs to be charged and discharging it further will lead to a damaged cell.

Storing the batteries also needs to be treated with care. They should not be close to empty (<3.7V) nor should the be fully charged. Many chargers have a "storage function" which either charges it or discharges it to 3.8V. This is just a value that has been copied over and over. In fact anything between 3.8V and 4V is fine. Storing them at higher voltages will shorten its lifespan.

But this article is not about LiPo's. It's about using Frsky's telemetry to know what voltage you're running during your flight. Funny enough you will discharge your battery more because the onboard telemetry transmitter needs most of the used energy (we're only talking about the receiver... not the servo's).
So, we need to take care that our battery stays well above that 3.7V and that's not only because of the LiPo.

Like most digital equipment the receiver's actual operating voltage is 3.3V
It gets this by using a small linear voltage regulator. The downside of a linear voltage regulator is the transistor in it that's actually letting the current through. That transistor will cause a voltage drop.
This means that your receiver is not operating on 3.3V. Because we need to stay above that 3.7V anyhow this isn't that critical.

But there's more to it.
Frsky's engineers totally didn't think about us F3K pilots flying their DLG's on merely a 1S battery. To measure the input voltage they use an 8-bit ADC that can measure up to 3.3V. The input voltage needs to be divided by 4 to do that. This is done using a simple resistor divider. To measure a voltage you need another fixed voltage as reference. Unlucky for us the Frsky engineers chose the operating voltage of the receiver which is 3.3V. A better solution would have been to create a stabilized 1.5V and use that as a reference.

This is really something you need to keep in mind as it is happening during the stage you really want to know what the voltage of the battery is. Because the reference voltage is lower it will "measure" a higher voltage than it actually is and this is getting worse and worse. When your battery is at 3.7V it will tell you that it's 3.8.

Luckily this has changed for the new GRX-8.
I did some new measurements and noticed the effect I just described was totally gone.
Because I bought a new more accurate multimeter retested the X4R and it clearly shows that this GRX-8 has much improved compared to the X4R

Here's a spreadsheet showing that...

And that's not the only reason the X4R is inaccurate. The OpenTX engineers preset the RxBat to the 13.2 (1:4 multiplier) and a 1-digit precision. You may be tempted to raise that to 2, but there's not much use in that.
The 1:4 voltage divider on the receiver brings the already low resolution (8-bit) to 0.0516V per step. As a rule of thumb one should double that to get the minimal sensible reading of it. So that's 0.1V

So what can we do about it?
Not that much really. Instead of 3.7V I will take 3.8V as my critical voltage and I take a somewhat oversized LiPo to make sure it is capable of flying more hours than I possibly can. I ran some tests with the GRX-8 and it now turns out it's not wasting the amount of energy XR4 is doing and it's even capable of doing much more.

  • Low resolution with steps that are as big as 0.05V
  • Instable reference voltage below 3.9V causing too optimistic readings

Here I want to offer a solution for the 1st problem. The low resolution is caused by 2 things:
  • low resolution ADC (8-bit)
  • 4:1 divider so it can measure up to 13.2V

The whole usable range of the LiPo (3.7V ~ 4.2V) are measured in only 10 steps.

4.18, 4.13, 4.07, 4.02, 3.97, 3.92, 3.87, 3.82, 3.76, 3.71

That should be rounded to 0.1V to give an honest representation of its accuracy

4.2, 4.1, 4.0, 3.9, 3.8, 3.7

We can't change the 8-bit ADC, but we could change the 4:1 divider.
Before you start heating up your soldering iron......
Hang on...
Changing the divider on the receiver would be a nice thing to do and I'm sure going to investigate that, but not for now....

The GRX8 and the X4R both also have a secondary analog input. We can use that one with a different divider and get a resolution of 0.0168V by not dividing the input voltage by 4, but by 110/33. This will limit the range to 4.3V, but thatís enough anyhow.

When you want to divide a voltage you need 2 resistors. Some current needs to flow or otherwise the high impendance input will take measure the full voltage. Not too much current, though. We need all the juice we can squeeze out of that LiPo.

Letís make it easy and take 1 mA. Thatís not much and it makes further calculations very easy because dividing by 1 and multiplying by 1 is not hard to do. At 3.3V you need an R2 resistor of 3300 Ohm. This resistor exists in every seriesÖ E12, E24, E48 and E96.

Changing R1 will change the maximum voltage we can measure. At 0 Ohm this will be 3.3V and at 3300 Ohm (same as R2) it will be 6.6V. Because the current is 1 mA each 3300 is another 3.3V.

But not all values exist and we need to pick a resistor that exists and because the multiplier thatís used in OpenTX is only 1 digit behind the dot it can become more and more complex to find the ideal value. When picking the best divider for our application we want to limit the range as much as we can by making the best out of the 8-bit DCA.

To achieve this I created this spreadsheet:

It has all kind of formulas in it and these do their best to help you pick the best value for both the maximum voltage (called multiplier in OpenTX) and R1. The value of R2 will also change in colour if it matches one out of the E12 series. It also gives a suggestion for which LiPo they would work optimally by matching the maximum voltage of the LiPo with the range of the analog input. The range will always be higher than the maximum voltage of such battery set to keep some headroom.

Today I modified my GRX-8 in a way that the A2 is connected to the input voltage so it can measure it with more precision.
Because I didn't have a resistor set that would give it a range to 4.3V I thought I make it easier for myself and use 2 x 10K resistors. I used normal ones, but I will probably desolder those one day to replace them with SMD-versions.
As you can see in the spreadsheet the result is in fact good enough to use a double digit reading and also accurate enough.
Last edited by hisroyaldudeness; Mar 10, 2018 at 12:01 PM.
Sign up now
to remove ads between posts

Quick Reply
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Analog servo tester w ground based input voltage. airbanana DIY Electronics 0 May 28, 2017 06:54 AM
Discussion Spektrum DX7: Extra analog input(s) Sleurhutje Radios 4 Oct 30, 2009 08:02 PM
Discussion What kind of analog signal for the Audio Input on OSD Pro JLerch Eagle Tree Systems 2 Jun 09, 2009 01:48 PM
Discussion DV Camcorders with Analog Input AnthonyRC FPV Talk 77 Jun 03, 2008 08:11 AM
Question 10-bit analog output from servo input, anybody have a canned solution available? EddieB DIY Electronics 33 Mar 11, 2005 01:47 AM