Custom button examples for TOP toolbar

PlanetCNC TNG software offers option of creating and adding custom buttons to software toolbars.

Buttons can be added to top, bottom, left sided and right sided toolbars.

Custom buttons can execute any feature from File, View, Program, Machine and Help menu.

For this tutorial we will create and add buttons to top toolbar of PlanetCNC TNG software for features: Settings (File/Settings) and Log dialogue (Help/Log)

 

Step 1.:

Create new text file and name it: PlanetCNC64.btntop

File should be located in PlanetCNC TNG install root folder.

Modifying this file, you create custom buttons located at top toolbar.

Please note: “PlanetCNC64” is name of settings used, if your settings are named differently then this file should have different name.

 

Step 2.:

Open file PlanetCNC64.btntop with your text editor.

Step 2.1.:

To create button for “Settings” insert this line:

File.Settings_… SET

Open File menu and locate Settings feature:

If you look closely at the text of inserted line you can see that it is actually path to location of this feature, with difference that level is replaced with “.” and spaces are replaced with “_”.

To name the newly created custom button, you add desired text at the end of the line(SET). Make sure that one space is added  before you type the name of the button.

 

Step 2.2.:

To create button for “Show Log” insert this line:

Help.Show_Log_… LOG

Open Help menu and locate Show Log feature:

If you look closely at the text of inserted line you can see that it is actually path to location of this feature, with difference that symbol level is replaced with “.” and spaces are replaced with “_”.

To name the newly created custom button, you add desired text at the end of the line(LOG). Make sure that one space is added  before you type the name of the button.

Step3:
Buttons will appear on top tool bar after you restart PlanetCNC TNG software:

 

To create a divider line between the buttons you just add three hyphen ( – – – ) between the text lines:

File.Settings_… SET
– – –
Help.Show_Log_… LOG

 

To add buttons on left, right, top and bottom toolbars create these files and use same procedure as above:

PlanetCNC64.btnbottom: With this file you create custom buttons located at bottom toolbar

PlanetCNC64.btnleft: With this file you create custom buttons located at left sided toolbar

PlanetCNC64.btnright: With this file you create custom buttons located at right sided toolbar

Attached are files for custom buttons for top and left toolbars:
Custom button examples for TOP toolbar
Custom button examples for LEFT toolbar

Using “Warp” with PlanetCNC TNG software

Since PCB milling is a very delicate and precise procedure (distance between two pads can be only few mils), already smallest PCB surface height irregularities can create bad results.

So it is very important that depth of milling is constant over the whole PCB surface throughout the whole milling process. We can achieve this by using “Warp” procedure.

‘Warp’ feature helps apply generated toolpath over bended, curved or uneven surfaces.

The most important step of ‘Warp’ procedure obtaining surface points. We can  either capture each point single-handedly  or we can use “Measure Surface” procedure. We recommend the latter.

Step 1:
Place your workpiece material (in future text ‘copper board’) to machines table. Mount it properly, so that you avoid any inconveniences later such as vibration, dislocation etc…also make sure that copper board is not in contact with the machine table.

Step 2:

Since copper board itself is conductive material,  it can already be used as sensor. You can solder wire to it or you could just use mounting screw to attach connection wire to copper board.

Now connect wire from your copper board to controllers ‘sensor’ input.

Other wire should be connected to controllers GND terminal. Other end of this wire can be clamped to engraving tool:

While Mk3/4 controller has a designated sensor input, Mk3 controller uses assignable inputs, so you can connect copper board wire at any input of Input header and configure it in settings later.

 

Step 3:

Now open IO tab and check if correct input is activated under “Input” panel. This is just to be sure that everything is working correctly. Image below shows that Input 1 is activated.

Step 4:

Jog your machine to desired initial origin point of your copper board, usually its corner, and click: “Machine/Work Position/Axis to Zero/XY” or click “Work Position Axis to Zero XY” button from toolbar.

With work position XY set to zero, you have initial point of your workpiece material from which you will start your ‘Warp’ measuring as also your g-code program.

