How to control steppers with high voltage

Hello all,

How would I control stepper motors for use with a CNC or 3D printer that require more voltage than the 5 volts the arduino can put out? One example is a 24 v solenoid I salvaged, and also 36 volt stepper motors that I salvaged from an old printer.

Any advice is appreciated!

Thanks,
Tyler

Just use a dedicated motor driver - have a look at DRV8825 drivers - the control side of them are controlled via I/O pins from the Arduino (step, direction, optionally: enable or sleep), whereas the motor output side has its own "high" voltage control.
In that given case you have to connect the GND's of Arduino and the "high" voltage GND.

Be careful if you use drivers with opto couplers - here it depends if you connect GND with GND or +5V with the anodes of the optocouplers - depends on the kind of control system (google: "common anode" or "common cathode"); for the suggested DRV8825 (given, that it delivers enough power for your motor) you just connect the GND's.

tyler_newcomb:
Hello all,
How would I control stepper motors for use with a CNC or 3D printer ......

Like this:

Sorry for the shameless plug, here's the answer to your question:

There are step motor driver shields you can buy for your Arduino that allow you to provide a separate, higher voltage for driving your motors via motor drivers like the DRV8825 based model mentioned in the last comment. I am using a common version of these drivers in the video, and am very happy with them. There are also several pin compatible driver modules available that are very similar.
SureStepr
Polulu a4988
Geetech step driver--I especially like the price of these; see them in action in the video :slight_smile:

This type of step motor drivers simply allow connection to higher voltages than your 5v logic from your Arduino for delivering to the motor, while only requiring two logic inputs from your Arduino; A 'step' signal and a 'direction' signal. The 'shields' essentially provide a convenient way to bundle all the connections together.

You can find shields scattered all over EBAY and elsewhere:
cnc shield

GRBLshield

And if you have an Arduino Mega: RAMPS

I also designed my own PCB that essentially combines the Arduino basics and the step motor drivers:
see pic...

And you definitely want to check out GRBL, open source CNC control firmware for your Arduino!

Bill

You may find some useful stuff in Stepper Motor Basics

that require more voltage than the 5 volts the arduino can put out?

You should never power any motor from the Arduino 5v pin - you risk damaging the Arduino as it is not designed for high currents or for the high voltage spikes that motors produce.

...R

tyler_newcomb:
Hello all,

How would I control stepper motors for use with a CNC or 3D printer that require more voltage than the 5 volts the arduino can put out? One example is a 24 v solenoid I salvaged, and also 36 volt stepper motors that I salvaged from an old printer.

Any advice is appreciated!

Thanks,
Tyler

For the solenoid a low-side MOSFET switching circuit is a good choice - logic-level n-channel power MOSFET and
a free-wheel diode across the winding to prevent inductive spike damage. Learn about star-grounding.

Thanks everyone for the help. I will check out those motor drivers, I'm assuming documentation for each shows you where to hook up the arduino pins and the power suppy? What would be suitable for use as a power supply?

Bill, is that a openbeam you're using for the cnc machine? How did you assemble it?

I'm assuming documentation for each shows you where to hook up the arduino pins and the power suppy? What would be suitable for use as a power supply?

The documentation doesn't necessarily tell you what pins of the Arduino are connected to the driver's pins.
You have to assign Arduino pins as output in your code and connect the designated pins to the adequate pins of the driver.

But if you search the internet you will find example codes with schematics.
If you go with the DRV8825 or a pin compatible 4988 board the simplest way is to connect either of the Arduino's digital I/O pins with the "step" (sometimes called pulse or clock) pin of the driver; then you connect one of the digital I/Os of Arduino to "dir". In your code you have to assign the Arduino pins to function as step and the other one as direction output.

Easiest way: use the AccelStepper library which directly support dir/step method.

Don't forget to connect the external power supply's GND with Arduino GND.

What power supply you can use - that's a question how much current you need to drive the motor (normally you look at the datasheet of the motor, add 15-20% to the max. value of the motor current and choose a power supply with 10-15% less than the max. supported voltage of the driver and you are in good shape).

tyler_newcomb:
Bill, is that a openbeam you're using for the cnc machine? How did you assemble it?

I am unfamiliar with openbeam, sorry? But the machine I built was mostly inexpensive parts I found from Ebay, mainly the linear slides, steppers and pulleys/belts.

Example:linear rails

Another place you can score big is a semiconductor tool salvage business, if you happen to be able to find one in your locale. You can find all sorts of rails, drive components(ballscrews, pulleys, belts, steppers) etc. at these places.

Regarding assemble, I spent perhaps a month or two utilizing my free time putting this one together. I have another larger DIY cnc machine that I am fortunate enough to be able to do light machining, for some of the more difficult parts like the stepper mounts, bolt hole patterns, etc.
There is info all over the web about DIY machines, just takes time to sort it all. Wish I could point you to one specific site, but I really absorbed the info I needed from many places. I can not emphasize enough that you check out GRBLGRBL Which makes controlling steppers from an Arduino amazingly convenient. It's opensource!

