By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by CML

Build your own telemetry sensors.

May 2019 article - OpenXSensor

All Topics | Latest Posts

Search for:  in Thread Title in  

Mike Blandford16/05/2019 23:24:05
avatar
532 forum posts
22 photos

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

Chris Bott - Moderator17/05/2019 07:18:01
avatar
Moderator
6667 forum posts
1382 photos
1 articles

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.

Andy Halmshaw18/05/2019 12:17:37
avatar
15 forum posts
17 photos

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

Chris Bott - Moderator18/05/2019 13:11:11
avatar
Moderator
6667 forum posts
1382 photos
1 articles

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?

Chris Bott - Moderator18/05/2019 13:14:39
avatar
Moderator
6667 forum posts
1382 photos
1 articles

Ooh just noticed VFAS is showing 4.16V so we need to fix that when we have time. My guess is that that one is pointing at the wrong A pin, as well.

Mike Blandford18/05/2019 16:31:54
avatar
532 forum posts
22 photos

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

Andy Halmshaw19/05/2019 16:27:27
avatar
15 forum posts
17 photos

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

Chris Bott - Moderator19/05/2019 17:55:58
avatar
Moderator
6667 forum posts
1382 photos
1 articles

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.

Chris Bott - Moderator19/05/2019 18:49:59
avatar
Moderator
6667 forum posts
1382 photos
1 articles

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

Mike Blandford19/05/2019 19:32:56
avatar
532 forum posts
22 photos

The output of the current sensor is "ratiometric" to the supply voltage. The value of 40 (mV per Amp) only applies to a supply voltage of 5V. At 3.3V supply, the value is 26.4 mV per Amp ( 40 *3.3 / 5 ).

Mike

Chris Bott - Moderator19/05/2019 19:59:35
avatar
Moderator
6667 forum posts
1382 photos
1 articles

Indeed it is, thanks Mike I'm so glad you're watching. All of mine are 26.4. As are the settings in the RCM&E article.

In fact, the article describes all the above settings.

Chris Bott - Moderator19/05/2019 20:28:29
avatar
Moderator
6667 forum posts
1382 photos
1 articles

So the max current this sensor can measure must be:

(REFERENCE_VOLTAGE - MVOLT_AT_ZERO_AMP)/MVOLT_PER_AMP ?

i.e roughly (3300-400)/26.4 = around 109A

The ACS758-100U has a 100A limit so that adds up.

I'd suggest that the limiting factor is in fact the quality of our soldering between wires and the ACS758.

Mike Blandford19/05/2019 20:52:21
avatar
532 forum posts
22 photos

Andy: It looks to me that you have the pack voltage and the current swapped over in your config files. 47A looks to be what you would get if using 12.2 volts on the voltage input and using the measured value as the current.

Mike

Chris Bott - Moderator20/05/2019 11:28:11
avatar
Moderator
6667 forum posts
1382 photos
1 articles

A new batch of boards has turned up.

I think we've exhausted demand, but these are here should anyone want any.

img_20190518_112314.jpg

Andy Halmshaw20/05/2019 11:44:11
avatar
15 forum posts
17 photos

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

Chris Bott - Moderator20/05/2019 12:50:21
avatar
Moderator
6667 forum posts
1382 photos
1 articles

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.

Mike Blandford20/05/2019 14:51:59
avatar
532 forum posts
22 photos

Just change the MVOLT_AT_ZERO_AMP value to 1650:

#define MVOLT_AT_ZERO_AMP 1650 // in millivolt

and you should get a correct 0 Amp result.

Mike

Chris Bott - Moderator20/05/2019 15:06:24
avatar
Moderator
6667 forum posts
1382 photos
1 articles

Ideally change it to whatever's measured on TP1

Chris Bott - Moderator20/05/2019 15:41:43
avatar
Moderator
6667 forum posts
1382 photos
1 articles

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.

David Tayler21/05/2019 19:40:51
95 forum posts

Chris, isn't A4 used for SDA in the I2C bus. David

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of RCM&E? Use our magazine locator link to find your nearest stockist!

Find RCM&E! 

Latest Forum Posts
Support Our Partners
CML
electricwingman 2017
Pepe Aircraft
Slec
Wings & Wheels 2019
Cambridge Gliding Club
Gliders Distribution
Advertise With Us
Sarik
Latest "For Sale" Ads
Do you use a throttle kill switch?
Q: This refers to electric-powered models but do you use a throttle kill switch?

 Yes
 No
 Sometimes
 Rarely

Latest Reviews
Digital Back Issues

RCM&E Digital Back Issues

Contact us

Contact us