Step 5:

To measure Z axis zero work position, click: “Machine/Work Position/Measure”  or click “Work Position Measure” button from toolbar.

 

Step 6:

Now that we set zero XY and Z axis work positions, we can start with surface point measuring.

Click “Machine/Measure/Measure Surface”:

“Measure surface” user dialogue will appear:

Position X: X axis initial point of surface measuring.

Position Y: Y axis initial point of  surface measuring.

Size X: X axis dimension of measuring area surface.

Size Y: Y axis dimension of measuring area surface.

Step: Distance between to neighbourly measuring points 

 

 

Step 7:

After you click OK, machine will begin measuring surface points of copper board.

 

Step 8:

When surface measuring procedure is finished,  measured points are saved in PlanetCNC TNG main installation folder as “MeasureSurface.txt” file.

Step 9:

Now open your Gerber file using “File/Import Gerber”:

 

Step 10:

Set Z axis work position to zero, click: “Machine/Work Position/Measure”  or click “Work Position Measure” button from toolbar.

Step 11:

To apply “Warp” click: “Program/Warp” and click “Load…” button. Locate file “MeasureSurface.txt” and click Open.

Table will be populated with coordinates of measured points:

Click OK.

 

Step 12:

You will notice that the displayed toolpath has changed in order to compensate for boards curved surface. This is much more evident if you set parameter “Alpha” in settings(File/Settings/User Interface/Colors/Alpha).

These are all steps required to apply Warp with your program. Machine will mill at constant depth no matter of the surface curvature.

 

 

PLEASE NOTE:

“Measure surface” script file is available for edit.

You can open and edit script file if you click: “File/Settings/Program Options/Scripts/Measure” and select “Measure/Measure Surface” from drop down menu. Click: “Edit Script” and script file will open in your default text editor.

Alternatively you can open surface measure script file “Machine.Measure.Measure_Surface.gcode” located in “PlanetCNC64.Scripts” folder with your text editor.

 

How to control PlanetCNC TNG from your own software

Command line arguments

PlanetCNC TNG accepts commands from command line. Only one software instance can run at same time. When you run second instance it will simply pass its arguments to running instance. Running instance will process these arguments and execute command.

Here are some examples (Windows, 64bit):

1. Open command prompt.
2. Go to PlanetCNC TNG installation folder. Usually “C:Program Files (x86)PlanetCNC”.
3. Type PlanetCNC64.exe. Software will start.
4. Type PlanetCNC64.exe gcode “G01 X10G01 Y10”. You will notice that two g-code lines are now loaded.
5. Type PlanetCNC64.exe start. Machine will start and g-code will be executed.

Named pipes

More advanced option is to use named pipes. Named pipes is simple cross-platform interprocess communication mechanism. It is possible to use named pipes in almost all programming languages.

PlanetCNC TNG must be running otherwise it will not receive command. If you do not want to show main window you can start software with “hide” command.

Here is source code of an example (Windows, C++):
PipeExample

 

List of supported commands

Both options described above use same commands. Here is a list and brief explanation.

