Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Stepper motor

Status
Not open for further replies.

Maverickmax

New Member
At the moment, I am using a mimusi stepper motor which contains five wires: red, black, orange, brown and yellow.

So far, I use the sequence: 0x01,0x02,0x04,0x08 at 12 times in order to complete one revolution with my AVR chip. It works well then I tried to reverse the direction and to my surprise, it still goes in the same direction instead of going backward.

Forward

Pin 16 of ULN2003 - Yellow - 0x01
Pin 15 of ULN2003 - Orange - 0x02
Pin 14 of ULN2003 - Brown - 0x04
Pin 16 of ULN2003 - Black - 0x08

Backward

Pin 16 of ULN2003 - Yellow - 0x08
Pin 15 of ULN2003 - Orange - 0x04
Pin 14 of ULN2003 - Brown - 0x02
Pin 16 of ULN2003 - Black - 0x01

I could not understand why. Any suggestion?

MM
 
I'm not that great with steppers, someone else might explain the pattern better but I think you're supposed to feed it
0x02 0x01 0x08 0x04

It's hard for me to keep stepper sequences straight in my head though so I could be wrong. Hopefully someone else will chime in here.
 
This might help I'm not an expert but I think this will work.
I posted some links for you earlier I think it’s tied up in a queue somewhere.


Step - A,B,C,D -> Coils
0 - 1100 FORWARD Backward
1 - 0100 Step's 0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,2,3,2,1,0,7,6
2 - 0110
3 - 0010
4 - 0011
5 - 0001
6 - 1001
7 - 1000

Step - A,B,C,D
0 - 1100 FORWARD Backward
1 - 0110 Step's 0,1,2,3,2,1,0,1,2,3,2,1,0,3,2,1,0
2 - 0011
3 - 1001

'OR'

Step - A,B,C,D
0 - 1000
1 - 0100
2 - 0010
3 - 0001

Regards,
Ray
 
Last edited:
At the moment, I am using a mimusi stepper motor which contains five wires: red, black, orange, brown and yellow.

So far, I use the sequence: 0x01,0x02,0x04,0x08 at 12 times in order to complete one revolution with my AVR chip. It works well then I tried to reverse the direction and to my surprise, it still goes in the same direction instead of going backward.

Forward

Pin 16 of ULN2003 - Yellow - 0x01
Pin 15 of ULN2003 - Orange - 0x02
Pin 14 of ULN2003 - Brown - 0x04
Pin 16 of ULN2003 - Black - 0x08

Backward

Pin 16 of ULN2003 - Yellow - 0x08
Pin 15 of ULN2003 - Orange - 0x04
Pin 14 of ULN2003 - Brown - 0x02
Pin 16 of ULN2003 - Black - 0x01

I could not understand why. Any suggestion?

MM

Pin 16 used for both yellow & black wires?

Which is the common wire and how is it connected?
 
found this on the net.
18-uln2003-control-stepper-motor-by-parallel-port.jpg
 
I'm working on a stepper controller for a CNC I'm making this is where I'm at now, allmost done with the program for 16F628A.
21-Pic_stepper.jpg
 
Last edited:
Easiest way to check you have the correct common wire, is to use an ohmmeter.
The common wire + any other of the four wires, will have the lowest reading.
Say you check two wires and read 5 ohms, then move one of the probes to another wire and read 2.5 ohms, ONE of the wires in the second test is the common wire.
In the first test, you were reading two sets of windings. In the second test, you were only reading one winding.
Carry out a third test, moving one of the probes again. If you read 2.5 ohms again, the wire connected to the probe you didn't move is the common.
If you read 5 ohms, the wire you moved from is the common.
 
I'm working on a stepper controller for a CNC I'm making this is where I'm at now, allmost done with the program for 16F628A.
21-Pic_stepper.jpg
What kind of CNC machine are you trying to make?

I went through a lot to set up a CNC machine. There are a lot of subtle problems to getting performance at useful speeds. The basic "this steps a stepper motor" circuits are not practical for CNC work. Unfortunately, there's a lot that's wrong with this drive you've got there that'll basically reduce the performance to like 5%-10% of what it needs to be for a CNC machine.
 
What kind of CNC machine are you trying to make?

I went through a lot to set up a CNC machine. There are a lot of subtle problems to getting performance at useful speeds. The basic "this steps a stepper motor" circuits are not practical for CNC work. Unfortunately, there's a lot that's wrong with this drive you've got there that'll basically reduce the performance to like 5%-10% of what it needs to be for a CNC machine.

I'll go along with the above, since I've done the same thing in the past.

The intricacies of a CNC project are far more complex than those which could be adequately covered on a purely electronics site, so the best advice is to refer to somewhere where the whole gamut is extensively covered.

