# Changing rotation\_distance during printing depending on sensor readings

**URL:** <https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087>\
**Category:** General Discussion\
**Created:** [February 13, 2024, 8:44am UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087 "2024-02-13T08:44:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheDoshs](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TheDoshs](https://klipper.discourse.group/u/TheDoshs)\
**Post date:** [February 13, 2024, 8:44am UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/1 "2024-02-13T08:44:31Z")

</div>

### Basic Information:

Printer Model: Custom  
MCU / Printerboard: Bigtreetech Manta M8P

Good day! I would like to know if it is possible to change the rotation\_distance of the extruder during printing depending on the sensor reading?  
The problem is that our printer sometimes starves of dry mixture. At the moment, the supply of the mixture is tied to a photoresistor (instead of a temperature sensor), which, using [heater\_fan fan], turns on/off the extruder driver (enable signal). Temperature adjustment in heater\_temp allows you to set the limits for turning the driver on and off. However, completely “turning off” the extruder is not a very good option; it would be nice to simply adjust its rotation\_distance depending on the sensor reading. For example, light (temperature) is above 50, then let rotation\_distance be equal to 100, if below then 500.

Apparently, need to create something like heater\_fan. I will be very glad to hear ideas and suggestions 🙂

---

<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:** [February 13, 2024, 9:28am UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/2 "2024-02-13T09:28:51Z")

</div>

While I have not the faintest idea of what you are talking about, see [G-Codes - Klipper documentation](https://www.klipper3d.org/G-Codes.html#set_extruder_rotation_distance)

---

<div class="post-metadata">

**Author:** ![TheDoshs](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TheDoshs](https://klipper.discourse.group/u/TheDoshs)\
**Post date:** [February 13, 2024, 9:57am UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/3 "2024-02-13T09:57:15Z")

</div>

I know about the SET\_EXTRUDER\_ROTATION\_DISTANCE command, but the question is how to change rotation\_distance based on sensor readings in real time

---

<div class="post-metadata">

**Author:** ![JassMan23](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/jassman23/32/8238_2.png) [@JassMan23](https://klipper.discourse.group/u/JassMan23)\
**Post date:** [February 13, 2024, 12:34pm UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/4 "2024-02-13T12:34:40Z")

</div>

> [@TheDoshs](#):
>
> SET\_EXTRUDER\_ROTATION\_DISTANCE

Rather than using a stepper for the extruder, have you though of using a geared down BLDC and using the [pwm\_tools](https://www.klipper3d.org/Using_PWM_Tools.html) in klipper. M3/M4 can be using to directly control the motor speed depending on the pseudo\_temperature. M5 could possibly be given a negative value to “retract” your extrustion\_mixture while moving from one position to another.  
[edit]Linked to pwm\_tools

---

<div class="post-metadata">

**Author:** ![jakep\_82](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jakep\_82](https://klipper.discourse.group/u/jakep_82)\
**Post date:** [February 13, 2024, 1:47pm UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/5 "2024-02-13T13:47:12Z")

</div>

Use M221 to change the extruder flow percentage.

---

<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:** [February 13, 2024, 1:51pm UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/6 "2024-02-13T13:51:01Z")

</div>

Yes, way better than fumbling around with the basic mechanic settings.

---

<div class="post-metadata">

**Author:** ![TheDoshs](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TheDoshs](https://klipper.discourse.group/u/TheDoshs)\
**Post date:** [February 14, 2024, 11:32am UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/7 "2024-02-14T11:32:09Z")

</div>

> [@jakep\_82](#):
>
> Use M221 to change the extruder flow percentage.

How can this be connected to a temperature sensor (photoresistor)? So that the printer uses this command depending on the sensor reading (without my intervention via the console)?

---

<div class="post-metadata">

**Author:** ![TheDoshs](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TheDoshs](https://klipper.discourse.group/u/TheDoshs)\
**Post date:** [February 14, 2024, 11:37am UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/8 "2024-02-14T11:37:40Z")

</div>

We need to think about this and figure out whether it will be possible to control Nema34 through this 🤔

---

<div class="post-metadata">

**Author:** ![JassMan23](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/jassman23/32/8238_2.png) [@JassMan23](https://klipper.discourse.group/u/JassMan23)\
**Post date:** [February 14, 2024, 11:45am UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/9 "2024-02-14T11:45:13Z")

</div>

@TheDoshs Hope I’m not teaching grandma to suck eggs here but BLDC are not steppers, although they are available in NEMA34 format. You would also need a stand alone controller to convert the pwm signal to the (normally) 3 wires for the motor.

---

<div class="post-metadata">

**Author:** ![TheDoshs](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TheDoshs](https://klipper.discourse.group/u/TheDoshs)\
**Post date:** [February 14, 2024, 11:52am UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/10 "2024-02-14T11:52:22Z")

</div>

> [@JassMan23](#):
>
> @TheDoshs Hope I’m not teaching grandma to suck eggs here but BLDC are not steppers, although they are available in NEMA34 format. You would alsoneed a stanalone controller to convert the pwm signal to the (normally) 3 wires for the motor.

Grandma needs to think

---

<div class="post-metadata">

**Author:** ![JassMan23](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/jassman23/32/8238_2.png) [@JassMan23](https://klipper.discourse.group/u/JassMan23)\
**Post date:** [February 14, 2024, 12:00pm UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/11 "2024-02-14T12:00:30Z")

</div>

I only suggested BLDC because you are extruding a mixture rather than a filament and assumed your photo sensor is looking at how much slump you are getting. Steppers are excellent for filament because the input volume to output layer height/width a direct calculation but you are outputting squidgy stuff and needs a more analog approach to the problem.

---

<div class="post-metadata">

**Author:** ![JassMan23](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/jassman23/32/8238_2.png) [@JassMan23](https://klipper.discourse.group/u/JassMan23)\
**Post date:** [February 14, 2024, 12:12pm UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/12 "2024-02-14T12:12:35Z")

</div>

In fact, have you thought of having a mixing reservoir and a simple gate to allow the mixture out? I was thinking that a loose fitting archemedies screw (as in a sausage making machine) could push it towards the gate but if the gate is closed, the screw wouldn’t jam. The output side of the gate could flow into a 3sided box and slipform the mixture onto the model. Obviously this basic version wouldn’t be so good for crossing infills but a method could be devised for the slipformer to raise/lower independently of the gate. The only extrusion control you would need would be into maintaining the reservoir which can be a simple fill/not\_fill.

---

<div class="post-metadata">

**Author:** ![TheDoshs](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TheDoshs](https://klipper.discourse.group/u/TheDoshs)\
**Post date:** [February 14, 2024, 1:31pm UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/13 "2024-02-14T13:31:50Z")

</div>

Personally, I haven’t thought about it, but I assure you that the current design of the mixture release is excellent, so I highly doubt that it will be revised. The only problem is how to give enough dry mixture for printing, but at the same time not give too much so as not to catch a wedge. Otherwise, in the current realities, the lack of mixture has a negative effect on the layers (extrude is too liquid). Therefore, we have an intermediate tank for dry mixture with a photoresistor and a light bulb, which should to some extent eliminate this problem, but it also has some nuances

---

<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:** [April 14, 2024, 1:31pm UTC](https://klipper.discourse.group/t/changing-rotation-distance-during-printing-depending-on-sensor-readings/14087/14 "2024-04-14T13:31:53Z")

</div>

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