show Shows main window
hide Hides main window
exit Exits program
estop Toggles EStop
start Performs Start
stop Performs Stop
pause Performs Pause
isestop Returns 1 if EStop is active, 0 otherwise
ispause Returns 1 if Pause is active, 0 otherwise
open "filename" Opens GCode from file
gcode "program" Opens GCode from string
close Closes opened GCode
mdi "command" Executes MDI command
param name=value Sets parameter value
param name Returns parameter value
posabs Returns absolute position for all axes
posabsx Returns absolute position for X axis
posabsy Returns absolute position for Y axis
posabsz Returns absolute position for Z axis
posabsa Returns absolute position for A axis
posabsb Returns absolute position for B axis
posabsc Returns absolute position for C axis
posabsu Returns absolute position for U axis
posabsv Returns absolute position for V axis
posabsw Returns absolute position for W axis
pos Returns position for all axes
posx Returns position for X axis
posy Returns position for Y axis
posz Returns position for Z axis
posa Returns position for A axis
posb Returns position for B axis
posc Returns position for C axis
posu Returns position for U axis
posv Returns position for V axis
posw Returns position for W axis
speed Returns current speed
accel Returns current acceleration
spindle Returns current spindle RPM
input Returns value of INPUT 
input1 Returns value of INPUT 1 pin
input2 Returns value of INPUT 2 pin
input3 Returns value of INPUT 3 pin
input4 Returns value of INPUT 4 pin
input5 Returns value of INPUT 5 pin
input6 Returns value of INPUT 6 pin
input7 Returns value of INPUT 7 pin
input8 Returns value of INPUT 8 pin
jog Returns value of JOG
jog1 Returns value of JOG 1 pin
jog2 Returns value of JOG 2 pin
jog3 Returns value of JOG 3 pin
jog4 Returns value of JOG 4 pin
jog5 Returns value of JOG 5 pin
jog6 Returns value of JOG 6 pin
jog7 Returns value of JOG 7 pin
jog8 Returns value of JOG 8 pin
joga1 Returns value of JOG A1 pin
joga2 Returns value of JOG A2 pin
jogs Returns value of JOG S pin
jogpot Returns value of JOG POT
limit Returns value of LIMIT
limit1 Returns value of LIMIT 1 pin
limit2 Returns value of LIMIT 2 pin
limit3 Returns value of LIMIT 3 pin
limit4 Returns value of LIMIT 4 pin
limit5 Returns value of LIMIT 5 pin
limit6 Returns value of LIMIT 6 pin
limit7 Returns value of LIMIT 7 pin
limit8 Returns value of LIMIT 8 pin
limit9 Returns value of LIMIT 9 pin
output Returns value of OUTPUT
output1 Returns value of OUTPUT 1 pin
output2 Returns value of OUTPUT 2 pin
output3 Returns value of OUTPUT 3 pin
output4 Returns value of OUTPUT 4 pin
output5 Returns value of OUTPUT 5 pin
output6 Returns value of OUTPUT 6 pin
output7 Returns value of OUTPUT 7 pin
output8 Returns value of OUTPUT 8 pin
aux1 Returns value of AUX 1 pin
aux2 Returns value of AUX 2 pin
aux3 Returns value of AUX 3 pin
aux4 Returns value of AUX 4 pin
buffer Returns amount of free buffer 
bufferpercent Returns percent of buffer utilization
linecount Returns number of lines in GCode program
line Returns line number currently executing

 

Starting program from g-code

You can also start your own program from gcode. Optionally you can wait for program to finish before g-code continues or you can pass parameters.

Start myprogram.exe:
(exec,myprogram.exe) 

