View Full Version : How to code a step motor axis move?


Niggo
10-29-2006, 04:17 AM
Hi! I'd like to code a program that simply rotate a stepper motor in a direction and in the opposite using the lpt interface. I know I need to give a square waveform for every step and a square waveform for the direction (or nothing for the opposite direction) but I don't know the timings/frequency for each one and for each step how much the signal should be in high state and low state, can you help me? For example, my motor is 200 step/seconds so the frequency of the step signal should be 0,005 seconds but in this time which is the % of high state and lower state? Thanks in advance!

mwalach
04-12-2007, 08:11 PM
Make a variable that you can adjust to control the pulse width. The speed of different cpu's will effect the speed of the data string out.

DocTanner
04-13-2007, 03:34 PM
Hey Niggo,
I think this page has the info you are seeking.
www.cs.uiowa.edu/~jones/step

DocTanner

integerspin
08-13-2007, 11:40 PM
I am doing a simple setup with a parallel port for a motor at the moment.

I will do it in fortran or c. But I didn't have a dos complier on the laptop I was going to use
, well i didn't think it had but it seems to have qbasic on it so I have had the motor running unipolar
with qbasic it's a simple as..

out 888,[first step]
out 888,[first step, and second step]
out 888,[second step]
out 888,[second step, third step]
out 888,[third step]
out 888,[third step, fourth step]
out 888,[fourth step]
out 888,[fourth step, first step]

888 is lpt1[378h] look up 'parallel port qbasic'


I had the above in a loop with a couple of nested delay loops wasting time between steps ..
not pretty but I had the motor spinnning within a few minutes of turning the laptop on..

Once you have seen it working it's pretty simple..
I am not sure if i shoud stick with unipolar, or go bipolar. For testing
I have 4 IRF540 fets bolted to an old bike swinging arm[well it was the only 'heatsink' in my junk] and am running the motor off car batteries with 2 car ballast resistors to limit the current. I have just cobbled together an old printer lead with some LED's for testing..