Building a 50A sensor module for openXvario

Development & General Chat for the superb openxvario project.

Moderator: rainer

User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

Jhsa: I think I am confused about this 'one wire' thing. If I am trying to draw power from pro mini, There are two wires go to rx at least. one from pro mini D4 to rx rs232 signal + Vraw from pro mini to rx + and Gnd on pro mini to rx -. or I can put the pro mini gnd to lipo gnd(-) and still has two wires from pro mini to rx (Vraw and D10)
I am going to use it in both 3S and 4S, so I am trying to get 5-6 V power from Rx for pro mini.
Basically, using your friend's schematic:
OpenXSensor.sch.pdf
(32.37 KiB) Downloaded 304 times
just direct the RAW on pro mini to Rx (+) instead of LIpo (+).
Will that work?

and I still don't understand in your friend's schematic the SW1 between D10 and gnd is for?

if only one wire from D4 to rx rs232, the pro mini power has to be drawn from lipo with a Vreg.

User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

I made a little diagram.
Option A is what I use, but without the extra V.Reg because I use only 3 cells lipo and my arduinos V.Reg can handle 12V. All the grounds for arduino and sensors are on the Battery side. Receiver gets power from the ESC. Then only one Data wire from arduino to receiver.

On Option B you have the arduino and receiver, all powered from the ESC's BEC. This will avoid the extra regulator but the voltage won't be stable because of the load the servos put on it. The current sensor and arduino need a very stable voltage. The ACS758 is a ratiometric sensor and it depends on the voltage supply to scale it's measurement. so, if the voltage is not stable, the mV/A and offset will be always changing.

With option B you could try to use a 6V ESC/BEC and the arduino would regulate it to 5V. But you would have to make sure that the servos wouldn't put enough load on it to bring it close to 5V. Also that your servos can handle 6V.

I still prefer option A. ;) :)

João
Attachments
oXs Connections.jpg
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

OK, now I see your 'one wire' thing is only for optionA. while I was thinking optionB.
so when you tried your build, the pro mini's 5V reg is not enough to keep it constant? that seems to be a ESC/BEC issue. Pro mini should be able to keep the 5V constant as long as it is above 5V?
yes, most of my servo can run from 5-6V. I prefer running at 6V for higher torque/spd when I can put extra UBEC at 6V in (depending on space/weight for that model).
and yes, a lot of the built in BEC in ESC will drop in voltage when heavy draw from servos occurs. I will check if the ones I am using would do that.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

If the voltage drops too much, the arduino's regulator won't be able to regulate properly.
I believe that adding an extra voltage regulator for the 4s lipo pack is still lighter than adding an extra BEC for 6V. There are a few choices.. I'm sure you will find the option that works best for you.. I did test both options and I prefer option A.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

A quick update.
Looks like my GY63 becomes MH370. 10 days ago, It was at California already - "waiting for delivery" , now all of a sudden, the tracking info becomes "waiting for departure from origin post". Already received my caps and resistors which were ordered way after the GY63. :( Even the smd caps and resistors are already at Maryland. :S Yes, I decided to get some smd caps and resistors (like 2300 pieces all together) to make it smaller. ;)
Did not mean to start the thread then quit. Just don't have the main part yet.

mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

Sorry that you I still waiting for your components.
Please note that I continue to adapt the program.
I have not (yet) the rights to publish myself my code on google.
So, if you want to use my latest version, please ask for when you are ready for.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

Kaos, I really hope you have more luck than I did with one of my sensors. The seller sent me an accelerometer instead. Then after some mail and pictures exchange, he/she said that another one was posted to me. Still waiting until today. This was about a year ago when Rainer started working on the openXsensor.
Rainer was very kind to sell me one of his sensors so I could build my vario.

Joao

Sent from my GT-I9195 using Tapatalk
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

mstrens wrote:So, if you want to use my latest version, please ask for when you are ready for.
thank you, I will when I can 'restart' the project. ;)

Jhsa: yep, that is the price we pay when we try to save some money and buying abroad/mail order via regular/registered mail. I don't think the seller is cheating (I have made a claim via Aliexperess.), but the mailing service either in China or US are not that good. I had one parcel sent to me from China and the USPS dropped 2 blocks away in my neighbors' mail box. He drove to my house to hand deliver to me. Thx for nice neighbors. Last year I had at least 3 times I have received other people's package and walk to their houses to give the package back to the neighbors too.
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

OK, I am picking up this unfinished project again.
Just finished all the soldering, for now, I only put a 100nF cap between the Vcc and gnd on the ACS758 to do a quick test and using A7 as arduino input pin.

