<p><em>I've reverted to version 2.1.2.2 to be compatible to the version used in the question. The analysis is based on this version.</em></p>
<hr />
<h2>Diving into the code</h2>
<p>When looking into the (2.1.2.2) sources you'll see that there is no mention of <code>Y_DUAL_STEPPER_DRIVERS</code> other than in the <code>Changes.h</code> file.</p>
<p><a href="https://i.sstatic.net/AcjBN.png" rel="nofollow noreferrer" title="Search results in Marlin 2.1.2.2 sources"><img src="https://i.sstatic.net/AcjBN.png" alt="enter image description here" title="Search results in Marlin 2.1.2.2 sources" /></a></p>
<p>Snippet:</p>
<pre><code>...
#elif defined(Y_DUAL_STEPPER_DRIVERS)
  #error &quot;Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed.&quot;
...
</code></pre>
<p>This file checks for compatibility of configuration settings against the current &quot;to be compiled&quot; version of Marlin based on your sources. On compilation you get the above mesage when using that <code>Y_DUAL_STEPPER_DRIVERS</code> define statement. The snippet from your question of your <code>Configuration_adv.h</code> is therefore incorrect, you are using a different config file  (or you are using an older config file from a previous Marlin version) than should be used for this version of Marlin; hence you have to keep <code>//#define Y_DUAL_STEPPER_DRIVERS</code> in comments!</p>
<h2>Getting to the issue!</h2>
<p>Definition of an additional stepper in e.g. Y (this will be called Y2 from now on) is configured through the <code>Configuration.h</code> file:</p>
<p>Change by uncommenting this line</p>
<pre><code>//#define Y2_DRIVER_TYPE A4988
</code></pre>
<p>to</p>
<pre><code>#define Y2_DRIVER_TYPE A4988
</code></pre>
<p>This configuration setting will define that you have multiple (i.e. two) Y stepper motors on separate stepper drivers by setting <code>HAS_Y2_STEPPER</code> to 1 (equivalent to <code>TRUE</code>) in <code>Conditionals_LCD.h</code>:</p>
<pre><code>#ifdef Y2_DRIVER_TYPE
#define HAS_Y2_STEPPER 1
</code></pre>
<p>This definition is very suspicious as <code>HAS_Y2_STEPPER</code> isn't used anywhere in the code... <em>This is actually a bug in Marlin 2.1.2.2!</em> This should have read:</p>
<pre><code>#ifdef Y2_DRIVER_TYPE
#define HAS_DUAL_Y_STEPPERS 1
</code></pre>
<p>We continue, with this Marlin version to find the check for the existance of the definitin of the Y2 pins, from <code>SanityCheck.h</code> we read:</p>
<pre><code>/**
 * Multiple Stepper Drivers Per Axis
 */
...
#if HAS_DUAL_Y_STEPPERS &amp;&amp; !GOOD_AXIS_PINS(Y2)
  #error &quot;If Y2_DRIVER_TYPE is defined, then Y2 ENABLE/STEP/DIR pins are also needed.&quot;
#endif
...
</code></pre>
<p>Since <code>HAS_DUAL_Y_STEPPERS</code> has never been set in the 2.1.2.2 sources, your build does not check if the pins for this Y2 stepper are defined in your <code>pins_RAMPS.h</code> file and hence does not compile.</p>
<h2>How to get it compiled</h2>
<p>Fix the 2.1.2.2 bugs as suggested above (replace <code>HAS_Y2_STEPPER</code> for <code>HAS_DUAL_Y_STEPPERS</code> in <code>Conditionals_LCD.h</code>) and set the Y2 stepper pins (see other solution below: using the latest bugfix branch). Do note that <code>HAS_Y2_STEPPER</code> is the constant name that is used throughout the latest version of Marlin. You'll see that this will compile fine:</p>
<p><a href="https://i.sstatic.net/LgIbH.png" rel="nofollow noreferrer" title="Screenshot of succesful compilation after fixing Marlin version 2.1.2.2"><img src="https://i.sstatic.net/LgIbH.png" alt="enter image description here" title="Screenshot of succesful compilation after fixing Marlin version 2.1.2.2" /></a></p>
<p>Anoter solution, and the preferred one, is to go to the latest branch of Marlin, i.e. Bugfix 2.1.x (where these problems are fixed) and define the Y2 pins in the <code>pins_RAMPS.h</code> file:</p>
<p>Change:</p>
<pre><code>#ifndef E1_STEP_PIN
  #define E1_STEP_PIN                         36
