# Building Bipolar stepper motor driver from scratch

Joined Mar 20, 2016
8
Hi, I am a electronics hobbyist and a I would like to build a CNC machine to do small and average volume parts.
The machine will be desktop size, say max 1 by 1 meter and I am planning on using various spindles sizes and masses.
that's for the machine

I am planning to use this motor
http://www.tme.eu/en/details/103h7823-1741/electric-motors/sanyo-denki/
I am planning to have feed rate from 0.5/minute up to 20/minute.
I am expecting the over all mass of the moving parts to reach 6 KG

I want to make the driver my self for several reasons
-I have already a lot of components so I wouldn't need to buy new parts almost
-I have time and patience and I want to learn something new in the process

I want to decide about the main parts that I will use. In general I have arduino due, I have IRFZ44Z and other glue parts(analog and digital)
for now I will support the following feature in my driver
-Full step
-Half Step
-Constant current (or may be constant current but be able to change the level of the current)
-ramping up and down (if possible and easy to do in the first release)

later I will try to add new features like microstepping or sinusoidal current drive, I don't know yet.

My first question
can I actually be able to build a good driver to drive the motor that I have mentioned above?

#### ISB123

Joined May 21, 2014
1,236
Yes,although that stepper motor is overkill for such small loads.

#### hp1729

Joined Nov 23, 2015
2,304
Hi, I am a electronics hobbyist and a I would like to build a CNC machine to do small and average volume parts.
The machine will be desktop size, say max 1 by 1 meter and I am planning on using various spindles sizes and masses.
that's for the machine

I am planning to use this motor
http://www.tme.eu/en/details/103h7823-1741/electric-motors/sanyo-denki/
I am planning to have feed rate from 0.5/minute up to 20/minute.
I am expecting the over all mass of the moving parts to reach 6 KG

I want to make the driver my self for several reasons
-I have already a lot of components so I wouldn't need to buy new parts almost
-I have time and patience and I want to learn something new in the process

I want to decide about the main parts that I will use. In general I have arduino due, I have IRFZ44Z and other glue parts(analog and digital)
for now I will support the following feature in my driver
-Full step
-Half Step
-Constant current (or may be constant current but be able to change the level of the current)
-ramping up and down (if possible and easy to do in the first release)

later I will try to add new features like microstepping or sinusoidal current drive, I don't know yet.

My first question
can I actually be able to build a good driver to drive the motor that I have mentioned above?
Well, do you have the unipolar or bipolar version of the motor? The motor is rated at 100 V and the IRFZ44 is rated at 50 V.
Looking at the data sheet for the motors you see examples of motor drivers. You want to make the equivalent with parts on hand???
The sons of the Prophet are, in deed, quite unaccustomed to fear.
It would be difficult to suggest a design not knowing what parts you have on hand.

A picture of an example of bipolar and unipolar stepper motors.

A controller is a certain requirement. Do you have a preference for a microcontroller?

#### Attachments

• 34.7 KB Views: 37
Last edited:

#### shortbus

Joined Sep 30, 2009
7,854
The price of ready made stepper motor drivers is so low these days that it wouldn't be economically worth doing a DIY driver. Even if you had the parts on hand you would still need to design a circuit and then make a PCB board and then troubleshoot the circuit. And it still wouldn't have all of the needed things to work with a CNC. Not trying to put your idea down, but to be practical. It would be more advantageous to put the time into building a better more accurate mechanical part of the machine.

Joined Jul 18, 2013
21,261
I am planning to use this motor
You realize that is rated as a 100v AC stepper, these are normally designed to work on AC supply using a phase shift capacitor, typically these AC rated ones as opposed to the DC stepper rated do not make for good variable rpm motors, they are designed for a fixed frequency (synchronous motor) and rpm, 72 rpm on 60hz and 60rpm on 50Hz. 'Instant' stop/start.
The DC steppers designed for CNC are typically between 2v & 8v.
Max.

Last edited:

Joined Mar 20, 2016
8
First of all I would like to thank everyone that responded.

First things first
-We are talking here about 2 phases bipolar stepper motor not unipolar.
-The motor that I have mentioned is rated for 100 ACV or 24-36 DCV.
-The driver that I am willing to make will drive the motors using DCV, max 48 DCV (the proposed mosfets maximum Vds is 55V).

Well, do you have the unipolar or bipolar version of the motor? The motor is rated at 100 V and the IRFZ44 is rated at 50 V.
Looking at the data sheet for the motors you see examples of motor drivers. You want to make the equivalent with parts on hand???
The sons of the Prophet are, in deed, quite unaccustomed to fear.
A controller is a certain requirement. Do you have a preference for a microcontroller?
The price of ready made stepper motor drivers is so low these days that it wouldn't be economically worth doing a DIY driver. Even if you had the parts on hand you would still need to design a circuit and then make a PCB board and then troubleshoot the circuit. And it still wouldn't have all of the needed things to work with a CNC. Not trying to put your idea down, but to be practical. It would be more advantageous to put the time into building a better more accurate mechanical part of the machine.
Yes I am willing to do my best to make one like in the picture, I have time and I want to learn everything about it anyway because I want to do more of this in the future
Don't forgot this is for hobby not for making money so I don't have to be very concern about time and resources for now
Thanks god, I have full job software engineer so this is not going to affect my income(I am not depending on this for living)

For the microcontroller, I have 2 options
First Arduino due
Second ATSAM3S2C, I have like 4 of this one
But for now I am not Actually concerned about the microcontroller, I am now concerned about the motors and the mosfets

