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.

Basic stepper control - PIC18F and L293D

Status
Not open for further replies.

jshayden

New Member
Ok... I'm not trying to do anything complex. No microstepping/current limiting, etc. All I need is basic movement: foward, reverse, and turning. I am using bipolar steppers and the circuit shown below. I am having trouble with the sequence, though. The motors move, but the direction seems arbitrary, and can be forced to reverse by grabbing the wheel attached to the shaft. The torque is ridiculously low.

Any ideas?
 

Attachments

  • stepper_control.jpg
    stepper_control.jpg
    88.1 KB · Views: 3,765
It sounds like you have no idea what kind of motors you have and how they are wound.

How many wires are coming out of the motor?
The top guess is four
The next best guess is five
Any other number is trouble

If the answer is four then it is a bipolar motor and you will need a different driving arrangement. If it is five then all five wires have to go somewhere.
 
I know the arrangement exactly. There are 4 (as shown in the schematic) and they ARE bipolar (as previously stated). And.. I've seen this arrangement used to control bipolar steppers before, I simply am confused with the pulsing, I believe.

Josh
 
The motor has four wires as shown in the schematic, that's good. Now you have to connect the phases as the L293 expects. If you dont know which pair of wires goes to one of the two phases then you need to find it with an ohmmeter.

Also the L293 needs to supply both voltage and current to the motor. If the motor needs more current than the L293 can supply then you will have trouble making the motor move or producing enough holding torque so you cannot move the shaft by hand.

I'll have a look at the data sheet.
 
Ok. I have recently switched motors.
The new motors are ABCD while the old (as on the schematic) were ACBD [where AB are 1 coil and CD are the other].
This problem is easily solved by making up a little cable and twisting the wires. That's not a problem.
The problem I'm having is the pulsing sequence, and possibly this current issue. Thanks for bringing that up. The motors ar rated at 0.42A, by the way.

Thanks Alot,
Josh
 
Bipolar Stepper Sequence

You want to alternate the coils and the direction in each coil. The following table may be helpful

**broken link removed**

Is there a reason why you don't show GROUND connected to pins 4, 5, 12, and 13 on your schematic?

Are you sure the battery can supply the load at its rated voltage? Put a scope on the L293 pin 8 and watch the battery votage sag if the current demand is to large.
 
Ok.. I've seen several tables like this. I understand the concept of pulsing the coils according to the chart with +/-'s. I guess what I don't understand is the input to the hbridge. I'm unsure of what combination of 1's and 0's to use when pulsing the hbridge itself. The hbridge table only gives...

A B 1a 1b
0 0 0 0
0 1 - +
1 0 + -
1 1 0 0


But, when describing how to pulse the motor, ++ and -- are used.

Maybe I'm reading something wrong?

Thanks,
Josh


EDIT: Oh, I think I see. 1 hbridge per coil = 2 hbridges per motor, which the L293 provides. I should be able to figure out the sequence from there. The real question is, I'm pretty sure I tried that sequence, and I'm still having the torque issue.
 
Stepper Motor Symbols

The notation ++ or -- means both ends of the coil need to be at the same potential. If both ends of the coil are at the same potential then it does not matter what the potential is - no current will flow.

Each input/output pin on the L293 can connect one end of one coil to either the positive supply on pin 8, or GROUND on pins 4, 5, 12, 13
If you arrange things correctly then you should be able to step by changing only two lines at a time, from some convenient initial condition.

Establishing an initial condition on a stepper with an unknown orientation often causes a small movement from where it is to the new holding position.
 
Ok. It's working great! The old motors must just be crap.

Thanks so much for your help. I certainly have a better understanding of what's actually going on now.

Josh
 
No problem. I'm glad I was able to help.
 
Welcome to the forum!
I doubt you will get a reply. You have hijacked an 8-year old thread :(.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top