Introduction to the openx vario/altimeter

Development & General Chat for the superb openxvario project.

Moderator: rainer

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

Re: Introduction to the openx vario/altimeter

Post by RightRudder »

Better than the new Frsky vario eh? Way to go Rainer!

User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Introduction to the openx vario/altimeter

Post by Rob Thomson »

Yup.

But do remember. New frsky vario isna beta unit. It may well get better!

Believe it us more accurate with absolute altitude, but less with vspeed. That in my mind is a software issue. They will probably fix that!

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
dumbthumbs
Posts: 13
Joined: Thu Apr 11, 2013 12:29 am
Country: -

Re: Introduction to the openx vario/altimeter

Post by dumbthumbs »

Awesome project, it looks easy enough I could do it :)

I bought this frsky vario:

http://www.alofthobbies.com/variometer-sensor.html

but the hub won't fit in the fuselage of my DLG (its a NEO made by Seba: http://flightcomp.com/airframesparts/). So, that sent me on a search for an all-in-one altimeter to work with my D4R-II receiver (I have a DJT transmitter module in my 9x running openTX). I saw pictures earlier of this working with that receiver, do I just plug it into the data port - I didn't see any pictures of this in this thread or on the wiki page. Now I've got to get things ordered and play the waiting game.

Does the arduino pro have memory? Can you do logging? If not that's fine. I've also purchased a bluetooth transmitter to hook up to the telemetry output of the transmitter to send data to my android phone.

Heath
User avatar
tilmanb
Posts: 347
Joined: Thu Oct 11, 2012 9:36 pm
Country: Germany
Location: Karlsruhe, Germany

Re: Introduction to the openx vario/altimeter

Post by tilmanb »

The Arduino has internal memory. And afaik the Arduino libraries provide tools to use it.
But by far the easiest way to log data is something like this: https://www.sparkfun.com/products/9530
It writes to SD card and takes care of all the time stamping and such. Arduino interfacing is child's play. Logs are written on a file and can be read on your pc directly.
RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by RightRudder »

+1 on the sparkfun openlogger. I love it. The only drawback is if you want really fast logging you can't send too many characters too fast or you will overwrite the buffer. There is a similar product at sparkfun which writes to onboard flash and I think is better for high speed logging. That being said I used openlogger to log data generated by a little PIC development board I am using which is connected to a Frsky D4R-II receiver. I set it up to serially transmit the recieved PPM values from the rx. Then I deflected the stick on the Tx and let it go. The following file clearly shows the stick bounce on the logged data so it shows that it is reasonably fast for most RC applications.

Stick log.xls
(115 KiB) Downloaded 242 times

dumbthumbs
Posts: 13
Joined: Thu Apr 11, 2013 12:29 am
Country: -

Re: Introduction to the openx vario/altimeter

Post by dumbthumbs »

I couldn't find anything clear on this. I believe the v4r-ii does not have a rs232 port on it. Does this mean I'll need to build the filter to hook it up to the analog port? All my parts are on their way. It will be cool to see how high I'm launching and get an idea of my sink rate to tune my different flight modes.
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Introduction to the openx vario/altimeter

Post by Kilrah »

The D4R-II does have a serial port, yes. The TX/RX wires on the little white plug. I suppose that's the one you're talking about as the V4 has no telemetry at all.
User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: Introduction to the openx vario/altimeter

Post by Flaps 30 »

dumbthumbs wrote:I couldn't find anything clear on this. I believe the v4r-ii does not have a rs232 port on it.
The V series doesn't have telemetry. It is only the D series that has that.
mpjf01
Posts: 367
Joined: Thu Jul 26, 2012 3:07 am
Country: -
Location: Adelaide, Australia

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by mpjf01 »

rainer wrote:
jhsa wrote:Anyway, I'm a beginner with this microcontroller stuff.. I suppose we don't need any kind of level converter if we use a 5V sensor and a 5V pro mini, right?
no, should work right away. i´ve got a setup here with 5v arduino mini pro and 5v ms5611 and another one using an arduino nano together with a 3.3v version of the sensor module.
I wonder if someone could please help out with a wiring diagram for using the nano. I haven't used this gear before and am not sure that I am using the correct pins as the labels are not all the same as with the mini pro. Thanks.
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

