# Strange steps per mm to rounds per minute conversion

Posted by DrPFF
 Strange steps per mm to rounds per minute conversion February 21, 2018 10:41AM Registered: 2 years ago Posts: 22
I'm running firmware v1.20 on a duet wifi. I have a 15.3:1 geared nema 23 that is connected to E1 on the board. My goal was to control the motor in rounds per minute in the range of about 1-30 rpm. According to the data sheet it is a 1.8 degree per step motor, so 200 steps per revolution. 200 x 15.3 = 3060 which is what I assumed should give me one revolution. But when I enter that into the config file and then send G1 E1 F1 it doesn't work. It moves but not the right distance. I messed with the config parameters a lot and found through systematic trial and error the following parameters which work... kind of, but I'm not sure why they do. By "kind of" I mean my commands have to be scaled by a factor of 100. So if I want it to go 1 revolution at 5 rpm I send G1 E100 F500 and it will work. I had to do it this way because if I try to put in 49,000 instead of 490 for steps per mm in the config then the speed could not be varied for some reason; F1 and F10 would both turn the motor at the same speed.

Here's the "kind of" working parameters:

M92 E1:490 ; Set extruder steps/mm
M906 X800 Y800 Z1200 E1200 ; Set motor currents (mA)
M201 X800 Y800 Z800 E100 ; Accelerations (mm/s^2)
M203 X15000 Y15000 Z100 E3600 ; Maximum speeds (mm/min)
M566 X600 Y600 Z30 E600 ; Maximum jerk speeds mm/minute

So to summarize:

I have no idea how the value of steps per mm that I experimentally found could mathematically result in 1 revolution.
I don't know why I need to scale down the steps per mm(aka revolution) by 100 in the config file and multiply the commands by 100 to maintain control of the speed

I know this is a little weird and not at all typical of what people want to do with these boards but does anyone have any thoughts? Thanks in advance.
 Re: Strange steps per mm to rounds per minute conversion February 21, 2018 03:08PM Registered: 5 years ago Posts: 13,871
Two issues:

1. The M92 command specifies the number of microstepping/mm at the microstepping in force when the M92 command is processed. The default microstepping is 16. So you need to multiply your steps/rev by 16.

2. 1mm is a small amount of movement, but 1 revolution is a lot. So if you have set up M92 to be steps/rev instead of steps/mm, you will need to reduce the extruder acceleration, max speed and jerk speed a lot in your M201, M203 and M556 commands. Try making them 1/100 of the usual values.

Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet.
 Re: Strange steps per mm to rounds per minute conversion February 21, 2018 05:10PM Registered: 2 years ago Posts: 22
Thanks for the reply dc42! I forgot to mention that I am supposed to have micro stepping off here. I have the following at the end of my config file.

M350 X1 Y1 Z1 E1:1 I0 ;micro stepping off, no interpolation
G91 ;relative x,y,z movements
M83 ;relative extruder movements
M302 P1 ;allow extruder motor to operate at cold temps

I've tried another ungeared stepper motor to simplify things plugged into the X spot on the board. I reduced acceleration and jerk as suggested this time and the same unexpected behavior occurs. (i.e., I set M92 to 200, I command to move 1mm expecting it should go one full revolution, but instead it just moves a little bit. Interestingly, I have to tell it to move 16mm for it to go a full revolution. This seems to suggest you may be onto something about the 16 micro stepping, but it is supposed to be turned off, and I can tell that it is indeed off by listening and watching the distinct pulses of the motor as it turns. Do you know what it might be doing here?
 Re: Strange steps per mm to rounds per minute conversion February 22, 2018 01:22AM Registered: 5 years ago Posts: 13,871
Read point 1 in my previous response carefully and you will see that the order of the M92 and M350 commands makes a difference.

Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet.
 Re: Strange steps per mm to rounds per minute conversion February 22, 2018 09:38AM Registered: 2 years ago Posts: 22
