Configuring Step and Direction Outputs

KMotion supports connection to motor amplifiers that utilize step and direction inputs to control the motion. Step and direction motor amplifiers are typically used with stepper motors with or without micro-stepping capability. Each "step" causes the motor amplifier to advance the motor position one step in the direction specified by the "Direction" signal. Only two digital output signals are required for this interface. Fine micro-stepping resolution combined with high motor RPM can result in step rates in the megahertz. For example, a 200 step/rev stepping motor with 128:1 micro-stepping running at 3000 RPM requires:

3000 RPM / 60 Sec/Min * 200 steps/rev * 128 µsteps/full step = 1.28 MHz µsteps/sec

KMotion has 4 axes of Step and Direction Generation on board. Output pulses up to 2.5 MHz can be generated.

The 4 Axes of Step and Direction outputs are hard wired to IO bits 8 through 15. If an axis channel is selected as a Step and Direction axis, the corresponding 2 output pins will be automatically configured as outputs and they may not be used as general purpose IO.

See the Table below:

Signal | IO Bit | Pin
Step 0 | 8 | 23
Direction 0 | 9 | 24
Step 1 | 10 | 25
Direction 1 | 11 | 26
Step 2 | 12 | 27
Direction 2 | 13 | 28
Step 3 | 14 | 29
Direction 3 | 15 | 30

To configure an axis as step and direction, on the Configuration Screen select output mode as "Step Dir" and select which of the 4 available Step and Direction generators should be used by setting the appropriate Output Channel 0 setting. See below.

Valid output channel settings 0-7 are allowed. Although only 4 Step and Direction generators are available, channels 4-7 specify the same generators as channels 0-3 except the output pins are actively driven (high and low) as 3.3V LVTTL signals instead of only driven low as open collector outputs.

If your Step and Direction amplifier has opto coupler inputs driven off +5V then open-collector mode is likely to work better. However if the amplifier has standard logic inputs then LVTTL outputs should work better.

The table below summarizes the modes:

Output Chan 0 Setting | Step & Dir Generator Selected | Output Drive Type
0 | 0 | Open Collector
1 | 1 | Open Collector
2 | 2 | Open Collector
3 | 3 | Open Collector
4 | 0 | LVTTL
5 | 1 | LVTTL
6 | 2 | LVTTL
7 | 3 | LVTTL

Appropriate maximum Velocity, Acceleration, and Jerk should be set in units of micro-steps/sec, micro-steps/sec2, and micro-steps/sec3 respectively.

Example Configuration for a IM804 Amplifier and Rapidsyn Stepper

Layout - KMotion - Amplifier - Motor

Amplifier Connections - resistors set coil currents (1500 ohms = 3A) and idle standby current (270 ohms = 0.5A). DIP Switches set to ON-OFF-OFF-ON for 128:1 micro-stepping.

Rapidsyn stepper motor. Note coil winding's centertaps are not used.

Axis channel 0 configures as "Step Dir" mode and using Step and Direction generator 0.

Max Velocity 1.6 x 106 steps/sec (1.6e6 / 128 = 12,500 sps = 3750 RPM). Note this (and most) steppers lose most all of their useful torque above several thousand full steps per second. The high speed demonstrated here is intended to demonstrate KMotion's ability to generate high pulse rates.

Max Acceleration 6 x 106 steps/sec2

Max Jerk 2 x 108 steps/sec3

1 x 106 count Move performed and data captured over 3 seconds.

Pushing Move downloads all parameters, enables the axis, performs the movement, and plots the result.

Note after the axis has been enabled, digital IO bits 8 and 9 have automatically been configured as outputs for use by Step and Direction Generator #0.

See Video

Click here for a video showing slow and smooth acceleration of this configuration up to 12,500 full steps per second.