Jump to content

Build your own telemetry sensors.


Recommended Posts

I have one of these working on pack voltage, current and cell voltage (3S tested so far), using your second revision board. Some observations:

1. The ground tracks a quite thin. I would normally use 50 thou width for ground, or create a ground plane.
2. The holes for the resistor leads are larger than needed, I would normally use 0.8mm for these and 1.0mm for (square) header pins.

You have a ground wire connection from the main power negative connecting to the board for measuring the flight pack voltage.This can create two ground paths to the ESC. One is along the main power connection, the other is via this connection to the board, through the board, along the ground of the SPort connection to the Rx, through the Rx and along the ground connection of the throttle connection to the BEC of the ESC.
The main power connection will be a very low resistance, although the power connectors (4mm gold shown) may add a few milliohms.

Now I'm guessing a bit on these values but suppose the main power connection is 5 milliohms and the other route through the board and receiver is 200 milliohms (0.2 ohms). The motor current will split between these two paths in a ratio of 200 to 5 (40 to 1). So if your motor is taking 41 Amps, 40 goes along the main connection but 1 Amp will go through the receiver and board.

I would suggest the wire from the LiPo negative to the board is not fitted.

I'll be adding my pressure sensor, although my board is a few years old and has a different arrangement for the connections. As have been testing using a G-RX8 receiver (to a X9Lite using the new ACCESS protocol) I had altitude anyway!

Mike

Link to comment
Share on other sites

Thanks Mike for the very constructive comments. I fully expected all of these points to come out in the discussion here. (Maybe not in a single post though).

As explained in the article, this has been the story of my experiments and I explained that there are many other ways to build up an OpenXSensor. The PCB was just supposed to be one example and I'm learning massively as I go there too. This forum can be so useful.

I've been taken very much by surprise by the interest, in the PCB particularly - 66 have gone out to date.

I did wonder about the ground wire to and debated with myself about whether the accuracy of voltage measurements might be affected if the reference connection relied on the black wire in the telemetry signal connection, via the Rx and the black in the throttle channel back to the ESC. Having said that my prototypes (pre PCB) didn't have that wire direct to the black power cable and they did work fine. What I hadn't done is consider that a small portion of the current between battery and ESC might flow that way. I might even try measuring that current, if I get a minute.

Link to comment
Share on other sites

Hi Chris, I have built my first Multi Function Telemetry sensor using your PCB and am chuffed to bits with the results. After reading Mikes message and remembering a problem we had at work I have left the LiPo negative wire off, it all appears to be working fine apart from the fact the Curr is reporting 0.0A. As you can see from the photo everything else looks correct.

Any help or ideas would be gratefully received and what settings to use?

img_2236_01.jpgimg_2243_01.jpg

Thanks Andy

Link to comment
Share on other sites

Hi Andy that looks great, well done.

Just off the top of my head - it looks like you have configured Curr to work so that's good. I can't check right now but is there somewhere in either of the config files to set which pin reads current? That needs to be A3. or 3.

On the hardware side have a good check for solder whiskers that could be shorting the current chip's output or A3 input to Gnd. You could check for this with a multimeter. Or, is there a connection break between current chip and the filter resistor, or between filter resistor and A3?

I'm out for the afternoon but if the above doesn't help we can dig more deeply later. Ooh one more question. When passing current do you have the lipo connected to the wires at the top of your photo and your load (ESC/Motor) connected to the wires exiting the left of your photo?

Link to comment
Share on other sites

In oXs_config_basic.h I have (comments removed):

#define VFAS_SOURCE VOLT_6

In oXs_config_advanced.h I have (comments removed):

#define REFERENCE_VOLTAGE 3300

// ***** 6.2 - Voltage parameters *****
#define PIN_VOLTAGE 0 , 1 , 2 , 6 , 8 , 7
#define RESISTOR_TO_GROUND 2.70 , 2.70 , 2.70 , 2.70 , 0 , 2.7
#define RESISTOR_TO_VOLTAGE 1 , 4.7 , 10 , 12 , 0 , 18
#define OFFSET_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0
#define SCALE_VOLTAGE 1.00 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0

// ***** 6.5 - Current parameters *****
#define PIN_CURRENTSENSOR 3
#define MVOLT_AT_ZERO_AMP 344 // in millivolt
#define MVOLT_PER_AMP 26.35 // in milliVolt per Amp
#define RESISTOR_TO_GROUND_FOR_CURRENT 0
#define RESISTOR_TO_CURRENT_SENSOR 0

The MVOLT_AT_ZERO_AMP value is first from measurement, then adjusted to give 0.0A (I had -0.3 to start with!).
The MVOLT_PER_AMP value comes from 40 / 5 * 3.293 as I measured VCC at 3.293 volts.

Mike

Link to comment
Share on other sites

Hi Chris & Mike,

Things are getting better as you will see from the photo below, I checked over the PCB to make sure there were no solder bridges and everything was okay and it was.

I noticed that I had no sensor ID so I deleted the sensor and then discovered the sensor again and it appears to be working. What is being displayed is not correct but this seems to be the zero point and when I advance the throttle it goes up by about 1.5A (no prop fitted), I just need to find out how to set this to zero. At 47A the device would be getting very hot but it is quite cold. Do I need to edit the current sensor line in my Taranis as I notice it has an "Offset " option or is something still incorrect?

You are correct Chris I do have the battery connected to the right and the ESC to the left, I notice that the VFAS voltage has come down ( not sure if this is the expected voltage). I found an error in one of the lines of code "#define RESISTOR_TO_GROUND 2700,2700,2700,2700,2700,2700" I had 2200 as the first number so was that causing part of the problem?