Start myprogram.exe and send current X and Y coordinates:
(exec,myprogram.exe #<_x> #<_y>) 

Start myprogram.exe, send current X and Y coordinates and wait for program to finish:
(execwait,myprogram.exe #<_x> #<_y>) 

Make sure that myprogram.exe is added to whitelist in settings otherwise TNG will refuse to execute it.

Hint: This external program can use named pipes to set some g-code parameters. TNG will use these parameters when g-code execution will continue.

How to measure work position with movable sensor in PlanetCNC TNG software

1. Reference your machine using Homing procedure(Machine/Home):
How to set Homing procedure in PlanetCNC TNG software

2. Connect movable sensor (further in text referenced as sensor) to one of the inputs (Input connector) of controller.

InputWiringMk34

InputWiringMk3

3. In settings select either Sensor 1 or Sensor 2 (File/Settings/Input/Sensors). It doesn’t matter which one you choose.

From drop down menu select input to which you connected your sensor.

SensorInput2

4. Activate sensor by hand and under IO tab of main display check if designated input gets properly triggered.

SensorIO

For safety reasons jog your machine (it can be in any direction) and see if machine stops when you activate sensor.

5. In settings set:

Probe speed(File/Settings/Program Options/Probe speed): This is the speed at which Z axis will descend to measure Z axis work position.

Sensor Thickness(File/Settings/Program Options/Probe speed): If you use copper board as a movable sensor, then value of this parameter is the thickness of the copper board( usually 1.6mm).

Thickness

 6. Start “Work Position Measure” procedure(Machine/Work Position/Measure). You can also use the “Work Position Measure” button on the left toolbar:

Button

7. When “Work Position Measure” procedure is executed, default sequence will be:

Machine will at current machine position descend towards sensor at probe speed(File/Settings/Program Options/Probe Speed). When sensor is activated, machine will stop and ascend to Z height from which we started “Work Position Measure” procedure.

Z axis work position value on surface of material should now be 0.

You have configured “Work Position Measure” procedure and you should be able to use it with your movable sensor.

If you would like to edit “Work Position Measure” procedure to fit your needs or to have more in depth look at the procedure itself, you can do that by opening the “Work Position Measure” procedure script file.

 

 

8. You can create and access “Work Position Measure” script file  in two ways:

a.) In settings (File/Settings/Program Options/Scripts/Work position) you can click buttons Generate and Edit. With Generate button you create default file and with Edit button you can open it and make any modifications of the script g-code

GenerateEdit

 

b.) When you start “Work Position Measure” procedure for the first time(for example via button), Machine.Work_Position.Measure.gcode default file will be created. Open your PlanetCNC TNG software installation folder and locate folder: “.Scripts”

Find “Machine.Work_Position.Measure.gcode” file and open it with text editor:

ScriptG-code

9. Description of parameters and g-codes(in order of appearance in script g-code):

M73:
This g-code saves states of of all modal g-codes currently used by software. When Machine.Work_Position.Measure.gcode procedure is executed in its entirety, all states will be restored to their previous values.

#3 = #<_abs_z>: Stores value of current Z axis position as parameter #3.

G90:
With G90 g-code we set absolute mode of motion.

 

F#<_speed_probe>:
Speed at which machine descends to measure tool. Set with Probe Speed in settings(File/Settings/Program Options/Probe Speed). This value can be set directly with new F value. In such case you should delete the “#<_speed_probe>” line of code.

G38.2 Z-100000:
This g-code moves selected axis in selected direction. G38.2 g-code uses parameter X(-/+)Value,Y(-/+)Value or Z(-/+)Value which define to which coordinate value machine should move and in what direction. When probe activation occurs over the time of machine travel, machine will stop.

G92 Z#<_sensor_thick>:

When movable sensor is activated, we set current work position as thickness of sensor. Here comes in great help g-code G92.

G53 G0 Z#3:

Machine moves in absolute coordinates to previously saved Z axis position.

 

 

 

 

 

How to measure tool offset using fixed tool sensor in PlanetCNC TNG software

1. Reference your machine using Homing procedure(Machine/Home):
How to set Homing procedure in PlanetCNC TNG software

2. Mount your fixed tool sensor(further in text referenced as sensor) on machine table.

3. Connect sensor to one of the inputs (Input connector) of controller.
InputWiringMk34

InputWiringMk3

4. In settings select either Sensor 1 or Sensor 2(File/Settings/Input/Sensors). It doesn’t matter which one you choose.

From drop down menu select input to which you connected your sensor.

SensorInput1

5. Activate sensor by hand and under IO tab of main display check if designated input gets properly triggered.
SensorInput1_IO

For safety reasons jog your machine (it can be in any direction) and see if machine stops when you activate sensor.

6. Jog your machine to sensor position, so that tool is right above the centre of fixed tool sensor.
For Sensor Position(File/Settings/Program Options/Sensor Position)insert X,Y motor values that can be seen under Motors tab of coordinate display.
Z value of sensor position is usually sensors height. Sensor Position(File/Settings/Program Options/Sensor Position).

7. Start Measure Tool procedure(Machine/Tool Offset/Measure Tool).
You can also use the “Tool Offset Measure Tool” button on the left toolbar:
ToolbarButton

8. When “Measure Tool” procedure is executed, default tool measure sequence will be:

