OpenXsensor Config & setup in OpenTx 2.015 with a Taranis pl

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
Bosshawg
Posts: 19
Joined: Mon Apr 28, 2014 12:38 pm
Country: -

OpenXsensor Config & setup in OpenTx 2.015 with a Taranis pl

Post by Bosshawg »

Greetings
Have built & flashed 5v Arduino with OpenXsensor and used configurator to modify settings in sketch.
I can get Vario tones,Alt,Vspd,Flight Pack voltage(using MikeB circuit),Rx voltage,RSSi with a D8R2.
But cannot get any current readings using 30Amp ACS712 sensor on A3 pin with sensitivity 66mV/A an Output Offset of 2500mV & a Divider Factor of 1.
The Sensor Outputs 2.5v @ 0A,and a decreasing voltage when current flows through it!
After reading Manual about configuring current source correctly in Tx & trying most of them to no avail!.
Thought I would post & see if any of you can tell me what i have done wrong.
Yours in anticipation a newbe @ Taranis :oops:
A common mistake people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools!... Douglas Adams: "Mostly Harmless"

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

Re: OpenXsensor Config & setup in OpenTx 2.015 with a Tarani

Post by jhsa »

Decreasing voltage? Hmmm, I think it should be an increasing voltage? That is a bidirectional sensor. Maybe try swapping the wires that are being sensed. NOT NEGATIVE AND POSITIVE.

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: OpenXsensor Config & setup in OpenTx 2.015 with a Tarani

Post by mstrens »

You are using a bidirectional sensor. Depending of the direction of the current the value reported by the sensor is higher or lower than 2.5 Volt.
The voltage at the output of the sensor is converted in current by the software in openXsensor by this formula:
currentData.milliAmps = ((currentData.sumCurrent / cnt) - OFFSET_CURRENT_STEPS ) * MAMP_PER_STEP ;
where (currentData.sumcurrent /cnt) is the average of the reading from the currentsensor.
So at this line currentData.milliAmps can be positive or negative (when the average is lower than the offset.
Still, on the next instruction openXsensor forces the current to zero when the calculated current is negative (in order to transmit only positive value).
That explains why you only get 0.

To solve it you can swap the wires that are being sensed as jhsa said. In this case, the voltage returned by the sensor will be higher than the offset and the current will be positive.
Still there is an easier alternative: do not modify you wires and just put a negative value for the parameter MAMP_PER_STEP (adding a minus in your config file). The resultwill be the same.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXsensor Config & setup in OpenTx 2.015 with a Tarani

Post by jhsa »

Didn't know about this simple solution ;)

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

Post Reply

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