Shop OBEX P1 Docs P2 Docs Learn Events
Adjusting the GPS speed sensitivity — Parallax Forums

Adjusting the GPS speed sensitivity

SteveWoodroughSteveWoodrough Posts: 190
edited 2013-01-13 19:01 in Accessories
I am using the attached GPS for my Robo Magellan project. Standard Parallax Red GPS module.


https://www.youtube.com/watch?v=M8u0VsNM0II

http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/gps/List/0/SortField/4/ProductID/703/Default.aspx

Right now the bot has to move at a fast walking pace in order to freshly update the position. In some ways this is nice as it acts as a filter but there are disadvantages.


Is there spin code that anyone has written that allows me to change the navigation speed threshold? I've looked over the documentation, and I cannot find such a command, but a lot of times, the forum knows more than what is published.

Thanks,
Steve

Comments

  • shimniokshimniok Posts: 177
    edited 2013-01-09 22:50
    I don't know of any SIRFIII commands to do that. What happens if it's moving slowly, the position never updates? Is it speed or distance related?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-01-09 23:37
    You're probably a victim of "static navigation." See this thread for more info:

    -Phil
  • SteveWoodroughSteveWoodrough Posts: 190
    edited 2013-01-13 17:12
    That sounds like it. Lemme look at how to disable. THANK YOU!!!
  • SteveWoodroughSteveWoodrough Posts: 190
    edited 2013-01-13 19:01
    Phil,
    I looked over your code and have a question or two. How do I modify since my GPS defaults to 9600 baud?

    Among my concern is getting the correct check sum value.

    I looked at this site, but I'm not really sure what I need to input as the message string.

    http://www.hhhh.org/wiml/proj/nmeaxor.html

    Do I need to make changes to the DAT information as well for 9600 baud?


    Thanks
    Steve


    CON
    
      _clkmode      = xtal1 + pll16x
      _xinfreq      = 5_000_000
    
    'SD Card pins:
    
      DO_PIN        = 22
      CLK_PIN       = 23
      DI_PIN        = 24
      nCS_PIN       = 25
    
    'Serial I/O pins:
    
      GPS_IN        = 16
      GPS_OUT       = 17
      PC_IN         = 31
      PC_OUT        = 30
    
    'Write indicator:
    
      LED_PIN       = 26
    
    'Unit ID:
    
      UNIT          = "0"
    
    'ASCII constants:
    
      CR            = 13
      LF            = 10
    
    OBJ
    
      sio   : "FullDuplexSerial"
      gps   : "FullDuplexSerial"
      sd    : "fsrw"
    
    PUB start | ch, i
    
      gps.start(GPS_IN, GPS_OUT, 0, 4800)
      sio.start(PC_IN, PC_OUT, 0, 9600)
      sd.mount_explicit(DO_PIN, CLK_PIN, DI_PIN, nCS_PIN)
      filename[7] := UNIT
      dira[26]~~
    
      waitcnt(cnt + clkfreq)
      gps.str(string("$PSRF100,0,4800,8,1,0*0F", CR, LF))   'Switch to SiRF binary protocol at 4800,8,N,1
       
      'Diable Static Navigation
      
      waitcnt(clkfreq + cnt)
      repeat i from 0 to 9
        gps.tx(DisStatNav[i])
       
      'Switch back To NMEA Protocol Message ID 129, leave only GGA and RMC strings and keep speed at 4800
      
      waitcnt(clkfreq / 2 + cnt)
      repeat i from 0 to 31
        gps.tx(BackToNMEA[i]) 
       
      repeat
        waitstr(string("$GPRMC,"))
        getstr(@time, 10)
        'if (time[5] == "0" or time[5] == "5")
          gps.rx
          if (gps.rx == "A")
            gps.rx
            getstr(@lat, 9)
            waitstr(string("N,"))                           'Change to "S" for southern hemisphere.
            getstr(@lon, 10)
            sio.str(@time)
            outa[26]~~                                      'Turn LED on during write, so it won't be interrupted by flipping off the power.
            sd.popen(@filename, "a")                        'Open the file to append data.
            sd.pwrite(@time, strsize(@time))                'Write the time and position line to the file.
            sd.pclose                                       'Do a close to stat the file.
            outa[26]~                                       'Turn off the LED.
          else
            sio.tx("*")
          
    PUB waitstr(strptr) | ptr, match
    
      ptr := strptr
      repeat while match := byte[ptr++]
        if (gps.rx <> match)
          ptr := strptr
    
    PUB getstr(strptr, len)
    
      repeat len
        byte[strptr++] := gps.rx
    
    DAT
    
    filename      byte      "gpsdata_.txt"
    time          byte      "dddddd.ddd,"
    lat           byte      "ddmm.mmmm,"
    lon           byte      "dddmm.mmmm",13,0
    
    'SiRF Disable Static Navigation, Message ID 143
    
    DisStatNav    byte      $A0,$A2,$00,$02,$8F,$00,$00,$8F,$B0,$B3
    
    'Switch back To NMEA Protocol Message ID 129 at 4800 bauds, leave on GGA and RMC strings updating oce per second.
    
    BackToNMEA    byte      $A0,$A2,$00,$18,$81,$02,$01,$01,$00,$01
                  byte      $00,$01,$00,$01,$01,$01,$00,$01,$00,$01
                  byte      $00,$01,$00,$01,$00,$01,$12,$C0,$01,$61
                  byte      $B0, $B3
    
    
Sign In or Register to comment.