Hi,
your proposal sounds simple but it is in fact not so easy at all.
Lets say you have a Gcode move be it from a Gcode program or MDI, Machs trajectory planner will issue PVT (Position, Velocity over Time)
data in 1ms slices. This numeric data will be put in the buffer to be 'consumed' by the motion controller at the rate of one data set per millisecond.
Typically the buffer in Mach4 is around 200ms. The default setting with the ESS for instance is 180ms.
Lets assume for the purposes of this discussion that the buffer has 100 data sets or 100ms worth of moves stored up. At that instant your input 'a'
changes state and now you wish to change the trajectory of the machine. If you abort the trajectory data within the buffer then Mach has lost reference,
a bad outcome. That would be like an Estop. Even assuming that you could abort the pre-existing data sets there would be a time when the motion
controller had no fresh data sets to consume so it would be stationary which rather violates your intention that the y axis progress smoothly
while there may be a variation in the z axis.
The type of motion you want is actually very similar to THC used on plasma tables. A plasma table has typically a succession of 2D moves
in X and Y as it traces out the shape of the part but the Z axis will go up a bit or down a bit to maintain a near constant arc voltage. This has
to be achieved WITHOUT affecting the smooth motion of X and Y and must not cause Mach to loose reference.
THC has, until recently at least, been enacted by the motion controller as the motion controller works in realtime whereas Mach does not.
Even then only two Mach4 ready motion controllers have that feature, the Hicon Integra and the ESS. More recently NFS have released
a scripted version of THC which does not require realtime support on the behalf of the motion controller. It is very much slower to respond
but is none the less adequate for a good many plasma tables.
May I suggest you look closely at the THC feature of Mach4 to determine whether you might adapt it to your sanding machine.
The only other option that I can think of, dare I say it, is LinuxCNC. LinuxCNC is a realtime computing system and does not have a buffer
as Mach does. This results from the fact that LinuxCNC runs on a realtime capable version of Linux. Windows PC's are not realtime capable,
at least in any practical sense, and thus ALL Windows CNC solutions including Mach, UCCNC, PlanetCNC, WinCNC etc require a buffer.
Craig