for powersupply: In my video, I am simply using a Dell laptop power supply; works great for smaller, light duty steppers. I could even do light duty aluminum milling (and have) on that machine, but the belt drive is the weak link, because of 1) gear ratio for speed, not power, and 2) stretch in the small belts.

wiring diagram this is the basic info on using the Panucatt DRV8825 drivers, I believe the others are all mostly pin compatible, so the other models should connect up in the same fashion, but be sure to doublecheck. For me, the Geetech models connect the exact same.

Once you get one working, you'll find how incredibly simple they actually are to use. Here's a minimum connection diagram I made for myself when I first starting using them:

rpt007:
The documentation doesn't necessarily tell you what pins of the Arduino are connected to the driver's pins.
You have to assign Arduino pins as output in your code and connect the designated pins to the adequate pins of the driver.

But if you search the internet you will find example codes with schematics.
If you go with the DRV8825 or a pin compatible 4988 board the simplest way is to connect either of the Arduino's digital I/O pins with the "step" (sometimes called pulse or clock) pin of the driver; then you connect one of the digital I/Os of Arduino to "dir". In your code you have to assign the Arduino pins to function as step and the other one as direction output.

Easiest way: use the AccelStepper library which directly support dir/step method.

Don't forget to connect the external power supply's GND with Arduino GND.

What power supply you can use - that's a question how much current you need to drive the motor (normally you look at the datasheet of the motor, add 15-20% to the max. value of the motor current and choose a power supply with 10-15% less than the max. supported voltage of the driver and you are in good shape).

Sorry I was unclear. I meant which pins on the motor controller to attach to the assigned pins on the arduino. Also, could you give a schematic for the wiring? I don't know what you mean by connecting the external GND to arduino GND, I would think that you would want to isolate the two, no?

billcat:
I am unfamiliar with openbeam, sorry? But the machine I built was mostly inexpensive parts I found from Ebay, mainly the linear slides, steppers and pulleys/belts.

Example:linear rails

Another place you can score big is a semiconductor tool salvage business, if you happen to be able to find one in your locale. You can find all sorts of rails, drive components(ballscrews, pulleys, belts, steppers) etc. at these places.

Regarding assemble, I spent perhaps a month or two utilizing my free time putting this one together. I have another larger DIY cnc machine that I am fortunate enough to be able to do light machining, for some of the more difficult parts like the stepper mounts, bolt hole patterns, etc.
There is info all over the web about DIY machines, just takes time to sort it all. Wish I could point you to one specific site, but I really absorbed the info I needed from many places. I can not emphasize enough that you check out GRBLGRBL Which makes controlling steppers from an Arduino amazingly convenient. It's opensource!

for powersupply: In my video, I am simply using a Dell laptop power supply; works great for smaller, light duty steppers. I could even do light duty aluminum milling (and have) on that machine, but the belt drive is the weak link, because of 1) gear ratio for speed, not power, and 2) stretch in the small belts.

wiring diagram this is the basic info on using the Panucatt DRV8825 drivers, I believe the others are all mostly pin compatible, so the other models should connect up in the same fashion, but be sure to doublecheck. For me, the Geetech models connect the exact same.

Once you get one working, you'll find how incredibly simple they actually are to use. Here's a minimum connection diagram I made for myself when I first starting using them:

Thanks a million! Tons of helpful information!! OpenBeam is an open source extruded aluminum assembly system, but since this I have researched more and realized its overpriced and I could get extruded aluminum cheaper.

Glad u find it useful!

Regarding the aluminum extrusion: indeed it is typically one of the very expensive parts of the project. This was one of the 'scores' I got lucky with, it was sold to me for roughly the price of scrap aluminum from a company locally that salvages semiconductor manufacturing tooling(think high end robots that manufacture silicon integrated circuits)
And it seems to be very high quality, can't remember the manufacturer at the moment, but I think it was a European company. I looked it up back when and the extrusions and especially the accessory hardware is very expensive. However, the ease of working with the stuff makes it invaluable for these type projects, highly recommended.
For my larger cnc I mentioned, I used welded steel(yours truly as the welder) and it took me a couple years (working in my free time) :0

Bill

Hi,

could you give a schematic for the wiring? I don't know what you mean by connecting the external GND to arduino GND, I would think that you would want to isolate the two, no?

Have a look at @billcat's useful schematics:
it tells you that the "logic controller's" GND is connected to the motor driver's GND; that's what I meant with connecting the two GNDs (in this case the Arduino is the logic controll

Upon closer inspection, I realized the drawing I attached above didn't actually show the ground connections as rpt007 has correctly described. I have modified it to now show this, sorry for any confusion.

Bill