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 wrote: Bear in mind that the arduino max voltage at the pins is 5V.
that is what i need to know to figure it out. Thx. ;)

mstrens:
could you give me link for the opensensor version, I don't seem to see it at the wiki. the branches are always a maze for me. some times I find my way, some times I don't. :mrgreen:
Also I need to figure out if there is a difference using this sensor, as far as setting the Tx up, in ERSKY9X and openTx. I am using er9x/ersky9x.

edit:
jhsa: the number still does not add up. if R1=33K and max Vin is 17V(for 4S) then R2 should be 79.2K. in the sketch it says for 20.xx V and R2 is 56K. something else is going on here. may be the 100nF cap associated with it.
also what the SW1 does? reset the sensor?

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

Re: Building a 50A sensor module for openXvario

Post by mstrens »

here the link for the latest version of openxsensor
https://code.google.com/p/openxvario/so ... penxsensor.

and here the link for openxvario
https://code.google.com/p/openxvario/so ... openxvario
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 »

thx, mstrens. I took a quick look at the opexsensor. Looks like it is for Sport not for D rx? :(
I did not have a chance to test the sensor today. Tied up with something else.
I need to figure out how the er9x/ersky9x works with the sensor setting too.
Will be back here when I got the test going. thx again.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

The version of Openxsensor available on the link I provided yesterday can work as well with D rx (hub protocol) as wel with X rx (SPORT protocol).
Still currently it can't switch automatically from the one to the other depending on the rx it is connected to. You have to select in config.h which protocol you want.

When the config.h has this line
"#define FRSKY_SPORT 1"
then oxs will support SPORT protocol.
In order to support Hub protocol instead of SPORT, then you must put this line as comment adding "//" as first 2 caracters. So the line should be "//#define FRSKY_SPORT 1"; You can also delete the line.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

The version of Openxsensor available on the link I provided yesterday can work as well with D rx (hub protocol) as wel with X rx (SPORT protocol).
Still currently it can't switch automatically from the one to the other depending on the rx it is connected to. You have to select in config.h which protocol you want.

When the config.h has this line
"#define FRSKY_SPORT 1"
then oxs will support SPORT protocol.
In order to support Hub protocol instead of SPORT, then you must put this line as comment adding "//" as first 2 caracters. So the line should be "//#define FRSKY_SPORT 1"; You can also delete the line.

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 »

I should have thought about that. if not for D rx as well, there is no need to define Sport. ;)

just as a trial, i just loaded rainer's openXviaro sketch to pro mini without issue. only changed the following:
#define MinCurrentMilliamps -62500 // the lowest measured current (=0v input voltage)
#define MaxCurrentMilliamps 62500 // the highest measured current (= input voltage= vRef)

I am setting up the test bed now. A mess for sure. Found out I only have 1 D4R-II available. and the rs232 pins are not a regular servo pin,have to make an adapter and my caps and resistors are not here yet. soldered 4 resistors which is 8 inches long for a 47K ;). use one of my removable VT EDF engine to run the test on current sensor. need to put this on a stand to fix it.
130824-2.jpg
I am thinking putting this on hold for a few days till the Gy63, caps, resistors arrive to make the whole thing all at once to make it more compact instead of doing it now just for the current sensor and have to resolder almost everything when those items arrives.

Here is what I have with Rainer's openXvairo sketch loaded:
140303-1.jpg
also I found there is another Vcc and Gnd at the right side of the pic (the bottom 2nd and 3rd whole). those will be my connector to current sensor with A2 to make the wires flow better.
140303-2.jpg
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 »

OpenVario? That was replaced by the openXsensor. When I get to my computer I will post here the version of the openXsensor I use. You will have to load the sketch and edit the config.h file. the different files will appear as different tabs on the arduino IDE.

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 »

I was following the original thread. yep a link to the new version would be helpful.
I guess I am all mixed up with different version.......
your zip file also contain a slightly different version too. :S
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

the link I mentioned here above gives all the files from the newest version of openxsensor.

Here again the link
https://code.google.com/p/openxvario/so ... penxsensor
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 »

thx again. I think I will try the latest openXsensor 1st before adding the voltage sensor which may need jhsa's zip. one step at a time. :) I also found I made a stupid mistake of ordering those wired caps and resistors. Why I did not think about the smd cap/resistor to make the whole thing smaller. :S
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

Normally, the latest oxs support 1 voltage sensor (on top of the current sensor).
Look at the config.h file how to set it up.

Note : I did not test this version but I had a look at the code this evening and I suspect a bug when it is configured for D series Rx.
I asked this evening the developper to check about this eventual bug.
I hope he will answer to morrow.
Michel
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 »

ah, that looks very much alike jhsa's zip file.
now here is the dumb question. How in the world do i save all those files? one by one, copy and past one by one? I tried to save one by one and end up saving the htm file. :oops: there must be a better way to save these files.
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 »

Click on one of the files, then at the bottom on the right hand side you will see "View raw file"
Right click on it and select "save as". save it.. repeat for all the other files :)
Save them all inside the same folder..

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: 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 »

You might like to install a copy of svn, the source code version control. With that, it will allow you to get the latest version of all the file with one command. The command you would need is shown if you click on the "checkout" item.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
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 »