I would like to calibrate the device but am not sure where to take a measurement and then which line to add it into. Can you give some help here please?

img_2248_01.jpg

I may give your values a go in the next one I build Mike and just see how they compare, as I have said this is all new to me, as the only programming I have done is GW Basic many years ago.

Thanks Andy

Link to comment
Share on other sites

Hi Andy.

One thing at a time, VFAS should be reading the full voltage of your battery.

As Mike's example above shows you need the line in config basic to be

#define VFAS_SOURCE VOLT_6

This tells it to use the pin 6th along the list defined in the config advanced

#define PIN_VOLTAGE 0 , 1 , 2 , 6 , 8 , 7

i.e. pin A7.

It then also uses the resistor values 6th along their respective lines. i.e. 18 and 2.7. (or 18000 and 2700) if those are the resistor values you've used for R2 and R3 on the PCB.

Link to comment
Share on other sites

For the current measurement then measure the voltage ,with a multimeter, between Gnd and TP1. Measure when no current is flowing.

Enter this figure (in millivolts) into the #define MVOLT_AT_ZERO_AMP line (config advanced section 6.5) and start with the number 26.4 40 in the #define MVOLT_PER_AMP line.

To calibrate further you could measure the voltage between Gnd and the 3v3 test point.
Enter this figure into the #define REFERENCE_VOLTAGE line (e.g. #define REFERENCE_VOLTAGE 3300).

Mikes formula above should give a more accurate current reading.

NOTE: All this calibration is only as accurate as your multimeter.

For some of mine I've measure all the resistor values and entered those in the appropriate slots in the config advanced file.

Edited to correct 40 to 26.4 - thanks Mike.

Edited By Chris Bott - Moderator on 19/05/2019 20:00:35

Link to comment
Share on other sites

Thanks for all the advice and help guys.

As you can see from the photo below I now have the current at zero and the VFAS voltage correct, the zero current I obtained by editing the current line in the telemetry screen on the transmitter and setting an offset value.

It may not be correct in your view but it is working and is consistent. I have added two photos of the soldering of the current sensor and leads and I feel that these are good well made connections, it may be just the combination of wire, connectors, soldering and device that gives the variation I am seeing.

You and Mike probably would have an explanation or do I have to change a value in the software so that I do not have to do the offset in the transmitter?

img_2267_01.jpg

img_2269_01.jpg

img_2271_01.jpg

Thanks

Andy

Link to comment
Share on other sites

Hi Andy well done!

Your soldering looks good and you've heeded the advice to solder direct to the ACS758. So all should be good.

Do I detect that the device is a 50B version? That's a maximum 50Amp bi-directional device.

The spec sheet says that that one has the same mV/A sensitivity as the 100U I've used, but the voltage at zero current is nominally half supply volts. This probably accounts for your current offset.

It's valid to fix this in the transmitter settings, but obviously you'll have to remember this if ever you set up another model to use it.

Checking readings against a wattmeter would be a very good thing to do, in my opinion.

Link to comment
Share on other sites

Mike I've confused myself again (easily done these days).

I've knocked one of these up just to measure two different receiver packs and altitude.

It's all working fine, I'm using A3 and A4 for the Rx packs with 1K to ground and 4K7 to voltage in the dividers.

Except - A3 and A4 are both reading 10x it's respective Rx pack voltage.

I have #define REFERENCE_VOLTAGE 3422 as that's what that measures.

Is there anything odd about A3 & A4 that you know about?

Hopefully it's just a silly mistake I've made.

Link to comment
Share on other sites

It is confusing isn't it? That's probably the hardest thing in OpenXSensor.

Once you've worked out that V1 to 6 can use any of the analog arduino pins A0 to A8, and you have to exclude the ones that are for current measuring and for SDA/SCL when using the likes of pressure sensor, GPS etc, then you start to get to grips with it.

Then FrSky label their analog voltage parameters A1 to A4, their LiPo pack volts VFAS etc. etc...

Link to comment
Share on other sites

Hi Mike,

Thank you for your post, entering the figure you had suggested helped but after experimenting I found that a figure of 1595 gave a more accurate reading. I used another meter in series and compared the readings and adjusted the number until I got the best match.

Andy

Link to comment
Share on other sites

Chris and Mike, Thank you for your help. Sorry to be confused by the Frsky/arduino nomenclature. I now have a module almost working for lipo voltage. I have the following display on my Taranis X9D;-

1: A2 11.1V( presumably from the receiver)

2: Cels 11.49V

3: RSSI 84dB

4: RxBT 5.0v

5:Vfas 11.50V

I only have 3S lipos and have not yet built the current sid eof the modue.The arduino pin connections are as per Chris's diagram/ PCB. VFas_SOURCE VOLT_3 to use the balance lead. Why do I not have individual cells displayed ? Also I have a series of flashing stars on the transmitter display.Why?

Thanks for the project I am gradually getting my head round it. One last question is there a cheap airspeed sensor available?

David

Link to comment
Share on other sites

Hi,

You will only see cells in the telemetry discovery screen try searching for FLVSS individual cell voltages for information about how to display each cell or click the link below

https://openrcforums.com/forum/viewtopic.php?t=7266

The stars appear as it reads the value of each item and is normal.

P.S. if you have a Horus using OpenTX there is a nice widget you can use on the Telemetry screens called BattCheck that will display the voltage and pack % graphically.

Edited By Paul Lewis 3 on 26/05/2019 09:58:45

Edited By Paul Lewis 3 on 26/05/2019 10:07:16

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...