PDA

View Full Version : Discussion AGL Altitude Measurement


octane-link
Nov 15, 2007, 08:30 PM
Hi everyone:

I am using a PIC18F452 to gather some air data and transmit it to a ground station in real-time (where it is stored).

For altitude, of greater interest to me, is AGL altitude. I am using a Freescale pressure sensor (not sure of the exact one), with a 0-5V output. I am going to use an op-amp to get a range of 0-50V, then use an offset on the inverting input so that I am looking a 5V window in that range. This will give me roughly 1 km of altitude to examine at a 1 m resolution with a 10 bit ADC.

What I want to know, is how should I do this so that I am reading 0 m on the ground? I want my range to be -100 to 900 m (for sensor noise). I was planning on using successive approximation to get 1V on the ground, but this doesn't give me the correct direction for voltage (it goes down as altitude goes up).

I was thinking about a 4V output for ground level, but I am not sure, and need some thoughts.

I am also not sure, would I need a gain circuit on both inputs or just the sensor input to the op-amp?

Thanks!

clolson
Nov 15, 2007, 09:16 PM
I'm a software guy, so this may not be helpful at all since you are talking a lot hardware lingo I don't understand, but if you've got a pic onboard you should be able to add a little bit of code. If it was me, I'd just record the sensor value at ground level, then subtract that off all subsequent readings to get height above ground level.

What I'm playing with right now with my gumstix project is to compare pressure altitude with gps altitude and build up an average error between the two over some amount of time. Then my best guess at true absolute altitude is my pressure sensor value + this averaged error term. In my first flight test, it seemed to work out pretty well ... better than using gps only. So you know your absolute altitude (within the resolution of your sensors) ... now just add a virtual terrain map, and you can look up your expected height above ground ... but I'm a software guy so doing it this way is a heck of a lot easier for me than figuring out how to rig up some sensor that actually senses height above ground. :-)

Curt.

hg1
Nov 15, 2007, 09:33 PM
What I'm playing with right now with my gumstix project is to compare pressure altitude with gps altitude and build up an average error between the two over some amount of time. Then my best guess at true absolute altitude is my pressure sensor value + this averaged error term. In my first flight test, it seemed to work out pretty well ... better than using gps only.
Curt - Not to hijack Octane's thread, but what kind of altitude accuracy do you see with GPS ? I've been considering an approach that just uses GPS plus a ground proximity sensor such as wide beam ultrasonic ranging or maybe optical flow for automating the takeoff and landing as well as unexpected obstacle detection. Howard

octane-link
Nov 15, 2007, 09:51 PM
I would like to do the subtraction option, but a requirement is to use the op-amp circuit for the offset. I have a DAC onboard too, which gives me the offset.

LukeZ
Nov 16, 2007, 01:13 PM
Octane, you may find some useful schematics in this thread (http://www.rcgroups.com/forums/showthread.php?t=372869), towards the end.

I did the same thing on my altimeter, used an op-amp to "amplify" the sensor output, then a variable DC voltage from my PIC to act as a reference voltage. I used a diff-amp to compare the two and that is what I read on the AD. It's not trivial to set up, nor is the coding easy.


Luke

octane-link
Nov 16, 2007, 01:32 PM
Thanks, those schematics were helpful.

I think I found a workaround for the coding, I will just assign everything as negative altitude, and then multiply by -1 on the ground before the data is shown. That makes things really simple on the coding end.

I also got some help on the circuit, so I might be OK.

If anyone is interested, after I am done, I can open-source the project out so that people can use it on their planes.