Sudden raspbery pi power cut or random long delay when running stepper motor using pigpiod
I think you need to stop for a moment, and do some reading about the pigpio library.

One of your last questions involved misusing one of the simplest pigpio methods (pi.stop)

This looks to be much more complicated, and you really need to understand what is going on.  

From a quick look at the documentation and some random examples on the internet, it appears to me that you need to be more careful about when you change or add waves to the queue.  Changing things at the wrong time will cause lost or skipped waves.

In general, your code could be improved.


Get more familiar with how the wave functions work and how (and when) you can change (or add or delete) waves from the queue.
You are generating the waves on every run through the loop.  The parameters to the wave generation don't seem to change, so you are continuously generating the same patterns.  Make them once outside the loop and reuse them.
You seem to be sending the same sequence over and over, and stopping when some external event (pins 16 and 26) happens.  You can set a wave to repeat until you stop it.  that would drastically simplify your code.  Look into "wave_send_repeat" and "WAVE_MODE_REPEAT."
Your pins are unnamed.  If you used a name like "Stop_Button" instead of "26" in your "pi.read" then it would be clearer what you are actually doing.
In general you should assign your constants to variables with good names.  


Doing the repeats in code as you do leaves you open to delays in execution.  Python runs in user space and can be interrupted by pretty much anything.  This can cause delays in starting the next wave.

Pigpio itself runs in kernel space, and can only be interrupted by high priority kernel tasks - it is much likelier to run properly than anything in user space.  The way it is written (using programmed DMA) makes it very likely that even the kernel won't bother it.  This makes it really the best way to do repeats and long sequences.



You are reversing on each repeat.  That was obscured by the lack of good names in your code.

You need to figure out how to ask pigpio when a particular wave is finished.  You send it your wave, wait until it is complete (or cancel it and wait until complete) then send the next command.

If you flip the reverese and the servo is still moving, then you might get voltage spikes on the ground connecting the pi and the servo controller.

The DM860 appears to have optically isolated inputs, so unless you have the grounds tied together you shouldn't be getting any spikes from the DM860  to the pi. 

Are you sharing ground or power between the pi and the motor/motor controller?