openXvario+C Current Sensor Support

Development & General Chat for the superb openxvario project.

Moderator: rainer

User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: openXvario+C Current Sensor Support

Post by rainer » Tue May 28, 2013 12:20 pm

Nice! Looks good. Will try it that way as well next time (remove coating...) i just soldered it directly to the pins, but was a bit difficult at first due to the smaller pin distance. Can i use the picture for the Wiki?

in my opinion the missing capacitor on those modules is really a complete fail..... ;-) it makes a difference
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)


User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: openXvario+C Current Sensor Support

Post by Flaps 30 » Tue May 28, 2013 12:41 pm

rainer wrote:Can i use the picture for the Wiki?
Go ahead.. :)

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Fri May 31, 2013 12:39 am

I built a current sensor using the Allegro ACS758 100U (100A unidirectional current sensor) and had a few problems with the offset value and the mV/A setting.. According to the datasheet, for a 5V supply the sensor should output an offset voltage of 600mV and output 40mV per Ampere. It didn't work like that.. The readings were way off when compared to my watt meter. Big difference.. Using the Watt Meter and my multimeter I measured the output voltage for a current of 5, 10, 20, 25 and 30A. After the calculations I got a value of 576mV offset and 34,47mV/A. Inserted them in the openXvario sensor settings and uploaded the code to the arduino.. Still no luck. The readings were still not accurate :(
So, I've decided to go trial and error. I then got to a value of 599mV for the offset and 33mV/A. These worked.. At least for current between 0 and 30A the readings follow the watt meter with a small difference. About 100mA. The resolution of this sensor is 500mA so I guess the readings are very good.
But I needed to build another one to find out if the cause of the values being completely off was the sensor itself as I damaged the first one a few weeks ago.. Cooked it :)
Tested this second not cooked ;) sensor and the readings are consistent with the other one.
So, I guess it is working. Don't ask why the values must be completely different from the datasheet. I don't know.
Here is a picture of a little schematic (sorry I'm bad drawing :) ) I did showing how I connected my sensor.
Note that I'm powering the arduino and sensor from a 78L05 regulator connected to the lipo +V.
Then from the arduino only the serial wire connects to the receiver RX pin.
The reason I decided to power the arduino (VCC pin) and sensors from their own regulator is that the Supply from the BEC is not very "clean" and the servos might also cause voltage drops. Also the arduino regulator, even if it is low drop will also reduce the voltage by a few milivolts. Connecting the power from the sensor to the arduino VCC pin will bypass it's regulator.
Thanks to Rainer for this great project and I'm happy to help the best I can, doing some testing. It has been fun :)
Attachments
310520132493.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
jhsa
Posts: 19248
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: openXvario+C Current Sensor Support

Post by jhsa » Sat Aug 31, 2013 10:30 am

Just built another one.. This time I built a shield for the arduino that has the voltage divider (voltage sensor), the current sensor (Allegro ACS758-50U), and everything is powered directly from the flight battery. 3 cell lipo is the maximum for using with this setup as the regulator on this arduino (must check for different versions) can handle only 12V with the absolute maximum being 20V. but at 20V you would be alredy destroying it ;) Before I've used a separate 7805 regulator.
The lipo voltage connects to the RAW pin on the arduino to power the regulator and then the current sensor is powered by the VCC (5V) pin.
will program the arduino with the fabulous openXsensor code and will report. I know it will be a headache to find the right values for this sensor as it was for the 100A one :(
But hey, at the end I'm sure it will work like the other does :)
Will update here.

João

P.S: - Just realized that I have a D6FR receiver on this plane.. It doesn't have a serial port :( How stupid am I? :mrgreen:
I know how to fix that though :mrgeen:
Attachments
310820132619.jpg
310820132620.jpg
310820132621.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
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: openXvario+C Current Sensor Support

Post by Flaps 30 » Sat Aug 31, 2013 1:28 pm

I see that A2 is being used as part of the current sensor circuit. What input is used as standard to connect to the voltage divider to measure the flight pack to get a capacity used readout? What is the maximum voltage that the analogue inputs to the MCU can read up to so that one can calculate the divider ratio for a 3S or 4S Lipo

Reason for asking, is that I am about to knock up another vario to replace a suspect one, and it would be nice to put the extra wires in at this stage.


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

Re: openXvario+C Current Sensor Support

Post by jhsa » Sat Aug 31, 2013 2:38 pm

A3 for the divider. 5v max on the arduino pin. Measure the resistors and insert the values in the code.
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
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: openXvario+C Current Sensor Support

Post by Flaps 30 » Sat Aug 31, 2013 7:07 pm

Thanks João. Any reason for A3 to be used as an input pin instead of say A0 or A1?

As for inserting resistor values and the like into the code. Eyes have glazed over after scanning through the few hundred or so of lines of code, only to come up empty. The same goes for trying to find the lines concerning the calibration of the current sensor. The code that I am looking at is the one that is used for the Vario version 148.

Slightly off topic - Have I ever mentioned how crude the Arduino software is as to its friendliness when reading or writing code? ... No line numbers. No coloured text to help you delineate between information and active code. As for the font type/style.. Seen better.

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Sat Aug 31, 2013 8:51 pm

You probably are trying to use the openxvario sketch. You need to get the openxsensor one.. it has the vario and the other sensors.
Also it has more files.. I'm posting a zip file here. Just unzip it somewhere on your computer. then open the .ino file in the arduino IDE. the one you hate so much :mrgreen: But hey, it's free and allows us to play with this stuff ;) :)
That will open a few tabs. Click on the one called "oxs_config.h"
This is where you configure the vario and other sensors.

