Ramps1.4 using five drivers: Y2 always same direction

I have connected my five steppers to a RAMPSv1.4 board. All steppers work fine, except Y2 (connected to E0).

When testing the motors using RepetierHost, it always turns counter-clockwise. Or rather, when moving Y direction, it always turns counter-clockwise. If I move it using the extruder buttons, it moves in both directions.

In the Marlin source I have defined Y_DUAL_STEPPER_DRIVERS and Z_DUAL_STEPPER_DRIVERS in configuration_adv.h and I have defined Y2 and Z2 pins to reflect E0 and E1 in pins_RAMPS.h

I’m using branch MPCNC_Ramps_T8_16T_LCD_32step, pulled yesterday.

Any ideas or suggestions are highly appreciated.

Can you verify your endstops are connected and working? Use M119 and verify each switch status indepenently.

If just one motor is moving the wrong direction, then you can flip the plug.

Ryan has a version with dual endstops already.

We assigned the E0 pins to 70, so if you can move it with extruder buttons, then at least that is different.

Thank you for your answers. I don’t have any endstops yet. But I fail to see how this problem could have anything to do with the endstops.

Let me clarify. The Y2 motor is not turning the wrong direction. It is turning in one direction only. For positive movement, Y is turning counter-clockwise and so is Y2. For negative movement, Y is turning clockwise but Y2 is still turning counter-clockwise. With the extruder buttons, the motor can turn both directions, so I don’t think there is anything wrong with the motor or the driver.

Hope that makes it clearer.

In any case, I will mount endstops just to rule out that they are causing the problem.

Any other ideas are greatly appreciated!

If you have a scope or DMM, try probing the the “DIR” line of the stepper driver in question. It should toggle logic high or low depending on the direction commanded.

 

Direction-Pin.png

The dual endstop firmware has the dual motors configured properly. I think Erwin got it right, the E0 dir pin is being xontrolled by E0 and not Y2. You need to change those pins to 70, just like Ryan’s dual firmware has it configured.

Here’s the file with the changes:

https://github.com/Allted/Marlin/blob/MPCNC_Ramps_T8_16T_LCD_32step_DualEndstop/Marlin/src/pins/pins_RAMPS.h

Yup, that was it! It wasn’t really obvious that the extruders should be configured to use an unmapped pin.

(I tried setting all extruder pins to -1, as that is used in other places. But that didn’t compile, as Marlin requires at least one extruder.)

Thank you!