#endif
#ifndef E1_DIR_PIN
  #define E1_DIR_PIN                          34
#endif
#ifndef E1_ENABLE_PIN
  #define E1_ENABLE_PIN                       30
#endif
#ifndef E1_CS_PIN
  #define E1_CS_PIN                      AUX2_07
#endif
</code></pre>
<p>to</p>
<pre><code>#ifndef Y2_STEP_PIN
  #define Y2_STEP_PIN                         36
#endif
#ifndef Y2_DIR_PIN
  #define Y2_DIR_PIN                          34
#endif
#ifndef Y2_ENABLE_PIN
  #define Y2_ENABLE_PIN                       30
#endif
#ifndef Y2_CS_PIN
  #define Y2_CS_PIN                      AUX2_07
#endif
</code></pre>
<h2>Miscellaneous</h2>
<blockquote>
<p>Other posts on different blogs drove me to tweak the pins_RAMPS.h file, but I realized it was a waste of time.</p>
</blockquote>
<p>No, this is not a waste of time, this is necessary as can be seen above. As you are changing the use of the board (standard: X, Y, Z, E0 and E1) to the dual Y solution (X, Y, Z, E0 and Y2) you need to assign the pins from the standard E1 to the Y2, this process cannot be skipped.</p>
<blockquote>
<p>I will be forced to build an add-on nanocard hosting a couple of twin A4988 drivers, but the room on the RAMPS shield is so little.</p>
</blockquote>
<p>No, this is not necessary.</p>

