Understanding M92 (steps per mm) with leadscrew and gear ratio
-
My printer has this 8mm lead screw with a pitch of 2 mm and 4 starts so 8mm lead:
https://www.amazon.com/gp/product/B017AR5QBS/
And is using these planetary stepper motors (1.8 deg w/o gearbox) with 57/11:1 (57:11) gear ratio:
https://www.omc-stepperonline.com/economy-planetary-gearbox/nema-17-stepper-bipolar-l33mm-w-gear-raio-51-small-planetary-gearbox-17hs13-0404s-cg5.html
I'm also using 64x microstepping.I used the reprap tool and when I enter this I get:
https://i.imgur.com/41vxHWi.pngM350 X64 Y64 Z64 E256 I0 ; configure microstepping without interpolation M92 X308.77 Y308.77 Z308.77 E420.00 ; set steps per mm
That says 308.77 steps/mm. When I use this configuration and press home on the control panel it moves slowly to home and does home. Then when I press X+100 it moves 3.7 mm (as measured with calipers). Shouldn't it move 100 mm?
If I rotate the lead screen 360 degrees it goes 8mm. So 360 degrees / 8 mm = 45 degrees per mm. At 1.8 degrees per step that (45 degrees/mm) / 1.8 degrees = 25 steps/mm without gearbox. So 25 steps/mm * (57/11) = 129.5454 steps/mm with gearbox. With microstepping that would just be 25 steps/mm * (57/11) * 64 microsteps = 8290.9091 steps/mm.
M92 X8290.91 Y8290.91 Z8290.91 E420.00 ; set steps per mm
I can home and then I move X+100 it moves 2.1mm.
I'm unsure what I'm doing wrong. I think I'm misunderstanding what these settings do.
-
I think you need to swap the 57 and 11.
16 micro steps is the most common. Any specific reason to use 64?
Thanks.
Frederick
-
@fcwilt Ah yeah that seems to gives the 8290.91 I manually entered. Doesn't explain why it's only moving 2.1mm when I do X+100 though.
I just changed to 16 to simplify this hopefully (the 64 is mostly because this is made out of aluminum and designed to also CNC small features, but was mostly just testing):
M350 X16 Y16 Z16 E256 I0 ; configure microstepping without interpolation M92 X2072.73 Y2072.73 Z2072.73 E420.00 ; set steps per mm
I pressed home and it homed to the switch. Then I press X+100 in the control panel and it moved 1.8 mm from the end stop. I can tell it to move X+100 again. Not sure what's wrong.
; Drives M569 P0 S0 ; physical drive 0 goes backwards M569 P1 S0 ; physical drive 1 goes backwards M569 P2 S1 ; physical drive 2 goes forwards M569 P3 S1 ; physical drive 3 goes forwards M584 X0 Y1 Z2 E3 ; set drive mapping M350 X16 Y16 Z16 E256 I0 ; configure microstepping without interpolation M92 X2072.73 Y2072.73 Z2072.73 E420.00 ; set steps per mm M566 X900.00 Y900.00 Z60.00 E120.00 ; set maximum instantaneous speed changes (mm/min) M203 X6000.00 Y6000.00 Z180.00 E1200.00 ; set maximum speeds (mm/min) M201 X500.00 Y500.00 Z20.00 E250.00 ; set accelerations (mm/s^2) M906 X400 Y400 Z400 E800 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X200 Y200 Z200 S0 ; set axis maxima ; Endstops M574 X1 S1 P"!xstop" ; configure active-high endstop for low end on X via pin !xstop M574 Y1 S1 P"!ystop" ; configure active-high endstop for low end on Y via pin !ystop
The endstops seem to work fine for the x and y. As in it moves and taps off and the control panel shows its homed.
-
The only reason I know that causes the distance to be wrong is the steps-per-mm setting.
Did you re-boot after changing the settings?
Frederick
-
@fcwilt Yes, I reboot the board after every settings change after uploading the system files.
I changed it from 16 to 1x microstepping and changed to 129.55 for the axis and it moved 0.3 mm each X+100.
-
@sirisian-0 said in Understanding M92 (steps per mm) with leadscrew and gear ratio:
@fcwilt Yes, I reboot the board after every settings change after uploading the system files.
I changed it from 16 to 1x microstepping and changed to 129.55 for the axis and it moved 0.3 mm each X+100.
OK.
What sort of printer uses lead screws for X and Y?
Frederick
-
@fcwilt A very custom aluminum one machined from scratch. (Designed for very precise movements).
I double checked all the wiring. I mean it wouldn't be able to rotate the x and y lead screw smoothly at all if it was wired wrong I think? Running out of things I can think of.
For further details, I'm using:
Board: Duet 2 WiFi (2WiFi) Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.3 (2021-06-15) Duet WiFi Server Version: 1.26
I changed it to:
M350 X1 Y1 Z1 E256 I0 ; configure microstepping without interpolation M92 X12.96 Y12.96 Z12.96 E420.00 ; set steps per mm
It moved 10mm when I did X+100. I don't know how to interpret what I'm seeing.
-
Be careful turning the lead screws by hand. The steppers generate voltage and it can sometimes be enough to damage the stepper driver.
Increasing the steps-per-mm should increase the distance moved.
Move the M350 to after the M92 and set M92 as appropriate for 16x.
From my config:
; if M92 above is set for the default 16x microstepping then putting M350 here
; will result in the needed adjustments to the initial values set by M92M350 X16 Y16 Z16 E16 I1 ; 16x microstepping with interpolation
Frederick
-
M92 X2072.73 Y2072.73 Z2072.73 E420.00 ; set steps per mm M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation
It moved like a mm when I did X+100 with that. No difference if I change the order of the lines.
-
@sirisian-0 maybe the motors just can't go that fast? 2000 steps per mm at 16usteps is quite a lot!
Try dropping the speed, accel and instantaneous speed change (jerk)
In general, those motors are only rated for 0.4A so may not be that suitable for use at high-speed. Have you calculated what your max speed might be for those steppers?
https://duet3d.dozuki.com/Wiki/Choosing_and_connecting_stepper_motors#Section_Inductance
-
@sirisian-0 said in Understanding M92 (steps per mm) with leadscrew and gear ratio:
M92 X2072.73 Y2072.73 Z2072.73 E420.00 ; set steps per mm M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation
It moved like a mm when I did X+100 with that. No difference if I change the order of the lines.
The positioning simply makes it easier to use something other than X16 - though I don't think the Duet 2 can.
Frederick
-
@engikeneer Ah this seem to be it. I dropped them down to 8 mm/s max change and 8 mm/s max speed and it all worked and moved exactly 100 mm.
Roughly (2 * 24V)/(200 * 3.141562653 * 27mH * 0.4A) = 7 per second. 7 * 8 mm/rev = 56 mm/second / (57/11) = 10.8 max speed? I chose 8 mm/s just to test. Will test more.
Thanks guys.