CAD CAM EDM DRO - Yahoo Group Archive

Re: [CAD_CAM_EDM_DRO] 'step and direction' motor driver

on 2002-12-17 14:20:36 UTC
Hi R,

You will need to be able to set the direction pin to a High for CW, and
Low for CCW (or swap these, as needed... menu selection). Then the
"step" line is pulsed, usually Hi to low for perhaps 10 uS, then back
high again. Here too, a menu selection to change the "polarity" of the
pulse (L to H, or H to L) is desirable, as well as a "pulse duration"
parameter.

You'll want to start out with slow pulses, and then increase their rate,
up to the desired step rate. Reverse this to slow back down and stop.
This is called acceleration/deceleration. If you don't, you'll find
that the steppers can't keep up, and will "loose sync" and stop
abruptly. They don't like to slow down too fast either!

Windows can "slice up" your machine's code execution time, giving a
choppy pulse stream. Steppers don't like this! I believe microstepping
drives (G201's or similar) help in this respect a little. This is why
many PC based controller programs (up to now) usually run under DOS.
DOS is less intrusive in this respect (and runs on CHEAP machines, as
well).

You can start off by just generating a square wave with pin 3 (step),
and set the direction pin (2) for the desired rotation direction. If
you start fairly slow, the motor should respond and move, even without
acceleration/deceleration (also called ramping).

As you probably have already determined, you'll need "loops" to generate
a series of NN step pulses, and controlling the loop will be code for
the conversion from inches (or mm's) to the number of steps you want to
move. This will require a scaling parameter that can be set (or
initially just defined in the source code). For example, my Sherline
CNC mill has 400 half steps, and a 20 tpi lead screw, so I get 8000
steps per inch, or 0.000125" of travel per step. To get the distance to
move for each new commanded position (assuming you desire to do absolute
moves... ABS, recommended over relative moves, which can accumulate
position errors), you'll save a "current location" for the axis
position, and then calculate the distance to the new position, do the
move, then update the current location.

Hope this helps! I'm now running the CNC controller program (STEP4)
that I wrote to make parts for my steam engines! I wrote my controller
in 'C' (and some .ASM here and there), so I can probably answer
additional questions you may have about the tasks involved in motion
control (although I don't care to write Visual Basic).

Good luck with your project!

Alan KM6VV


"rdenn25 " wrote:
>
> OK,
>
> what does this mean, exactly?
>
> if I want to move the X axis motor,
> what do I do with pin 2 and pin 3 on
> the parallel port
>
> Do you you set the direction pin then
> pulse the step pin on and off?
>
> I want to write a snippet of code to move
> the X axis of a cnc mill a small distance
>
> I'm using visual basic 6, and I have found the
> DLportIO dll to control the parallel port, but
> I'm not sure what to do with the pins? Do you set
> one and pulse the other, pulse them both, what?
>
> thanks for any help...

Discussion Thread

rdenn25 <rdenn25@y... 2002-12-17 13:06:31 UTC 'step and direction' motor driver j.guenther 2002-12-17 13:15:30 UTC RE: [CAD_CAM_EDM_DRO] 'step and direction' motor driver Alan Marconett KM6VV 2002-12-17 14:20:36 UTC Re: [CAD_CAM_EDM_DRO] 'step and direction' motor driver rdenn25 <rdenn25@y... 2002-12-17 15:12:43 UTC Re: 'step and direction' motor driver Jon Elson 2002-12-17 18:32:02 UTC Re: [CAD_CAM_EDM_DRO] 'step and direction' motor driver