As for A0 and A1 you can try to replace A2 and 3 with them in hte config tab. Maybe it works but I'm not sure.. Don't know much about this myself. Everything is well explained there I would say, just read the comments. If my dumb brain could understand it and configure it, I'm sure everyone else can do it :mrgreen:

João
Attachments
OpenXsensor-Glider.zip
(19.4 KiB) Downloaded 164 times
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
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: openXvario+C Current Sensor Support

Post by Flaps 30 » Sat Aug 31, 2013 11:27 pm

jhsa wrote:You probably are trying to use the openxvario sketch. You need to get the openxsensor one.. it has the vario and the other sensors.
Also it has more files..
Ahhh.. Now it makes sense.. I will have to try and recall how to stop the Kalman filter sensitivity rain dance stuff that annoyed the hell out of me. *Edit* - The 'new' version 161 seems to have the current option in place, along with information concerning the current sensor discussed on page one. This doesn't seem to appear in the same way with the package of files. :(

The voltage divider setup (line numbers 128,129,131 and 132) is confusing, as it looks as if you would get around 7.5 Volts at the junction of the resistors (56000 & 33000) if you had a battery voltage of 20 Volts. I take it that where it is mentioned (first two lines of divider resistor values) ANALOGUE_TO_GND 3900 and ANALOGUE_TO_GND 1200 that the resistor values should be 3.9K Ohm and 12K Ohm the voltage at the junction would be about 5Volts which looks much better as a division ratio.
jhsa wrote:then open the .ino file in the arduino IDE. the one you hate so much :mrgreen: But hey, it's free and allows us to play with this stuff ;) :)
Umm.. Okay.. It's late here. Opening the 'ino file gives me a number of tabs. I take it that all the tweaks are done in the config file, then you save that file, then compile/write all of the files to the board as one operation. Is that correct?

Hmm.. I did find something that worked very well in that it had line numbers and a much better presentation of all the scribble, but it wasn't compatible with Ubuntu or Wine and it complained when it was running in Virtual Windows. :(
jhsa wrote:Everything is well explained there I would say, just read the comments. If my dumb brain could understand it and configure it, I'm sure everyone else can do it :mrgreen:
Sometimes things work well for the real dumb ones. :P Trouble is that I am far from being dumb, so that is why it takes a while for things to come right. :twisted:

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Sat Aug 31, 2013 11:36 pm

Well, I am and I'm proud of it.. things work better, speaccially when is convenient to me :mrgreen:

But anyway. In this case, to configure the sensor we don't need numbered lines as there aren't soooo many options on the config file. And also I don't code, so I guess I don't need it so bad..

Oh I just checked, guess what.. The IDE does show the line number ;)
Bottom left corner :)

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
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: openXvario+C Current Sensor Support

Post by Flaps 30 » Sun Sep 01, 2013 1:06 am

Ta.. Yes thanks. I have found that excuse for a line numbering system now. Better than nothing, but it does look like a bit of an afterthought.

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Sun Sep 01, 2013 1:14 am

