# MANUAL\_STEPPER only moves 1 time

**URL:** <https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987>\
**Category:** General Discussion\
**Created:** [June 11, 2024, 5:37pm UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987 "2024-06-11T17:37:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mago3D](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Mago3D](https://klipper.discourse.group/u/Mago3D)\
**Post date:** [June 11, 2024, 5:37pm UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/1 "2024-06-11T17:37:47Z")

</div>

### Basic Information:

MCU / Printerboard: Raspberry pi pico

When I use the command:

```auto
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

```auto
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

---

<div class="post-metadata">

**Author:** ![flowerysong](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/flowerysong/32/10214_2.png) [@flowerysong](https://klipper.discourse.group/u/flowerysong)\
**Post date:** [June 11, 2024, 6:20pm UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/2 "2024-06-11T18:20:30Z")

</div>

Looking at the [documentation](https://www.klipper3d.org/G-Codes.html#manual_stepper_1), 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`).

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [June 11, 2024, 7:22pm UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/3 "2024-06-11T19:22:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![theophile](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/theophile/32/31_2.png) [@theophile](https://klipper.discourse.group/u/theophile)\
**Post date:** [June 11, 2024, 8:10pm UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/4 "2024-06-11T20:10:40Z")

</div>

> [@Sineos](#):
>
> Actually, I’m not sure if the manual stepper respects `G90` / `G91`.

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](https://github.com/Klipper3d/klipper/blob/589bd64ce013691ef8989d3dfbc74ffe0822d480/klippy/extras/gcode_move.py#L120). 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](https://github.com/Klipper3d/klipper/blob/589bd64ce013691ef8989d3dfbc74ffe0822d480/klippy/extras/manual_stepper.py#L61C9-L61C28).

---

<div class="post-metadata">

**Author:** ![flowerysong](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/flowerysong/32/10214_2.png) [@flowerysong](https://klipper.discourse.group/u/flowerysong)\
**Post date:** [June 11, 2024, 8:16pm UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/5 "2024-06-11T20:16:33Z")

</div>

> [@Sineos](#):
>
> For example you could write a macro that always adds +100 to the current position.

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

---

<div class="post-metadata">

**Author:** ![theophile](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/theophile/32/31_2.png) [@theophile](https://klipper.discourse.group/u/theophile)\
**Post date:** [June 11, 2024, 9:01pm UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/6 "2024-06-11T21:01:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mago3D](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Mago3D](https://klipper.discourse.group/u/Mago3D)\
**Post date:** [June 12, 2024, 3:50am UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/7 "2024-06-12T03:50:17Z")

</div>

I tried this and it worked, I made this macro

```auto
[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…

---

<div class="post-metadata">

**Author:** ![flowerysong](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/flowerysong/32/10214_2.png) [@flowerysong](https://klipper.discourse.group/u/flowerysong)\
**Post date:** [June 12, 2024, 4:06am UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/8 "2024-06-12T04:06:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [August 11, 2024, 4:07am UTC](https://klipper.discourse.group/t/manual-stepper-only-moves-1-time/16987/9 "2024-08-11T04:07:18Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
