Debugging a new HobbyCNC/Mach3 Installation

NOTE: As of 1/25/08, this is an early draft of this document. Please submit any corrections or suggestions to the email address at the bottom of the page.

I've written this in response to what I perceive as a common problem among new users of the HobbyCNC controller board with Mach3 CNC software. Although, in my opinion, this combination of hardware/software makes one of most appealing CNC configurations for the hobbyist/small shop, it should not be viewed as an endorsement of either product. The procedures outlined here are drawn from the experience of the writer and are not intended as a comprehensive procedure for debugging all problems with either the HobbyCNC controller and/or Mach3.

Although the HobbyCNC board and kits are well designed and include detailed instructions, construction of the board and system requires a certain level of expertise in, and understanding of, electronics. A complete system, including the AC power supply, contains dangerous voltages which can cause severe injury and even death. Extreme care and attention to detail is required for a successful completion of the project. The instructions contained on this web site are intended to be guidelines for debugging the HobbyCNC/Mach3 installation and the writer assumes no responsibility for any damage or injury which my arise from their use.

The stern warning of the previous paragraph is not intended to discourage the entry level participant from constructing a CNC system based on the HobbyCNC controller. Many "newbies" have successfully constructed systems based on the HobbyCNC controller. If you are lacking soldering skills, stop by your local electronics store (i.e.: Radio Shack) and pickup a prototyping board and some wire (22 gauge works well). Pre-tinned wire works best and most closely emulates the environment you will encounter constructing the HobbyCNC controller board. Then practice, practice, practice until you are able to make a clean, well defined, solder joint with the minimum application of heat. Heat is the enemy of electronics and many boards and/or components are damaged by the application of too much heat during the construction process. Since this web page is intended for the debugging of a HobbyCNC/Mach3 installation, further explanation of the soldering and the construction process will be left to others.

An inexpensive MultiMeter is required to complete all steps in this debugging process. You should have one on hand because the construction of a CNC system should never be attempted without one.

The first item to check is the parallel cable between the computer and the controller board. If you purchased the cable as a part of a kit from Dave (HobbyCNC) or Mike your cable is most definitely the correct cable and this test might be unnecessary. However, if after having completed all the tests on this web page, your system is still not functioning properly, you might return to this section and test ALL of the pins on the cable. Dave and Mike both use nothing but the highest quality components, but there is always the possibility of a defective cable slipping through.

The construction of the HobbyCNC controller system requires a "straight through" parallel cable. That is, pin 1 on one end must be connected to pin 1 on the other end. Pin 2 to pin 2, etc. Be sure you don't have a "LapLink" style cable. (This is the most common style of cable that is not "straight through, but there are others.) These cables look the same (externally) as a "straight through" cable, but some of the pins are swapped between the ends. With your multimeter set to check resistance or continuity, check the connection of the pins by placing one probe on pin 1 of one end of the cable, and the other probe on pin 1 of the other end. The resistance should be less than 1 ohm (actually it should be very close to zero). If pin 1 tests OK, perform the same test on pin 2. If at any point your cable fails the test, you should discard it and obtain a "straight through" cable.  Testing cables can be a bit of a challenge unless you have some extra hands.  A couple of mini-jumper wires make the job much easier.  The jumpers must have clips that are small enough to clip on a single pin on the DB-25 connector. Use the cables to connect the multimeter probes to the cable pins.

The critical pins on the parallel cable are pins 2 through 9. These are the step and direction pins for the X, Y, Z and A axis. These are also the pins that will most likely be connected incorrectly if the cable is not "straight through".

After confirming that your cable is correct, hook up the computer, controller and motors. Be sure to carefully follow the instructions that came with your board or kit.

A quick test to see if all axis are working is to issue some G0 commands on the MDI page of Mach3. The reason for using commands on the MDI page instead of the jogging keys is that the commands on the MDI page do not depend upon the correct assignment of the jogging keys.

First be sure the Reset button is not flashing. If it is, click it once. It should stop flashing. If it doesn't, you cannot go farther until you solve this problem. Look in "Config" + "Ports & Pins" (drop down menus at the top of the Mach3 window) page to see that the EStop entry under the Input Signals tab is set to Port #0 (no port, this causes Mach3 to ignore the Estop signal.) Even though the Estop is assigned to Port #0 it must be Enabled (a green check mark in the Enabled column). After exiting the Ports & Pins window the Reset will be active and you will need to click on the Reset button.

Now click the MDI tab at the top of the Mach3 page. Put your cursor in the "Input" field by clicking in the white area to the right of the "Input" label (in the bottom half of the page).

