GPS Module: Difference between revisions
NickPGSmith (talk | contribs)  | 
				NickPGSmith (talk | contribs)  | 
				||
| (7 intermediate revisions by the same user not shown) | |||
| Line 46: | Line 46: | ||
* Can be configured as a frequency reference: 0.25 Hz - 10 MHz  | * Can be configured as a frequency reference: 0.25 Hz - 10 MHz  | ||
** Output has high frequency accuracy  | ** Output has high frequency accuracy  | ||
** Suffers from jitter except at a few specific frequencies  | ** Suffers from jitter except at a few specific frequencies that divide into internal 48 MHz clock  | ||
* Configure in u-Center [[Media:u-Center Configuration.png|here]]  | * Configure in u-Center [[Media:u-Center Configuration.png|here]]  | ||
* Different frquencies/duty cycles can be configure for GPS synced/not synced  | * Different frquencies/duty cycles can be configure for GPS synced/not synced  | ||
| Line 65: | Line 65: | ||
** Baud Rate : 9600 -> 115200  | ** Baud Rate : 9600 -> 115200  | ||
* TP5 (Timepulse 5)  | * TP5 (Timepulse 5)  | ||
** PPS Settings for no GPS lock (eg use as an "alert" signal:  | ** PPS Settings for no GPS lock (eg use as an "alert" signal):  | ||
*** Frequency : 1   | *** Frequency : 1 Hz  | ||
*** Duty Cycle :   | *** Duty Cycle : 0% (for permanent low output)  | ||
** PPS Settings for GPS Locked:  | ** PPS Settings for GPS Locked:  | ||
*** Frequency Locked : 1 Hz  | *** Frequency Locked : 1 Hz  | ||
*** Duty Locked : 50%  | *** Duty Locked : 50%  | ||
**   | ** Falling Edge on TOS  | ||
** Cable Delay : 50 ns ->   | ** Cable Delay : 50 ns -> 20 ns (This compensates for cable delay between antenna and receiver)  | ||
*** At 0.7c, 1 m <=> 4.8 ns  | |||
View -> Message View:  | View -> Message View:  | ||
| Line 87: | Line 88: | ||
Can be tested with something like (Debug level 4) :  | Can be tested with something like (Debug level 4) :  | ||
  gpsd -N -n -s 9600 -D 4 /dev/ttyS0 /dev/pps0  |   gpsd -N -n -s 9600 -D 4 /dev/ttyS0 /dev/pps0  | ||
Lines showing visible/used satellites:  | |||
 gpsd:PROG: SVINFO: visible=15 used=5 mask={SATELLITE|USED}  | |||
 gpsd:INFO: CORE: PRN   6 az  47.0 el 20.0 ( 0.687248,  0.640869,  0.342020)  | |||
 gpsd:INFO: CORE: PRN  11 az  93.0 el 22.0 ( 0.925913, -0.048525,  0.374607)  | |||
 gpsd:INFO: CORE: PRN  12 az  70.0 el 58.0 ( 0.497961,  0.181243,  0.848048)  | |||
 gpsd:INFO: CORE: PRN  28 az 301.0 el 35.0 (-0.702150,  0.421894,  0.573576)  | |||
 gpsd:INFO: CORE: PRN  32 az 257.0 el 44.0 (-0.700903, -0.161816,  0.694658)  | |||
 gpsd:INFO: CORE: Sats used (5):  | |||
Line showing time in [https://www.epochconverter.com/clock UNIX Epoch]:  | |||
gpsd:PROG: TIMEGPS: time= 1728071281.000150311 mask={TIME}  | |||
Line showing PPS is asserted on control line. Here the control line is asserted with 0.5s delay:   | |||
 gpsd:PROG: PPS:/dev/ttyUSB0 Assert accepted @  1728071281.503229046 offset  0.496770954  | |||
Configuration in /etc/sysconfig/gpsd, which by default enables detection of USB devices via udev events including creation of a PPS device (/dev/pps0):  | Configuration in /etc/sysconfig/gpsd, which by default enables detection of USB devices via udev events including creation of a PPS device (/dev/pps0):  | ||
| Line 101: | Line 117: | ||
  gpsmon  |   gpsmon  | ||
Show raw data:  | |||
  gpscat /dev/ttyS0  |   gpscat -p -s 9600 /dev/ttyS0  | ||
Enable and start gpsd:  | Enable and start gpsd:  | ||
  systemctl enable gpsd  |   systemctl enable gpsd  | ||
  systemctl start gpsd  |   systemctl start gpsd  | ||
By default, gpsd listens on port 2947.  | |||
Monitor with:  | Monitor with:  | ||
| Line 125: | Line 143: | ||
Check PPS signal:  | Check PPS signal:  | ||
  ppstest /dev/pps0  |   # ppstest /dev/pps0  | ||
  ppscheck /dev/ttyS0  |   trying PPS source "/dev/pps0"  | ||
 found PPS source "/dev/pps0"  | |||
 ok, found 1 source(s), now start fetching data...  | |||
 source 0 - assert 1733262552.000005797, sequence: 308579 - clear  1733262552.499996498, sequence: 308580  | |||
 source 0 - assert 1733262553.000004664, sequence: 308580 - clear  1733262552.499996498, sequence: 308580  | |||
 source 0 - assert 1733262553.000004664, sequence: 308580 - clear  1733262553.500003597, sequence: 308581  | |||
 source 0 - assert 1733262554.000004920, sequence: 308581 - clear  1733262553.500003597, sequence: 308581  | |||
 source 0 - assert 1733262554.000004920, sequence: 308581 - clear  1733262554.500000766, sequence: 308582  | |||
 # ppscheck /dev/ttyS0  | |||
 ...  | |||
  KPPS  1733262666.000002906    assert  308693  | |||
  KPPS  1733262665.500002983    clear   308693  | |||
  KPPS  1733262666.499814138    clear   308694  | |||
  KPPS  1733262666.999988850    assert  308694  | |||
ppscheck /dev/ttyS0  | |||
Can set at boot with udev rule (/etc/udev/rules.d/gps.rules):  | Can set at boot with udev rule (/etc/udev/rules.d/gps.rules):  | ||
Latest revision as of 21:53, 3 December 2024
HW-595 Board

- Based on uBlox NEO-6M-0-001
 - Receiver Description
 - 5V operation (3.3 V regulator onboard)
 - UART: 4800 - 230400 bps (9600 bps 8N1 default), TTL levels buffered by 220R resistors
 - U.FL connector supplies 3.3 V to active antenna
 - Crystal Osc, not TCXO
 - PPS LED: Invertion of PPS pin
 - Battery-backed RAM contains config data and clock and speeds first-time-to-fix
 - Data in NMEA 0183 format
 - More background here
 
Board pinouts:
| Pin | Function | Description | 
|---|---|---|
| 1 | PPS | 1 pulse/s, synchronised at rising edge, length 100 ms (by default) | 
| 2 | RXD | UART input | 
| 3 | TXD | UART output | 
| 4 | GND | Ground | 
| 5 | VCC | 3.3 - 5 V | 
PPS:
- Send PPS to UART via CTS to allow GPSD to acurately sync
 - Can be configured as a frequency reference: 0.25 Hz - 10 MHz
- Output has high frequency accuracy
 - Suffers from jitter except at a few specific frequencies that divide into internal 48 MHz clock
 
 - Configure in u-Center here
 - Different frquencies/duty cycles can be configure for GPS synced/not synced
 
Software
U-Center
- U-Center
 - Select COM port and Baud rate
 - Communicates with uBlox with binary UBX Protocol
 
View -> Configuration View; to activate change: Send
- CFG (Configuration)
- Select: Save current configuration
 - Select in Devices: 2-I2C-EEPROM
 
 - PRT (Ports)
- Baud Rate : 9600 -> 115200
 
 - TP5 (Timepulse 5)
- PPS Settings for no GPS lock (eg use as an "alert" signal):
- Frequency : 1 Hz
 - Duty Cycle : 0% (for permanent low output)
 
 - PPS Settings for GPS Locked:
- Frequency Locked : 1 Hz
 - Duty Locked : 50%
 
 - Falling Edge on TOS
 - Cable Delay : 50 ns -> 20 ns (This compensates for cable delay between antenna and receiver)
- At 0.7c, 1 m <=> 4.8 ns
 
 
 - PPS Settings for no GPS lock (eg use as an "alert" signal):
 
View -> Message View:
- Firmware version: UBX -> MON (Monitor) -> VER (Version)
- Currently: 7.03 (45969)
 
 
GPSD
- gpsd
 - Packages: gpsd, gpsd-clients
 
Use of a serial device (eg ttyS0) is prefered over a USB/serial interface (eg ttyUSB0) due to lower latency and PPS availability.
Can be tested with something like (Debug level 4) :
gpsd -N -n -s 9600 -D 4 /dev/ttyS0 /dev/pps0
Lines showing visible/used satellites:
gpsd:PROG: SVINFO: visible=15 used=5 mask={SATELLITE|USED}
gpsd:INFO: CORE: PRN   6 az  47.0 el 20.0 ( 0.687248,  0.640869,  0.342020)
gpsd:INFO: CORE: PRN  11 az  93.0 el 22.0 ( 0.925913, -0.048525,  0.374607)
gpsd:INFO: CORE: PRN  12 az  70.0 el 58.0 ( 0.497961,  0.181243,  0.848048)
gpsd:INFO: CORE: PRN  28 az 301.0 el 35.0 (-0.702150,  0.421894,  0.573576)
gpsd:INFO: CORE: PRN  32 az 257.0 el 44.0 (-0.700903, -0.161816,  0.694658)
gpsd:INFO: CORE: Sats used (5):
Line showing time in UNIX Epoch: gpsd:PROG: TIMEGPS: time= 1728071281.000150311 mask={TIME}
Line showing PPS is asserted on control line. Here the control line is asserted with 0.5s delay:
gpsd:PROG: PPS:/dev/ttyUSB0 Assert accepted @ 1728071281.503229046 offset 0.496770954
Configuration in /etc/sysconfig/gpsd, which by default enables detection of USB devices via udev events including creation of a PPS device (/dev/pps0):
USBAUTO="true"
Options can be forced, eg:
OPTIONS="-n -s 9600" DEVICES="/dev/ttyS0 /dev/pps0"
Check data stream with gpsmon:
gpsmon /dev/ttyS0
when gpsd is not started, or connected to gpsd:
gpsmon
Show raw data:
gpscat -p -s 9600 /dev/ttyS0
Enable and start gpsd:
systemctl enable gpsd systemctl start gpsd
By default, gpsd listens on port 2947.
Monitor with:
cgps -s gpsmon gpscsv gpsplot --image gps.png xgps
Pulse Per Second (PPS)
With PPS output connected to a serial port pin, GPSD should detect it. If it is on GPIO or other serial port, this can be used to create a PPS device:
dnf install pps-tools modprobe pps_ldisc setserial -v /dev/ttyS0 low_latency ldattach PPS /dev/ttyS0
Check PPS signal:
# ppstest /dev/pps0 trying PPS source "/dev/pps0" found PPS source "/dev/pps0" ok, found 1 source(s), now start fetching data... source 0 - assert 1733262552.000005797, sequence: 308579 - clear 1733262552.499996498, sequence: 308580 source 0 - assert 1733262553.000004664, sequence: 308580 - clear 1733262552.499996498, sequence: 308580 source 0 - assert 1733262553.000004664, sequence: 308580 - clear 1733262553.500003597, sequence: 308581 source 0 - assert 1733262554.000004920, sequence: 308581 - clear 1733262553.500003597, sequence: 308581 source 0 - assert 1733262554.000004920, sequence: 308581 - clear 1733262554.500000766, sequence: 308582
# ppscheck /dev/ttyS0 ... KPPS 1733262666.000002906 assert 308693 KPPS 1733262665.500002983 clear 308693 KPPS 1733262666.499814138 clear 308694 KPPS 1733262666.999988850 assert 308694
ppscheck /dev/ttyS0
Can set at boot with udev rule (/etc/udev/rules.d/gps.rules):
KERNEL=="ttyS0", SYMLINK+="gps0" KERNEL=="ttyS0", RUN+="/usr/bin/setserial -v /dev/%k low_latency" KERNEL=="ttyS0", RUN+="/usr/sbin/ldattach PPS /dev/%k"