Have a peek at:
https://www.cnczone.com/forums
 
Last edited:
Oznog,
I confused now I thought the speed of the stepper motors are determined by the computer’s (step pulse rate), the manual mode on my circuit is so I can run the stepper without the computer control. Is there something I’m overlooking? This is my first stepper motor project I’m aiming to build a 4’x4’ CNC Router

I'm using the ULN2003 just for software testing I know it will not handle the load on a CNC.
 
Last edited:
Oznog,
I confused now I thought the speed of the stepper motors are determined by the computer’s (step pulse rate), the manual mode on my circuit is so I can run the stepper without the computer control. Is there something I’m overlooking? This is my first stepper motor project I’m aiming to build a 4’x4’ CNC Router
The circuit you're discussing is just not remotely appropriate for so many reasons for a setup needing performance:
It's unipolar
it's linear instead of pwm/current regulated/decay-rate controlled. No way can that go on a CNC machine.
Needs high voltage for speed. Current regulation will keep this from blowing up the motor.
Need microstepping, and there's a ton of advanced stuff needed to do this
PIC steps having to line up with the clocks cause major problems with current phase vs rotor phase
Need mid-band resonance compensation

What you've got, if all the problems were solved, could at best make a stepper crawl with a light load. A 4'x4' router requires vastly more!

I went through this for awhile and wasted a lot of time and money. And I'm a very big DIY guy with a pretty decent amount of skill and know where to get answers on things I don't know. In the end it wasn't practical to build a drive. I even started to draw up plans using the microstepping Allegro chip before I read through a huge thread on CNCZone documenting the minimum-duty-cycle design problem which prevents them from ever being used as a CNC driver. I could write a big long story on this, but when it comes down to it, bottom line is you need:
GeckoDrive, like a G540 (no other drives work like a GeckoDrive, the midband compensation is a night-and-day difference. They also caught on to the fact that microstepping becomes a liability at high speeds and needs to be disengaged automatically)
48v power supply, 7A is good
SmoothStepper (in my experience the pulses off a PC parallel port aren't good at all, even if Mach3 says it's "good")

Bipolar steppers of the appropriate size (sizing is a big long story)

And CNCZone is absolutely the place to go. In fact you need to go there just to see if your router plans are viable. There's gantry routers vs moving-table routers, for example. A lot of plans look good at first, but in reality will just not perform. Racking of a two-sided drive, sawdust in the slides or leadscrew, too long of a leadscrew, all sorts of details that can wreck a big project.
 
Last edited:
Hi RayVT, if you are building a home CNC on a budget then check out the Linistepper microstepping stepper motor driver kit;

or the new 3 amp "SLAmStepper kit";

Both will give good microstepping performance with your unipolar motors.
 
I see what your saying Oznig, I just watched some video on YouTube on the G540 impressive I’ll have to get some more information on how they work but for now I have to watch my budget, I’m disabled and on a fixed income I have about 95% of the material to make the CNC table, 4’x6’ metal table, 6 steppers ok for testing, 10 pic16F628A and I just got LinuxCNC on a bootable 8 Gig. Flashdrive. My main goal is to build the CNC table for now I think I’ll use what I have just to get it working and then upgrade the motors and controller later.

Oh and thanks Mr RB for the links I put them in my favorites folder for now.
 
StepperMotorCct.gif


Here is a stepper motor controller circuit to help you test your motor. It will produce forward/reverse and determine the maximum rpm.
 
Last edited:
I see what your saying Oznig, I just watched some video on YouTube on the G540 impressive I’ll have to get some more information on how they work but for now I have to watch my budget, I’m disabled and on a fixed income I have about 95% of the material to make the CNC table, 4’x6’ metal table, 6 steppers ok for testing, 10 pic16F628A and I just got LinuxCNC on a bootable 8 Gig. Flashdrive. My main goal is to build the CNC table for now I think I’ll use what I have just to get it working and then upgrade the motors and controller later.
Hey I'm with you. I'm the king of overdoing a project to save a dime or some intangible "DIY" virtue. But your plan won't work at all, that's not a CNC driver circuit. The ULN2003A cannot drive a CNC stepper, period. For many reasons. That circuit can't drive a small mill, much less a monster router (4'x4' is big!). And it can't be improved into one that will work. And I did a fair amount of advanced stuff to try to build a new CNC driver for a mill I got that already had a CNC driver professionally designed for it- one which never actually worked because the designer didn't know what they were doing. And it's not that the circuit you have won't work to some high standards I have in mind or will only work at 1/4 the speed I'd call "performance".

People have tried to DIY stuff, with plans which are vastly more capable than that circuit, but they typically run at least several hundred in parts and generally end up badly flawed.