which labels are you unsure about?
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: Introduction to the openx vario/altimeter

Post by RightRudder »

dumbthumbs wrote: SNIP...

but the hub won't fit in the fuselage of my DLG (its a NEO made by Seba: http://flightcomp.com/airframesparts/). So, that sent me on a search for an all-in-one altimeter to work with my D4R-II receiver (I have a DJT transmitter module in my 9x running openTX). I saw pictures earlier of this working with that receiver, do I just plug it into the data port -

I just ordered a NEO (red tiger stripe colour scheme) and plan to use the oXv along with a D4R-II so we can compare notes! Are you going to try to energy compensate your vario?
mpjf01
Posts: 367
Joined: Thu Jul 26, 2012 3:07 am
Country: -
Location: Adelaide, Australia

Re: Introduction to the openx vario/altimeter

Post by mpjf01 »

rainer wrote:which labels are you unsure about?
For the Nano to 5611. There are pins on the nano marked GND, 5v, A4 and A5. I'm assuming these are the ones to be used but would like confirmation if possible please.

For the nano to Rx.

The instructions state that the black wire goes to GND, that's OK. The red wire to RAW. There is no pin on the nano that I can see marked RAW. The yellow wire to pin 4 (for Rx with RS232). There's a pin D4 and a pin A4 and a vertical pin (of 6) on the nano, I'm assuming not A4 as that has been used already for the sensor, but is D4 the same as pin 4 in the instructions or is it one of the 6 vertical pins which has a 4 next to it?

I could guess at this but I've just received the sensor that I ordered nearly 2 months ago and don't really want to break it.
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

OK, i added the nano's pin names in brackets: (and changed it in the wiki as well)

Code: Select all

(nano pin names in bracket if different)
=== Powering the Arduino : ===
     Arduino GND   --------------------- Receiver GND (Servo Plug)
     Arduino RAW(VIN)  ----------------- Receiver +5V (Servo Plug)

=== Optional PPM Input from servo port to the arduino: ===
     Arduino Pin 2(D2) ----------------- Receiver PPM Signal (Servo Plug)

=== Output of the data to the receiver: ===
     Arduino Pin 4(D4) ----------------- Receiver RX Pin (If there is a RS232 Port on the receiver)
  or
     Arduino Pin 3(D3) ----------------- Receiver A1 or A2 (If there is NO RS232 Port on the receiver)

=== connecting the MS56711 module to the receiver ===
     Arduino Pin A4   ------------------ MS5611 SDA
     Arduino Pin A5   ------------------ MS5611 SCL
     Arduino VCC (5V) ------------------ MS5611 5V
     Arduino GND      ------------------ MS5611 GND
	 
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
mpjf01
Posts: 367
Joined: Thu Jul 26, 2012 3:07 am
Country: -
Location: Adelaide, Australia

Re: Introduction to the openx vario/altimeter

Post by mpjf01 »

Thank you for helping out with that information.
mpjf01
Posts: 367
Joined: Thu Jul 26, 2012 3:07 am
Country: -
Location: Adelaide, Australia

Re: Introduction to the openx vario/altimeter

Post by mpjf01 »

I have set up the nano and sensor as described above and loaded the sketch after uncommenting the line PPMalwaysused and recompiling. I have one wire connecting pin D4 on the nano to the Rx port on the receiver. I have set the sensitivity to various values but currently is -3, 0,0,+3. All other settings as per the instructions. The VSPEED continually varies between +- 0.08 with the sensor stationary. Is this expected? the ALT value changes all the time and is only sometimes zero, see photos.
20130423_173508.jpg
20130423_173622.jpg
20130423_173655.jpg
20130423_173705.jpg
20130423_173715.jpg
I have put the power and PPM cable to Rx Ch 08 and mapped to the source P1. Moving the pot doesn't seem to vary anything.

This outcome doesn't seem to match what others have posted and I was wondering whether there is a way to test if the sensor is faulty?

