Suppressing parallel port from modern computers and transition to external motion controllers that are used to control CNC machines, has lead to a significant advance in performances and quality of control. USB-MC motion controller performs a large number of functions autonomously within the hardware, offers higher frequency of generated step pulses (up to 250 kHz), more outputs (16), more inputs (14) as well as one analog input and that is notably more in comparison to hardware limited parallel port.
However, just like LPT port, USB standard also has not been originally intended for operation in industrial environment, so careful consideration should be applied when connecting a computer to USB-MC motion controller. Even though USB communication is usually not considered a desirable means of communication in industrial environment, with a little care and respect for basic recommendations that apply to any correctly assembled control system, it is possible to achieve very reliable communication.
USB standard has built-in error detection and correction thus even in presence of some environmental interferences it can function correctly (with somewhat reduced data flow rate). Nevertheless, in presence of more severe interferences even complete loss of communication is possible.
In text below some precautionary measures will be described that are necessary to take in order to avoid Mach3 control software displaying the message: ERROR! Connection closed! (Figure 1).
Figure 1 ERROR! Connection closed!
Described problem of losing connection with USB-MC motion controller can arise as a consequence of one or more combined causes. Follow up offers description of possible causes of connection loss, as well as recommendations for minimization of these causes.
1. Low quality of USB cable
Usage of high quality USB cables is recommended, preferably shielded and with ferrite chokes (cores) (Figure 2). For connection of USB-MC motion controller to a computer it is recommended to use USB cable as short as possible, as a rule not longer than 2-3 m.
Figure 2 USB cable with ferrite chokes (cores)
If USB cable does not have built-in ferrite chokes, then those can be added subsequently. The appearance of mountable snap-on ferrite chokes that can be used for this purpose is shown on Figure 3, and possible supplier is given on this link. It is recommended to use two ferrite chokes, one near each connector.
Figure 3 Ferrite choke (core)
Inadequate cable can also have insufficient cross section area of power supply conductors which manifests as a voltage drop. That voltage drop can have negative influence on USB-MC motion controller operation.
2. USB habs usage
Insufficient number of USB ports is a frequent case when using laptop computers. Then usually an USB hub is used to increase a number of available USB ports. It is highly recommended to connect USB-MC controller directly to a computer USB port (without intermediary).
3. Power supply for USB-MC motion controller
USB-MC motion controller can be powered in two ways: from USB port and from external (additional) power supply. For proper operation USB-MC controller needs 150-250 mA depending on peripherals connected to the controller.
If USB-MC controller is powered from PC USB port it is possible to encounter a limitation of current that this port can provide. When a laptop computer runs on its battery supply, a power saving mode may be active and that often implies limitation off current consumption of USB ports.
In all mentioned situations it is necessary to provide external (additional) power supply for USB-MC motion controller.
4. Improperly implemented grounding
Practically it may happen that CNC machine that uses USB-MC motion controller is connected to one wall outlet, and a computer that is connected to the controller is connected to another wall outlet. In this case ground potentials of the computer and machine are equalized over USB cable that connects USB-MC motion controller and computer.
In some cases described shortcoming can lead to damage of USB-MC motion controller or computer.
This problem can be avoided by implementing proper ground wiring or by using USB isolation module (Figure 4) that can be found on this link.
Figure 4 USB-ISO USB isolation module
It should be mentioned that USB isolation modules usually provide somewhat lower supply current than a standard USB port. It is necessary to study in detail the product documentation that is provided by the module manufacturer. It is recommended in this case to use external power supply for USB-MC motion controller.
5. Interferences from electromagnetic radiation or power lines in direct proximity
For any electronic control system thus also for a system based on USB connection, it is necessary to ensure that modules and lines that generate high electromagnetic radiation be adequately isolated. For example, cable that is used for powering spindle motor when in operation caries high current and voltage and as a potentially high interference generator should be shielded (and shield grounded).
It is necessary to follow recommendations of equipment manufacturer (for variable frequency drives and other) about using input and output noise filters.
Also, it is recommended to keep long signal lines away from power lines and other potential sources of electromagnetic interferences (electromagnetic contactors or similar).
6. Active background process
When operating USB-MC motion controller requires continuous connection with PC computer in order to maintain correct and timely commands sending and status reading. If a hold-up in communication longer than 500 ms appears, for preventive reasons both sides (PC computer and USB-MC motion controller) detect this as interruption of connection so USB-MC controller then enters so called SAFE mode.
Computers run multiple processes continuously; there are always many currently active or temporarily inactive programs. There is a possibility for some processes (like antivirus, screen saver or similar) to begin its work and momentarily apply a big load thus freezing computer and disabling normal operation of Mach3 software.
CPU load is much less when working with external controllers then when using LPT driver, but still it is recommended to turn off all unnecessary background programs.
7. Power saving options active
If interruption of communication happens always after a long period of user inactivity, it may be that some power saving option is the culprit. For example, the computer may have been setup to turn off power for USB ports after some period of inactivity. In such a case power saving options should be turned off.
8. Mechanical damage and dirt
Make sure that USB cable and its connectors, as well as connectors located on USB-MC controller are not physically damaged (twisted, distorted, with enlarged gap, contact loss when touching etc.). Also make sure that no dirt (dust, oil, grease etc) has entered inside USB connector.
9. What next?
If all mentioned above is found to be correct and the problem still persists, then following procedure can be tried. Disconnect everything that is connected to the USB-MC controller (leaving only USB connection to PC) and then reconnect peripherals one at a time (motor drivers, limit switches, spindle motor etc.) and test. This way it can be found if some of connected devices when operating causes problems and connection interruption between USB-MC motion controller and computer.
Previous experience from our customers shows that, if proper conditions are provided, USB communication can work reliably even in difficult industrial environment.
Audioms Automatika doo Support team