# Klipper Shutdown When Moving Manual Stepper Simultaneously

**URL:** <https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642>\
**Category:** General Discussion\
**Created:** [August 20, 2025, 12:54pm UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642 "2025-08-20T12:54:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zapprint](https://avatars.discourse-cdn.com/v4/letter/z/a9adbd/32.png) [@zapprint](https://klipper.discourse.group/u/zapprint)\
**Post date:** [August 20, 2025, 12:54pm UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642/1 "2025-08-20T12:54:06Z")

</div>

### Basic Information:

Printer Model: Voron Trident  
 MCU / Printerboard: BTT-SKR 1.4 & MELLOW Fly D8  
 Host / SBC: Orange Pi Zero 3  
 klippy.log

_Fill out above information and_ _ **in all cases attach your** _ **`klippy.log` _file_** (use zip to compress it, if too big). _Pasting your_ `printer.cfg` _is **not** needed_  
_ **Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there** _

So i tried to make pico mmu ([Pico MMU · lhndo/LH-Stinger Wiki · GitHub](https://github.com/lhndo/LH-Stinger/wiki/Pico-MMU) ) but when i comfigure my [manual\_stepper] there is something wrong with it. when i move my stepper this message show up.

 ![Screenshot_2025-08-20-19-48-06-734_com.android.chrome-edit](https://global.discourse-cdn.com/free1/uploads/klipper/original/3X/d/c/dc540dbbf1c0192aa36aaaf965bb8056f9f95fee.jpeg)

strange thing is, this message is only appear when i execute the macro/gcode command when stepper is moving. but when is stop and execute it. it works fine the stepper is moving correctly

[klippy.log (5).zip](https://klipper.discourse.group/uploads/short-url/cYoliuiA76SbJxFcMYnPuKA81w8.zip) (6.4 MB)

---

<div class="post-metadata">

**Author:** ![3dcoded](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/3dcoded/32/20297_2.png) [@3dcoded](https://klipper.discourse.group/u/3dcoded)\
**Post date:** [August 20, 2025, 1:25pm UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642/2 "2025-08-20T13:25:04Z")

</div>

Hi @zapprint ,

It looks like you’re getting an internal error on stepcompress, which is one of the more obscure errors. 🤔

Have you seen Happy Hare MMU software? It has Pico MMU support and is much more robust than simple macros.

> **[GitHub - moggieuk/Happy-Hare: MMU software driver for Klipper (ERCF, Tradrack,...](https://github.com/moggieuk/Happy-Hare)**
>
> MMU software driver for Klipper (ERCF, Tradrack, Box Turtle, Night Owl, Angry Beaver, 3MS, ...)

---

<div class="post-metadata">

**Author:** ![nefelim4ag](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/nefelim4ag/32/2387_2.png) [@nefelim4ag](https://klipper.discourse.group/u/nefelim4ag)\
**Post date:** [August 20, 2025, 2:30pm UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642/3 "2025-08-20T14:30:07Z")

</div>

```auto
Git version: 'v0.13.0-212-g78462cff4-dirty'
Untracked files: klippy/extras/led_effect.py, klippy/extras/z_calibration.py
Branch: master
Remote: origin
....
b'stepcompress o=2 i=0 c=4 a=0: Invalid sequence'
Internal error on command:"MANUAL_STEPPER"
Traceback (most recent call last):
  File "/home/zopi/klipper/klippy/gcode.py", line 212, in _process_commands
    handler(gcmd)
  File "/home/zopi/klipper/klippy/gcode.py", line 140, in <lambda>
    func = lambda params: origfunc(self._get_extended_params(params))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zopi/klipper/klippy/gcode.py", line 150, in <lambda>
    handler = lambda gcmd: self._cmd_mux(cmd, gcmd)
                           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zopi/klipper/klippy/gcode.py", line 315, in _cmd_mux
    values[key_param](gcmd)
  File "/home/zopi/klipper/klippy/extras/manual_stepper.py", line 120, in cmd_MANUAL_STEPPER
    self.do_move(movepos, speed, accel, sync)
  File "/home/zopi/klipper/klippy/extras/manual_stepper.py", line 81, in do_move
    self.sync_print_time()
  File "/home/zopi/klipper/klippy/extras/manual_stepper.py", line 47, in sync_print_time
    toolhead.dwell(self.next_cmd_time - print_time)
  File "/home/zopi/klipper/klippy/toolhead.py", line 463, in dwell
    self._advance_move_time(next_print_time)
  File "/home/zopi/klipper/klippy/toolhead.py", line 291, in _advance_move_time
    self._advance_flush_time(flush_time)
  File "/home/zopi/klipper/klippy/toolhead.py", line 278, in _advance_flush_time
    self.motion_queuing.flush_motion_queues(flush_time, sg_flush_time)
  File "/home/zopi/klipper/klippy/extras/motion_queuing.py", line 65, in flush_motion_queues
    raise mcu.error("Internal error in MCU '%s' stepcompress"
mcu.error: Internal error in MCU 'btt-skr' stepcompress
Transition to shutdown state: Internal error on command:"MANUAL_STEPPER"
...

```

Hmmm…

@zapprint, can you maybe show the minimal G-code sequence to reproduce that?

It can be related to recent refactoring, so you can also try switching to an older Klipper:

```auto
git checkout 3ef760c18
sudo systemctl restart klipper

```

So, if you can reproduce on the recent release and can’t with the older one, something has been broken recently.

Thanks.

* * *

@3dcoded, jfyi, generally, there is an assumption that you should not be able to crash vanilla Klipper, even by the macros.

> [@3dcoded](#):
>
> It looks like you’re getting an internal error on stepcompress, which is one of the more obscure errors. 🤔

This is not so obscure, in a sense. This means that, for some reason, itersolve generates steps with a 0 interval (infinite speed), or the stepcompress code does something strange and outputs that sequence.

---

<div class="post-metadata">

**Author:** ![zapprint](https://avatars.discourse-cdn.com/v4/letter/z/a9adbd/32.png) [@zapprint](https://klipper.discourse.group/u/zapprint)\
**Post date:** [August 20, 2025, 4:53pm UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642/4 "2025-08-20T16:53:53Z")

</div>

yeah i found out this is a problem with the klipper. i tried to roll back and it works

> cd ~/klipper
> 
> sudo systemctl stop klipper
> 
> git reset --hard 17ce45d2
> 
> sudo systemctl start klipper

---

<div class="post-metadata">

**Author:** ![nefelim4ag](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/nefelim4ag/32/2387_2.png) [@nefelim4ag](https://klipper.discourse.group/u/nefelim4ag)\
**Post date:** [August 20, 2025, 6:21pm UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642/5 "2025-08-20T18:21:01Z")

</div>

@koconnor JFYI,  
I will try to make a fix, but it will take some time.

gcode, rp2040 printer.cfg, rp2040 kconfig just in case  
[Archive.zip](https://klipper.discourse.group/uploads/short-url/wpghS6VyOYJvUQIoL7zM8n0ZU93.zip) (2.0 KB)

```auto
python3 klippy/klippy.py rp2040_printer.cfg -a /tmp/klippy_uds -i /tmp/bug.gcode -d out/klipper.dict -o test.serial
INFO:root:Starting Klippy...
INFO:root:Start printer at Wed Aug 20 20:12:39 2025 (1755713559.9 9055.3)
INFO:root:Extruder max_extrude_ratio=2.494510
INFO:root:Loaded MCU 'mcu' 134 commands (v0.13.0-237-gc4ac6e04c / gcc: (Arch Repository) 14.2.0 binutils: (GNU Binutils) 2.43)
MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c0a=gpio0,gpio1 BUS_PINS_i2c0b=gpio4,gpio5 BUS_PINS_i2c0c=gpio8,gpio9 BUS_PINS_i2c0d=gpio12,gpio13 ... BUS_PINS_spi1a=gpio8,gpio11,gpio10 BUS_PINS_spi1b=gpio12,gpio15,gpio14 BUS_PINS_spi1c=gpio24,gpio27,gpio26 CLOCK_FREQ=12000000 MCU=rp2040 PWM_MAX=255 STATS_SUMSQ_BASE=256 STEPPER_OPTIMIZED_EDGE=2 STEPPER_STEP_BOTH_EDGE=1
INFO:root:Sending MCU 'mcu' printer configuration...
INFO:root:Configured MCU 'mcu' (500 moves)
ERROR:root:b'stepcompress o=2 i=0 c=17 a=0: Invalid sequence'
ERROR:root:Internal error on command:"MANUAL_STEPPER"
Traceback (most recent call last):
  File "/home/nefelim4ag/Coding/klipper/klippy/gcode.py", line 212, in _process_commands
    handler(gcmd)
    ~~~~~~~ ^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/gcode.py", line 140, in <lambda>
    func = lambda params: origfunc(self._get_extended_params(params))
                          ~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/gcode.py", line 150, in <lambda>
    handler = lambda gcmd: self._cmd_mux(cmd, gcmd)
                           ~~~~~~~~~~~~~ ^^^^^^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/gcode.py", line 315, in _cmd_mux
    values[key_param](gcmd)
    ~~~~~~~~~~~~~~~~~ ^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/extras/manual_stepper.py", line 120, in cmd_MANUAL_STEPPER
    self.do_move(movepos, speed, accel, sync)
    ~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/extras/manual_stepper.py", line 81, in do_move
    self.sync_print_time()
    ~~~~~~~~~~~~~~~~~~~~ ^^
  File "/home/nefelim4ag/Coding/klipper/klippy/extras/manual_stepper.py", line 47, in sync_print_time
    toolhead.dwell(self.next_cmd_time - print_time)
    ~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/toolhead.py", line 462, in dwell
    self._advance_move_time(next_print_time)
    ~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/toolhead.py", line 290, in _advance_move_time
    self._advance_flush_time(flush_time)
    ~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/toolhead.py", line 279, in _advance_flush_time
    self.motion_queuing.flush_motion_queues(flush_time, sg_flush_time,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                            trapq_free_time)
                                            ^^^^^^^^^^^^^^^^
  File "/home/nefelim4ag/Coding/klipper/klippy/extras/motion_queuing.py", line 67, in flush_motion_queues
    raise mcu.error("Internal error in MCU '%s' stepcompress"
                    % (mcu.get_name(),))
mcu.error: Internal error in MCU 'mcu' stepcompress
ERROR:root:Transition to shutdown state: Internal error on command:"MANUAL_STEPPER"
INFO:root:Dumping gcode input 1 blocks
Read 9055.314311: 'MANUAL_STEPPER STEPPER=sp_motor MOVE=300 SPEED=10 ACCEL=2000\nMANUAL_STEPPER STEPPER=sp_motor MOVE=100 SPEED=10 ACCEL=2000\n'
INFO:root:gcode state: absolute_coord=True absolute_extrude=True base_position=[0.0, 0.0, 0.0, 0.0] last_position=[0.0, 0.0, 0.0, 0.0] homing_position=[0.0, 0.0, 0.0, 0.0] speed_factor=0.016666666666666666 extrude_factor=1.0 speed=25.0
INFO:root:Reactor garbage collection: (0.0, 0.0, 0.0)
ERROR:root:Internal error on command:"MANUAL_STEPPER"
Once the underlying issue is corrected, use the
"FIRMWARE_RESTART" command to reset the firmware, reload the
config, and restart the host software.
Printer is shutdown

WARNING:root:Internal error on command:"MANUAL_STEPPER"

```

---

<div class="post-metadata">

**Author:** ![koconnor](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@koconnor](https://klipper.discourse.group/u/koconnor)\
**Post date:** [August 20, 2025, 7:06pm UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642/6 "2025-08-20T19:06:12Z")

</div>

> JFYI,  
> I will try to make a fix, but it will take some time.

Thanks for the ping and the well designed test case. It’s this change in commit 5cbe7d83e that introduces the regression:

```diff
@@ -76,8 +75,6 @@ class ManualStepper:
         self.sync_print_time()
         self.next_cmd_time = self._submit_move(self.next_cmd_time, movepos,
                                                speed, accel)
- self.trapq_finalize_moves(self.trapq, self.next_cmd_time + 99999.9,
- self.next_cmd_time + 99999.9)
         toolhead = self.printer.lookup_object('toolhead')
         toolhead.note_mcu_movequeue_activity(self.next_cmd_time)
         if sync:

```

It’s not immediately clear to me why that change breaks the code - I’ll continue to look at it.

-Kevin

---

<div class="post-metadata">

**Author:** ![koconnor](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@koconnor](https://klipper.discourse.group/u/koconnor)\
**Post date:** [August 20, 2025, 8:59pm UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642/7 "2025-08-20T20:59:17Z")

</div>

I was able to track this down. The issue was actually introduced in commit 9399e738. I have created a PR at [Fix flushing bug in manual\_stepper by KevinOConnor · Pull Request #7019 · Klipper3d/klipper · GitHub](https://github.com/Klipper3d/klipper/pull/7019) that will hopefully fix the issue.

-Kevin

---

<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:** [September 20, 2025, 6:59am UTC](https://klipper.discourse.group/t/klipper-shutdown-when-moving-manual-stepper-simultaneously/24642/8 "2025-09-20T06:59:59Z")

</div>

Closed on September 20, 2025, 6:59am UTC

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