gps模块控制指令(转载)

以前想找没找到的资料

 

使用适当的初始化语句和控制命令,可以使搜星速度大大加快,且可以降低很多功耗。

在设计低功耗仪器的时候会用得到。

对于目前设计的仪器,是步行测量的,移动速度很慢,所以更新时间由1秒改为10秒,就可降低功耗,毕竟使用电池的设备,电力还是很紧张的。若是在高速运动的交通工具上面使用GPS,更新时间0.1秒为宜。

=================================================

$PSRF104复位指令(主机输出):
$PSRF104,<纬度偏移>,<经度偏移>,<高度偏 移>,<时钟补偿>,<GPS秒/周>,<GPS周>,<频道>,<复位选 项>*<校验和><CR><LF>
<纬度偏移> 范围90到-90度,GPS定位准确的默认可为0。
<经度偏移> 范围180到-180度,GPS定位准确的默认可为0。
<高度偏移> GPS定位准确的默认可为0。
<时钟补偿> 为0时则调用上次存储的数据,默认为96000。
<GPS秒/周> 默认为237759。
<GPS周>    这个参数可能用处不是很大,我这里串口**出来的数据为922。
<频道>     GPS所用的频道,范围0到12。默认可为12。
<复位选项> 1=热启动,所有数据均有效        2=暖启动,星历清除      3=暖启动,星历清除并加载初始化数据  
           4=冷启动,清除内存所有的数据    8=清除内存中所有的数据并复位GPS回到出厂状态。
例子:热启动、暖启动、冷启动
$PSRF104,0,0,0,96000,237759,922,12,1*2B<CR><LF>
$PSRF104,0,0,0,96000,237759,922,12,2*28<CR><LF>
$PSRF104,0,0,0,96000,237759,922,12,4*2E<CR><LF>

 

===================================================================================

 

凯立德几秒钟内搜星定位的终极探讨(其他方法可能是错误的)

原作者:coolrunner

有一篇文章“关于凯立德不同版本出现搜星慢和跳星问题”,该文探讨了解决方法,我感觉修改COM4的方法是正确的,但修改96000是错的,因为96000是时间补偿,不是GPS波特率,故该方法只在COM端口错误时有改善,对搜星慢和跳星应该没有明显改善。

我 提供一个最终解决方法,供大家参考(我自己修改后无论是首次启动还是以后每次启动,都可在几乎3秒钟之内定位):用UEDIT以十六进制方式打开 pnavi.dll或者navione.dll(不同凯立德版本打开的程序不同),搜索到$PSRF104(也即前文修改96000的同一位置),你会看 到凯立德启动GPS时所用的指令 “$PSRF104,0,0,0,96000,237759,922,12,4*2E<CR><LF>”,其中4*2E表明首次 启动GPS时用冷启动,但我怀疑可能凯立德每次启动GPS时都是用冷启动,故每次搜星定位速度都很慢,而且还会清除QuickGPS数据,因此,我将冷启 动修改为热启动,即将前述的4*2E修改为1*2B,保存文件。OK!大功告成!

试用一下修改后的凯立德,搜星定位速度超快,几乎都在两三秒钟内(记得在首次启动前更新QUICK GPS数据)。

另 外,我DIY的WM 6.1ROM中调整了一些GPS参数,主要是减小GPS缓冲区大小、POLL间隔改为100毫秒(即每秒10次,此项修改可能更耗电,但的确很有意义,尤 其行车到三岔路口时可及时导航,因为我理解导航软件对GPS数据的处理与GPS硬件接收数据的频率可能不完全同步,因此将POLL间隔设为每秒读一次时理 论上可行,但事实上因数据丢失、CPU速度、软件设计等原因会导致数据滞后)、使用QUICKGPS但不使用AGPS(个人觉得AGPS意义不大)、波特 率改为115200(很多人说此项修改无意义,但感觉上还是有点儿区别,也可能仅仅是感觉,没有科学依据),供大家参考:

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/GPS Intermediate Driver/Multiplexer]
  "MaxBufferSize"=dword:200

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/GPS Intermediate Driver/Drivers]
  "SleepOnNoData"=dword:64
  "OutputBufferSize"=dword:100
  "InputBufferSize"=dword:100

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/GPS Intermediate Driver/Drivers/GPSOneDevice]
  "PollInterval"=dword:64

[HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/explorer]
  "gpsbaud"="115200"

[HKEY_LOCAL_MACHINE/Software/HTC/SUPL AGPS]
  "GPSMode"=dword:0
  "EnableAGPS"=dword:0

此外,我的凯立德的GPS设置为COM4,115200

附件用于凯立德 P0902-T3106-17B1J04版本,其他版本的不要下载,请自行修改。

本方法原理是修改导航软件中的GPS指令,应该可用于灵图等其他导航软件吧。

 

===================================================================================

 

具体资料可参考SIRF公司的《NMEA Reference Manual》资料。

下面摘抄几段,供大家参考:

104—LLANavigationInitialization

This command is used to cause a restart of the receiver, and to specify the type of restart. Optionally, it may also initialize position (in lattitude, longitude, and altitude), clock drift, GPS Time Of Week and GPS Week Number. This enables the receiver to search for the correct satellite signals at the correct signal parameters. Correct initialization parameters enable the receiver to quickly acquire signals.

 

150—OkToSend

This message is sent out during power-saving modes such as TricklePowerTM and Push-to-FixTM to indicate when the receiver is ready to receive messages or when it is going into low-power mode. When power is restored, it is the first message sent, and when power is going to be reduced, it is the last message sent.
Table 1-15 contains the values for the following examples:
1.OkToSend
$PSRF150,1*3F
2.not OkToSend
$PSRF150,0*3E

 

Advanced Power Management (APM) Considerations for SSIII

Advanced Power Management - Message ID 53

Used to implement Advanced Power Management (APM). APM will not engage until
all information is received.
Example:
The following example sets the receiver to operate in APM mode with 0 cycles before
sleep (continuous operation), 20 seconds between fixes, 50% duty cycle, a time
between fixes priority, and no preference for accuracy.
A0A2000C—Start Sequence and Payload Length
3501001400030700000A0100—Payload
005FB0B3—Message Checksum and End Sequence

详见说明书2-3页,

Set TricklePower Parameters - Message ID 151
Table 2-36 contains the input values for the following example:
Sets the receiver into low power modes.
Example: Set receiver into TricklePower at 1 Hz update and 200 ms on-time.
A0A20009—Start Sequence and Payload Length
97000000C8000000C8—Payload
0227B0B3—Message Checksum and End Sequence

详见说明书2-19页,

Push-to-Fix
In this mode the receiver will turn on every cycle period to perform a system update
consisting of an RTC calibration and satellite ephemeris data collection if required
(i.e., a new satellite has become visible) as well as all software tasks to support Snap
Start in the event of an NMI (Non-Maskable Interrupt). Ephemeris collection time in
general takes 18 to 36 seconds. If ephemeris data is not required then the system will
re-calibrate and shut down. In either case, the amount of time the receiver remains off
will be in proportion to how long it stayed on:
Off period = On Period*(1-Duty Cycle)
Duty Cycle
The off period has a possible range between 10 and 7200 seconds. The default is 1800
seconds. Push-to-Fix cycle period is set using message MID 167.

详见说明书2-20页。

Set Low Power Acquisition Parameters - Message ID 167

详见说明书2-23页。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值