My 3040 also develped x-axis missing steps problem. But it only missed steps in one direction. My setup is on LinuxCNC. Tried to slow down the pulse rates but not helping at all. Every single test pin-pointed problem back to the X-Axis driver. The problem seemed getting better when I probed (scope) the TBA6560 pins. So I ordered a replacement TBA6560 but not helpful either. But I am glad that the new chip is genuine.
The next step was to trace the circuit. My controller is a simple one that comes with the CNC. It has all three axis on one board. I have the picture but don't know how to post it..:-(
To make the long story short, I did two things that have fixed the problem so far:
1. Soldered thick wires on board between the X axis driver circuit and both 24V and ground input. There's quite a bit a voltage spikes observed on the TBA6560 driver chip that could increase signal noise and has the potential of damaging the driver.
2. Replaced the "motor current swicthing (between running and idling)" circuit with one I put together using 555 timers as retriggerable one-shot. The original circuit design has two problems I could see. 1) It's sensitive to step pulse width; 2) The control polarity is wrong.
After the changes, my CNC machine can now run a 6 hours job without observable missing step problem. Before that, I could see it would drift to the right for about 1/8 inch on x axis in about 15 minutes. And I could hear the stepper motor "jumping" noise.
Hope this helps.