Here is the setting I put in the config.h tab:
// ***** 6.1 - Voltage Reference selection (VCC or 1.1V internal) *****
//#define USE_INTERNAL_REFERENCE // to use Vcc as reference

// ***** 6.5 - Current sensor analog pin *****
#define PIN_CURRENTSENSOR 7

// ***** 6.6 - Current sensor calibration parameters *****
#define OFFSET_CURRENT_STEPS 512 // bidirectional
#define MAMP_PER_STEP 122.2 // sensitivity is 40mV/A according to data sheet, so 5000 / (40 * 1.023) = 122.2

but I have no readings at all. I wonder what I did wrong?
I also have a vario sensor on it which is working just fine.
any idea? I am still running ersky9x r178 in the radio.
20151008_175006 (800x450).jpg
Attachments
20151008_175158 (800x450).jpg
20151009_000636 (800x450).jpg
Last edited by kaos on Fri Oct 09, 2015 6:55 am, edited 1 time in total.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

kaos wrote: //#define USE_INTERNAL_REFERENCE // to use Vcc as reference
I think your problem might be here. This line is very unclear to me. It says we should uncomment it to use internal reference, which I think is the 1.1V, but then it says that by uncommenting it we will use VCC. :o
Other thing to try is a lower analog pin like analog pin 2 or 3. The original arduino doesn't have analog pins 6 and 7 available so I'm not sure oXs supports them.
I don't know if you are also using an old version of oXs or if you downloaded the most recent version.
While you were away, there were many new developments and one of them was a very nice configuration tool. I am not at the PC at the moment so I'm not able to provide a link but if you google "openXsensor" you will find it.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

yes, I used the latest version 2.5 of oXs.
I thought about the uncommenting thing too. but in oxs-config-descrpition, it is quite clear:
"Uncomment the "#define USE_INTERNAL_REFERENCE" to activate the 1.1 internal voltage reference (otherwise, measurements will be based on VCC)."
actually, I tried both ways.
I read you can use A0,1,2,3,6,7 for cell voltage monitoring (4,5 already used for GY-63) , so I think A7 should be able to do the job. Mainly the convenience to use A7, that side has Vcc and Gnd along side of A7 so I can use a regular servo plug by shorting out A7 pin and the next pin as in the pic shown. of course the pin next to the A7 actually is not touching the aruino board at all, it was cut underneath and the (+) and (-) wire is swapped in the connector head from the sensor to match vcc->vcc, gnd --> gnd and viout --> A7
I have not figured out the oxs configurator usage yet. don't know how that thing works. I read through the topic but still fuzzy. It seems to me it does not change the .ino file at all just create a preset file. How does that preset file linked to Arduino sketch? and 'write EEPROM' means what? I can't see where it has the capability to write to arduino board.
Can you use it to load the arduino or just an interface to change the config.h file settings?

what I am afraid is the chance I may fried the ACS758 chip when I soldered it to the XT60 connector. I remember that was a daunting job last yr. Any way to check if the chip is fried or not?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

kaos wrote: I thought about the uncommenting thing too. but in oxs-config-descrpition, it is quite clear:
"Uncomment the "#define USE_INTERNAL_REFERENCE" to activate the 1.1 internal voltage reference (otherwise, measurements will be based on VCC)."
This is NOT what I read on your post above ;) :)
I have not figured out the oxs configurator usage yet. don't know how that thing works. I read through the topic but still fuzzy. It seems to me it does not change the .ino file at all just create a preset file. How does that preset file linked to Arduino sketch? and 'write EEPROM' means what? I can't see where it has the capability to write to arduino board.
Can you use it to load the arduino or just an interface to change the config.h file settings?
No, the configurator only creates a config.h file for you. It is a very nice tool as the config.h file most of the times can be a little overwhelming.. To write the code to the arduino you need the arduino IDE as always..
what I am afraid is the chance I may fried the ACS758 chip when I soldered it to the XT60 connector. I remember that was a daunting job last yr. Any way to check if the chip is fried or not?
It can happen. It did to me. I overheated one and fried it.
You can check it by disconnecting the output pin, and measure the voltage between that pin and ground. If yours is bidirectional it should output 2.5V at zero amps and it should increase when you apply a current in one direction, and decrease the voltage if you reverse the direction of the current..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

