I haven't converted the pressure to altitude which is why I was looking through that piece of code. I was going to try this
value := f.FFloat(Pressure)
value := f.FDiv(value,101325.0) '1013.25 * 100 since Pressure is * 100
value := f.Pow(value, 0.190263)
value := f.FSub(1.0, value)
value := f.FMul(value,288.15)
value := f.FDiv(value,0.00198122)
which is a direct conversion of the wiki equation but its in floating point (f is Float32) but I am already running Float32 on a cog so it isn't a problem.
I haven't tried it yet so I dont know whether it works or not.
I have attached the hp03 interface code I use if you are interested.
p := ((UP - B3) * 100000) / B4 ' p = 95732
X1 := (p / 255 ) * (p / 255 ) ' X1 = 139129
X1 := (X1 * 3038) / 65535 ' X1 = 6449
X2 := (- 7357 * p) / 65535 ' X2 = -10747
p := p + (X1 + X2 + 3791) / 8 ' p = 95700
p := p * 2
BaroP := p/100 ' BaroP = 957 pa
value := f.FFloat(BaroP)
value := f.FDiv(value,101325.0) '1013.25 * 100 since Pressure is * 100
value := f.Pow(value, 0.190263)
value := f.FSub(1.0, value)
value := f.FMul(value,288.15)
value := f.FDiv(value,0.00198122)
[noparse][[/noparse]/code ]
The program hangs at your value := section of code... any ideas ?
There must be another problem somewhere, looking at the graph on page 13 of the bmp085 spec, a 957hpa is 500-600m or 1500-2000ft, not 6500ft. I get the same answer doing the calculation on a calculator - 1571ft. For 6500ft you should be seeing a hPa of about 800hPa.
What you can do is look up the air pressure for your area - weather sites normally have it in inches e.g. for me its currently 29.84". multiple by 33.86 to get hPA and you should be seeing something close to that.
Post Edited (Timmoore) : 5/13/2009 11:43:42 PM GMT
Quick thought - how are you printing it out - its in a floating point format and normal print routines dont work - I use floattoformat routine from the floatstring object to convert to a string.
value := f.FFloat(p1)
value := f.FDiv(value,101325.0) '1013.25 * 100 since Pressure is * 100
value := f.Pow(value, 0.190263)
value := f.FSub(1.0, value)
value := f.FMul(value,288.15)
value := f.FDiv(value,0.00198122)
value := f.FMul(value,3.28) ' make meters into feet
[noparse][[/noparse]/code ]
This comes out to 6761 feet
BTW: it was the printing.... had to do floatTOstring.....
Added a new OSD look..
When you are in level flight...no L or R is displayed.
Added Splash screen
If you get closer than 60 inches to the ground, the reading is displayed in big numbers
Pitch and Roll is displayed in degrees.
Ch 6 and Ch7 from the R/C may be used for changing display appearance
Hardware change made the OSD brighter over the camera input. Changed the resistor to a lower value from p1 of prop.
Oh....How about a live video window in the ground station ?
(See PIC)
Post Edited (Ole Man Earl) : 5/15/2009 1:37:14 AM GMT
All the data displayed on the ground station is coming from the UAV by XBee radio on 2.4ghz. No physical connection.
The video window on the right of the instruments are coming from the UAV by 900mhz and inputted into the PC by a video USB adapter. Again , no physical connection.
You could be miles from the UAV and have complete control as well as seeing what it sees.
With the AP off, you control it by the 72mhz R/C transmitter. (if it would reach that far) Most R/C transmitters only have a range of 1/2 mile or less.
So how do we control the UAV from that distance ?
By the 2 way XBee radio of course! 2.4ghz from that altitude and 60mw of power should go over 10 miles. With a beam antenna, much further.
I need to develop software using Labview that will take a joystick input, convert it to data the UAV can use and send it to the servos, and squirt it out the XBee radio. Labview software can do this also !
If anyone has some experience with Labview, I could use the help on the joystick input and data output to the XBee radio. I just got my student edition of Labview and WOW, this is gonna take some learning.
This is what someone (me) can do by devoting 10-12 hours a day, 7 days a week, for about the last 6-7 weeks ! It has been quite an experience and a great learning exercise.
The guys at the coffee shop are asking me how I stay so young. I tell them by exercising my mind ! Now if I could exercise my body a little more.....
Not bad for being 63 and retired ! I hope to see all of you at the conference at the end of June.
I don't know. It can run on a small 9v battery. Shouldn't be much. I haven't tested the range yet. Up in the air with a decent antenna on the ground it should be in miles. As a ham radio operator we did 2 way video on 900mhz, 1.2ghz, and 2.4ghz over 10 miles with high gain antennas at very low power. Probably need to develop a tracking system for the antennas if we go to high gain. (narrow beam width). But all antennas (2.4ghz 900mhz,72mhz could all be on same mast)
@Earl: I've been following this thread since you started it - great work This is just the thing I've been thinking of doing to about three years, but never seem to find the time (maybe I spend too much of my spare time reading these forums?!). Can't wait 'til I'm 63 and retired - LOL
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
Here is some pictures showing the ground station horizon ball reflecting what the OSD on the video shows.
I guess I should make a video on you tube to show some real live action....
I've ported the provisional code to the Propeller and have it reading all the sensors but the modem. I need to get a few cogs optimized so I don't run out doing the math and driving the motors. All in all, its coming along quickly. I started it on the Microsoft platform , but now have it on my Prop. Once its fully operational, I'll be posting it all.
wow this is so amazing what you can do!
I strongly need a simple way to just overlay some text to a video Signal in PAL, without all this GPS- and Compass-Stuff.
Therefor i tried to simplify the schematics i found in this thread, as you can see in my attachment. Is it right? Or did i missaprehend something?
And is there a smaller version of the code for the overlay?
For those interested, The whole circuit including the XBee transmitter and Video transmitter running full tilt the draw is 480ma at 5vdc
Most of the current is the Xbee.
Latest code here too....
Ground Station also...In Labview
Post Edited (Ole Man Earl) : 5/19/2009 3:56:46 AM GMT
For those interested, The whole circuit including the XBee transmitter and Video transmitter running full tilt the draw is 480ma at 5vdc
Most of the current is the Xbee.
The propeller is sending data out via the XBee quite reliably now... Recieved by thr ground station XBee and sent to LabView..
One pic with the moving map and live video (simulated now) and the 3rd one live data from XBee coming in.
Post Edited (Ole Man Earl) : 5/20/2009 3:15:08 AM GMT
Comments
which is a direct conversion of the wiki equation but its in floating point (f is Float32) but I am already running Float32 on a cog so it isn't a problem.
I haven't tried it yet so I dont know whether it works or not.
I have attached the hp03 interface code I use if you are interested.
f : "float32"
and I use your code after I get the pressure in tores
[noparse][[/noparse]code ]
PUB GetAlt ' from the barometer module
Baro.init(28,29) ' scl and sda on pin 28 and pin 29
Baro.start_adcTemp ' start the adc then
Baro.readBaro ' read data via i2c bus
UP := ((baro.baro_f6 * 255) + baro.baro_f7) 'raw 16 bit pressure data
B6 := B5 - 4000 ' B6 = 237
X1 := (B2 * (B6 * B6 / 4096 )) / 2048 ' X1 = 0
X2 := (AC2 - 457) * B6 / 512 ' X2 = -103
X3 := ((X1 + X2) + 2) / 2 ' X3 = -26
B3 := (AC1 - 2218) * 2 + X3 ' B3 = 11704
Y1 := (AC3 -1984) * B6 / 1024 ' Y1 = -415
Y2 := (B1 * (B6 * B6 / 4096 )) / 65535 ' Y2 = 1
Y3 := ((Y1 + Y2) + 2) / 2 ' Y3 = -103
B4 := (AC4 + 8808) * (Y3 + 32768) / 16386 ' B4 = 26781
p := ((UP - B3) * 100000) / B4 ' p = 95732
X1 := (p / 255 ) * (p / 255 ) ' X1 = 139129
X1 := (X1 * 3038) / 65535 ' X1 = 6449
X2 := (- 7357 * p) / 65535 ' X2 = -10747
p := p + (X1 + X2 + 3791) / 8 ' p = 95700
p := p * 2
BaroP := p/100 ' BaroP = 957 pa
value := f.FFloat(BaroP)
value := f.FDiv(value,101325.0) '1013.25 * 100 since Pressure is * 100
value := f.Pow(value, 0.190263)
value := f.FSub(1.0, value)
value := f.FMul(value,288.15)
value := f.FDiv(value,0.00198122)
[noparse][[/noparse]/code ]
The program hangs at your value := section of code... any ideas ?
f.start
duhhh......
p I believe is in 'tores'
which is 957 in hpa
should be about 6500 feet
We are in the mountains !!
Post Edited (Ole Man Earl) : 5/13/2009 10:34:06 PM GMT
What you can do is look up the air pressure for your area - weather sites normally have it in inches e.g. for me its currently 29.84". multiple by 33.86 to get hPA and you should be seeing something close to that.
Post Edited (Timmoore) : 5/13/2009 11:43:42 PM GMT
p1 := 94000 'set to 940 hga for a test
value := f.FFloat(p1)
value := f.FDiv(value,101325.0) '1013.25 * 100 since Pressure is * 100
value := f.Pow(value, 0.190263)
value := f.FSub(1.0, value)
value := f.FMul(value,288.15)
value := f.FDiv(value,0.00198122)
value := f.FMul(value,3.28) ' make meters into feet
[noparse][[/noparse]/code ]
This comes out to 6761 feet
BTW: it was the printing.... had to do floatTOstring.....
I get 6670 from my brometer here which is correct.
Dang...math is complicated !
When you are in level flight...no L or R is displayed.
Added Splash screen
If you get closer than 60 inches to the ground, the reading is displayed in big numbers
Pitch and Roll is displayed in degrees.
Ch 6 and Ch7 from the R/C may be used for changing display appearance
Hardware change made the OSD brighter over the camera input. Changed the resistor to a lower value from p1 of prop.
Oh....How about a live video window in the ground station ?
(See PIC)
Post Edited (Ole Man Earl) : 5/15/2009 1:37:14 AM GMT
The video window on the right of the instruments are coming from the UAV by 900mhz and inputted into the PC by a video USB adapter. Again , no physical connection.
You could be miles from the UAV and have complete control as well as seeing what it sees.
With the AP off, you control it by the 72mhz R/C transmitter. (if it would reach that far) Most R/C transmitters only have a range of 1/2 mile or less.
So how do we control the UAV from that distance ?
By the 2 way XBee radio of course! 2.4ghz from that altitude and 60mw of power should go over 10 miles. With a beam antenna, much further.
I need to develop software using Labview that will take a joystick input, convert it to data the UAV can use and send it to the servos, and squirt it out the XBee radio. Labview software can do this also !
If anyone has some experience with Labview, I could use the help on the joystick input and data output to the XBee radio. I just got my student edition of Labview and WOW, this is gonna take some learning.
This is what someone (me) can do by devoting 10-12 hours a day, 7 days a week, for about the last 6-7 weeks ! It has been quite an experience and a great learning exercise.
The guys at the coffee shop are asking me how I stay so young. I tell them by exercising my mind ! Now if I could exercise my body a little more.....
Not bad for being 63 and retired ! I hope to see all of you at the conference at the end of June.
Out of interest how much power does the 900mHz video transmitter consume?
tubular
Dang, another big part of the project !
Earl
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
I guess I should make a video on you tube to show some real live action....
You've been making sweet progress I like your use of the Ardupilot ground software.
I have a present for you if you havent seen it - GSTaTS - Ground Station Tracking and Telemetry
paul.hubner.googlepages.com/infot
I've ported the provisional code to the Propeller and have it reading all the sensors but the modem. I need to get a few cogs optimized so I don't run out doing the math and driving the motors. All in all, its coming along quickly. I started it on the Microsoft platform , but now have it on my Prop. Once its fully operational, I'll be posting it all.
Paul
I've been lurking here since the beginning. Excellent work! (I also like that "penguin pyramid" picture!)
Paul,
Cool yagi! Did you make it or buy it? (Maybe start another thread, so we don't hijack Earl's.)
-Phil
YouTube reports that the vid exceeds the 10 minute mark, and was withdrawn. Any chance of a Reader's Digest version?
Cheers!
Paul Rowntree
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My new unsecure propmod both 1x1 and full size arriving soon.
Need to upload large images or movies for use in the forum. you can do so at propmodule.com/upload.html for free.
Part 2 is
It is not quite processed yet.
I am uploading part 1 now.
ok here is part 1
Post Edited (Ole Man Earl) : 5/16/2009 4:35:57 AM GMT
Earl
I strongly need a simple way to just overlay some text to a video Signal in PAL, without all this GPS- and Compass-Stuff.
Therefor i tried to simplify the schematics i found in this thread, as you can see in my attachment. Is it right? Or did i missaprehend something?
And is there a smaller version of the code for the overlay?
Thank you all very much, i really admire you...
Most of the current is the Xbee.
Latest code here too....
Ground Station also...In Labview
Post Edited (Ole Man Earl) : 5/19/2009 3:56:46 AM GMT
Most of the current is the Xbee.
Latest code here too....
One pic with the moving map and live video (simulated now) and the 3rd one live data from XBee coming in.
Post Edited (Ole Man Earl) : 5/20/2009 3:15:08 AM GMT