Machine will ascend to safe height and move from current position to sensors XY position(the one we set in settings).

Machine will descend towards sensor with probe speed(File/Settings/Program Options/Probe Speed) and when sensor gets activated, machine will stop and ascend to safe height.
Machine will return back to XY position from which we started the “Measure Tool” procedure.

You have configured your fixed tool sensor and you should be able to use “Measure Tool” procedure.

If you would like to edit “Measure Tool” procedure to fit your needs or to have more in depth look at the tool measure procedure itself, you can do that by opening the tool measure script file.

 

 

9. You can create and access “Measure Tool” procedure script file  in two ways:

a.) In settings (File/Settings/Program Options/Scripts/Tool Offset) you can click buttons Generate and Edit. With Generate button you create default file and with Edit button you can open it and make any modifications of the script g-code

GenerateEdit

b.) When you start “Measure Tool” procedure for the first time, Machine.Tool_Offset.Measure_Tool.gcode default file will be created. Open your PlanetCNC TNG software installation folder and locate folder: “.Scripts”

Find “Machine.Tool_Offset.Measure_Tool.gcode” file and open it with text editor:

MeasureScript

 

10. Description of parameters and g-codes(in order of appearance in script g-code):

M73:
This g-code saves states of of all modal g-codes currently used by software. When Machine.Tool_Offset.Measure_Tool.gcode procedure is executed in its entirety, all states will be restored to their previous values.

#1 = # (store current x position): Stores value of current X axis position as parameter #1.
#2 = # (store current y position): Stores value of current Y axis position as parameter #2.
#3 = # (store current z position): Stores value of current Z axis position as parameter #3.

G90:
With G90 g-code we set absolute mode of motion. Prior to “Measure Tool” procedure , motion mode could be different so we used M73 to save current modal states.

G53 G0 Z#<_motorlimit_zp>:
Machine ascends to safe height.

G53 G0 X#<_sensor_x> Y#<_sensor_y>:
Machine moves to sensor XY position.

F#<_speed_probe>:
Speed at which machine descends to measure tool. Set with Probe Speed in settings(File/Settings/Program Options/Probe Speed). This value can be set directly with new F value. In such case you should delete the “#<_speed_probe>” line of code.

G38.2 Z-100000:
This g-code moves selected axis in selected direction. G38.2 g-code uses parameter X(-/+)Value,Y(-/+)Value or Z(-/+)Value which define to which coordinate value machine should move and in what direction. When probe activation occurs over the time of machine travel, machine will stop.