Enter the following command: "G0 X0.5" followed by the ENTER key. Your table (or gantry) should move 1/2 inch on the X axis (Left to right or right to left on a mill. On a router, the entire gantry should move. For the remainder of these instructions, the term "table" can also refer to the gantry). NOTE, the command is G Zero not G Oh. Only numbers and a decimal point may follow the X. The G and X are not case sensitive so either G or g will work. This is true of all G-Codes.

It should also be noted here that it is not necessary to have the motors mounted on a mill, router or other machine in order to perform most of these tests. You can test the basic control and movement of the motors with the motors un-mounted. However, movement measurement tests and motor tuning cannot be performed "off machine". Again, the term "table" can refer to unmounted motors when testing basic motor movements.

If your table does not move, carefully check the "Config" + "Ports & Pins" setup. Port #1 must be Enabled and set to the proper Port Address. ANY movement of the table indicates that the Port Address is set correctly. If it was not, your table to move at all. If you suspect this setting is incorrect, email me with info on your computer (Brand, operating system, etc.) and I will attempt to help you determine your Port Address.

If it appears the Port address is set correctly and the G0 commands do not cause the table to move, check the "Motor Outputs" tab on the "Config" + "Ports & Pins" menu. The X, Y and Z Axis should all be Enabled (Green Check Mark). (The A axis should also be enabled if you are using 4 stepper motors.) The Step Pin# and Dir Pin# for these axis must be correct. The correct setup for the HobbyCNC board is:
X Dir = pin 3
X Step = pin 2
Y Dir = pin 5
Y Step = pin 4
Z Dir = pin 7
Z Step = pin 6
(A Step = pin 9)
(A Dir = pin 8)

All of these axis must have the "Step Port" and "Dir Port" set to 1.

If your table moves on the G0 X0.5 command issue a G0 X-0.5. Your table should move 1 inch in the opposite direction.

Repeat the test for the Y axis (G0 Y0.5, G0 Y1). Your table should move first 1/2 inch in the Y axis and then 1 inch in the opposite direction.

Now repeat for the Z axis (G0 Z0.5, G0 Z1). You should see similar results, except on the Z axis (the Z axis is the up and down axis).

(Repeat the test for the A axis if you have 4 motors.)

BTW, this test will also show if you have the "Steps per Inch" setting in the "Motor Tuning" setup correctly. If you table does not move the distances indicated, you most likely have the "Steps per" value set incorrectly. If you need help with this, email me.

Passing this test does not mean that your Motor Tuning is "fine tuned". You will need to set the Velocity and Acceleration for each motor by experimentation.

If your motors pass all these tests, click the Program Run tab in Mach3. Be sure the "Jog ON/OFF" button is enabled (green border). Press the right or left arrow key on your keyboard. Use the keys on the main portion of the keyboard, not the numeric keypad. Your table should move one direction in the X axis when the right arrow is pressed and the opposite direction when the left arrow is pressed (actual directions are not important at this time, just that the table moves, and in opposite directions).

Repeat these tests with the up and down arrow keys (Y axis) and the PageUp and PageDown keys (Z axis). You should see similar results on the respective axis.

If your machine fails any of these tests, you most likely have a problem on the "Config" + "System HotKeys" menu.

To set the scan codes for the hotkeys, follow this procedure:

In the "Config" + "System Hot Keys" menu click on the "X++" button (the button, not the data entry area). A popup window should appear with the command to "Press any Key" displayed. Press either the right or the left arrow key. The scan code for the key pressed should be displayed in the "ScanCode" column. Repeat this for the X-- button, this time pressing the other right/left arrow key.

Repeat this procedure for the Y++, Y-- (up and down arrow keys), Z++ and Z-- (Page up and Page Down keys) keys.

After clicking the OK button on this setup window, repeat the jog tests. If your table does not move correctly now, other potential problems will need to be examined. These issues are not addressed on this web page.

If your machine passes these tests, you will still need to complete the Motor Tuning and the Ports and Pins setup to get optimum motor performance and the proper direction movement. I hope to have another page on this procedure at some future date.

One last item. If on any of the motor movement tests, your motors seem to rattle or hum without moving, or move erratically, your motor tuning is probably set too aggressive. Try setting the Velocity to 5 and the Acceleration to 1 for each axis. Be sure to click the "Save Axis Settings" for each axis BEFORE moving to the next axis. These are very slow speeds, but should be sufficient for initial testing.

At this point, if all tests have been completed successfully, you are ready to set the Steps per Inch, Direction and Motor Tuning parameters.

Email: netboss at mypage dot net

  Privacy Policy Feel free to link, please don't rip.