like everything else that is in constant development ;) Linux included :D
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
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: openXvario+C Current Sensor Support

Post by Flaps 30 » Sun Sep 01, 2013 1:40 am

Time I was in bed.. Used the compile/verify on it and it failed. It told me the following: In file included from oxs_arduino.cpp;2:0: oxs_arduino.h:4:21 fatal error arduino;h; No such file or directory compilation terminated.

Sadly the Arduino software isn't all that it could be in Linux. It gets horribly confused with regards to where you put files and where it insists on storing/reading them from.

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Sun Sep 01, 2013 10:18 am

i did use it in linux sometime ago and I don't remember having any problems.. Did you try to compile the file I posted or did you change it? Did you choose the right board in the IDE?
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
jhsa
Posts: 19248
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: openXvario+C Current Sensor Support

Post by jhsa » Sun Sep 01, 2013 1:45 pm

Flaps30, please download the zip file again.. the one I had there was an older version of the openXsensor and I didn't realise it..
this one has also an offset for the voltage calculation.. If the voltage is a bit off just set the offset by the same amount..

The file I uploaded now is the one I'm using on my glider.. no current sensor on that glider though..
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
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: openXvario+C Current Sensor Support

Post by Flaps 30 » Sun Sep 01, 2013 6:57 pm

Nice to see that this whole thing is confusing you also... :) I went to the main site and downloaded the Opensensor package before I went too far last night.

I have tried out the multiple file compile thing using a Windows (spit) version of the Arduino software. That went without a hitch.. The problem does seem to be with the Linux version of the Arduino software. Latest thing I tried was to create a folder on the Sketch folder to contain all the sensor files. Opening the INO file went okay and I could see all the other files in the tabs. Compiling all of them came up with the usual error telling me that it couldn't locate the other files, even though they were in the same folder as the INO file. Grrrrrr!! :evil: :evil:

Before with the single file as we had it, there wasn't this issue, as it was just one file.. Yes this may be just an issue for all Linux users who are not out and out geeks. :geek: :ugeek: Of course I could put up with using the Windows version of Arduino. Hmmm. Nope! :evil: I would rather pull out blocks of code to suit what I wish to do which is vario, altimeter, battery voltage and current. Throwing away all of that GPS, Temperature, motor RPM and GPS, Kalman sensitivity 'dance' stuff that is of little use to glider guiders, and then make one neat file.. But that may remain a dream for now along with the rest, as this Arduino software makes me see red and drink becomes the way out of the problem.. Hasn't anyone come out with something that works without hassle and looks good (rather than some DOS relic) for Linux?

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Sun Sep 01, 2013 8:05 pm

No, I'm not confused.. My computer is a mess, not organised at all.. That's why I posted an old version of the code..
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
jhsa
Posts: 19248
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: openXvario+C Current Sensor Support

Post by jhsa » Sun Sep 01, 2013 8:18 pm

Ok, have been testing this 50A sensor, and with the Datasheet settings which are, 600mV offset at 0A and 60mV / A, the values measured by my wattmeter and the tx are very close.. Actually after recharging the battery it seems that the tx might even be more accurate.. here are the values after discharging the battery with a static plane.. Tried to simulate a flight by changing the throttle several times..

Discharge:

TX - 1723mA
Wattmeter - 1678mA

Recharged the battery and the charger put 1838mA back in..
That makes a difference off 115mA to the tx and 160mA to the wattmeter..
I would like to read some comments on these numbers. I know that the charger always puts back more than we took out. But how much is good? As I said, I would like your opinions.

Thank you

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
MikeB
9x Developer
Posts: 16791
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: openXvario+C Current Sensor Support

Post by MikeB » Sun Sep 01, 2013 8:26 pm

Flaps30: What version of the Arduino software do you have on linux?

Mike.

