# Move individual z stepper

**URL:** <https://klipper.discourse.group/t/move-individual-z-stepper/5757>\
**Category:** Developers\
**Created:** [January 5, 2023, 4:00pm UTC](https://klipper.discourse.group/t/move-individual-z-stepper/5757 "2023-01-05T16:00:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLoneDeranger](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@TheLoneDeranger](https://klipper.discourse.group/u/TheLoneDeranger)\
**Post date:** [January 5, 2023, 4:00pm UTC](https://klipper.discourse.group/t/move-individual-z-stepper/5757/1 "2023-01-05T16:00:47Z")

</div>

Hi,  
I’m working on a script that will auto-adjust the tilt of the bed during printing.

I’m looking for a way to control each z-stepper motor independently and transparently during printing just like bed mesh or z\_thermal\_adjust  
Currently I’m using FORCE\_MOVE which validated the concept and resolved the main objective of the project, But it causes the **toolhead** to **pause** every time a FORCE\_MOVE is called.

What will be the best route to go for implementing it?

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [January 5, 2023, 5:11pm UTC](https://klipper.discourse.group/t/move-individual-z-stepper/5757/2 "2023-01-05T17:11:03Z")

</div>

> [@TheLoneDeranger](#):
>
> auto-adjust the tilt of the bed during printing.

How will you know that the adjustment is wrong during print?

---

<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:** [January 10, 2023, 2:07am UTC](https://klipper.discourse.group/t/move-individual-z-stepper/5757/5 "2023-01-10T02:07:23Z")

</div>

The bed\_mesh and z\_thermal\_adjust modules work by altering the incoming g-code commands. It has the effect of changing the Z position of moves to account for differences in bed height. It is possible to create a similar module if the goal is to adjust the nominal Z position of the toolhead.

There is also quad\_gantry\_level and z\_tilt modules - they work by altering the individual z stepper motors of printers that have multiple z motors. Once these motors are adjusted, they remain at the same relative position through the remainder of the print. These modules effectively use something similar to FORCE\_MOVE to alter the stepper positions.

If the goal is to alter the individual Z motors during a print, such that their relative positions also change during a print, then the only way to do that currently is to create a new Klipper kinematics. This is harder to implement as it requires both Python code and C code. The C kinematics code specifies a math formula that can convert a nominal cartesian XYZ coordinate into a stepper position. Once Klipper has this math formula it uses an “iterative solver” to generate appropriate step times for it. There is some details on this process at [Code overview - Klipper documentation](https://www.klipper3d.org/Code_Overview.html#adding-new-kinematics) .

-Kevin

---

<div class="post-metadata">

**Author:** ![TheLoneDeranger](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@TheLoneDeranger](https://klipper.discourse.group/u/TheLoneDeranger)\
**Post date:** [January 10, 2023, 7:02am UTC](https://klipper.discourse.group/t/move-individual-z-stepper/5757/6 "2023-01-10T07:02:10Z")

</div>

Thanks for the reply  
So just to be sure  
1 . bed\_mesh does move the each z steppers during print?  
2 . Or it moves all of them together in a “bouncing motion” no matter how rough the bed mesh is?

3 . “nominal Z position” - it means that for every X,Y it alter the Z position in gcode (or add a z position)?

---

<div class="post-metadata">

**Author:** ![TheLoneDeranger](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@TheLoneDeranger](https://klipper.discourse.group/u/TheLoneDeranger)\
**Post date:** [January 10, 2023, 5:56pm UTC](https://klipper.discourse.group/t/move-individual-z-stepper/5757/7 "2023-01-10T17:56:13Z")

</div>

I might have an idea on how to avoid diving into a python plugin

I can tram the bed mesh itself either on-the-fly according to the ref\_temp or prepare all the permutations before that.

Each one raises a potential problem that you might know the answer to:

on-the-fly - Is it possible to add / modify manual (points) bed meshes during printing?

permutations - How scalable is the config? does the number of bed meshes has any effect on performance? we are talking N^2 bed meshes, N is the number of temperatures, which is usually between 22C-60C, with 0.1 steps, i.e 78,400, lets round it to 100K, will it handle it?

---

<div class="post-metadata">

**Author:** ![TheLoneDeranger](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@TheLoneDeranger](https://klipper.discourse.group/u/TheLoneDeranger)\
**Post date:** [January 14, 2023, 2:14pm UTC](https://klipper.discourse.group/t/move-individual-z-stepper/5757/8 "2023-01-14T14:14:21Z")

</div>

@koconnor  
I haven’t found a way to add new manual meshes, but the question of the max size of the config / max number of supported bed meshes is still relevant

---

<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:** [January 15, 2023, 2:07am UTC](https://klipper.discourse.group/t/move-individual-z-stepper/5757/9 "2023-01-15T02:07:53Z")

</div>

I don’t know. It’s not something I’ve tried.

-Kevin
