Possible wrong time correction factor on navigation solution
Someone asked me why FGI-GSRx gave wrong position for a IF capture from a receiver flying on an low Earth orbit satellite. The error between FGI-GSRx and our onboard GPS receiver seems familiar, this looks like wrong sign on the time correction. I've seen this before on https://github.com/JuliaGNSS/PositionVelocityTime.jl/issues/8
If we go with the navigation problem according to Kaplan and Hegarty:
If I read these code correctly: https://github.com/nlsfi/FGI-GSRx/blob/1ce27caf3e1e16f0ce6d253e56047997881b8c7b/lse/calcPosLSE.m#L117 https://github.com/nlsfi/FGI-GSRx/blob/1ce27caf3e1e16f0ce6d253e56047997881b8c7b/lse/calcPosLSE.m#L126
DeltaPos(4:end) corresponds to -c*Δtu in the navigation problem.
The navigation solution timestamp is then corrected in https://github.com/nlsfi/FGI-GSRx/blob/1ce27caf3e1e16f0ce6d253e56047997881b8c7b/nav/updateReceiverTime.m#L41
But this means that pos.dt will have the wrong sign, because we're currently dividing it by +c instead of -c.
It will then apply the time correction to the wrong way, so we will have correct solution but at wrong time.
At static scenario this won't do anything, but at low Earth orbit speed, which is around 6 km/s, a 100ms error translates to 600m error in position
Can you please confirm the speed of light sign?
Hey,
I can confirm that there is an error here. The clock bias (if we define it as receiver time minus system time) ends up having the correct sign but then the corrected receiver TOW is incorrect since the bias is added and not subtracted.
The fix to get the receiver TOW to be correct is to simply change the sign in the correction step:
Time.receiverTow(signalNr) = obs.(signal).receiverTow + Pos.dt(signalNr); -> Time.receiverTow(signalNr) = obs.(signal).receiverTow - Pos.dt(signalNr);
The way I read the section in Kaplan & Hegarty, DeltaPos(4:end) in FGI-GSRx actually corresponds to c*Δtu. Its the correction step that should be changed to get the correct receiver TOW included in the solution.
Best regards, Into