Please note that the last version of oXs is currently version 5.0.
It is available on github in the master branch at :
https://github.com/openXsensor/openXsensor
The configurator does not support version above 2.5 because it has not been updated yet.
If you understand the descriptions given in the file oXs_config_description.h, this should not be an issue because you can always edit manually the file oXs_config.h.
In fact the configurator is just a different user interface in order to edit this file; it does not change any line in the code.

I really suggest that you download/use version 5.0 from the master branch.
In this version there are quite many differences in the way the voltages and the current measurements are setup.
I tried to make it easier for the user. You can directly fill in the values of the resistors used as voltage divider as well as the parameters from you current sensor.
Please read the oXs_config_description.h file and let me know if there are some topics that you do not understand.

All versions of oXs should be able to read A6 and A7 pin. So using A7 should not be the reason for your issue.
The line #define USE_INTERNAL_REFERENCE can't be the issue. By default oXs use VCC as voltage reference. That is the case when this line does not exist or is put as comment (having // in front of it). In some cases (see description), it can be better to use the Arduino internal reference (about 1.1 volt) and thefore you have to remove the "//".

In order to solve your issue, I suggest the following:
- check that you have added some lines in the config.h file to specify which measurements have to be transmitted. Under "#define SETUP_FRSKY_DATA_TO_SEND \" you should have at least one line to say to transmit the current so somthing like "DEFAULTFIELD , CURRENTMA , 1, 1, 0 , \ ". You can also add "DEFAULTFIELD , MILLIAH, 1, 1, 0 , \" if you want the consumption.
- check the voltage that is generated by you current sensor using a voltmeter on pin A7. When there is (nearly) no current, you should get Vcc/2 so about 2.5 volt if you do not use voltage divider and if your sensor is a bidirectional (I assume it is based on your current setup). If you get zero volt, it means that you current sensor is bad (or that the wiring is wrong). Then you have to solve this before continuing with oXs.

Let me know the result of those checks.
If it is still wrong, I can explain further other steps in order to debug oXs.

Just for information, I am currently working on another branch (openXsensor_gps that will become version 6 ) wich allows to connect a UBLOX GPS module (Neo6M, Neo7M,...).
Even if available on github, this version is not yet 100% stable and is not yet documented.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

mstrens wrote: The configurator does not support version above 2.5 because it has not been updated yet.
If you understand the descriptions given in the file oXs_config_description.h, this should not be an issue because you can always edit manually the file oXs_config.h.
In fact the configurator is just a different user interface in order to edit this file; it does not change any line in the code.
it would be nice if the configurator was updated. ;) Do you know if Davx is still working on it, or is it a dead project? :( What a wonderful tool it is.. 1000 times better than editing the config file manually.

I tried to make it easier for the user. You can directly fill in the values of the resistors used as voltage divider as well as the parameters from you current sensor.
Wow, this is a great improvement really. It went back to how it was done originally. A couple years ago when I suggested this I was told it was not a good way to do it and we had to do all that rain dance calculation in order to calibrate the voltage instead. Not very user friendly.. Now finally we can understand what we are doing :) Well done :mrgreen:
One more step towards being user friendly ;) Thank you..

In order to solve your issue, I suggest the following:
- check that you have added some lines in the config.h file to specify which measurements have to be transmitted. Under "#define SETUP_FRSKY_DATA_TO_SEND \" you should have at least one line to say to transmit the current so somthing like "DEFAULTFIELD , CURRENTMA , 1, 1, 0 , \ ". You can also add "DEFAULTFIELD , MILLIAH, 1, 1, 0 , \" if you want the consumption.
This is the bit that really bugs me on the configuration file. I always get it wrong. That's where the configurator shows it's power. I really hope it is still being developed :o ;)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

A few weeks ago, davx said he was still working on the configurator.
So I presume we will soon get a new version.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

That is great to know.. Thanks.
And you are doing an awesome job as always ;) Thank you.
I still didn't try the latest version of the oXs, but i am converting all my sensors to read cells in addition to the total voltage. I was never bothered to do that but I do realize that monitoring individual cells is much safer for the batteries. So, I will try it soon. ;)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

mstrens:
thx for the response, sorry to bring back this OLD project. I was out from this hobby for over 1 1/2 yr. Just got back in again. Quite overwhelmed by everything had happened/improved during this period of time. I will check and do all the things you mentioned today or tomorrow and get back with you. Thx again.
Ha, you mentioned ublox gps, How do you know I have 2 sitting in my drawer waiting for codes. :D
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

