I've been having a lot of trouble with my Chinese made 6040 CNC machine, which turned out to be mostly due to the VFD for the 800 watt spindle. I'm posting here in case others are using a similar configuration and having similar problems.
I'm using a v7 TinyG as the controller for it, currently running 438.02 firmware.
To begin with I was using CoolTerm to send the g-code files to the TinyG, and fairly frequently the machine would depart from the g-code and head off in some random direction, typically for about 100mm or so before returning a few lines ahead of where it left off. This almost always ruined the workpiece and ran the risk of hard crashing one of the axises.
I switched to tgFX which resolved that particular issue. Every second piece I'd cut or so the machine would freeze and not resume. I'd also get much smaller departures from the g-code. This all got much worse when I moved the cnc to a dedicated workbench, which also moved the VFD closer, and it got to the point where I was having to restart jobs 4 or 5 times to get them cut.
To cut a long and very frustrating story short I identified the culprit after I tried a longer usb cable and got continuous disconnects of the tinyg from the computer as soon as I started the VFD.
The fix is to install a EMI filter in the mains power line very close to the VFD, and to add ferrite bead on the VFD output (near the VFD and near the spindle) and a ferrite bead on each of the connections to the stepper motors (as close to the TinyG as possible). I already had an EMI filter on the tinyG and stepper motor power supply, but I'd recommend doing that if you haven't got that.
Once I did this I was able to run 8 separate pieces in the time it was taking me to do 1 previously. No crashes, no weird departures, no new holes in my spoil board or hold down clamps. That was the first time for me to do that many pieces at once.
One issue I have noticed is that if you run a number of jobs one after the other with out resetting the TinyG it will slow down a lot. This normally manifests very noticeably on the third job, but that might be a factor of the g-code I was using for the test. I'll post the g-code file shortly.