PCB Milling

When using PCB milling one really needs to fully understand the CNC coordinate systems involved. See the LinuxCNC Coordinate Systems documentation for more information.

Build-in leveling made Smoothieware a very powerful tool for PCB milling - no need to recalculate G-codes, just run leveling using G31/G32 and mill.


Grid Leveling “By Two Corners”

Two corners rectangular mode of “rectangular-grid” made leveling even simpler.

You can use any grid position, grid size and number of probing points.

It also allows for changing these parameters on the fly.

Enable it in the configuration with:

leveling-strategy.rectangular-grid.only_by_two_corners        true

Configuration:

leveling-strategy.rectangular-grid.only_by_two_corners true
[cartesian grid leveling strategy]
only_by_two_corners = true

PCB Milling Configuration Examples

When setting up Smoothieware for PCB milling, you’ll need to configure several key parameters for optimal performance.

Basic Motion Settings

V1 Configuration:

# PCB milling specific settings
alpha_steps_per_mm                           80        # Steps per mm for X axis
beta_steps_per_mm                            80        # Steps per mm for Y axis
gamma_steps_per_mm                           800       # Steps per mm for Z axis (higher resolution)

default_feed_rate                            500       # Default rate (mm/minute) for G1/G2/G3 moves
default_seek_rate                            1000      # Default rate (mm/minute) for G0 moves

alpha_max_rate                               6000      # Maximum rate in mm/min
beta_max_rate                                6000
gamma_max_rate                               300       # Slower Z for precision

V2 Configuration:

[actuator.alpha]
steps_per_mm = 80        # Steps per mm for X axis

[actuator.beta]
steps_per_mm = 80        # Steps per mm for Y axis

[actuator.gamma]
steps_per_mm = 800       # Steps per mm for Z axis (higher resolution)

[motion control]
default_feed_rate = 500       # Default rate (mm/minute) for G1/G2/G3 moves
default_seek_rate = 1000      # Default rate (mm/minute) for G0 moves

[actuator.alpha]
max_rate = 6000      # Maximum rate in mm/min

[actuator.beta]
max_rate = 6000

[actuator.gamma]
max_rate = 300       # Slower Z for precision

Z-Probe Configuration

V1 Configuration:

# Z-probe settings for PCB milling
zprobe.enable                                true
zprobe.probe_pin                             1.28!^   # Pin probe is attached to
zprobe.slow_feedrate                         5        # Mm/sec probe feed rate
zprobe.fast_feedrate                         100      # Move feedrate
zprobe.probe_height                          5        # How much above the bed to start probe

# Leveling strategy
leveling-strategy.rectangular-grid.enable    true
leveling-strategy.rectangular-grid.x_size    100      # Grid size in X direction
leveling-strategy.rectangular-grid.y_size    100      # Grid size in Y direction
leveling-strategy.rectangular-grid.grid_x_size 10     # Number of probe points in X
leveling-strategy.rectangular-grid.grid_y_size 10     # Number of probe points in Y
leveling-strategy.rectangular-grid.probe_offsets 0,0,0  # Probe offsets from nozzle/spindle
leveling-strategy.rectangular-grid.save      false    # Don't save grid to memory

V2 Configuration:

[zprobe]
enable = true
probe_pin = 1.28!^   # Pin probe is attached to
slow_feedrate = 5        # Mm/sec probe feed rate
fast_feedrate = 100      # Move feedrate
probe_height = 5        # How much above the bed to start probe

[cartesian grid leveling strategy]
enable = true
x_size = 100      # Grid size in X direction
y_size = 100      # Grid size in Y direction
grid_x_size = 10     # Number of probe points in X
grid_y_size = 10     # Number of probe points in Y
probe_offsets = 0,0,0  # Probe offsets from nozzle/spindle
save = false    # Don't save grid to memory

Acceleration and Jerk Settings

V1 Configuration:

# Acceleration settings for smooth PCB milling
acceleration                                 500       # Acceleration in mm/second/second
junction_deviation                           0.01      # Similar to GRBL's "max_jerk" (lower = slower cornering)

# Per-axis acceleration (optional for finer control)
alpha_acceleration                           500
beta_acceleration                            500
gamma_acceleration                           100       # Lower Z acceleration for precision

V2 Configuration:

[planner]
acceleration = 500       # Acceleration in mm/second/second
junction_deviation = 0.01      # Similar to GRBL's "max_jerk" (lower = slower cornering)

[actuator.alpha]
acceleration = 500

[actuator.beta]
acceleration = 500

[actuator.gamma]
acceleration = 100       # Lower Z acceleration for precision

Spindle Control

V1 Configuration:

# Spindle control for PCB milling
spindle.enable                               true
spindle.type                                 pwm       # PWM spindle control
spindle.max_rpm                              10000     # Maximum spindle RPM
spindle.pwm_pin                              2.5       # PWM output pin
spindle.pwm_period                           1000      # PWM period in microseconds
spindle.feedback_pin                         nc        # No feedback pin
spindle.switch_on_pin                        nc        # No switch on pin

V2 Configuration:

[spindle control]
enable = true
type = pwm       # PWM spindle control
max_rpm = 10000     # Maximum spindle RPM
pwm_pin = 2.5       # PWM output pin
pwm_period = 1000      # PWM period in microseconds
feedback_pin = nc        # No feedback pin
switch_on_pin = nc        # No switch on pin

Before two corners mode, you had to correct machine (0,0) and bed size according to the desired probing grid position and size.

“Two corners” is not an absolutely correct name for this mode, because it uses only one corner and rectangle size. Name from one of CAD.

Important: All positions for probing are in the MCS (Machine Coordinate System) and not in the WCS (Work Coordinate System).

In the latest version, there is a quick way to use two corners mode without enabling it in the configuration.

G32 R1 X0 Y0 A30 B30

The R1 sets a special two corners mode which uses the current position of the head as the start x and y, the X and Y specified in the G32 will be offsets from that and would usually be specified as 0.

NOTE: If there is a probe offset, which is not recommended, then it will move the probe to where we asked it to start from.


Usage

Command Description
G32 Xnn Ynn Ann Bnn Inn Jnn Probes the grid from X, Y (Machine coordinates), with X size = A, Y size = B, with X grid size = I, Y grid size = J. I*J must be <= grid size from configuration. Omitting I or J or both will use grid size from configuration

Example Commands

G32 X0 Y50 A50 B100

Probes the grid from X=0, Y=50, X size = 50, Y size = 100, with grid size from configuration

G32 X0 Y50 A50 B100 I5 J9

Probes the grid from X=0, Y=50, X size = 50, Y size = 100, X grid size = 5, Y grid size = 9

G32 X50 Y0 A100 B50

Probes the grid from X=50, Y=0, X size = 100, Y size = 50, with grid size from configuration

G32 X50 Y0 A100 B50 I9 J5

Probes the grid from X=50, Y=0, X size = 100, Y size = 50, X grid size = 9, Y grid size = 5

Version Note: Older versions of Smoothieware used G31 for probing when the "two corners" mode was enabled. This has now been changed to G32.

Further Reading

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.