This tutorial will explain how to correctly configure step per unit values of your machine.
Step per unit value (in further text SPU) defines how many step pulses controller needs to generate in order that machine 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:
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
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
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.)
Configuring SPU values of your machine in PlanetCNC TNG software
StepsPerUnit tab can be found in settings under Motors section: File/Settings/Motors
We can calculate SPU values for our machine by starting from two different initial 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.
2) Jog machine to a suitable location, and set: Machine/Work Position/Axis to Zero/XY .
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:
In MDI window write X10:
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:
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
Insert correct value for SPU in Settings/Motors/StepsPerUnit:
Now enter X10 in MDI window and measure the new distance value:
Measured distance value is now correct. Our steps per unit are correctly set.
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.