What you want to avoid is ground loops
Although this applies to audio it is the same regardless
https://www.google.co.uk/amp/s/www.soun ... loop%3fampIn simple terms... You have too many earth connections.... Yes it is possible to have too many earth's.
So your CNC machine is grounded / earthed.
Your controller box is grounded / earthed
Your pc is grounded / earthed..
Then you wire everything in multi core or screened cable and join all the cable shielding to the equipment chassis
... You have now created a ground loop system.... In theory it's all at the same potential.
Until something runs... Moves or works and currents are induced in the cable screening.... Now you have electrical noise...
If you are running usb this is more of an issue because it was never developed for noisy environments... And never for long data transmissions.... (Unlike ethernet and other protocols)
Suggestion.... Get your usb lead..... And bear the cable screening.... Cut the screening , bear it back so there is a gap.. .
Tape over the top of the beared back cable
Now try to run the system.... It should work better.
... Another suggestion....
If you have a voltmeter
Disconnect your usb from pc to uc300
Connect a voltmeter between the pc and the CNC controller / uc300 ground.... Sometimes you'll read a voltage difference... This will be because of the power supplies in the cabinet or pc.... I've seen people connect the zero volt line of the power supply to chassis earth.... I've also seen it in the power supplies.