Gantry square procedure with PlanetCNC

Many machines use two lead/ball screws or rack and pinion rods per machine axis. In most cases, the Y axis.
Rods can be driven with one motor or two. One motor usually drives both rods using a timing belt, which also helps with

But you can also drive each rod with its separate motor. At PlanetCNC we use the terms Master and Slave motor.
PlanetCNC TNG software takes care of master and slave motor synchronization internally.

Nevertheless, between the two motors, there might be some discrepancy in a sense of gantry squareness. This can be due motor failure, lost steps, mechanical problems etc..

Since CNC machines are meant to ease the pain of accuracy and repeatability of machining process, we as users always strive
for squareness of our CNC machine.

In order to achieve this with dual motor setup, PlanetCNC TNG sw offers Gantry Square feature.

What gantry square feature does,  it “decouples” the master and slave axis motors from their common axis (e.g. Y), and assigns them new axis letters U and V, for the purpose of gantry square procedure. This needs to be done so that system is able to detect limit switches of each motor, as also to separately control each motor in order to  align gantry.


Before you proceed, we recommend that your machine steps per unit and limit switch configuration is set correctly:
Steps per unit tutorial
Limit switch tutorial

1. Setting the motors of Master and Slave axis

Under File/Settings/Motors we set additional (slave) motor of desired axis. In our case, axis output 4 will be used.


2. Settings Limit switches

Configuration of limit switch inputs for master and slave motor. We need to set limit switch inputs under motor U and V.

Motor U will have the same input number as motor Y, while motor V will have input number 4.



3. Gantry square parameters

Here we set the parameters of gantry square procedure.


Speed value at which gantry square procedure will be performed.



Machine axis that will be squared. In our case Y.



Direction of squaring axis motion. It should be the same direction as set for limit switches for U and V.


Move U:

Value of measured misalignment of master axis. This is the distance for which master motor will retract.


Move V:

Value of measured misalignment of master axis. This is the distance for which slave motor will retract.


4. Using the gantry square procedure

Gantry square procedure will consist of two takes.

For first take we will use Move UV values set to zero. So, if any misalignment of limit switches (gantry) exists (and it probably does), we will measure it trough a test. In second take we will use these measured values as Move UV values, and therefore square our gantry.


We start the procedure under : Machine/Measure/Gantry square

Machine will move in direction set under Direction. Once the first limit switch is activated, corresponding motor will stop, second motor will continue to move its side of the gantry until the second limit switch is activated. After activation, second motor also stops.

After first take, mill or engrave a square and measure the discrepancy of the angle. One user recommended the use the 3-4-5 Triangle approach. Trough measurement or calculation, we can obtain the Move UV correctional values and use it with second take.


Image below demonstrates (exaggerated) situation of limit switch misalignment.

-Normal line represents gantry misalignment due to limit switch

-The doted line represents squared gantry.