Thanks! That took care of the steps/mm issue. I swapped the order of those commands in the config and now a command to move 1 mm results in 1 revolution. However, I'm unable to change speeds again with these config parameters. Both the ungeared motor on X and the geared motor on E1 both spin at 30 rpm as measured with a stopwatch when I command it to move at either "F1" or "F10" speeds. Here is my entire config file currently after the network stuff. I've highlighted the part I think is relevant in blue.

M555 P2 ; Set output to look like Marlin
G21 ; Work in millimetres
G90 ; Send absolute coordinates...
M83 ; ...but relative extruder moves

; Machine configuration
M569 P0 S1 ; Drive 0 goes forwards (change to S0 to reverse it)
M569 P1 S0 ; Drive 1 goes forwards
M569 P2 S1 ; Drive 2 goes forwards
M569 P3 S1 ; Drive 3 goes forwards
M569 P4 S1 ; Drive 4 goes forwards
; If you use an endstop switch for Z homing, change Z0 to Z1 in the following line, and see also M558 command later in this file
M574 X1 Y2 Z1 S0 ; set endstop configuration (X and Y and endstops only, at low end, active high)
M667 S1 ; set CoreXY mode
M350 X1 Y1 Z1 E1:1 I0 ;micro stepping off, no interpolation
M92 X200 Y100 Z100 ; Set axis steps/mm
M92 E1:3060 ; Set extruder steps/mm
M906 X2000 Y800 Z1200 E2000 ; Set motor currents (mA)
M201 X8 Y800 Z800 E8 ; Accelerations (mm/s^2)
M203 X50 Y15000 Z100 E36 ; Maximum speeds (mm/min)
M566 X6 Y600 Z30 E6 ; Maximum jerk speeds mm/minute

M208 X300 Y300 Z300 ; set axis maxima (adjust to suit your machine)
M208 X-8 Y0 Z-0.5 S1 ; set axis minima (adjust to make X=0 and Y=0 the edges of the bed)

; Z probe
;M558 P1 X0 Y0 Z1 ; Analog Z probe, also used for homing the Z axis
;G31 Z1.20 P500 ; Set the probe height and threshold (put your own values here)
; The following M557 commands are not needed if you are using a bed.g file to perform bed compensation
;*** Adjust the XY coordinates in the following M557 commands to suit your build and the position of the Z probe
;M557 P0 X60 Y0 ; Four...
;M557 P1 X60 Y165 ; ...probe points...
;M557 P2 X222 Y165 ; ...for bed...
;M557 P3 X222 Y0 ; ...levelling
;M557 P4 X141 Y82.5 ; 5th probe point for levelling

; Thermistors and heaters
;*** If you have a Duet board with 1K thermistor series resistors, change R4700 to R1000 to the following M305 commands
; You can also use S and B parameters to define the parameters of the thermistors you are using
M305 P0 R4700 H0 L0 ; Put your own H and/or L values here to set the bed thermistor ADC correction
M305 P1 R4700 H0 L0 ; Put your own H and/or L values here to set the first nozzle thermistor ADC correction
M305 P2 R4700 H0 L0 ; Put your own H and/or L values here to set the second nozzle thermistor ADC correction
;M301 H1 P10 I0.10 D100 T0.50 S1.0 ; PID settings for extruder 0
M307 H2 A330.2 C955.5 D15.1 S1.00 V24.0 B0
M570 S600 ; Increase to allow extra heating time if needed

; Tool definition
M563 P0 D0 H1 ; Define tool 0
G10 P0 S0 R0 ; Set tool 0 operating and standby temperatures
;*** If you have a dual-nozzle build, un-comment the following 3 lines
M563 P1 D1 H2 ; Define tool 1
G10 P1 X0.00 Y0.00 Z0.0 S0 R0 ; Set tool 1 operating and standby temperatures

;*** If you are using axis compensation, put the figures in the following command
M556 S78 X0 Y0 Z0 ; Axis compensation here
T1 ; select first hot end

G91 ;relative x,y,z movements
M83 ;relative extruder movements
M302 P1 ;allow extruder motor to operate at cold temps
 Re: Strange steps per mm to rounds per minute conversion February 22, 2018 06:24PM Registered: 5 years ago Posts: 13,871