BTW, what do the small numbers after the main value mean?
Last edited by mpjf01 on Thu Apr 25, 2013 7:59 am, edited 1 time in total.
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

Hi!
Ok, let's see.
the noise in the vertical speed is normal. you can take influence by changing the sensitivity.
The DIST Field in you screenshot displays the absolute height. any smaller numbers should always be treated the same as the bigger ones.
So in the last screenshot you get 3847 which should be 384,70 meters.
The jumps in the alt field are strange. haven't seen anything like that yet. but as the Dist field doesn't jump in the same way, this should not be related to a measuring error of the sensor.Which version of open9x are you using and how did you setup you telemetry in open9x?
for the pot to sensitivity control you need as well the "#define PPM_AllwaysUsed" dis you set that one?
Rainer.
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
mpjf01
Posts: 367
Joined: Thu Jul 26, 2012 3:07 am
Country: -
Location: Adelaide, Australia

Re: Introduction to the openx vario/altimeter

Post by mpjf01 »

I'm using Open9x version r2168. I have set up the telemetry with exactly the same settings as on the screens in the Wiki here:
https://code.google.com/p/openxvario/wi ... gsInOpen9x
except that I have used several different settings for the sensitivity (including those in the Wiki screen). Whatever I choose does not seem to affect the variability of the Alt field.

Here's a copy of the sketch I am using.
sketch_mar21a.txt
(42.4 KiB) Downloaded 213 times
I changed the .ino to .txt to allow upload.
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

just flashed your sketch to one of my oXv ( using the pro mini) and its working fine here.
i use the following two lines now:
#define SEND_SensitivityAsT2
// #define SEND_PressureAsT2 9000
this way i can see the sensitivity in the T2 telemetry value.

The Alt field is stable as it should be, so there must be some other problem.
how did you connect power to the arduino when you did those tests?
which ms5611 module are you using?
exatly which connections have you got between the oXv and the receiver?
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
mpjf01
Posts: 367
Joined: Thu Jul 26, 2012 3:07 am
Country: -
Location: Adelaide, Australia

Re: Introduction to the openx vario/altimeter

Post by mpjf01 »

The connections between nano and 5611
nano 5611
A4 SDA
A5 SCL
5V 5V
GND GND

Between Nano and Rx
Nano Rx
GND Rx GND (servo plug)
VIN RX + (servo plug)
D2 Rx PPM (servo plug)
D4 Rx pin on RS232 port

The module looks like the GY-63 in your photos.

I modified the sketch to show sensitivity as T2. Screenshots follow. The two photos were taken at nearly the same time as quickly as the camera would allow. Rotating P1 changes T2 from a minimum of 50 to a maximum of 1000.
20130424_084359.jpg
Attachments
20130424_084404.jpg
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

P2 is exactly as it should be. thats the pre-defined range for the kamlan_r ( sensitivity) parameter.
which voltage is your system running on?
Your vfas value is down to 4v (measured behind the arduino internal voltage regulator) idealy this shsould be at 5V ( even though my pro mini setup works down to 3.5v) could you try running your system with a stable 5v for a test?
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
mpjf01
Posts: 367
Joined: Thu Jul 26, 2012 3:07 am
Country: -
Location: Adelaide, Australia

Re: Introduction to the openx vario/altimeter

Post by mpjf01 »

The receiver was powered by a 4.8v LiMH flight pack fully charged and reading 4.8v on my meter. I tried with a 2s LIFE 6.6v and Vfas reads steady 4.9. Alt still fluctuates but seems to read zero more of the time than before. I don't have a way that I know of to get a 5v supply exactly.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Introduction to the openx vario/altimeter

Post by jhsa »

Silly question.. The ALT+ field at the bottom right corner is always at zero. what is it used for? because if it is not used i will use that slot for something else.. flight pack voltage for example
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
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Introduction to the openx vario/altimeter

Post by Rob Thomson »

Thought that was for the maximum altitude for the flight?

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

