Wednesday, June 26, 2013

Horner Controlling a Stepper Drive

Horner features many HMIs that include I/O. Today, we're using an XL4 which is equipped with two high speed digital outputs for two axis of motion. Cscape, Horner's free programming software, configures the output between the options of PWM, high speed counter output, or stepper. In our case, we just want a typical stepper for our stepper drive.



This will allocate two regions of variables. AQ421 through AQ440 for analog outputs and I1617 through I1620 for digital inputs. The analog outputs are set points for both high speed outputs.


Let's look at just stepper 1 axis. Parameters start/run frequency and acceleration/run/deceleration count quantify our move profile. The only required parameters however are run frequency and run count. The others can remain zero.

Register Stepper Value
%AQ421 Start Frequency 0
%AQ423 Run Frequency 15000
%AQ425 Acceleration Count 0
%AQ427 Run Count 3200
%AQ429 Deceleration Count 0

Finally, set Q1 to true and Q1 will output the pulse train at the requested frequency and count. In this example, the drive is set to 3200 counts per rev and it will move at 15kHz. After the move is done, I1617 becomes true representing move complete. If bad values are used in the move profile for axis one, I1618 will be a value of 1.

What if you want to command direction? There are several more digital outputs you can use to command the direction bit on a stepper drive.

What if you want to jog the drive? Make the value of run count a very large number like 4 billion and reset Q1 when you desire to stop.

No comments:

Post a Comment