Sidebar

Home



Knowledge Base


Guides & Tutorials

Projects

Samples

kb:tutorials:essential:how_set_steps_per_unit

How to set "steps per unit" values

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 millimeters or 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 motion, 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.)

Configuring SPU values of your machine

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
Example:
M = 200
S = 1/8
P = 5mm
PU value = (M*S)/P = (200*8)/5= 320


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 are millimeters. If you use imperial units (inches) then values are different.

Step 1:
In Settings/Motors/StepPerUnit we set our SPU value to some “normal” number, say 200 steps per unit:

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

Step3:
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 and hit Enter.

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.

Step 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.

kb/tutorials/essential/how_set_steps_per_unit.txt · Last modified: 2023/12/19 20:27 by andrej

Page Tools