short version (TL;DR):
I'm receiving x(t) waypoints "online", which I must travel through at the specified times. I need an algorithm that would plan a smooth trajectory in-between them without knowing the whole trajectory in advance.
I have a 1D motion control problem. I control a DOF of a robot, and a primary design goal is for the motion to be very smooth.
A high-level controller (computer) sends my low-level motion controller a waypoint, expressed as an (xi, ti) pair, every N msec. I am running my control loop at a much higher rate, say every 1 msec.
Because of various constraints, I am not able to get the whole trajectory in advance - I am getting new waypoints as the robot is moving through previous waypoints. I am, however, able to receive a few waypoints in advance (say 3 or 4) so I have a short buffer (look-ahead) and not limited to working strictly with the next waypoint only.
I need an algorithm that would build a smooth trajectory in between these waypoints. 'Smooth' here means continuous velocity and continuous acceleration (which also implies bounded jerk).
I have tried to implement a cubic spline interpolation scheme, since it appears to be exactly what my problem requires: a piecewise function of 3rd degree polynomials, which are guaranteed to have continuous first and second derivatives everywhere, including at the 'stitches'. However, all the implementations I saw generate the spline based on all the data points, which unlike my case, are usually known in advance. My attempts to implement incremental spline generation have failed, and I'm starting to figure this is not a technical error but a mathematical impossibility. If you ask, I'll edit and try to formally explain why I think so, but this question is already quite long as it is.
So, for concrete questions:
Do you know if it's possible to build a cubic spline this way, incrementally, and keep its 1st and 2nd derivatives smooth?
If, as I suspect, it's impossible: What other algorithm would you suggest, that will build the trajectory incrementally, pass through all the waypoints at the specified times, while keeping everything smooth up to the 2nd derivative? Alternatively, have I defined a problem with no solution and I must relax some of the requirements?