Way OT!!!
Issuing new velocity commands on-the-fly is not a problem.
Thank you, that is what I was looking for.
The spacecraft has already launched; I was mainly curious about how these things are controlled.
TL;DR
I don't under[stand] the problem.
It takes a while; on the last mission I think that maybe a handful on the team fully understood it, although a lot more had a rough idea. Even the one person who first thought that something was amiss in the original planned approach only got there by intuition, and it took her over a year of asking questions trying to understand it before someone finally said "oh."
The instruments in question use an observation technique called TDI (Time Delay and Integration), which means they need to have whatever target is in the field of view (FOV) scan across that FOV at a constant angular rate, and the only way to control that is to control the angle Theta of the instrument boresight.
Theta is the inertial angle that represents vector of the scanning boresight over time relative to an inertial reference frame i.e. to the stars, in the plane of the trajectory of the spacecraft and the target. The angular velocity dTheta/dt needs to compensate for any rotational velocity of the spacecraft and the instrument pointing platform, but that is the easy part.
The spacecraft only has best estimate (model) of where the target is, plus uncertainties. The spacecraft trajectory (velocity vector, a.k.a. along-track) is essentially a straight line. Looking from behind the spacecraft, the cross-track uncertainties are small, but the uncertainty is much higher along-track, because that is based on parallax i.e. cotangent of a very small angle.
So the instruments need to scan through positions significantly uptrack and downtrack from the nominal estimate to ensure capture of the target e.g. 3σ+ (it would not be good to say "we spent all this money but missed the target because of measurement uncertainties.").
The solution currently in place is to calculate the angular velocity of the spacecraft-target vector in inertial space, using the
nominal target position, and set the scan to move at a constant rate relative to that vector. That works fine when the scan is indeed pointing
at that nominal position, but for scanning off-nominal positions where the target may be, it would yield degraded TDI data.
It turns out that the nominal estimated position of the target is a distraction from the actual solution to this puzzle.
As can be seen from the derivation of equation [3] in that Github repo readme, the correct angular velocity at any scan orientation is independent of the along-track nominal target position, and dependent instead on only (i) the angle theta itself, (ii) the along-track velocity of the spacecraft relative to the target, and (iii) the nominal flyby distance at closest approach. Item (ii) has a small uncertainty by orbital mechanics, and item (iii) has a small uncertainty as it is a cross-track value. Item (i) is measured by the on-board attitude determination system (star trackers) and also has small uncertainties.
Hey, I said OT and TL;DR, so if you read this far, you have only yourself to blame
.