mpjf01 wrote:The receiver was powered by a 4.8v LiMH flight pack fully charged and reading 4.8v on my meter. I tried with a 2s LIFE 6.6v and Vfas reads steady 4.9. Alt still fluctuates but seems to read zero more of the time than before. I don't have a way that I know of to get a 5v supply exactly.
4.8 should be ok.
as we know that the sketch is fine ( tested on my board) and the sensor is fine (Dist field display altitude without problems) the next logical step would be to try another receiver and another power source.
i assume the problem is somewhere behind the oXv
Have you got an alternative reciever you could try?
are you using a BEC? if yes can you try another one?
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
mpjf01
Posts: 367
Joined: Thu Jul 26, 2012 3:07 am
Country: -
Location: Adelaide, Australia

Re: Introduction to the openx vario/altimeter

Post by mpjf01 »

I have tried 3 different receivers and two different power sources (no BEC) and there is no fundamental change.
I am interested in your comment about the sensor though. The dist reading does vary a lot (as per screenshots) and is different each time I turn the unit on. At present for example it is reading -140 and slowly increasing with time. The temperature reading is incorrect, not 16 degrees here at present, actually 25 degrees. So if the dist reading is a measure of whether the sensor is faulty or not it would seem to me that a fault is likely. I guess the only way to find out is to get another sensor and try that. Unless you have any more suggestions I should try of course.
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

mpjf01 wrote:The temperature reading is incorrect, not 16 degrees here at present, actually 25 degrees. So if the dist reading is a measure of whether the sensor is faulty or not it would seem to me that a fault is likely. I guess the only way to find out is to get another sensor and try that. Unless you have any more suggestions I should try of course.
There is a calibration offset in the code that by default subtracts a predefined value from the temperature.
your reading could be ok depending on your physical setup ( sensor mounted on another heat generating board or test setup where the sensor is placed away from other heat sources(like the arduino iself))

The Dist Field and the Alt Field contain the same data ( at least below 328 Meters)
in both fields i transmit the absoult height.
the alt field might be corrected by the tx to start with a height of "0" upon initialisation.
so in gerneral: DIST= Absolute Height, ALT=Relative height.
as in your screenshots the variance in the alt field is much higher than in the DIST field, the error must somewhere else ( not the sensor)
the tx will take the first received value in the ALT field and store that as an offset that for all future displayed altituded (ALT Field) will be subtracted from the received value. ( there is some code in the sketch that can be turned on/off) that tries to override this.
If you press the menu key, the last received altitude will again be copied in that offset.
that might explain the last 2 pictures if that was the case.
for the series of 5 pictures , in which order and in which time scale did you take those?
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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Introduction to the openx vario/altimeter

Post by jhsa »

On mine, the temperature is also not accurate.. It shows few degrees too less.
also when I reset the altitude by pressing "Menu", the altitude starts increasing over time..

João

EDIT: The version of the sketch I have installed is about a month old.. so if all this was corrected already, please ignore my post
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
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

HI João,
no you sketch should be ok, this area hasn't changed.
the temperature is not really accurate.
the following is the current default calibration offset:
const long TemperatureCalibrationOffset=-80 ; // Temperature correction in 1/10 of degree celsius
so a total of 8C will be subtracted from the measured temperature.
this is due to normal heat generated by an arduino and the sensor.
the drift in altitude that you mentioned is more likely normal air pressure variation. we cannot measure altitude. we only measure air pressure and use a formula to "estimate" the altitude. the drift can be quite a lot depending on the weather situation ( and the temperature of the board)
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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Introduction to the openx vario/altimeter

Post by jhsa »

the air pressure don't change so fast and always as far as I know..
I'm talking about changing 1 meter every 5 or 10 minutes.. almost always increasing..
question, so if the board takes some time to stabilize it's temperature, we can also have this drift? because that could be what it's happening..

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
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Introduction to the openx vario/altimeter

Post by rainer »

1hPa air pressure change per 8 Meter
e.g. yesterday between 18:00 and 22:00 we had an air pressure change of about 2 hPa = 16 Meter and that's with a "stable" weather condition. on other days you can have huge differences resulting in height changes of a couple of hundred meters.
And yes the temperature is also affecting the altitude calculation and measurement in various ways ( sensor + math)
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)

Post Reply

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