<p>You should be able to adapt the "Dual X Carriage" feature for your project.</p>

<p>That allows a second print head (on the X axis) to move independently of the "main" X axis motor - and it can also be homed against its own endstop.</p>

<p>You can enable this feature in the <code>configuration_adv.h</code> file under "Dual X Carriage".</p>

<p>By default, all "Dual X/Y/Z axis" features use the first free extruder stepper driver - which would be E1 in your case.</p>

<p>You would have to adjust the <code>X2</code> parameters to allow you to zero the motor on the endstop (<code>X2_MIN_POS 0</code>, <code>X2_HOME_DIR -1</code>, <code>X2_HOME_POS X2_MIN_POS</code>), as well as setting the default mode to "<code>FULL CONTROL</code>" (<code>DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE</code>).</p>

<p>As far as I understand, you can then use
<code>T0</code> and <code>T1</code> to change between both "X axes", with <code>T0</code> selecting your real X axis, and <code>T1</code> your custom stepper motor.</p>

CC BY-SA 4.0
2019-07-01T10:23:19.000Z
It is a good idea to use a second X-axis stepper and the X-max end-stop. This means that the OP needs to divert from the E1 approach.
0scar
CC BY-SA 4.0
2019-07-01T10:48:26.383Z
E1 would still apply, only it's not really E1 anymore. "Dual X Carriage" uses the first unused extruder port for its operation, much like the perhaps more common "Dual Z Axis".
towe
CC BY-SA 4.0
2019-07-01T11:03:10.030Z
Yes I know, but you should make that clear in the answer as the OP might be on the route of specifying an E1 and a mechanism to home the stepper, while the dual X approach is different, certainly in the configuration file.
0scar
CC BY-SA 4.0
2019-07-01T11:54:38.847Z
@0scar I think it should be clearer now, though Marlin documentation on the Dual X Carriage feature is a bit lacking.
towe
CC BY-SA 4.0
2019-07-01T12:13:06.063Z
Thanks for the edit! This makes it better to understand for the OP and other users!
0scar
CC BY-SA 4.0
2019-07-01T15:06:25.150Z
Thanks, I'm a bit ashamed that I did not think about that :) I'll try it out. I'll try to remember to share the "thing" I'm working on here once it's finished.
McAbra
CC BY-SA 4.0
2019-07-01T09:25:43.530Z
2019-07-01T12:02:01.127Z
2019-07-01T12:02:01.127Z
towe
<p>I'm working on something that I'll share once it's done (then hope it's not a disaster and actually useful to someone).</p>

<p>It requires a stepper to rotate a part by a certain amount of degrees, which I plan to achieve by using E1 and simply issuing an appropriate <code>G0</code> command.</p>

<p>The issue I'm having is that I would need Marlin, upon start to check if the part is actually rotated to the 0 deg position.</p>

<p>I suspect that there is no way to i.e. use an unused Z max pin and issue something like the well known <code>G28</code> or like Duet3D does with <code>G0/1 S</code> parameter. Is there maybe a hack I can apply with a filament run out sensor as that axis endstop?</p>

CC BY-SA 4.0
2019-07-01T15:31:55.063Z
Can you edit for clarity, please?  "rotating a stepper" sounds like rotating the mount. I'm guessing what you want, per the answer, is to home a separate stepper and then drive it N steps.
Carl Witthoft
CC BY-SA 4.0
2019-07-03T06:40:55.423Z
Another option would be Klipper's "manual_stepper" functionality.
Will the project be standalone, or is it connected to a Raspberry / PC at all times?
towe
CC BY-SA 4.0
2019-07-03T16:31:45.683Z
I set Marlin as a baseline for myself thinking that if I can get it to work on Marlin 1.1.x it'll work on Marlin 2, Klipper and Duet3D. Nevertheless your input is highly appreciated as I'd like to at some point provide instructions on how to run it on the mentioned three.
McAbra
<extruder><endstop><axis>
Home E / extrude until endstop is triggered
McAbra
# Home E / extrude until endstop is triggered

(Asked by: username_0 on 2019-06-30)

I'm working on something that I'll share once it's done (then hope it's not a disaster and actually useful to someone).

It requires a stepper to rotate a part by a certain amount of degrees, which I plan to achieve by using E1 and simply issuing an appropriate `G0` command.

The issue I'm having is that I would need Marlin, upon start to check if the part is actually rotated to the 0 deg position.

I suspect that there is no way to i.e. use an unused Z max pin and issue something like the well known `G28` or like Duet3D does with `G0/1 S` parameter. Is there maybe a hack I can apply with a filament run out sensor as that axis endstop?

**Tags:** extruder, endstop, axis

> **Comments:**
> **username_1**: Can you edit for clarity, please?  "rotating a stepper" sounds like rotating the mount. I'm guessing what you want, per the answer, is to home a separate stepper and then drive it N steps.  
> **username_2**: Another option would be Klipper's "manual_stepper" functionality. Will the project be standalone, or is it connected to a Raspberry / PC at all times?  
> **username_0**: I set Marlin as a baseline for myself thinking that if I can get it to work on Marlin 1.1.x it'll work on Marlin 2, Klipper and Duet3D. Nevertheless your input is highly appreciated as I'd like to at some point provide instructions on how to run it on the mentioned three.  

---

## 1 answers

### Answer by username_2 on 2019-07-01. Score: 3 | Accepted answer

You should be able to adapt the "Dual X Carriage" feature for your project.

That allows a second print head (on the X axis) to move independently of the "main" X axis motor - and it can also be homed against its own endstop.

You can enable this feature in the `configuration_adv.h` file under "Dual X Carriage".

By default, all "Dual X/Y/Z axis" features use the first free extruder stepper driver - which would be E1 in your case.

You would have to adjust the `X2` parameters to allow you to zero the motor on the endstop (`X2_MIN_POS 0`, `X2_HOME_DIR -1`, `X2_HOME_POS X2_MIN_POS`), as well as setting the default mode to "`FULL CONTROL`" (`DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE`).

As far as I understand, you can then use
`T0` and `T1` to change between both "X axes", with `T0` selecting your real X axis, and `T1` your custom stepper motor.

> **Comments:**
> **username_3**: It is a good idea to use a second X-axis stepper and the X-max end-stop. This means that the OP needs to divert from the E1 approach.  
> **username_2**: E1 would still apply, only it's not really E1 anymore. "Dual X Carriage" uses the first unused extruder port for its operation, much like the perhaps more common "Dual Z Axis".  
> **username_3**: Yes I know, but you should make that clear in the answer as the OP might be on the route of specifying an E1 and a mechanism to home the stepper, while the dual X approach is different, certainly in the configuration file.  
> **username_2**: @username_3 I think it should be clearer now, though Marlin documentation on the Dual X Carriage feature is a bit lacking.  
> **username_3**: Thanks for the edit! This makes it better to understand for the OP and other users!  
> **username_0**: Thanks, I'm a bit ashamed that I did not think about that :) I'll try it out. I'll try to remember to share the "thing" I'm working on here once it's finished.  

---