You specified E36 in the M201 command, so both extruders will be limited to 36 RPM.

Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet.
 Re: Strange steps per mm to rounds per minute conversion February 22, 2018 09:39PM Registered: 2 years ago Posts: 22
Yes, the E36 in the M203 command was intentional. Referring back to my first post, my goal is to control the speed of the geared motor connected to E1 in the range of 1-30 rpm. I originally had the max speed at 3600, which of course is way faster than I'd ever be able to make it spin. I dropped it to 1/100 of that value as you suggested in your first reply, which should be fine since it is still faster than I want to go. The problem is I'm trying to tell it to spin slower than that but no matter what I command it spins at 30 rpm (i.e., If I tell it to go 1 rpm, it goes 30 rpm, if I tell it to 10 rpm it goes 30 rpm). Furthermore, it is doing the same thing on an ungeared motor plugged into X which has a different max speed setting as you can see from the config settings I posted. It seems like there's a minimum speed setting somewhere that I don't know about. Here's a quick summary below:

Two motors connected to the board right now:

X
ungeared motor
set at 200 steps per mm so a command of 1mm travel equals 1 revolution
Max speed is set at 50 rpm
speed commands in the range of F1 - F30 always result in output of 30 rpm

E1
15.3:1 geared motor
set at 3060 steps per mm so a command of 1mm travel equals 1 revolution
Max speed is set at 36 rpm
speed commands in the range of F1 - F30 always result in output of 30 rpm

If I can give any additional information to shed light on what's going on please let me know. Thanks!
 Re: Strange steps per mm to rounds per minute conversion February 23, 2018 05:16AM Registered: 5 years ago Posts: 13,871
OK, now I see what you mean. The firmware enforces a minimum movement speed of 0.5mm/sec, which on your system is 30rpm.

Is there a particular reason you need to move so slowly; or that you need to equate 1mm = 1 revolution?

Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet.
 Re: Strange steps per mm to rounds per minute conversion February 24, 2018 04:28AM Registered: 3 years ago Posts: 5,232
Quote

M92 E1:3060 ; Set extruder steps/mm

Is that line correct? Wouldn't it better be
`E[E0_steps]:[E1_steps]`

And is it in the correct place of the config file? I have set my e-steps line after the tool-definition
 Re: Strange steps per mm to rounds per minute conversion February 24, 2018 11:55AM Registered: 2 years ago Posts: 22
Aha! Thanks dc42! I'm just using an extra duet board I had around and trying some experimental things with this setup. I'm shooting for maximum torque to see how much work I can get these geared Nema 23 motors to do. Now that I know the issue I can trick the firmware into doing what I want. I'll scale the steps per mm down by a factor of 100, and scale the acceleration, max speed, and jerk up by a factor of 100. Then I'll write my gcode with speed and distance commands scaled up by a factor of 100 to get the output I want. So G1 E500 F1000 will give me 5 revolutions at 10 rpm for example.
 Re: Strange steps per mm to rounds per minute conversion February 24, 2018 12:07PM Registered: 2 years ago Posts: 22
Quote
o_lampe
Quote

M92 E1:3060 ; Set extruder steps/mm

Is that line correct? Wouldn't it better be
`E[E0_steps]:[E1_steps]`

And is it in the correct place of the config file? I have set my e-steps line after the tool-definition

o_lampe,

You're correct. Actually on this board the E0 driver is burnt out. I don't really remember why I changed the steps per mm of E0 to 1 step per mm but nothing is hooked up to E0 anyway so its just really a placeholder to be skipped over to get you past the colon and over to the E1 section of the M92 command.

As for it being in the "correct" place. Logically I agree it is better your way but it does work in the order I wrote it.
 Re: Strange steps per mm to rounds per minute conversion February 25, 2018 03:58AM Registered: 3 years ago Posts: 5,232
I remember, I had all the M92 values in one line and it didn't work. So I asked myself, why the e-steps had to be in a separate command line. Maybe it was, because I also had extruder mixing enabled...
Sorry, only registered users may post in this forum.