Correct calculations for steps per mm for Z axis to move 1mm on OpenPnP

110 views
Skip to first unread message

Developer Algo

unread,
Jan 8, 2025, 11:47:37 AM1/8/25
to OpenPnP

With Help of the community i have managed to rectify most of the issues i did have on all my Axes movement and Synchronization with OpenPnP but i have a slight issue with Z-axes 

Any Quick suggestions:

On my PnP Machine, i have 3 x NEMA 17 steppers Motors BD4248 with 1.8 deg./step , 200 KHz used for 3 x Z-axes type ( Z, U, V) on Duet 3HC using Duet Internal (In-built) Drivers

  • 5mm (0.2") Diameter Drive Shaft . i.e The circumference = 1 complete revolution (360 degrees) = 15.71 mm

  • 360/1.8 = 200 steps/revolution

  • So steps/mm on Z-axes = 200/15.71 steps/mm = 12.73 steps/mm

i think i might be calculating it wrong ???

My goal is to have OpenPnP synchronized with Duet3 Controller board so an OpenPnP command for Z axis to move 1mm actually moves 1mm on the Z-axis on the machine

My Current Z-axes configs on Duet3 Controller that need adjustment

M584 Z1.0 U1.1 V1.2  R0 S0      ; LIN R0 = LINEAR ,  R1 = ROTATION
M350 Z32 U32 V32 I1           ; configure microstepping with interpolation
M92 Z32 U32 V32               ; set steps per mm
M566 Z900.00 U900.00 V900.00  ; set maximum instantaneous speed changes (mm/min)
M203 Z60.00  U60.00  V60.00   ; set maximum speeds (mm/min)
M201 Z60.00  U60.00  V60.00   ; set accelerations (mm/s^2)
M906 X800 Y800 Z800        ; set motor currents (mA) and motor idle factor in per cent
M84 S30                       ; Set idle timeout


My current OpenPnP Z-Axes Configs that i will adjust 



OpenPnP_Z_axes.png

mark maker

unread,
Jan 8, 2025, 12:09:52 PM1/8/25
to ope...@googlegroups.com

Is it belt driven? then use the number of teeth in the pulley, times the pitch of the belt as the circumference.

_Mark

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/openpnp/ba47500e-646c-47f0-aab8-6fdf9b42cec5n%40googlegroups.com.

Developer Algo

unread,
Jan 8, 2025, 12:24:07 PM1/8/25
to OpenPnP
its Dual /Cam driven ( Where 2 Nozzles share a Z-axis ) . i have 3 x Z-axes (Z, U, V ) with a total of 6 nozzles ( 2 nozzles per axis per stepper motor ) with no Belts 
Dual_Cam_driven_Nozzles.png

tonyl...@gmail.com

unread,
Jan 8, 2025, 4:10:46 PM1/8/25
to OpenPnP
I don't have a cam driven Z axis, but I think you want the cam to rotate by the same number of degrees as the Gcode that gets sent to the controller. For instance, if the command G1 Z10 is sent to your controller, the cam should rotate 10 degrees (not that the nozzle moves 10mm). So, if your motor has 1.8 degrees per step and you've configured your controller for 32 microsteps, I think you want the steps/mm to be 32 / 1.8 = 17.7778.

Note that OpenPnP takes care of the linear<->angular conversions so that if it needs to move the nozzle up or down by a certain number of millimeters, it calculate the number of degrees to rotate the cam to achieve the desired amount of linear motion and sends that to the controller.

Developer Algo

unread,
Jan 8, 2025, 7:26:44 PM1/8/25
to OpenPnP
Here is a picture of 1 of the CAM driven axis 
IMG_3352.jpg

Developer Algo

unread,
Jan 8, 2025, 7:47:03 PM1/8/25
to OpenPnP

I have adjusted the Duet3 configs to 16 micro steps instead of 32 . As per your suggestions that would mean that  16/1.8 = 8.888 Steps/mm to be configured on OpenPnP , is that correct ?

My Current Z-axes configs on Duet3 Controller that need adjustment

M584 Z1.0 U1.1 V1.2  R0 S0      ; LIN R0 = LINEAR ,  R1 = ROTATION

M350 Z16 U16 V16 I1           ; configure microstepping with interpolation
M92 Z8.88 U
8.88   V 8.88                 ; set steps per mm


M566 Z900.00 U900.00 V900.00  ; set maximum instantaneous speed changes (mm/min)
M203 Z60.00  U60.00  V60.00   ; set maximum speeds (mm/min)
M201 Z60.00  U60.00  V60.00   ; set accelerations (mm/s^2)
M906 X800 Y800 Z800        ; set motor currents (mA) and motor idle factor in per cent
M84 S30                       ; Set idle timeout

Developer Algo

unread,
Jan 8, 2025, 8:13:06 PM1/8/25
to OpenPnP
I can't seem to understand how OpenPnP  Z-Axis gets from  mm/deg  to steps/mm   e.g  if i command  OpenPnP   with  G1 Z10 , As per explanations above it rotates 10 degrees ( Units ) 

So how do we get to steps/mm to be configured on the Z-axis ( Which is supposed to be the same as on Duet3 config file )

  • Stepper Motor  has 1.8 Degrees/ Step , 200 KHz 
  • Steps per Revolution  = 360/1.8 =  200 Steps
  • With 16 Microsteps  = 200 x 16  =  3200 Microsteps(Pulses) / Revolution 

Most of the configs are in Millimeters  e.g when configuring  Axis & Nozzle Safe Zones. I am trying to have clear explanation  of  how OpenPnP gets to that point .  

Jan

unread,
Jan 9, 2025, 4:54:15 AM1/9/25
to ope...@googlegroups.com
Hi Developer Algo!
For a CAM style head as yours, you need to configure three axis per two
nozzles: one axis that drives your motor and two derived axes, one
ReferenceCamCounterClockwiseAxis that translates a linear motion of one
of the two nozzles Z axes into a rotation of the motor and a
ReferenceCamClockwiseAxis that inverts the translation of the
ReferenceCamCounterClockwiseAxis for the second nozzle Z axis.
IIRC OpenPnP does not actually need to know what "steps" means for your
motors as GCode sends positions in arbitrary units. Your controller
takes this positions and multiplies it by the configured steps/arbitrary
units to calculate the amount of steps required to drive the motor as
requested. It is common to choose arbitrary units as Millimeter for
linear motion and Degree for rotational as for your Z axis. This changes
GCode positions to be in Millimeters or Degree and the meaning of the
translation factor in the controller to steps/Millimeter and steps/Degree.
I'd suggest to configure Duet to operate the motor in units of Degree
as you did. Your 8.88 steps/degree is similar to mine. Then you shall
configure your ReferenceCamCounterClockwiseAxis to reference the motor
axis and the dimensions of your CAM. Now you shall assign the name of
this axis as one of the nozzles Z axis. If you now move that nozzle, the
requested position is translated using the CAM geometry into an angle
which is then send to the Z motor. (you may need to invert the motor
rotation or use that axis for the other nozzle to get the directions
correct.)
Finally you shall configure the ReferenceCamClockwiseAxis to reference
the ReferenceCamCounterClockwiseAxis and assign its name to the other
nozzles Z axis. Now you shall be able to operate both nozzles and they
shall move exactly as commanded.
For a six-nozzle head as yours you need to repeat the above three times.

Jan

On 09.01.2025 02:13, Developer Algo wrote:
> I can't seem to understand how OpenPnP  Z-Axis gets from  mm/deg  to
> steps/mm   e.g  if i command  OpenPnP   with G1 Z10 , As per
> explanations above it rotates 10 degrees ( Units )
>
> So how do we get to steps/mm to be configured on the Z-axis ( Which is
> supposed to be the same as on Duet3 config file )
>
> * Stepper Motor  has 1.8 Degrees/ Step , 200 KHz
> * Steps per Revolution  = 360/1.8 =  200 Steps
> * With 16 Microsteps  = 200 x 16  =  3200 Microsteps(Pulses) / Revolution
> __
>
> Is it belt driven? then use the number of teeth in
> the pulley, times the pitch of the belt as the
> circumference.
>
> _Mark
>
> On 08.01.2025 17:47, Developer Algo wrote:
>>
>> With Help of the community i have managed to
>> rectify most of the issues i did have on all my
>> Axes movement and Synchronization with OpenPnP but
>> i have a slight issue with Z-axes
>>
>> Any Quick suggestions:
>>
>> On my PnP Machine, i have 3 x NEMA 17 steppers
>> Motors BD4248 with 1.8 deg./step , 200 KHz used
>> for 3 x Z-axes type ( Z, U, V) on Duet 3HC using
>> Duet Internal (In-built) Drivers
>>
>> *
>>
>> 5mm (0.2") Diameter Drive Shaft . i.e The
>> circumference = 1 complete revolution (360
>> degrees) = 15.71 mm
>>
>> *
>>
>> 360/1.8 = 200 steps/revolution
>>
>> *
>> aab8-6fdf9b42cec5n%40googlegroups.com <https://
>> groups.google.com/d/msgid/openpnp/
>> ba47500e-646c-47f0-
>> aab8-6fdf9b42cec5n%40googlegroups.com?
>> utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> openpnp/1a8a0424-1ee9-4dd8-a42f-6372790e306bn%40googlegroups.com
> <https://groups.google.com/d/msgid/openpnp/1a8a0424-1ee9-4dd8-
> a42f-6372790e306bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

mark maker

unread,
Jan 9, 2025, 5:41:26 AM1/9/25
to ope...@googlegroups.com

> IIRC OpenPnP does not actually need to know what "steps" means for your motors

It does! For a cam head it must mean degrees, i.e. 360 units per revolution, so 3200 Microsteps divided by 360 means 8.8888888 steps per unit.

_Mark

SM

unread,
Jan 9, 2025, 7:02:47 AM1/9/25
to OpenPnP
With the head shown, the relationship between motor rotation and linear movement is usually derived using simple trigonometric functions (sine, arcsine).

It is important that both the corresponding steps/degree are entered on the controller and the correct length of the lever arm etc. on the host.
Reply all
Reply to author
Forward
0 new messages