Robin2:
Maybe you know exactly how to do this and you are just not telling us. But I have a sneaking suspicion that you don't.
What "other parameters" can another Arduino monitor that can usefully be compared with a pulse count?
If you can detect the pulses as they are sent to the motor and also detect the pulses from an encoder a simple AND logic gate (cost less than £1) could be used to detect a disparity between them - assuming, of course, that the number of step pulses per revolution is the same as the number of steps produced by the encoder. Even if there is a simple multiple between motor and encoder steps you could use logic gates to compare things and trip an alarm or shut-down. You won't have a pulse rate that causes problems for the speed of logic gates.
...R
It's not quite that simple. The CNC controller is issuing step/dir pulses to drive the stepper motor. Presumably his "feedback" is coming from an encoder on the motor, or perhaps a linear scale on the machine axis. These two will almost certainly have different resolutions. Then you have to account for the non-linearities in the stepper positioning, especially if it's micro-stepping (which it almost certainly is on a CNC machine). Then there is the allowance for following error, due to inertia, load, etc.
This is basically a solution in search of a problem. Everyone buys into the myth that stepper motors WILL always lose steps, which is simply wrong. If a stepper system is losing steps, it is because it was not properly designed for the load, period. Then they buy into the myth that servos will never lose steps, because they have encoders for feedback, so if you put an encoder on a stepper, you can get servo performance. What they miss is the fact that servos have lots of reserve torque, so they can react to following error by increasing their torque output. Steppers, OTOH, run at max torque all the time. Once you get unacceptable following error, you're toast. There is nothing you can do to recover, other than slow down the trajectory, which low-end CNC controller software (like Mach3, etc.) cannot do. Thinking stopping the process when unacceptable following error is detected is naive, because by that point, the part is already scrap, as the tool is already off-position.
This topic comes up constantly on CNC forums, and it's a waste of time and effort. Design the stepper system properly, operate it within its capability, and you will never lose position. Anything else is a band-aid that does not address the root cause of the problem.
Regards,
Ray L.