MANUAL_STEPPER only moves 1 time

Basic Information:

MCU / Printerboard: Raspberry pi pico

When I use the command:

MANUAL_STEPPER STEPPER=my_stepper MOVE=100 SPEED=50

the motor only moves once and only when I use a “-” in the movement it moves again but in the other direction that is, returning

MANUAL_STEPPER STEPPER=my_stepper MOVE=-100 SPEED=50

I need the motor to move without limits since it will be a conveyor belt for a delta

Looking at the documentation, that seems normal.

You told it to move to position 100, and it did so. It was then at position 100, so telling it to move to position 100 again would result in zero movement. If you want it to move to a different position, you need to either tell it to move to that new position (e.g. MOVE=200) or change what position it thinks it is in (e.g. SET_POSITION=0).

Actually, I’m not sure if the manual stepper respects G90 / G91.

If not then you need to work with absolute positions as indicated by @flowerysong.
For example you could write a macro that always adds +100 to the current position.

I don’t think it does. G90/G91 are handled in gcode_move.py and appear to be specific to calculating the position in the G1 command. manual_stepper.py doesn’t appear to contemplate the possibility of relative movement coordinates, but instead calculates the movement distance as being simply the difference between the current position and the commanded position.

1 Like

While I can’t test it, I don’t think you need a macro (unless you want to track the absolute change in position.) Just MANUAL_STEPPER STEPPER=my_stepper MOVE=100 SPEED=50 SET_POSITION=0.

Yes, that should work. The module processes the SET_POSITION parameter before the MOVE parameter, so always including SET_POSITION=0 in every MANUAL_STEPPER command would have the practical effect of making the MOVE parameter relative instead of absolute.

I tried this and it worked, I made this macro

[gcode_macro Move]
gcode:
 MANUAL_STEPPER STEPPER=my_stepper MOVE=500 SPEED=100
 MANUAL_STEPPER STEPPER=my_stepper SET_POSITION=0

and I think it works for my purposes…

I would not do it that way around, since it makes the behaviour of the move dependent on the state of the stepper (if it already thinks it’s at 500 it won’t move, while if it thinks it’s at 5500 it will move backward 5000.)

This might not matter in practice for your use case, but it’s easier to reason about the code if you either calculate the move based on the current position of the stepper, have the SET_POSITION before the move, or do what I suggested before and use SET_POSITION in the same command as the move.

1 Like