LinuxCNC Spindle Setup, Axis Config, 'Home-All' Correction

All types of topics and discussions can be found here.

LinuxCNC Spindle Setup, Axis Config, 'Home-All' Correction

Postby CptMal » Mon Feb 02, 2015 5:34 pm

I recently got my F8 12x12 with the ZenTW Mach3 breakout board up and running with LinuxCNC after facing a few problems with the spindle and 'home all'. This post specifically deals with the spindle setup, axis configuration for zeroing properly, and modification of the 'home all' function. If you're not careful with the axis configuration your physical direction of travel could differ from the virtual, you might also just be zeroing on the opposite side. When using the default 'home all' order the Z-Axis is zeroed before the X-Axis gantry. The vibrations of the gantry movement can cause the spindle to trip the limit switch when it's not supposed to which yields 'error on limit 2' and stops the homing sequence. I'm posting this with the intention of clearing up any remaining questions regarding the LinuxCNC setup with the Mach3 breakout board. This should only be used in supplement to guides already out there. Ralph Hinkley's guide ( which is also available through the wiki and forums is great for the initial setup without the spindle, very comprehensive and thorough. I am currently running LinuxCNC v2.6.5 available as live install via the LinuxCNC site (

Spindle Setup in the StepConf Wizard
One issue with the Mach3 Breakout Board is that if the spindle relay is used in PWM mode for rapid switching, which is the LinuxCNC default configuration, it overloads the spindle's PSU. I only found one forum post referencing this problem ( and I can confirm this problem. Although you'll be able to modulate the spindle speed without a problem in this mode, that success is short lived. For spindle speed control you can use the ZenTW Variable Speed Control Package ( or a VFD (Variable Frequency Drive).

The setup in the StepConf Wizard is very simple. Set pin 16 to 'Spindle ON' and pins 14, 15, & 17 to 'Unused'.

Parallel Port1 Configuration (note: I did not invert my X-Axis and I inverted my Z-Axis because I want zero to be the back-left corner of the work table, top-right if you're facing the machine, with the spindle all the way up)

  • Pin 14: Unused
  • Pin 15: Unused
  • Pin 16: Spindle ON
  • Pin 17: Unused

Axis Configuration
The following configuration only works if your 'Parallel Port1' configuration is the same as shown above with only the Y and Z Axes inverted. This setup makes zero to the back-left (top-right if facing the machine) of the table with the spindle all the way up. When running through different setups I found this to work the best with the default virtualization scheme. When I want to lower my spindle I move it in the negative direction because the top is zero. When the table is all the way out, away from back end of the machine, this is zero. Moving the table back in is positive motion. Moving the spindle assembly along the X-Axis gantry away from the stepper, from left to right (from right to left when facing the machine) is positive motion.

The 'Table travel' is recommended in approximate numbers that deliberately over-estimate, however these values need to be measured manually after the configuration is complete. Manually jog the axes until they hit their extreme limits after they've been zeroed, you will see a display of the precise limit location. If you set your initial 'Table travel' limits lower than the recommended then you may not be able to reach your limit switches because of a 'soft limit' boundary. The 'Home Latch direction' parameter is set to 'Opposite', 'Home location' and 'Home Switch location' are set to 0 for each axis.

X-Axis referred to as 'Axis X' is not inverted as it is in Ralph Hinkley's guide (double check your 'Parallel Port1' configuration before modifying these parameters).

X-Axis Configuration, use recommended 'Table travel' values below

  • Table travel: 0 to ~360
  • Home Search velocity: -1.5

Y-Axis referred to as 'Axis Y' is inverted.

Y-Axis Configuration, use recommended 'Table travel' values below

  • Table travel: 0 to ~330
  • Home Search velocity: -1.5

Z-Axis referred to as 'Axis Z' is inverted. Note that the 'Table travel' goes from a negative value to a positive value. Also the 'Home Search velocity' is set to positive 1.5 unlike the other axes.

Z-Axis Configuration, use recommended 'Table travel' values below (note: the value range is inverted as is the velocity direction)

  • Table travel: ~ -60 to 0
  • Home Search velocity: 1.5

Home All Sequence Modification
As mentioned previously the default homing sequence order can cause errors on the Z-Axis limits due to vibrations caused by the motion of the X-Axis gantry. In order to modify the default sequence so that the Z-Axis is zeroed last instead of first you need to modify the '.ini' file of your configuration. This correction can only be made after you have created a setup in the StepConf Wizard. Because this deals with filenames you need to replace <your-mill> with the name of your configuration that you created with the StepConf Wizard. In order for this to be applicable you need to to have home inputs defined (see Pins 11-13 of Parallel Port1 Configuration) if you did not define 'home' inputs you will not see all of the options in the '.ini' file. These steps can be replicated in other Linux distros that run LinuxCNC, any text-editing program can be used.

On your desktop, a shortcut folder and LinuxCNC launcher should have been made for <your-mill>

Desktop View

Open the shortcut folder <your-mill> and find the <your-mill>.ini file

File Manager View of <your-mill>

Right-Click <your-mill>.ini and select 'Open With Mousepad', if you are using a different Linux distro (Ubuntu etc.) gedit or any other text-editor can be used here.

Right-Click Options, select 'Open With Mousepad' (note: you can use any text-editor)

Once in 'Mousepad' (or your preferred text-editor), scroll all the way down until you see '[AXIS_0]', this is where the configuration of the axes begins. Instead of using X, Y, Z as a naming scheme in this configuration, LinuxCNC uses 0, 1, 2 correspondingly. The default configuration of the 'HOME_SEQUENCE' parameter for the axes is as follows:

Below is an example of my modified configuration for [AXIS_0]
Modified 'HOME_SEQUENCE' parameter of [AXIS_0]

My modified configuration of the 'HOME_SEQUENCE' parameter for the axes is as follows:

Save the changes and start <your-mill> as usual, check that the changes have taken effect by trying 'home all'. I'v noticed that every time I modify the '.stepconf' file of my mill in the StepConf Wizard, my 'HOME_SEQUENCE' parameters are reset to their default.

I hope this helps!
Any questions/comments are appreciated.
User avatar
New User
Posts: 1
Joined: Mon Feb 02, 2015 11:16 am
Zen Model: Zen 1212

Return to General Discussions