Shop OBEX P1 Docs P2 Docs Learn Events
Video overlay with prop for the AutoProp8 autopilot - Page 3 — Parallax Forums

Video overlay with prop for the AutoProp8 autopilot

13

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2009-05-13 21:23
    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.
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-13 21:48
    Looks interesting... I used i2c routines available as objects. I may try and do mine 2-3 times because my data is not right sometimes.
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-13 22:03
    I do this in the obj section

    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 ?
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-13 22:10
    I know why it hung... When I init all my other stuff, I forgot to do :

    f.start

    duhhh......
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-13 22:11
    well, I get 0 now when I print 'value'....still looking
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-13 22:23
    now I get a BIG number.... My value for p here in NM is 95700 from the barometer.
    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
  • TimmooreTimmoore Posts: 1,031
    edited 2009-05-13 23:35
    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
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-13 23:41
    Well I will work on that. BUT, the value part of the software does not compute.
  • TimmooreTimmoore Posts: 1,031
    edited 2009-05-13 23:51
    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.
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-14 00:06
    Could be...I'll check because the number is like 11 million plus !
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-14 00:35
    [noparse][[/noparse]code]

    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.....
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-14 00:54
    Ahhh...... got it.

    I get 6670 from my brometer here which is correct.
    Dang...math is complicated !
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-15 00:38
    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
    1600 x 1200 - 403K
    1600 x 1200 - 368K
    1600 x 1200 - 352K
    1600 x 1200 - 364K
    1600 x 1200 - 336K
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-15 03:06
    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.
  • TubularTubular Posts: 4,706
    edited 2009-05-15 04:50
    Truly inspirational stuff earl, well done

    Out of interest how much power does the 900mHz video transmitter consume?

    tubular
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-15 16:52
    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)

    Dang, another big part of the project !
    Earl
  • simonlsimonl Posts: 866
    edited 2009-05-15 18:30
    @Earl: I've been following this thread since you started it - great work smile.gif 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

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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.
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-15 21:36
    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....
    1600 x 1200 - 335K
    1600 x 1200 - 324K
    1600 x 1200 - 358K
    1600 x 1200 - 357K
  • Paul_HPaul_H Posts: 85
    edited 2009-05-15 22:31
    Hey Earl!

    You've been making sweet progress smile.gif 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
    3648 x 2736 - 732K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-05-16 01:44
    Earl,

    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
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-16 01:51
    I made a youtube video..took forever to upload...still processing on youtube. hete is address

  • TreeLabTreeLab Posts: 138
    edited 2009-05-16 03:23
    Earl;
    YouTube reports that the vid exceeds the 10 minute mark, and was withdrawn. Any chance of a Reader's Digest version?
    Cheers!
    Paul Rowntree
  • mctriviamctrivia Posts: 3,772
    edited 2009-05-16 03:51
    you can upload to my site. see below

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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.
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-16 03:51
    Ok. I am editing it to 2 parts.
    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
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-16 04:35
    I also sent the whole video to http://propmodule.com/upload.html
    Earl
  • propwellpropwell Posts: 87
    edited 2009-05-18 13:01
    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?

    Thank you all very much, i really admire you... yeah.gifshocked.gif
    2240 x 2663 - 111K
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-19 03:06
    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
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-19 04:00
    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....
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-19 19:46
    Does anyone know what angle is reasonable for a small UAV climbing to waypoint altitude ?
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-05-20 02:09
    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
    1600 x 1200 - 342K
    640 x 480 - 88K
    1600 x 1200 - 397K
Sign In or Register to comment.