You realize that is rated as a 100v AC stepper, these are normally designed to work on AC supply using a phase shift capacitor, typically these AC rated ones as opposed to the DC stepper rated do not make for good variable rpm motors, they are designed for a fixed frequency (synchronous motor) and rpm, 72 rpm on 60hz and 60rpm on 50Hz. 'Instant' stop/start.
The DC steppers designed for CNC are typically between 2v & 8v.
Max.
As I a have mentioned, this motor can be driven using both ACV or DCV.
http://electronics.stackexchange.com/questions/223552/can-i-drive-stepper-motor-with-ac-voltage

I have read on SanyoDenki website about this series that this motor belongs to that it can be driven from 100-240 VAC or 24-36 VDC.

So I think If I am going to apply around 48 volts with current limits I think I can manage to drive it.

The question now is that motor suitable for using in CNC machines or not?
Some people suggested that I should get motor that is rated for less than 5 volts so I can smoothly drive it with higher voltage
But actually the motor winding has 0.65 ohm resistance and rated for 4 amps, if we said 2 amps for per phase that will give us 1.3v nominal rated voltage
If I am wrong please correct me!

Joined Mar 20, 2016
8
Yes,although that stepper motor is overkill for such small loads.
This is actually initial numbers not exact, also I want later after succesfully finishing this (hopefully not in the far future) to make may be bigger machine.
Anyway the motors that I have mentioned is not actually that expensive , it is still in the range of hobbyist

#### hp1729

Joined Nov 23, 2015
2,304
First of all I would like to thank everyone that responded.

First things first
-We are talking here about 2 phases bipolar stepper motor not unipolar.
-The motor that I have mentioned is rated for 100 ACV or 24-36 DCV.
-The driver that I am willing to make will drive the motors using DCV, max 48 DCV (the proposed mosfets maximum Vds is 55V).

Yes I am willing to do my best to make one like in the picture, I have time and I want to learn everything about it anyway because I want to do more of this in the future
Don't forgot this is for hobby not for making money so I don't have to be very concern about time and resources for now
Thanks god, I have full job software engineer so this is not going to affect my income(I am not depending on this for living)

For the microcontroller, I have 2 options
First Arduino due
Second ATSAM3S2C, I have like 4 of this one
But for now I am not Actually concerned about the microcontroller, I am now concerned about the motors and the mosfets

As I a have mentioned, this motor can be driven using both ACV or DCV.
http://electronics.stackexchange.com/questions/223552/can-i-drive-stepper-motor-with-ac-voltage

I have read on SanyoDenki website about this series that this motor belongs to that it can be driven from 100-240 VAC or 24-36 VDC.

So I think If I am going to apply around 48 volts with current limits I think I can manage to drive it.

The question now is that motor suitable for using in CNC machines or not?
Some people suggested that I should get motor that is rated for less than 5 volts so I can smoothly drive it with higher voltage
But actually the motor winding has 0.65 ohm resistance and rated for 4 amps, if we said 2 amps for per phase that will give us 1.3v nominal rated voltage
If I am wrong please correct me!
It sounds like you are well on your way to success on this project.
Your motor drivers might be as simple as a latch and the MOSFETs. The patterns you put out will determine speed and smoothness of the motors. I have never built such a thing. Perhaps others here can give more specifics. It looks to me like "Keep it simple" applies.

Joined Mar 20, 2016
8
So what do you think Max, do you think this motor is not suitable for my application because I will not be able to run it smoothly using DCV?
If so what do you recommend for general specs. I want to have a good torque over speed that's on thing I have to keep in mind when choosing the motors because I want to have a reasonable feed rate when cutting through the materials.

Joined Mar 20, 2016
8
I think I have to mention the materials that I may want to cut:
Wood, Aluminum, Plastic, PVC, Acrylic, Foam, Mild Steel, Copper, brass, extra

but basically the most common materials would be
Wood, Plastic, PVC, Acrylic, Aluminum

#### BR-549

Joined Sep 22, 2013
4,938
Your not in a hurry and you have a little play money. Contact motor manufacturer for recommended controller. Buy it. Study it, but don't use it. Then see if you can fashion one with your parts.

Joined Mar 20, 2016
8
I just have got new Idea and I want to discuss it here

I have found this driver here
http://www.tme.eu/en/Document/9dd3f3aa8dc3cbe14f97c4b3a7ab0eb2/A4989.pdf
Basically this integrated circuit would allow me to connect external Mosfet H bridge to it and have all the power that I would have from external discrete mosfets and also the advantage of small one package that can do current limiting, microstepping and other stuff
So by doing this I will be able to have a good driver for under 10$so what do you think? Can someone evaluate this chip! #### shortbus Joined Sep 30, 2009 7,854 Thread Starter #### Muhammad Nour Elmogy Joined Mar 20, 2016 8 You'll use a chip for$10, but not a complete, tested driver for a few dollars more? Will you also be building your own computer and writing you own CNC software too? http://www.ebay.com/bhp/stepper-motor-driver
I don't understand do you mean that's a good idea or bad idea and why?

the very cheap drivers in ebay wouldn't hold more than 4 amps max the more expensive drivers may give you more power
The chip that I have mentioned has this feature that you can connect external Mosfet H Bridge to it and the limit is almost the mosfets
So why are you pointing me to those cheap drivers ?? what is the point ?
also making stuff from scratch doesn't mean making My PC From Scratch

I have mentioned that I would like to learn in the process of building them
I have already learned a lot of things about mosfet since I have began like 1 month ago..

#### shortbus

Joined Sep 30, 2009
7,854
Just like the chip you linked to, the drivers can have their mosfets replaced by ones with a higher rating. A working stepper motor driver is much more than buying a chip and adding some mosfets. and in the end they still need to work with an existing CNC software, that is written for the drivers that are normally built and available. I'm not trying to "dishearten" you, just trying to give you the advantage of getting a "working" CNC in the least amount of time and easiest possible way. I've been in your position and learned the hard way.