CC BY-SA 4.0
2024-04-05T07:37:07.030Z
dear Oscar, thank you  for your detailed explanation. So I have re-unzipped a 2.1.2.2 release in my Arduino IDE (2.3.2), in Configuration.h I have defined Y2_DRIVER_TYPE A4988, in src\inc\Conditionals_LCD.h I have #define HAS_DUAL_Y_STEPPERS 1, in src\pins\ramps\pins_RAMPS.h I have defined the pins as you told. Recompiled, reloaded, I hate to say that it doesn't work (only 1 motor spins, the Y). Ditto for the Bugfix 2.1.x  release. I think I will simply connect the DIR /STEP/EN pins of the E1 driver connector to the same pins of the Y driver connector.
RCecinati
CC BY-SA 4.0
2024-04-05T11:09:32.637Z
@RCecinati Have you swapped the drivers (put the Z, or de Y, stepstick in E1 or now Y2), you could have a broken one, or an incorrect Vref. Also try it on the Z position, so, swap the pins for Z and Y2 in the pins file. You need to troubleshoot a little further. It is hard to help you with the physical side, the software side should be okay now. Please use VSCode and PlatformIO and Auto Build Marlin plugins instead of Arduino IDE, this works much better. I hope you succeed! If all fails you can always split the DIR/STEP and EN pins to the new driver, first check if they work on other axes.
0scar
CC BY-SA 4.0
2024-04-08T16:01:19.483Z
dear Oscar, yes, I've swapped the E1 cable+motor with the Y ones, and the E1 cable/motor runs smooth, so the problem lies in the driver. All of the drivers have been checked against Vref.  I have  problems in migrating to another IDE, it's a lot easier to me to:  1) raise Y and E1 sockets through male/female 8 pin strips 2) divert Enable, DIR and STEP male pins 3) tie them to the same pins of Y socket with wire wrap  wire.  I've tried with a mezzanine but there's no room available down there.     Thank you  anyway
RCecinati
CC BY-SA 4.0
2024-04-08T18:56:49.267Z
Good old [wire wrap](https://www.aliexpress.com/w/wholesale-Wire-Wrap-Strip-Unwrap-Tool.html?spm=a2g0o.detail.search.0)! I've fixed printer displays with it!, very handy.
0scar
CC BY-SA 4.0
2024-04-04T12:04:01.760Z
2024-04-04T14:18:57.637Z
2024-04-04T14:18:57.637Z
0scar
<p>I am building a DIY 3D printer, and my hw requirements are X, Y1, Y2, Z, and E0 steppers. All of them are supposed to be A4988. One hotend heater, no heatbed (by now). My board is an Arduino Mega 2560, and I am trying to use the latest Marlin available (i.e. 2.1.2.2). The issue is that I can't get any movement on the Y2 motor. I have been crawling around, and what I think I should have  is as follows:</p>
<p>in Configuration.h,</p>
<pre><code>#define MOTHERBOARD BOARD_RAMPS_14_EFF 
#define EXTRUDERS 1
#define Y2_DRIVER_TYPE A4988    //uncommented
</code></pre>
<p>in Configuration_adv.h</p>
<pre><code>//#define Y_DUAL_STEPPER_DRIVERS
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
  #define INVERT_Y2_VS_Y_DIR true   // Set 'true' if Y motors should rotate in opposite directions
  //#define Y_DUAL_ENDSTOPS
  #if ENABLED(Y_DUAL_ENDSTOPS)
    #define Y2_USE_ENDSTOP _YMAX_
    #define Y_DUAL_ENDSTOPS_ADJUSTMENT  0
  #endif
#endif
</code></pre>
<p>Note: the <code>#define Y_DUAL_STEPPER_DRIVERS</code> statement <strong>has</strong> to be left commented otherwise a compilation error is raised.
This is the situation. Of course, I have tested the cables/motors, and all of them are working.
Other posts on different blogs drove me to tweak the  <code>pins_RAMPS.h</code> file, but I realized it was a waste of time.
Can you give me a hint? Otherwise, I will be forced to build an add-on nanocard hosting a couple of twin A4988 drivers, but the room on the RAMPS shield is so little. And I don't dare to drive two motors with a single A4988, I never tried but I know that A4988 are difficult guys.</p>

CC BY-SA 4.0
2024-03-29T20:14:59.377Z
No, you shouldn't (read *can't*) drive two motors with a single A4988. As an aside, this seems related to a (now deleted) question, [Can I add TMC stepsticks in parallel with existing A4988?](https://3dprinting.stackexchange.com/q/23074/4762), which I had commented heavily upon. The same Q has now been asked on SE.Electronics, [Can I add TMC stepsticks in parallel with existing A4988?](https://electronics.stackexchange.com/q/702418/64015). See meta Q, [Should I delete and repost in another community?](https://3dprinting.meta.stackexchange.com/q/604/4762) for more background.
Greenonline
CC BY-SA 4.0
2024-03-29T20:15:46.850Z
I might post my comments that are under the deleted question as an answer to this question, even though they aren't a solution, per se.
Greenonline
CC BY-SA 4.0
2024-03-30T07:34:50.930Z
Thank you #Greenonline. I will not parallel motors, I am rather building an A4988 "twinner", unless some goodwilling fellow will show me how to use the available driver on top of the RAMPS shield.
RCecinati
CC BY-SA 4.0
2024-04-04T12:12:16.163Z
The E1 on the RAMPS shield can be used for Y2, but you need to configure this! Note that Marlin 2.1.2.2 is flawed for dual Y setups, see answer below.
0scar
CC BY-SA 4.0
2024-04-05T03:36:43.507Z
Could you post an answer, expanding upon your "twinner" concept (PCB design, schematic, etc.) to this question, [What is an A4988 "twinner"?](https://3dprinting.stackexchange.com/q/23194/4762) Thanks.
Greenonline
<marlin><ramps-1.4><arduino-mega-2650>
Using dual Y stepper drivers on Marlin / RAMPS 1.4
RCecinati
# Using dual Y stepper drivers on Marlin / RAMPS 1.4

(Asked by: username_0 on 2024-03-28)

I am building a DIY 3D printer, and my hw requirements are X, Y1, Y2, Z, and E0 steppers. All of them are supposed to be A4988. One hotend heater, no heatbed (by now). My board is an Arduino Mega 2560, and I am trying to use the latest Marlin available (i.e. 2.1.2.2). The issue is that I can't get any movement on the Y2 motor. I have been crawling around, and what I think I should have is as follows:

in Configuration.h,

```
#define MOTHERBOARD BOARD_RAMPS_14_EFF 
#define EXTRUDERS 1
#define Y2_DRIVER_TYPE A4988    //uncommented

```

in Configuration\_adv.h

```
//#define Y_DUAL_STEPPER_DRIVERS
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
  #define INVERT_Y2_VS_Y_DIR true   // Set 'true' if Y motors should rotate in opposite directions
  //#define Y_DUAL_ENDSTOPS
  #if ENABLED(Y_DUAL_ENDSTOPS)
    #define Y2_USE_ENDSTOP _YMAX_
    #define Y_DUAL_ENDSTOPS_ADJUSTMENT  0
  #endif
#endif

```

Note: the `#define Y_DUAL_STEPPER_DRIVERS` statement **has** to be left commented otherwise a compilation error is raised.
This is the situation. Of course, I have tested the cables/motors, and all of them are working.
Other posts on different blogs drove me to tweak the `pins_RAMPS.h` file, but I realized it was a waste of time.
Can you give me a hint? Otherwise, I will be forced to build an add-on nanocard hosting a couple of twin A4988 drivers, but the room on the RAMPS shield is so little. And I don't dare to drive two motors with a single A4988, I never tried but I know that A4988 are difficult guys.

**Tags:** marlin, ramps-1.4, arduino-mega-2650

> **Comments:**
> **username_1**: No, you shouldn't (read *can't*) drive two motors with a single A4988. As an aside, this seems related to a (now deleted) question, [Can I add TMC stepsticks in parallel with existing A4988?](https://3dprinting.stackexchange.com/q/23074/4762), which I had commented heavily upon. The same Q has now been asked on SE.Electronics, [Can I add TMC stepsticks in parallel with existing A4988?](https://electronics.stackexchange.com/q/702418/64015). See meta Q, [Should I delete and repost in another community?](https://3dprinting.meta.stackexchange.com/q/604/4762) for more background.  
> **username_1**: I might post my comments that are under the deleted question as an answer to this question, even though they aren't a solution, per se.  
> **username_0**: Thank you #username_1. I will not parallel motors, I am rather building an A4988 "twinner", unless some goodwilling fellow will show me how to use the available driver on top of the RAMPS shield.  
> **username_2**: The E1 on the RAMPS shield can be used for Y2, but you need to configure this! Note that Marlin 2.1.2.2 is flawed for dual Y setups, see answer below.  
> **username_1**: Could you post an answer, expanding upon your "twinner" concept (PCB design, schematic, etc.) to this question, [What is an A4988 "twinner"?](https://3dprinting.stackexchange.com/q/23194/4762) Thanks.  

---

## 1 answers

### Answer by username_2 on 2024-04-04. Score: 2

*I've reverted to version 2.1.2.2 to be compatible to the version used in the question. The analysis is based on this version.*

---

## Diving into the code

When looking into the (2.1.2.2) sources you'll see that there is no mention of `Y_DUAL_STEPPER_DRIVERS` other than in the `Changes.h` file.

[![enter image description here](https://i.sstatic.net/AcjBN.png "Search results in Marlin 2.1.2.2 sources")](https://i.sstatic.net/AcjBN.png "Search results in Marlin 2.1.2.2 sources")

Snippet:

```
...
#elif defined(Y_DUAL_STEPPER_DRIVERS)
  #error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
...

```

This file checks for compatibility of configuration settings against the current "to be compiled" version of Marlin based on your sources. On compilation you get the above mesage when using that `Y_DUAL_STEPPER_DRIVERS` define statement. The snippet from your question of your `Configuration_adv.h` is therefore incorrect, you are using a different config file (or you are using an older config file from a previous Marlin version) than should be used for this version of Marlin; hence you have to keep `//#define Y_DUAL_STEPPER_DRIVERS` in comments!

## Getting to the issue!

Definition of an additional stepper in e.g. Y (this will be called Y2 from now on) is configured through the `Configuration.h` file:

Change by uncommenting this line

```
//#define Y2_DRIVER_TYPE A4988

```

to

```
#define Y2_DRIVER_TYPE A4988

```

This configuration setting will define that you have multiple (i.e. two) Y stepper motors on separate stepper drivers by setting `HAS_Y2_STEPPER` to 1 (equivalent to `TRUE`) in `Conditionals_LCD.h`:

```
#ifdef Y2_DRIVER_TYPE
#define HAS_Y2_STEPPER 1

```

This definition is very suspicious as `HAS_Y2_STEPPER` isn't used anywhere in the code... *This is actually a bug in Marlin 2.1.2.2!* This should have read:

```
#ifdef Y2_DRIVER_TYPE
#define HAS_DUAL_Y_STEPPERS 1

```

We continue, with this Marlin version to find the check for the existance of the definitin of the Y2 pins, from `SanityCheck.h` we read:

```
/**
 * Multiple Stepper Drivers Per Axis
 */
...
#if HAS_DUAL_Y_STEPPERS && !GOOD_AXIS_PINS(Y2)
  #error "If Y2_DRIVER_TYPE is defined, then Y2 ENABLE/STEP/DIR pins are also needed."
#endif
...

```

Since `HAS_DUAL_Y_STEPPERS` has never been set in the 2.1.2.2 sources, your build does not check if the pins for this Y2 stepper are defined in your `pins_RAMPS.h` file and hence does not compile.

## How to get it compiled

Fix the 2.1.2.2 bugs as suggested above (replace `HAS_Y2_STEPPER` for `HAS_DUAL_Y_STEPPERS` in `Conditionals_LCD.h`) and set the Y2 stepper pins (see other solution below: using the latest bugfix branch). Do note that `HAS_Y2_STEPPER` is the constant name that is used throughout the latest version of Marlin. You'll see that this will compile fine:

[![enter image description here](https://i.sstatic.net/LgIbH.png "Screenshot of succesful compilation after fixing Marlin version 2.1.2.2")](https://i.sstatic.net/LgIbH.png "Screenshot of succesful compilation after fixing Marlin version 2.1.2.2")

Anoter solution, and the preferred one, is to go to the latest branch of Marlin, i.e. Bugfix 2.1.x (where these problems are fixed) and define the Y2 pins in the `pins_RAMPS.h` file:

Change:

```
#ifndef E1_STEP_PIN
  #define E1_STEP_PIN                         36
#endif
#ifndef E1_DIR_PIN
  #define E1_DIR_PIN                          34
#endif
#ifndef E1_ENABLE_PIN
  #define E1_ENABLE_PIN                       30
#endif
#ifndef E1_CS_PIN
  #define E1_CS_PIN                      AUX2_07
#endif

```

to

```
#ifndef Y2_STEP_PIN
  #define Y2_STEP_PIN                         36
#endif
#ifndef Y2_DIR_PIN
  #define Y2_DIR_PIN                          34
#endif
#ifndef Y2_ENABLE_PIN
  #define Y2_ENABLE_PIN                       30
#endif
#ifndef Y2_CS_PIN
  #define Y2_CS_PIN                      AUX2_07
#endif

```

## Miscellaneous

> Other posts on different blogs drove me to tweak the pins\_RAMPS.h file, but I realized it was a waste of time.

No, this is not a waste of time, this is necessary as can be seen above. As you are changing the use of the board (standard: X, Y, Z, E0 and E1) to the dual Y solution (X, Y, Z, E0 and Y2) you need to assign the pins from the standard E1 to the Y2, this process cannot be skipped.

> I will be forced to build an add-on nanocard hosting a couple of twin A4988 drivers, but the room on the RAMPS shield is so little.

No, this is not necessary.

> **Comments:**
> **username_0**: dear Oscar, thank you  for your detailed explanation. So I have re-unzipped a 2.1.2.2 release in my Arduino IDE (2.3.2), in Configuration.h I have defined Y2_DRIVER_TYPE A4988, in src\inc\Conditionals_LCD.h I have #define HAS_DUAL_Y_STEPPERS 1, in src\pins\ramps\pins_RAMPS.h I have defined the pins as you told. Recompiled, reloaded, I hate to say that it doesn't work (only 1 motor spins, the Y). Ditto for the Bugfix 2.1.x  release. I think I will simply connect the DIR /STEP/EN pins of the E1 driver connector to the same pins of the Y driver connector.  
> **username_2**: @username_0 Have you swapped the drivers (put the Z, or de Y, stepstick in E1 or now Y2), you could have a broken one, or an incorrect Vref. Also try it on the Z position, so, swap the pins for Z and Y2 in the pins file. You need to troubleshoot a little further. It is hard to help you with the physical side, the software side should be okay now. Please use VSCode and PlatformIO and Auto Build Marlin plugins instead of Arduino IDE, this works much better. I hope you succeed! If all fails you can always split the DIR/STEP and EN pins to the new driver, first check if they work on other axes.  
> **username_0**: dear Oscar, yes, I've swapped the E1 cable+motor with the Y ones, and the E1 cable/motor runs smooth, so the problem lies in the driver. All of the drivers have been checked against Vref.  I have  problems in migrating to another IDE, it's a lot easier to me to:  1) raise Y and E1 sockets through male/female 8 pin strips 2) divert Enable, DIR and STEP male pins 3) tie them to the same pins of Y socket with wire wrap  wire.  I've tried with a mezzanine but there's no room available down there.     Thank you  anyway  
> **username_2**: Good old [wire wrap](https://www.aliexpress.com/w/wholesale-Wire-Wrap-Strip-Unwrap-Tool.html?spm=a2g0o.detail.search.0)! I've fixed printer displays with it!, very handy.  

---