Edit: Also (I'm totally unfamiliar with linux) what did you do to get it running at all? I've downloaded the "Arduino for linux" and extracted it into a directory, but nothing runs. I'm used to what I did for windows, download and install, then it runs!
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: openXvario+C Current Sensor Support

Post by Flaps 30 » Sun Sep 01, 2013 9:48 pm

Mike - The version of Arduino running on Ubuntu is version 1.0.1. I installed it using the Synaptic Package Manager. Just type in Arduino in the search box on the Synaptic Package Manager and select it.

Yes I did try to install the latest Arduino, but that ended up as a failure. I guess that Arduino really isn't Ubuntu/DEB friendly. :( Having said that .. This worked for me using the latest Arduino 1.5.3 ----> http://www.pluggy.me.uk/arduino-ubuntu/ Still with the problems as mentioned of course. Giving the following error when you verify/compile. 'In file included from oxs_arduino.cpp:2: oxs_arduino.h:4:21: error: arduino.h: No such file or directory' :evil:

RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: openXvario+C Current Sensor Support

Post by RightRudder » Mon Oct 14, 2013 9:55 pm

Rainer,

Rather than use the DIST field to get around the 100mAH resolution problem in the CNSP field in the telemetry why not prescale the current actual value in software by multiplying by 10 or 100 before sending to the rx? That way you can get 10mAH or 1mAH resolution through the telemetry. You just have to remember that what is being displayed on the TX LCD needs to be divided by 10 or 100 as is the case.

RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: openXvario+C Current Sensor Support

Post by RightRudder » Sun Oct 20, 2013 5:05 pm

I have setup a pro-mini and GY-63 module on a breadboard and just connected a potentiometer to the current sense input. I have configured the compile switches to send the current as T1 and the milliamp percentage as fuel. When the oXs powes up I get 100% fuel which decreases in 10% increments at a speed depending on current and the value I gave as battery capacity. This is cool! Thanks Rainer.

EDIT: Actually this was a quick test where I set a low value for the capacity of the pack when I compiled the sketch. When I put a more realistic battery capacity the fuel gauge changes in 1% incrememnts.

The persistent data switch doesn't seem to be working right. Whenever I set it, the fuel just stays at 100%. What did I miss here?

Edit: I was wrong. I must have done something dumb. The persistent switch and data logging works perfect.

Joe

Patrick74
Posts: 7
Joined: Fri Apr 25, 2014 5:59 am
Country: -

Re: openXvario+C Current Sensor Support

Post by Patrick74 » Fri Apr 25, 2014 6:14 am

I made a +/-5A current sensor with oXs. That works !

But now I'm trying to connect it in my glider with D4R-II with a FBVS and vario (hp). I tried to connect on the "input" port of the vario, but it doesn't work!

How can make this work?

Thank you
Trying to make an oXs current sensor work with Vario high Precision on RX port on a D4R-II and FBVS

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

Re: openXvario+C Current Sensor Support

Post by mstrens » Fri Apr 25, 2014 1:05 pm

I presume that you make a test connecting directly OXS to D4R-II (on the Rx pin from D4R-II).
If this works, it means that OXS works and support the Hub protocol.

In the specification of vario high precision vario, it is said that "data in"from vario can be connected to a FAS-40.
The signal must be put on the "Rx" pin from "data in".
Did you connect to this pin?

Which version (release) of openXsensor are you using?
With the latest version which support SPORT and HUB protocols, you must select the Hub protocol (so you must put the line "#define FRSKY_SPORT" as comment) when you connect want to the "data in" from vario.

If still this does not work, I presume that the HP vario does not forward all data from OXS to the receiver probably because the frame of data generated by XOS is not 100% the same as the one from FAS-40.
I do not see directly how to solve it in OXS.

If it does not work, I see perhaps another solution.
Please note that I am not sure at all that it would work.
If the vario is a bridge than can convert SPORT protocol to Hub protocol (I am not sure it is), it would be possible to:
- configure the XOS in order to support the SPORT protocol (activating the line "#define FRSKY_SPORT" and using field_ID foreseen for SPORT)
- connecting XOS to the vario using the SPORT connector
- connecting the vario to Rx pin from receiver (just like when you connect XOS to the D4R-II.

Another solution that would for sure work, would be to let OXS provides all informations by it self (so removing the FBVS and the Frsky vario).
It means that you must add to you XOS:
- some resistors (as voltage divider in order to replace FBVS)
- a MS5611 sensor (in order to replace the vario) (about 10 € on ebay).
The advantage is that you have all in one.
The latest version of XOS support such a configuration.
It can even measure the voltage of each cells individually if you put a voltage divider per cell.

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Fri Apr 25, 2014 2:00 pm

mstrens wrote: The advantage is that you have all in one.
The latest version of XOS support such a configuration.
It can even measure the voltage of each cells individually if you put a voltage divider per cell.
Is this tested? Is it accurate? do you have a schematic for the dividers? do they all connect together? Do they all read the voltage to ground?

Thanks.

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: 1369
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openXvario+C Current Sensor Support

Post by mstrens » Fri Apr 25, 2014 2:30 pm

jhsa wrote:
mstrens wrote: The advantage is that you have all in one.
The latest version of XOS support such a configuration.
It can even measure the voltage of each cells individually if you put a voltage divider per cell.
Is this tested? Is it accurate? do you have a schematic for the dividers? do they all connect together? Do they all read the voltage to ground?

Thanks.

João
I made an OXS with a MS5611 and 4 dividers (in order to measure 4 voltages - 3 for for a 3s and one connected to Rx Vcc).
I tested it and it was ok.
It is accurate (I think) once you have calibrated it (it only requires a voltmeter).
The dividers are explained in the config.h file (see github).
There is one divider per voltage you want to measure.
Each divider has 2 resistors.
All voltages are read to ground.
You can choise to read (all) the voltages regarding internal 1.5 volt or regarding VCC (better if Vcc is stable).
Best is that the divider resitors are choosen in order to get full range of ADC. So if you measure regarding VCC 5 volt and you want to measure max 5 volt, 9 volt, 13 volt then select different resistor for each divider (in order to get max accuracy).
Each divider can be calibrated individually in the config (so no need for accurate resistors).
Each callibration allows an offset so you can have the best accuracy in the range of value you want to measure.

You can declare that some voltages are part from a multicells battery. Then OXS will calculate the voltage of each cell by difference and send it in the required format on telemetry.

I did not test myself a setup for a current sensor but someone did it and it works.

So, at this moment there are no known issue.

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Fri Apr 25, 2014 2:46 pm

I have a couple of current sensors working with the older version of the oXs and it works great.
Is this project not in google code? You mentioned github. Also I use the old frsky system. Not S-Port.

Thanks.

João

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

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

Re: openXvario+C Current Sensor Support

Post by mstrens » Fri Apr 25, 2014 3:09 pm

Sorry, the source is not on github but on google code at this link
https://code.google.com/p/openxvario/so ... 253Dclosed

The latest version support as wel the SPORT as the Hub.
It generates the vertical speed on an anlog port (to be connected e.g. to A2) also if you want.

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

Re: openXvario+C Current Sensor Support

Post by jhsa » Fri Apr 25, 2014 3:19 pm

Thanks, no, I prefer the serial for the Vspd. Thinking better I could test thw A2 as well ;) I have the stuff to build one more vario and I guess I could include a wire for the A2. will be connected to an ersky9x radio and I need to test it.
I will power the arduino directly from the 3s lipo. the regulator can handle it, so the VCC line will be stable enough for the voltage reading I think.

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

Patrick74
Posts: 7
Joined: Fri Apr 25, 2014 5:59 am
Country: -

Re: openXvario+C Current Sensor Support

Post by Patrick74 » Fri Apr 25, 2014 7:44 pm

mstrens wrote:In the specification of vario high precision vario, it is said that "data in"from vario can be connected to a FAS-40.The signal must be put on the "Rx" pin from "data in".
Did you connect to this pin?
Yes I did it!
mstrens wrote: Which version (release) of openXsensor are you using?
With the latest version which support SPORT and HUB protocols, you must select the Hub protocol (so you must put the line "#define FRSKY_SPORT" as comment) when you connect want to the "data in" from vario.
This is the R204. The line is as comment.
mstrens wrote: If the vario is a bridge than can convert SPORT protocol to Hub protocol (I am not sure it is), it would be possible to:
- configure the XOS in order to support the SPORT protocol (activating the line "#define FRSKY_SPORT" and using field_ID foreseen for SPORT)
- connecting XOS to the vario using the SPORT connector
- connecting the vario to Rx pin from receiver (just like when you connect XOS to the D4R-II.
Yes, good idea, I will try it.

But I don't want to use the oXs as master. I would to use it like an option, an add'on.
Trying to make an oXs current sensor work with Vario high Precision on RX port on a D4R-II and FBVS


Post Reply

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