BTW, advance warning: this is the Internet, and there are some odd ideas on the CNCZone forum (most advice is great though). The one I'd caution against is that there are people swearing you need a huge, 60Hz transformer "for stability" and swear switching power supplies are unstable and failure-prone (though, to my knowledge, no one has ever documented such a failure or even instability). It's bunk. The 60Hz transformer is phenomenally expensive, poorly regulated, and requires very huge and expensive caps which are often replaced by grossly undersized caps by people who don't understand the subtleties of ESR and ripple current rating, and the linear regulator (if they even use a reg) and heatsink need to be enormous too. They're just absurdly unnecessary substitutes for switching power supplies, which are really good stuff, reliable, fairly clean DC output, and far cheaper, smaller, and lighter.
 
Hey I'm with you. I'm the king of overdoing a project to save a dime or some intangible "DIY" virtue. But your plan won't work at all, that's not a CNC driver circuit. The ULN2003A cannot drive a CNC stepper, period. For many reasons. That circuit can't drive a small mill, much less a monster router (4'x4' is big!). And it can't be improved into one that will work. And I did a fair amount of advanced stuff to try to build a new CNC driver for a mill I got that already had a CNC driver professionally designed for it- one which never actually worked because the designer didn't know what they were doing. And it's not that the circuit you have won't work to some high standards I have in mind or will only work at 1/4 the speed I'd call "performance".

People have tried to DIY stuff, with plans which are vastly more capable than that circuit, but they typically run at least several hundred in parts and generally end up badly flawed.

BTW, advance warning: this is the Internet, and there are some odd ideas on the CNCZone forum (most advice is great though). The one I'd caution against is that there are people swearing you need a huge, 60Hz transformer "for stability" and swear switching power supplies are unstable and failure-prone (though, to my knowledge, no one has ever documented such a failure or even instability). It's bunk. The 60Hz transformer is phenomenally expensive, poorly regulated, and requires very huge and expensive caps which are often replaced by grossly undersized caps by people who don't understand the subtleties of ESR and ripple current rating, and the linear regulator (if they even use a reg) and heatsink need to be enormous too. They're just absurdly unnecessary substitutes for switching power supplies, which are really good stuff, reliable, fairly clean DC output, and far cheaper, smaller, and lighter.

LOL… I agree the ULN2003 will not cut it…
I think you missed the last line of an earlier post, I think you hit ‘reply with quote’ just before I posted the edit LOL I was looking at the time stamps,,,

Oznog,
I confused now I thought the speed of the stepper motors are determined by the computer’s (step pulse rate), the manual mode on my circuit is so I can run the stepper without the computer control. Is there something I’m overlooking? This is my first stepper motor project I’m aiming to build a 4’x4’ CNC Router

I'm using the ULN2003 just for software testing I know it will not handle the load on a CNC.

Anyway I found an old 500 watt auto audio amp. I took out 4 of the smaller power transistors (NEC–K2724) could not find a datasheet on them so I made a test circuit and hooked it a coil (1.4 ohm) to it and to my 35 amp. power supply set at 15 volts, I ran it about an 1/2 hour it was pulling about 7.9 amps. The heat sink got a little warm but not bad. I think I might use them for now.
 
Last edited:
Anyway I found an old 500 watt auto audio amp. I took out 4 of the smaller power transistors (NEC–K2724) could not find a datasheet on them so I made a test circuit and hooked it a coil (1.4 ohm) to it and to my 35 amp. power supply set at 15 volts, I ran it about an 1/2 hour it was pulling about 7.9 amps. The heat sink got a little warm but not bad. I think I might use them for now.
Well that's not gonna fix much, because a stepper must be current-driven, not voltage-driven like audio. In fact it's in great danger of smoking a motor without current control.

What "software testing" are you doing? I'm confused about your overall plan and setup, could you describe it? For one, a 16F628 can't act as a useful drive controller really, for a number of reasons. And you've got "manual" inputs shown. A CNC driver should not have manual inputs, because there is no line of communication back to the software on the PC to know that the position has been messed with. We DO use manual controllers- that's an MPG "pendant", and they're common projects to build. They're devices- generally USB- hooked up to the driving PC and they tell the PC software to step the controller. Consequently, the PC software never becomes disoriented. In fact with Mach3 there's even a plugin to use a standard gamepad as an MPG.

And you've got a limit/home switch listed as a pin. Again, the PC needs to see the switch click and stop pulsing, for the same reasons as described above. There's no reason to send it through part of the driver. The driver has nothing to do with it.

What steppers do you have? And why 6? The job should need 4, but they do need to be pretty beefy for a router of this size.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top