MPCNC and grbl on a Ramps (the easy way?)

Hi, y’all. I was bit by a bug to play with grbl, and found that there was a grbl-Mega project over on github already. The only problem with it is that trying to run the dual motors off of E0 and E1 would not be easy (or even possible without software or hardware hacking). I initially looked at just making E0 and E1 be copies of X and Y but there’s a whole lot of changes that would be needed. More than I would care to do just to play around.

In order to scratch my grbl itch, I jumped into my schematic program and drew up a little board to go between the RAMPS and the X and Y drivers. It has a place for a second driver, and a little circuit to invert the direction pin going over there. Since it covers up the regular motor pins, the two motor cables plug into that board as well. I guess the transistor inversion thing isn’t really needed (just plug the 2nd wires in backwards) but my OCD would know it’s backwards, even if it was hidden under the table. :slight_smile:

Sure, hardware costs money, but it only took a few minutes to do, and I have the parts already. :slight_smile: If anyone else is interested and can deal with a couple of surface mount resistors and a transistor, I shared the project on Osh Park at https://www.oshpark.com/shared_projects/WIHfUqpZ and the github link to that fork of grbl is at GitHub - gnea/grbl-Mega: An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on an Arduino Mega2560

 

Well that is pretty cool!

What are the resistors and transistor for? My only guess would be back current??

I really need to learn more about this stuff.

They create an inverter circuit. When the DIR pin goes high, it will make the DIR pin of the other one low and vice versa, so when the step pin gets fired, each stepper driver will go in different directions. The one resistor is needed to prevent too much current from going into the transistor from the DIR pin, and the other one keeps too much from going through the transistor when it turns on (because it’s connected between 5v and ground).

I added a screenshot of that bit. DIN is the direction pin for X (or Y), and DOUT goes to X1 (or Y1).

snapshot3.png

Ohhhh, instead of flipping the plug. Cool. Thanks for that, I understand and have added it to the bag-o-tricks (I hope).

This is neat. The inverter is a nice touch.

This pcb would like up the master stepper with the ramps socket? So you’d use those long pin headers to reach the board and make a socket for the primary driver?

I saw somewhere that someone used those long pin headers to replace the ones on the drv8825 and they installed them everywhere but the motor output on the drv8825. So they basically made a piggyback version of this, without the inversion. The top driver needed a header on the top for the motor pins.

Another thing you could do here is have another set of headers for the board, and you could offset them in the middle of these two sockets. So you’d have the pins on the back layer, and two sockets on the top. Then you wouldn’t need those long pin headers.

I hope you don’t mind me poking it a bit. It’s part of my curiosity. What you have is great.

Exactly, you’d use the female headers with really long pins like many Arduino shields use and plug this board between the Ramps and the stepper board. Then stick a second stepper board on there as well. I’ve used those long-pin headers before to be able to have heatsinks on the bottom of stepper drivers without bumping into the microstep setting jumpers. They give space for a little more air flow, too.

Your idea of the offset third set of pins would work well, too. If I hadn’t already sent the board off to get made, I’d look at doing that. Also, the reason I posted is so people can poke at it. :slight_smile: I love tinkering and seeing if I can make things work like I want them to. :slight_smile: A added the Eagle 7.x files to this, if you or anyone else wants to play with them.

mpcnc_ez_grbl.zip (16.2 KB)