oXs with two simultaneous current sensors

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
Trebb
Posts: 6
Joined: Fri Jul 01, 2016 11:35 am
Country: -

oXs with two simultaneous current sensors

Post by Trebb » Fri Aug 19, 2016 8:18 pm

I just built an oXs rpm and current temp thanks to kuroguy for providing inspiration on helifreak! And it is working really well. So now I want to make more oxs sensors for all my helis and planes.

Just wondering is it possible to have two simultaneous current sensors to the same Arduino and appear as two separate readings in my Taranis transmitter?

Is it possible to modify the sensor ID codes in the oxs code?


Sent from my iPhone using Tapatalk
Last edited by Trebb on Fri Aug 19, 2016 8:18 pm, edited 1 time in total.

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

Re: oXs with two simultaneous current sensors

Post by mstrens » Fri Aug 19, 2016 9:09 pm

Currently oXs support only one current sensor and one RPM on one arduino.

If you want several current sensors, the easiest is to build 2 oXs.
It is possible to assign different sensor ID code in oXs code (for SPORT protocol). In the latest (current) version, the sensor ID are defined in oXs_out_frsky.h in folowing lines :
#define DATA_ID_VARIO 0x00 // = sensor 0
#define DATA_ID_FLVSS 0xA1 // 1
#define DATA_ID_FAS 0x22 // 2
#define DATA_ID_GPS 0x83 // 3
#define DATA_ID_RPM 0xE4 // 4
#define DATA_ID_ACC 0x1B // ?

There is one Id per group of data being sent.
Current is sent using the ID defined in DATA_ID_FAS.

Trebb
Posts: 6
Joined: Fri Jul 01, 2016 11:35 am
Country: -

Re: oXs with two simultaneous current sensors

Post by Trebb » Sat Aug 20, 2016 2:40 pm

Ok, thanks! That's just the info I was after.


Sent from my iPhone using Tapatalk

raleighcoter
Posts: 19
Joined: Mon Apr 18, 2016 10:40 pm
Country: -

Re: oXs with two simultaneous current sensors

Post by raleighcoter » Sat Aug 20, 2016 11:46 pm

Who is kalle123? I thought I was the inspirer.

By the way, current sensors output a voltage that is proportional to current measured. You can hook up 6 current sensors as voltage sensors. All you need to do is figure out the range and offset in opentx. Hint: the n2 minihub instructions have the range and offset for the 5, 20, and 30 amp sensors.

Trebb
Posts: 6
Joined: Fri Jul 01, 2016 11:35 am
Country: -

oXs with two simultaneous current sensors

Post by Trebb » Sun Aug 21, 2016 5:21 pm

Thanks for the tip, yes that makes sense I'm sure you could duplicate the current reading code and point it to a different pin and change the Data ID, just wondering had anyone had already done it.


Sent from my iPhone using Tapatalk
Last edited by Trebb on Sun Aug 21, 2016 5:21 pm, edited 1 time in total.


User avatar
kalle123
Posts: 685
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: oXs with two simultaneous current sensors

Post by kalle123 » Sun Aug 21, 2016 5:28 pm

raleighcoter wrote:Who is kalle123?
That is me. Any problem, wanna fight :mrgreen:

raleighcoter
Posts: 19
Joined: Mon Apr 18, 2016 10:40 pm
Country: -

Re: oXs with two simultaneous current sensors

Post by raleighcoter » Sun Aug 21, 2016 5:47 pm

Glad i could help both of you. I enjoy spreading the hobby.

User avatar
kalle123
Posts: 685
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: oXs with two simultaneous current sensors

Post by kalle123 » Sun Aug 21, 2016 6:56 pm

raleighcoter wrote:Glad i could help both of you.
How did you help me? Must have forgotten ...

raleighcoter
Posts: 19
Joined: Mon Apr 18, 2016 10:40 pm
Country: -

Re: RE: Re: oXs with two simultaneous current sensors

Post by raleighcoter » Sun Aug 21, 2016 6:57 pm

kalle123 wrote:
raleighcoter wrote:Glad i could help both of you.
How did you help me? Must have forgotten ...
viewtopic.php?t=8976

User avatar
kalle123
Posts: 685
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: oXs with two simultaneous current sensors

Post by kalle123 » Sun Aug 21, 2016 7:15 pm

And I did not thank you for that useful information. My mistake :shock:

raleighcoter
Posts: 19
Joined: Mon Apr 18, 2016 10:40 pm
Country: -

Re: oXs with two simultaneous current sensors

Post by raleighcoter » Sun Aug 21, 2016 9:36 pm

My pleasure

Trebb
Posts: 6
Joined: Fri Jul 01, 2016 11:35 am
Country: -

Re: oXs with two simultaneous current sensors

Post by Trebb » Mon Sep 26, 2016 7:04 pm

mstrens wrote:Currently oXs support only one current sensor and one RPM on one arduino.

If you want several current sensors, the easiest is to build 2 oXs.
It is possible to assign different sensor ID code in oXs code (for SPORT protocol). In the latest (current) version, the sensor ID are defined in oXs_out_frsky.h in folowing lines :
#define DATA_ID_VARIO 0x00 // = sensor 0
#define DATA_ID_FLVSS 0xA1 // 1
#define DATA_ID_FAS 0x22 // 2
#define DATA_ID_GPS 0x83 // 3
#define DATA_ID_RPM 0xE4 // 4
#define DATA_ID_ACC 0x1B // ?

There is one Id per group of data being sent.
Current is sent using the ID defined in DATA_ID_FAS.
Hi mstrens,
I've now tried this with a second arduino but I couldn't get my taranis to read two clear separate values for the current.

How do I "assign a different sensor ID"?

I tried changing 0x22 to 0x23 but then the current couldn't even be discovered... I'm not familiar with how these hex values work...

Thanks!


Sent from my iPhone using Tapatalk

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

Re: oXs with two simultaneous current sensors

Post by mstrens » Mon Sep 26, 2016 8:38 pm

there are only 28 valid values for a device ID.
Here are the valid values:
0x00, 0xA1, 0x22, 0x83, 0xE4, 0x45,
0xC6, 0x67, 0x48, 0xE9, 0x6A, 0xCB,
0xAC, 0x0D, 0x8E, 0x2F, 0xD0, 0x71,
0xF2, 0x53, 0x34, 0x95, 0x16, 0xB7,
0x98, 0x39, 0xBA, 0x1B

0x23 is not a valid ID and can't be used.
You can try replacing 0x22 by e.g. 0x45

Post Reply

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

Who is online

Users browsing this forum: No registered users and 2 guests