G43.1 Z[#<_probe_z> – #<_sensor_z>]:
When G38.2 g-code senses that sensor is activated and stops the machine, this g-code sets tool offset.

G53 G0 Z#<_motorlimit_zp>:
Machine moves in absolute coordinates to safe height.

G0 X#1 Y#2:
Rapid move to position from which we started the “Measure Tool” procedure .

o<100> if[[TOABSZ[#3] LT #<_motorlimit_zp>] AND [TOABSZ[#3] GT #<_motorlimit_zm>]]
G0 Z#3 (move to last z position)
o<100> endif

With this sub program we make sure that we are safely within Z axis motors limits when machine moves back to position from which we started the “Measure Tool” procedure .

How to configure limit switch inputs of controller in PlanetCNC TNG software

Limit switches are used to reference your machine(homing procedure) as also for safety reasons.

If you use only one limit switch for axis X motor (positive direction), connected to controllers limit input 1:

XAxis+

If you have two limit switches for axis X motor (negative and positive direction), connected to same limit input of controller:

XAxis+-

If you have two limit switches on X axis(negative and positive direction), connected to separate limit inputs of controller:

XAxisSeparatePin

Same principles that were shown above for X axis can be used for all other axes.

Limit switch test:

When your limit switches are connected to limit inputs of controller, you can test if PlanetCNC TNG software senses the limit switch activation. On main screen click the “IO” tab and observe controllers Limit status bar behaviour:

Limit1_IO

Limit1_IO_Active

Invert option:
If you use normally closed type of limit switches then you can invert controller limit input in settings: File/Settings/Limit

LimitInvert

Click round button next to limit pin that you wish to invert:

LimitInvertEnabled

How to set Homing procedure in PlanetCNC TNG software

Homing procedure will reference your machine and set machine work area.

1. First you need to configure these settings:
Motor limits(File/Settings/Motors/Limits):
Set limitation of movement for each motor.
Motor limits tutorial can be found on this link: Motor Limits tutorial

Limit switch input configuration(File/Settings/Limit/Limit Switches):
Configure limit switch inputs of controller. Limit switch input configuration tutorial can be found on this link: Limit switch input configuration tutorial

Home speed(File/Settings/Program Options/Home Speed):
Set homing speed.

2. To execute homing procedure click: Machine/Home or click the “Home” button located on vertical toolbar: HomingButton

Homing procedure(File/Settings/Program Options/Homing) can be configured to fit your needs.

To set homing Order of axes you select order number from drop down menu for each axis:

HomingSettings

To set homing Direction of axes you click the round button of axis direction option:

HomingDirection

You can set home Position for each axis:

HomePosition

Switch hysteresis:
This is the distance from the moment when limit switch is activated to when limit switch is released. Usually around 2-5mm. Test this on your machine.

When Homing is executed, homing sequence(as set above) will be:

Z axis will homed first. Axis will move in positive direction until Z axis limit switch is activated. When switch is activated machine stops and moves to position set with Z “Position”.

X axis will homed second. Axis will move in positive direction until X axis limit switch is activated. When switch is activated machine stops and moves to position set with X “Position”.

Y axis will homed third. Axis will move in positive direction until Y axis limit switch is activated. When switch is activated machine stops and moves to position set with Y “Position”.

These are all necessary steps to configure Homing procedure of your machine. 

To take more in-depth look at the code behind Homing procedure see next chapter.

 

3. When you click home button for the first time, Machine.Home.gcode file will be created. Open your PlanetCNC TNG software installation folder and locate folder: “.Scripts”

Find “Machine.Home.gcode” file and open it with text editor(bottom image describes homing g-code only for three axes):

Script_g-code

Description of important script parameters and g-codes:

M73:
This g-code saves states of of all modal g-codes currently used by software. When Machine.Tool_Offset.Measure_Tool.gcode procedure is executed in its entirety, all states will be restored to their previous values.

G90:
With G90 g-code we set absolute mode of motion. Prior to measure tool procedure, motion mode could be different so we used M73 to save current modal states.

F#<_speed_home>:

Speed at which machine will home each axis. Set with Home Speed in settings(File/Settings/Program Options/Home Speed). This value can be set directly with new F value. In such case you should delete the “#<_speed_home>” line of code.

 

G38.1 X+100000:
This g-code moves selected axis in selected direction and senses the limit switch activation.
G38.1 g-code uses parameter X(-/+)Value,Y(-/+)Value or Z(-/+)Value which define to which coordinate value machine should move and in what direction.
When limit swith activation occures over the time of machine travel, machine will stop.

G10 L9 X[#<_motorlimit_xm> + #<_homeswitch_hysteresis>]:
When G38.1 g-code senses and stops the machine, this g-code sets current absolute position for selected axis .
Example:
G10 L9 X[#<_motorlimit_xp> + #<_homeswitch_hysteresis>]: Absolute position Z will now be added value of X+ motor limit  and  X+ switch hysteresis value.

G53 G0 X[#<_home_x>]: Machine moves in absolute coordinates to x axis home postion.
Example: If new machine absolute position is the one saved with G10 L9 g-code(X+ motor limit  and  X+ switch hysteresis value), we move machine back to X axis home position.

Homing procedure can be configured to fit your needs. You can set homing speed, axes homing order, home position etc…

How to set Motion Limits in PlanetCNC TNG software

To set motion limits of your machine click: File/Settings/Motion-> “Motion Limits”

Motion Limits tab

Limit- value sets limitation of machine/effector (tool) movement in negative direction, Limit+ value sets limitation of machine/effector (tool) movement in positive direction for specific axis:

MotionLimitsValues

With Motion limits values inserted, we set motion limits of machine. If we want machine to stop when limits are reached we must enable them.
To enable Motion limits for specified axis click the round button:

MotionLimitsValuesEnabled

When you set your machines motion limits you will notice that 3D representation of machine limits will be displayed accordingly on the main screen:

3DDisplayValues

If you use normal XYZ axis machine then we recommend that you set your motion limits at same values as motor limits.

You are probably wondering what is the difference between Motor limits and Motion limits?
We try to think that motor limits are limiting actual motor movement and Motion limits are limiting machine or effector (tool) movement.

Eleboration:
With use of combined motors and special mechanics you can achieve movement which doesn’t follow the same kinematic rules as linear motion CNC’s.
Examples of such machines are H-bot, Delta printer or multiple axis machines. In such cases values for Motor limits and Motion limits would not be the same.

How to set Motor limits in PlanetCNC TNG software

To set your axis motor limits click: File/Settings/Motors -> “Motor Limits”.
MotorLimitsTab

Limit- value sets limitation of motor movement in negative direction, Limit+ value sets limitation of motor movement in positive direction:

MotorLimitsTabValues

With Motor limits values inserted, we set limits of motors. If we want motors to stop when limits are reached, we must enable them.
To enable Motor limits for specified axis click the round button:

MotorLimitsEnabled

How to set Steps Per Unit values in PlanetCNC TNG software

Steps per unit value (in further text SPU) defines how many step pulses controller needs to generate in order that axis moves for distance of one unit. Units can be in millimeters or in inches.

SPU value depends on few factors: stepper motor, stepper drivers micro-step configuration, lead screw pitch:

Motor
Stepper motors usually have 200 or 400 full steps per one rotation of its shaft.
One rotation of shaft in degrees is 360°. For motors with 200 steps per revolution this means
one step is equal to 1.8°. For motors with 400 steps per revolution this means one step is equal to 0.9°.

In equation below, we will name this parameter M

Micro-Stepping
With micro-stepping we improve motors resolution, accuracy, smoother movements, we reduce
resonance problems etc. The real compromise is that as you increase the number of micro-steps per
full step the incremental torque per micro-step drops off drastically. Resolution increases but
accuracy will actually suffer.

With micro-step number we define, how many smaller steps is one full step divided into.
Most common values are ½ , ¼ , ⅛… but it is really up to you which micro-step value you will use.

In equation below, we will name this parameter S

Pitch
Usually CNC machines operate with the help of lead screws and nuts. They can be trapezoidal or
ball screw leads. The pitch of a screw thread is the distance between adjacent threads. When lead
screw is rotated for one revolution, this reflects as linear motion of axis. Distance traveled is equal
to lead screw’s pitch.

In equation below, we will name this parameter P

(Some CNC machines use rack and pinion instead. Distance traveled when pinion makes one
revolution can also be considered as pinion pitch. Similar is also true for toothed belt drive.)

Setting SPU values of your machine in PlanetCNC TNG software

StepsPerUnit tab can be found in settings under Motors section: File/Settings/Motors
SettingsSPU

We can calculate SPU values for our machine by starting from two different conditions:

If we know all variable values:
Calculating correct SPU value is easy: SPU value = (M*S)/P

If we don’t know all variable values:
We will have to do some measuring and provide ourselves with some numbers. Then we will be able to calculate correct SPU value.

We use metric units so our unit is millimeter. If you use imperial units (inches) then values are different.

1) In Settings/Axes/Setup we set our SPU value to some “normal” number, say 200 steps per unit.

SettingsSPU200

2) Jog machine to a suitable location, and set: Machine/Work Position/Axis to Zero/XY offsetXY.

3) Now let’s say that we want to move X axis from our offset zero position to X=10 position and measure the actual distance for which machine will move. To measure the distance of machines travel, we can use ruler, caliper or measuring tape which we place under machines tool.

Tool should start at 0 of the ruler:
X0TNG

In MDI window write X10:
MDIx10

Machine should move from X=0 to X=10, therefore travel for 10mm, but when we execute MDI command we can see that machine travelled for 2.5mm instead of 10mm:
X3.5TNG

Meaning, our current SPU value moves machine axis for wrong distance.

4) We can ask ourselves a question:

If ‘Current SPU’ value moves X axis for ‘Measured distance’ value, what is the ‘Correct SPU’ value that will move X axis for ‘Entered distance’ value?

Equation looks like this:
Correct SPU value = ( Current SPU value * Entered distance value ) / Measured distance value

Current SPU = 200
Entered Distance = 10
Measured distance = 2.5

Correct SPU value= (200*10)/2,5 = 800 SPU

Now we enter correct value for SPU in Settings/Axes/Setup, Enter X10 in MDI window and measure the new distance value.
X0TNG

Measured distance value is now correct. Our steps per unit are correctly set.
X10TNG

It is recommended to repeat this procedure several times and use largest possible travel. Using 10mm travel is good for first pass but if you use maximum possible distance machine can travel, you will obtain much better results.

Basic PlanetCNC TNG connection settings

PlanetCNC TNG software recognises all PlanetCNC controllers that are connected to your PC trough USB or Network ports. You would need to select controller that will serve as primary controller.

Basic connection settings:

USB_Devices

Lets start by going trough connection parameters in settings: File/Settings/Connection

Select the type of connection that you wish to use with your controller:
-USB
-Network(Only Mk3 controller)
“Adapter IP” setting allows you to insert your network adapter IP address.

When you select type of connection, you will notice that window with connected devices will add new controller(s) to the list(beside Simulation). If you have multiple controllers connected via USB to your computer, software will display them. In case of enabling Ethernet option, software will display also controllers connected to you network:
USB_Devices_NET_devices

To select your primary controller from device list, you double click on it. “Primary controller” window will display type of connection, type of controller and its serial number.
Primary controller

Now that your primary controller is selected click OK and then you can observe its communication status.

Connection light colour description:

If you look closely at the bottom right corner of PlanetCNC TNG software you will notice that there is a round light.
This light can be lit in various colours and each colour indicates different connection state.

Green light indicates that controller is updated to correct firmware version and controller is activated meaning license is found by software. connected_license

Green light with X indicates that software does not find proper license for connected controller. connected_NO_license

Orange light indicates that controllers firmware version is not correct. Update firmware of controller. Firmware_not_correct

Gray light indicates no communication between controller and software. Click “Machine/Controller/Reconnect” and make sure that correct controller is set as Primary controller in settings. Not connected_No license

Red light indicates that software is processing commands and is sending them to controller. ProgramRunning

Communication status can also be indicated by observing on-board Link LED. If this LED is blinking in pattern of approximately 500ms, controller is communicating with software. When software is processing commands and is sending them to controller, this LED will be blinking even faster.

If Link LED is not blinking, this indicates communication has dropped.

List of essential PlanetCNC TNG tutorials

New to PlanetCNC TNG software? Don’t worry, here you can find list of tutorials that explain how to start using PlanetCNC TNG software as fastest and as effectively as possible.

It is very recommended to follow these tutorials in chronological order:

1. PlanetCNC TNG software overview and performance guidelines
Short description of PlanetCNC TNG software and few guidelines for better perfomance.

2. Updating to new PlanetCNC USB driver
PlanetCNC TNG software uses new digitaly signed PlanetCNC USB driver. See how to install it on you computer.

3. Updating PlanetCNC controller with PlanetCNC TNG software
To update your PlanetCNC controller with PlanetCNC TNG software you need to follow sequence of steps.

4. PlanetCNC TNG Linux installation guide
PlanetCNC TNG software works also with Linux OS. See how it is installed on Ubuntu MATE.

5. Obtaining and activating license for PlanetCNC controller with TNG software