Yeh.... it works. :D
the viout gives 2.48V After adding the "DEFAULTFIELD , MILLIAH, 1, 1, 0 , \" in config.h, the current showed up. I 'assumed' all the fields transmitted are already in the config.h, never looked into that section. Like the famous conversation in the 'ROCK', Sean Connery said: "Assumption is the mother of all **** UPS" :lol:

I also added "DEFAULTFIELD , MILLIAH, 1, 1, 0 , \", but no fields on the radio telemetry shows that data field. these two cannot be used at the same time? or there is some difference between openTx and Ersky9X which I am using that has a different field name to use? (I am still using oXs V2.5 for a quick check,but again, I still have the old ersky9x r178 for the sky9x board in the radio in the process of upgrading to the current version which Mike is helping me.

I also noticed I used to be able to zero the Alt by pressing 'long menu' key on radio when using Frysky hub. How oXs zero out the Alt on the radio?

I check the github, over there I only see V4, not V5. Is V4 the latest released version?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

kaos wrote:
I also added "DEFAULTFIELD , MILLIAH, 1, 1, 0 , \", but no fields on the radio telemetry shows that data field. these two cannot be used at the same time? or there is some difference between openTx and Ersky9X which I am using that has a different field name to use? (I am still using oXs V2.5 for a quick check,but again, I still have the old ersky9x r178 for the sky9x board in the radio in the process of upgrading to the current version which Mike is helping me.
Try the "FUEL" field. That is what I have been using..
I also noticed I used to be able to zero the Alt by pressing 'long menu' key on radio when using Frysky hub. How oXs zero out the Alt on the radio?
On your ersky9x version, I think you can use the long menu press to reset the altitude..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

oops, I meant "DEFAULTFIELD , CURRENTMA , 1, 1, 0 , \" for Amps on radio to show current.
The "DEFAULTFIELD , MILLIAH, 1, 1, 0 , \" dos not seem to show up in any radio telemetry field. I tried FUEL, Mah1, Mah2... every field. It just shows a big zero with no decimal. I hooked up with my watt meter to do the test, the watt meter is showing around 30 mah for the duration of testing but the radio is 0 with any of those fields.

As of now with my ersky9x r178, 'long menu' does not reset the Alt. I know it worked for using Frysky hub.

another thing is the Amps is jumping up and down quite a bit, I guess I need to add the filter on the Arduino side (like a 1.5K ohm resistor + a 100nF cap) to correct/improve that? (I only have a 100nF cap on the sensor side now)

update: yes, added a 15K resistor on A7 and 100nF between Gnd/A7, the Amps is very stable, not jumping any more. The only thing is compared to my watt meter, the reading from the sensor is 0.1A smaller than my watt meter.
I should trust the watt meter or the sensor? could this be the 15K resistor is a little too big? or I just need to adjust the parameter in the config.h?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Building a 50A sensor module for openXvario

Post by jhsa »

I think you should first update the firmware on your radio and then worry about the other stuff..
We don't remember anymore what was on revision r178.. That was a looonnnng time ago ;) :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

OK, I got my radio rupdated to r217. now I can really test this thing. I also found out in r217,you need to specify 'current source' to FAS for mAh to be displayed in mAh, mAh1, mAh2 all 3 of them, except FUEL.
and you can reset mAh to 0 by pressing EXIT button. you can zero Alt by 'short menu' to pop up a screen to zero out several telemetry parameter. I wonder why zero out the mAh is not part of the pop up menu instead of using a separate button- EXIT?

One thing got me worried is the Amps, it is very sensitive to connector I made with a servo connector and pins solderer on the pro mini, slight movement will cause the Amp to jump to a number that is not real while the mAh keep accumulating based on Amp reading. I need to go for the oXs V4 to test it again to see if this is because of V2.5 or it is the connector. It should not be so sensitive by connector wiggling.
Last edited by kaos on Sat Oct 10, 2015 2:12 am, edited 2 times in total.
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

hmm.... need a little help on how to down load the v5 from github.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

The consumption can be calculated on oXs side or Tx side.
I presume that when you activate FAS as current source, you ask the Tx to perform the calculation. In this case, you do not have to ask oXs to send the MILLIAH (so you can remove this line from your config.h).

Note: oXs can also calculate the consumption and reset it when pressing a button. This had been foreseen long ago when the Tx firmware did not perform the calculation.