I do have SVN installed. I checked the openxvario site 'checkout' and got this :http://openxvario.googlecode.com/svn/trunk/ openxvario-read-only
but when running SVN check out, it says :
URL 'http://openxvario.googlecode.com/svn/tr ... -read-only'
doesn't exist
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 »

Did you put quotes round the text?
The URL is http://openxvario.googlecode.com/svn/trunk/
The openxvario-read-only is the name of a sub-directory on your PC.
Are you running svn from a command line prompt?

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
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, I tried http://openxvario.googlecode.com/svn/trunk/
and it downloaded a 'openxvario' folder in there it it has '.svn' folder, under that there is 'pristine' and a 'tmp' foler and 3 other small files. but the 2 folders are empty. no openxvario program seen.

What I did is right click to get a pop up screen has option for 'SVN checkout...' , click on it it pops a window where I entered the http page name. and specify where I want it to be downloaded. This worked well for openTx and a Hubsan project very well. but not on this openxvario.
Attachments
SVN checkout.png
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 »

What copy of svn are you using? Mine is a command line version!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
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 »

It is TortoriseSVN for windows V1.7
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

Kaos,
I do not know if you already have all the files from openxsensor branch.
If not, I put an archive in attachment.
All files have to be copied in a folder having a name "openxsensor" (same name as the .ino file).

As said, I still suspect a bug in the .ino file (for D series receiver).
At line 123 you have
"// readSensors();"

I think that this line should be uncommented so :
"readSensors();"

Mike has not yet changed this file.
Attachments
openxsensor_r197.rar
copy of files in openxsensor branch
(31.38 KiB) Downloaded 142 times
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 »

got it. thx. I will take a good look at it later today. by the way, it needs to be in a sketch folder 'openxsensor_r197". ;)

I do see line 123 thing.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

kaos wrote:it needs to be in a sketch folder 'openxsensor_r197". ;)
Right, I forgot that I renamed the .ino file when I copied it on my PC.
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 »

I think that is a good thing to do so we can keep different version separated. I did not know this easy way to do it before. ;)
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 »

I am still waiting my gy63 and resistors/cap to arrive. But I found this thing:
http://www.ebay.com/itm/111258145236?_t ... EBIDX%3AIT
http://dx.com/p/crius-v-i-sensor-voltag ... xqwDYWgSCI
and I believe they are the same thing.

http://dlnmh9ip6v2uc.cloudfront.net/dat ... Output.pdf
http://dlnmh9ip6v2uc.cloudfront.net/dat ... seDemo.pde

it is very small and light compare to ASC758. if someone can incorporate the sketch into openXvario sensor it would be cheaper to get ASC758 and other little parts and lighter. Easier to make as well. ;) Vario + current + voltage probably will satisfy most of flying needs.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Building a 50A sensor module for openXvario

Post by mstrens »

kaos wrote:ASC758
kaos wrote:I am still waiting my gy63 and resistors/cap to arrive. But I found this thing:
http://www.ebay.com/itm/111258145236?_t ... EBIDX%3AIT
http://dx.com/p/crius-v-i-sensor-voltag ... xqwDYWgSCI
and I believe they are the same thing.

http://dlnmh9ip6v2uc.cloudfront.net/dat ... Output.pdf
http://dlnmh9ip6v2uc.cloudfront.net/dat ... seDemo.pde

it is very small and light compare to ASC758. if someone can incorporate the sketch into openXvario sensor it would be cheaper to get ASC758 and other little parts and lighter. Easier to make as well. ;) Vario + current + voltage probably will satisfy most of flying needs.
Thanks for information.
This component could normally work with oxs too.
Compare to ASC758, there could be one drawback: ground has to be common (there is no isolation between the measured current and the voltage put on ADC arduino). Still most of the time this should not be an issue.

Note : it exists one similar (small) board with ASC758 but it seems to be more expensive (about 20 up to 35$).
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 »

There's nothing different. Even If you power the arduino from the receiver the ground is still the same as the sensor and battery. The ground is not isolated by the ESC unless it uses an optocoupler. But those don't supply any voltage as far as I know. Someone correct me here if I'm wrong please. I personally prefer to use the ground on the battery side for the sensors and arduino. It won't normally blow things up if something goes wrong ;)

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 »

Thx. that would be my 2nd oXs with a 10DOF. seems GPS is in the talk now. ;)
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: Building a 50A sensor module for openXvario

Post by KAL »

mstrens wrote: ... ground has to be common (there is no isolation between the measured current and the voltage put on ADC arduino). Still most of the time this should not be an issue ...
The only problem can be a ground loop in which some "uncomfortable" voltages can be induced by magnetic fields caused by high currents.
So it would be better to use only one ground connection to each component as Joao mentioned.
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
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 »

if the vario and current sensor are drawing power from pro mini, you are saying attaching the battery gnd to the pro mini gnd while raw to rx V?
or the sensor's gnd to lipo gnd while pro mini still gets its gnd from rx? I think I am a little confused here.
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 »

Both ground from lipo. Only one wire goes to the receiver..
Don't forget that if you use more than 3 cell lipo, you will have to regulate it down to 12 or even 8V before the arduino.
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

Post Reply

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