Interfacing a Hybrid Stepper Motor

jc173

Member
Right, i'm building a PCB Etching CNC Machine (A basic prototype) for my A2 systems & control project and am going with Stepper Motors and a PICAXE 18 chip.


I am having issues with interfacing a Hybrid Stepper Motor as I am unsure how I need to design the pcb, it would need to go to a Stepper Motor Controller (Through a Resistor) surely?

I've been told I need two outputs (one for step and one for direction).


Could someone give me a 5 minute (post) lecture on how to interface a Hybrid Stepper Motors and interfacing with PICAXE.


I am also looking to either buy a commercial controller or make my own if someone could point me in the right direction please??


TIA


James
 

Ruzzz

Member
Ive used motion control stepper drives

http://www.motioncontrolproducts.com/drives/stepper-drives-msd.php?cat=2

when refurbishing my CNC Mill, and I'm very happy with them.

The connections to them are pulse, direction and enable. The controller then uses microstepping

http://knol.google.com/k/zaber-technologies/stepper-motor-microstepping-tutorial/108cmw9eh3e0t/3#

to control the stepper motor. You specify using switches how many micro steps you want the controller to do. The cheapest one they do, the MSD415, should be suitable. Your motor has 200 steps/rev. using micro stepping with the MSD415 you can increase this to 12800.

If you want to use the PICAXE itself to control the stepper motor, then the second link gives you the timing diagrams. You will need a driver circuit and it will use 2 outputs on the PICAXE for Full stepping and 4 outputs for half stepping or wave stepping.

In either case you need to connect the Yellow and Blue wires together and the Puce? ( PUE ) and Brown together. Then use Red as A and Black as A- and White as B and Green as B-.

When designing a power supply for stepper motors, you can use up to 7 times the rated voltage with any significant heating of them. I use a 28V 16A supply to power 4 off 2.7A 5V stepper motors ( the mill being of a crazy German design uses 2 identical x axis steppers ).
 

eclectic

Moderator
@James.

The datasheet makes life easier now. :)

Page 2 shows how to connect the stepper as a simple Bipolar.

For BIPOLAR SERIES:
Join YELLOW A to BLUE C and insulate connection
Join PURPLE B to BROWN D and insulate connection
Winding One then equals RED and BLACK
Winding Two then equals WHITE and GREEN

Then it can be connected as Manual 3, page 16-17.

Some points to note.

1.4.5v / 9.2Ω = ~0.5A which is close to maximum for an L293D
2.It might be possible to run everything
from 4.0 volts, or slightly lower, providing

a. That the power supply is capable.
b. The stepper is not required to produce full torque.

I've got a 6 wire 7.5v stepper.
I've isolated the two “centre” wires.
The rest is wired as M3 p.17, (but o/p 0,1,2,3)

Prog
Code:
;Forum 23 06 09
;** good reference here
;http://users.bigpond.net.au/electrotech/How%20Stepper%20Motors%20Work.htm

#picaxe 20m
; uses outputs 0,1,2,3
symbol del = 3 ; alter as required

Main:
for b0 = 1 to 100
gosub CWFull
next
Pause 1000

for b0 = 1 to 100
gosub CWhalf
next
Pause 1000

for b0 = 1 to 100
gosub ACWFull
next
Pause 1000

for b0 = 1 to 100
gosub ACWhalf
next
Pause 1000
goto main


CWFull:
pins = %1010 : pause del ;1 1/3
pins = %0110 : pause del ;2 1/2
pins = %0101 : pause del ;3 0/2
pins = %1001 : pause del ;4 0/3
return

CWhalf:
pins = %1000 : pause del ;1
pins = %1010  : pause del ; 1 and 2
pins = %0010 : pause del ;2
pins = %0110  : pause del ; 2 and 3
pins = %0100 : pause del ;3
pins = %1100  : pause del ; 3 and 4
pins = %0001 : pause del ;4 
pins = %1001  : pause del ; 4 and 1
return

ACWFull:
pins = %1001 : pause del ;4 0/3
pins = %0101 : pause del ;3 0/2
pins = %0110 : pause del ;2 1/2
pins = %1010 : pause del ;1 1/3
return

ACWhalf:
pins = %1001  : pause del ; 4 and 1
pins = %0001 : pause del ;4 
pins = %1100  : pause del ; 3 and 4
pins = %0100 : pause del ;3
pins = %0110  : pause del ; 2 and 3
pins = %0010 : pause del ;2
pins = %1010  : pause del ; 1 and 2
pins = %1000 : pause del ;1
return
It's running from three NiMh, at ~ 3.65v


e
 

jc173

Member
With a L293 I need 4 outputs right? so the diagram on pg 17 M3 is wrong?

I have looked at a L298 so to avoid the problem of chip overload, however I'm completely miffed at wiring it up!! Even after reading the datasheet, things like:

Do I need all 4 outputs?
What is the need for Sense B?
 

jc173

Member
Sorry James, but I don't understand your question(s).

Could you explain further your query re

M3 p17?

e
M3 P17 shows 2 Motors being controlle by one chip, does it not require 4 outputs (not two as shown in the manual to controll each coil)??
 

eclectic

Moderator
M3 P17 shows 2 Motors being controlle by one chip, does it not require 4 outputs (not two as shown in the manual to controll each coil)??
Going back weeks to post #6.

I wired the stepper as a Bipolar.
(Similar to your datasheet)
Then, wired it as M3, p17,
except I used different Picaxe pin numbers.

Remember, a BIpolar uses FOUR wires.

Please re-read manual 3 and the reference I included in
post #6

e
e
 

jc173

Member
Quick one REF: Post 6... can someone explain the code to me in English please so I can interpret it for my folio explanation.


TIA


J.
 

BeanieBots

Moderator
It's just an example that drives the motor in several different modes for 100 steps of each mode. (the for/next loops)
The binary patterns (eg %0011) reperesent the outputs that are turned on in sequence.
The code really is quite self explanitory.

Try 'walking' through the code and see what happens to the outputs at each step.
 
Last edited:

jc173

Member
It's just an example that drives the motor in several different modes for 100 steps of each mode. (the for/next loops)
The binary patterns (eg %0011) reperesent the outputs that are turned on in sequence.
The code really is quite self explanitory.

Try 'walking' through the code and see what happens to the outputs at each step.
Sorry, me being blonde. It's turning on and off the 'magnets' or outputs that position the motor isn't it... 0,1,2,3 are the 4 outputs......


I get it... d'oh!
 
Top