GPS speed logger for RC planes.


Go to last post By: hadv215
Yesterday 23:56
Forum: Proton 24
Starter: hadv215
Views: 0
Replies: 3
Yesterday 21:14
Forum: USB
Starter: towlerg
Views: 0
Replies: 4
Yesterday 20:01
Forum: Proton Studio
Starter: johngb
Views: 0
Replies: 2
Yesterday 17:47
Forum: The Lounge
Starter: Tim
Views: 0
Replies: 10
Yesterday 17:12
Forum: Proton 24
Starter: craig
Views: 0
Replies: 0
Yesterday 13:14
Forum: The Lounge
Starter: shantanu@india
Views: 0
Replies: 24
Yesterday 08:05
Forum: Proton Plus Compiler v3
Starter: Valter
Views: 0
Replies: 11
+ Reply to Thread
Results 1 to 7 of 7

Thread: GPS speed logger for RC planes.63 days old

  1. #1
    Junior Member david's Avatar
    Join Date
    Jan 2019
    Posts
    32
    Thumbs Up
    Received: 3
    Given: 1
    Total Downloaded
    91.44 MB

    1 Not allowed!

    Default GPS speed logger for RC planes.

    Hi All,
    This is a simple project to allow the logging of RC plane speeds to help determine battery, motor and prop variables.
    The code is crude and simple but has worked well to date.
    Basically it does a very simple parsing process to grab a field from the VTG sentence and stuffs it in to EEPROM. The limited EEPROM space means you get about 4 minutes of 1Hz updates. Trust me - your electric plane will never go faster than in the first couple of minutes.

    GPS module is -
    https://www.aliexpress.com/item/smal...AbTest=ae803_3

    Code is here.
    Code:
    'GPS speed sensor
    
    
    '                  Vdd <1 U 8> Gnd   
    '    From GPS  Rx  RA5 <2   7> RA0    sw
    'Invert To PC  TX  RA4 <3   6> RA1    led
    '         in/gnd   RA3 <4   5> RA2    in/gnd
    '  
    
    
    Device = 12F1840
    Config1 FCMEN_OFF, IESO_OFF, CLKOUTEN_OFF, BOREN_OFF, CPD_OFF, CP_OFF, MCLRE_OFF, PWRTE_ON, WDTE_OFF, FOSC_INTOSC 
    Config2 LVP_OFF, BORV_19, STVREN_OFF, PLLEN_OFF, WRT_OFF	
    
    
    
    
    Declare Xtal = 16 'Internal OSC
    OSCCON = %01111010    '16MHz=01111010, 4MHz=01101010, 8MHz =01110010
    APFCON = %10000100    'Tx=RA.4, Rx=RA.5
    TRISA = %00101101     '
    ANSELA=0              '
    PORTA=0
    OPTION_REG.7=0        'Enable pull-ups
    WPUA.0=1              'pull-up current on sw
    
    
    Declare Hserial_Baud=9600
    Declare Hserial_SPBRG=25
    RCSTA=%10010000
    TXSTA=%00100000
    BAUDCON=%01000000   'output inverted -use FTDI dongle
    Declare Hserial_Clear=On
    
    
    Symbol led=PORTA.1   'active high rled
    Symbol sw=PORTA.0    'active low switch   
    Dim comma As Byte    'For counting commas
    Dim kph As Byte      'kph data 
    Dim addr As Byte     'EEPROM address variable
    
    
            DelayMS 500               'Settling time
            addr=1
            If sw=0 Then GoTo pback   'If switch pressed play back data via serial port
    begin:  DelayMS 200               'Loop delay time
            HRSIn Wait ("VTG,")       'Wait for VTG sentence
            For comma=1 To 6          'Step out 6 fields
              While HRSIn<>",": Wend
            Next comma
            HRSIn Dec kph             'take next data field as kph
            
            If kph<5 Then GoTo begin  'If speed less than 5kph skip to start
            If addr<255 Then          'If greater than 5kph then...
              EWrite addr, [kph]      'Write to addr
              Inc addr                'Increase addr
            EndIf
            If addr=255 Then 
              led=1    'Check if finished
              Stop
            EndIf
            GoTo begin  
            
    pback:  While sw=0:Wend             'wait for switch to open
            For addr=1 To 255
              kph=ERead addr 
              HRSOut Dec kph,13,10     '9600 via FTDI. kph
              DelayMS 10
              EWrite addr, [0]         'rewrite value to 0
              DelayMS 10
            Next addr
            HRSOut "End of data"
    
    
    End
    I used a tiny tact switch to hold down when powering up to get in to the playback mode.
    Power is supplied off a single cell of the balance connector on the flight battery. (4.2V) Data output is TTL and fed to the PC via a FTDI adapter however it could be fed directly by changing the registers in the tx out to invert the data signal which the 12F1840 offers.
    Any questions - just ask me.

    Regards,
    David
    Attached Images Attached Images

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,410
    Thumbs Up
    Received: 96
    Given: 24
    Total Downloaded
    4.38 GB

    1 Not allowed!

    Default Re: GPS speed logger for RC planes.

    David,

    I used this device because of the omni direction antenna. Sparkfun used to have those antennas. They are essential for flight because the GPS can be positioned in any direction.

    I looked for the antennas to have a cheaper solution.
    Regards

    Joseph

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Junior Member david's Avatar
    Join Date
    Jan 2019
    Posts
    32
    Thumbs Up
    Received: 3
    Given: 1
    Total Downloaded
    91.44 MB

    0 Not allowed!

    Default Re: GPS speed logger for RC planes.

    Quote Originally Posted by joesaliba View Post
    David,

    I used this device because of the omni direction antenna. Sparkfun used to have those antennas. They are essential for flight because the GPS can be positioned in any direction.

    I looked for the antennas to have a cheaper solution.
    Hi,
    Looking a the pick up pattern for that antenna it's very similar to a dielectric patch on a modest groundplane and it's also lower gain. It won't see much below its own horizon so if mounted on the side you would have low gain from the underside of the helix. The higher the dielectric of the base material the smaller size and also the lower the gain. Now an air dielectric QFH would be impressive. That's a stiff price for something that could be trashed in an instance.
    Actually if you visit the RC forums you will often find pictures of flying wings and other craft where the owners have unwittingly mounted the patch antennas upside down and have not noticed. Obviously there's enough signal coming in from the back of the patch to navigate with.

    Cheers,
    David

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,410
    Thumbs Up
    Received: 96
    Given: 24
    Total Downloaded
    4.38 GB

    0 Not allowed!

    Default Re: GPS speed logger for RC planes.

    Quote Originally Posted by david View Post
    Actually if you visit the RC forums you will often find pictures of flying wings and other craft where the owners have unwittingly mounted the patch antennas upside down and have not noticed. Obviously there's enough signal coming in from the back of the patch to navigate with.
    Good to know. I will buy a cheap GPS with a patch antenna and make some tests.
    Regards

    Joseph

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,163
    Thumbs Up
    Received: 360
    Given: 130
    Total Downloaded
    1.53 GB

    0 Not allowed!

    Default Re: GPS speed logger for RC planes.

    That's an excellent use of the Hrsin command David. Within a While Loop looking for the values between commas. :-)

    That's what I've always said about the compiler. It has a myriad of permutations that the syntax checker or underlying code cannot always follow because I had never thought of that way of using it. The way the compiler is designed, it does not follow a 100% rigid syntax, otherwise it would simply be "yet another" procedure language with no commands of its own that make it unique and easy to use.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,632
    Thumbs Up
    Received: 118
    Given: 31
    Total Downloaded
    3.15 GB

    0 Not allowed!

    Default Re: GPS speed logger for RC planes.

    G'day David,
    Hope it's OK with you. I promoted the post as an article in the Wiki. See Example Code/GPS
    It's too good to get lost in the forum.
    Cheers
    John

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Junior Member david's Avatar
    Join Date
    Jan 2019
    Posts
    32
    Thumbs Up
    Received: 3
    Given: 1
    Total Downloaded
    91.44 MB

    0 Not allowed!

    Default Re: GPS speed logger for RC planes.

    Thanks guys.
    It was a fairly quick and dirty lash up and I hadn't been doing code for some time. I love the way you can target a single piece of data in a GPS sentence without recording a whole string. Even an old hobbyist like me can look like a power coder when given good tools to work with. There are many times I marvel at the simplicity and elegance of Proton - thanks for a brilliant product Les.
    No problem John - I guess someone may want to build one to help their bragging.

    Best regards,
    David

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Gps Data Logger
    By ohararp in forum SWright's Feedback Forum
    Replies: 30
    Last Post: 2nd September 2014, 15:42
  2. GPS speed
    By RGV250 in forum GPS
    Replies: 5
    Last Post: 9th November 2008, 23:49
  3. High Speed Data Logger
    By Sterling101 in forum SWright's Feedback Forum
    Replies: 7
    Last Post: 13th January 2008, 17:40
  4. SD GPS DATA LOGGER - Sleep but does not Wake
    By ohararp in forum Proton Plus Compiler v3
    Replies: 10
    Last Post: 14th March 2007, 21:45
  5. SD GPS DATA LOGGER - Sleep but does not Wake
    By ohararp in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 18th November 2006, 01:39

Members who have read this thread since 10th March 2019, 18:09 : 1

Actions :  (Set Date)  (Clear Date)

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts