Given that pmp is of type struct MotionProfile *, you
should initialize it as follows:
In this example, the function step_func must handle positive
and negative velocities. While pmp->vel.freq represents the
magnitude of velocity, pmp->v_sign represents the
direction. Similarly, the function accel_func must take
into account the sign of acceleration, stored in
pmp->a_sign.
step_func has to handle the sign crossover of pmp->D.
This is easy because pmp->D is a signed number.
accel_func has to handle the sign crossover
of velocity magnitude pmp->vel.freq and velocity direction
pmp->v_sign.