Using oXs V4 or V5 will not solve your issue about the connector. In fact current measurement has not been modified. oXs reads several times the voltage on the current sensor and makes an average over about 200 milli sec. If the connector does not provide good contact, the voltage measured by oXs can vary a lot. E.g. when there is a good contact and nearly no current, oXs will get about 2.5 volt and report about zero amp.
But if at the next second, the contact is loss, the voltage could drop to 0 volt which would be interpreted by oXs as the max curent (so e.g. about 40 amp). oXs will send this value and the Tx will continue calculating the consumption based on this wrong current value.
So, best would be to replace your connector or to use fixed wires.

About version 5 : If you use this link https://github.com/openXsensor/openXsensor you arrive on the home page. Normally, it should say that you are on the branch "master". If not select the master branch in a drop list. Then you can click on a button named "Download Zip" (on the right side down of the page). Your get all the files. In file version.oxs you can check the version number.
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

thank you mstrens, it is my old eyes did not see that 'download zip' . I thought there should be something like that just did not see it. :cry:
Yes, I will try a different kind of connector to make a better connection otherwise, as it is, it would be no good for flying. if it just sit there there won't be any problem but when I was testing the vario by throwing the sensor up and down with a little movement of the wires that current jumping occurs. but that is what is going to happen in real fly.

Here is another question. How much error we would expect if I just want to get a total voltage reading from the flypack. I think it is fairly simple to add a divider between the two main power wire in the current sensor and just add one wire from the divider to a port like A6. the purpose is just to measure a 2 or 3 or 4S total voltage. we are looking at from 7 -17V range. Is this doable or practical from one single divider? A lot of times I just need an idea of total voltage instead of individual cell voltage.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

If you only want the total voltage of the lipo, you can just add one divider (2 resistors).
This divider has to be choosen in order to support the max voltage that you expect (so e.g. 17 volt).
If Oxs is correctly calibrated (see the explanation in the file oXs_config_description.h) and if you have a stable Vcc, I expect that the error should be about 0.2 to 0.5 % max.
To implement it, you just have to connect a resistor to the positive pin of the lipo (it can be on the current sensor), the other pin of this resistor should be connected to an arduino analog pin and to the second resistor. The other pin of the second resistor has to be connected to Arduino ground.

In the oXs_config.h file, you have then to adapt the parameters in the voltage section and in the Frsky data to send section.

If you need help, let me know.
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

Great I will do that.
Does the placement of divider make any difference? (I know a filter may make a difference) I would like to place both resistors at the sensor side so everything will be in one shrink wrapped piece only the wires goes to the arduino.
Based on the largest lipo I want to measure is 4S~17Volt max, using 5V Vcc as reference, R2=2.4 R1

-------- + of ACS758
|
2.4K
|
--------------------------------------------------------------------------------------A6
|
1K
|
---------Gnd of ACS758
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

I presume that setting the resistances on the sensor side will be fine, specially if you are using quite low value of resistors.
In order to increase the stability you could even add a condensator (100nf or more) between A6 and ground (so in // with 1k).
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Building a 50A sensor module for openXvario

Post by kaos »

that 1K 2.4K were picked by 'guess'. Since the divider formula only gives a ratio of R1/R2, how do you determine 1k/2.4K is better or 10K/24K is better?

After fooling around with the Ersky9x r217 teelmetry settings and parameters in oXs V5, I finally get the telemetry displayed seemingly correct and as I wanted:
20151011_003226 (800x450).jpg
Is there a way to output the built in temperature sensor on Gy-63 to radio?

To get that Amps and Mah, Fuel correct, I found out you really need to measure the Vcc on arduino with a volt meter and put the exact reading as the reference voltage and that matched my watt meter reading. ;)
I was using default 5V and there was 0.3 or 0.3 amp difference. After I use the volt meter reading (4.94V), they matched perfectly.

Here is another question, I have some ESC/BEC have 5V rated output and some 6V output because some servos I use need 6V power to achieve the torque/spd. and I checked with volt meter with 5v BEC, the Vcc is only 4.64V but it is stable. Looks like the same oXs when used with different models which have different BEC supply, one would need to reload the arduino program with the adjusted Vcc to get accurate reading. Is that correct?

mstrens, if 1k/2.k seem too low, let me know what would be a better combination (may be 10K/24K) and the cap needed for that.
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Building a 50A sensor module for openXvario

Post by MikeB »

The resistor values you use must not be too large. The Atmel processor requires that the resistance of an analog input should not exceed 10K, or it won't read the analog vlotage correctly.
For information, when using a potential divider, the resistance "seen" by the analog input is actually the PARALLEL combination of the two resistors that make up the divider. So with 10K and 24K, the resistance is 1/(1/10 +1/24) K = 7.06K.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”