Single Axis Stepper Control
Single Axis Stepper Control
Single Axis Stepper Control
Stepper Lab
While this stepper lab is are important, a later lab using multiple stepper drives is preferred. This
single axis stepper control was first designed to interface with an Etch-a-Sketch. That design
didn’t work well due to limitations of the Etch-a-Sketch.
The present design has similar requirements to the servo in that a starter program was given with
the student required to enhance the program with a HMI program as well as control of the motor
in auto and manual.
One of the design components of this lab was the green Phoenix Contact interface devices. It
was felt that students should be introduced to common devices used by industry rather than
trying to build the interface on a breadboard. Cost does increase with this design with the cost of
each of the interface devices >$100. The concept of off-the-shelf parts is an important one for
the student to learn, however.
The Siemens PLC is used to generate the pulses controlling the stepper motor through the
EVAL6208N unit. Software configuration is described in this section. Use this application to
successfully start and control the stepper motor.
Follow the steps below in the order given to use motion control with the CPU S7-1200. The
subject will be broadly divided into the following steps. The text will only cover portions of
these:
The axis program given already has commissioned the drive and has several programming
blocks present to test the operation of the stepper. The following gives the list of programming
blocks available plus the Command Table blocks. The Command Table block allows the user to
enter a number of commands in a sequence for execution as a block.
Active homing
In active homing mode, the motion control instruction "MC_Home" performs the required
reference point approach. When the homing switch is detected, the axis is homed according to
the configuration. Active traversing motions are aborted.
Passive homing
During passive homing, the motion control instruction "MC_Home" does not carry out any
homing motion. The traversing motion required for this step must be implemented by the user
via other motion control instructions. When the homing switch is detected, the axis is homed
according to the configuration. Active traversing motions are not aborted upon start of passive
homing.
The axis position is set regardless of the homing switch. Active traversing motions are not
aborted. The value of input parameter "Position" of motion control instruction "MC_Home" is
set immediately as the reference point of the axis.
The axis position is set regardless of the homing switch. Active traversing motions are not
aborted. The following statement applies to the axis position after homing:
New axis position = current axis position + value of parameter "Position" of instruction
"MC_Home".
You control the axis with the user program using motion control instructions. The instructions
start Motion Control jobs that execute the desired functions.
The status of the motion control jobs and any errors that occur during their execution can be
obtained from the output parameters of the motion control instructions. The following Motion
Control instructions are available:
1. In the project tree, double-click your code block (the code block must be called in the
cyclic program). The code block is opened in the programming editor and all available
instructions are displayed.
2. Open the “Technology” category and the “Motion Control” and “S7-1200 Motion
Control” folders.
5. Click “ok”. The motion control instruction “MC_Power” is inserted into the network:
Parameters marked with “<???>” must be initialized; all other parameters are assigned
default values. Parameters displayed in black are required for use of the motion control
instruction.
Click the toolbox icon if you want to open the configuration view of the technology
object:
Click the toolbox icon if you want to open the configuration view of the technology
object. Click the arrow down icon to view additional parameters of the motion control
instruction.
Programming notes:
Cyclic call of utilized motion control instructions. The current status of command
execution is available via the output parameters of the motion control instruction. The
status is updated with every call of the motion control instruction. Therefore, make sure
that the utilized motion control instructions are called cyclically.
Transfer of parameter values of a motion control instruction. The parameter values
pending for the input parameters are transferred with a positive edge at input parameter
“execute” when the block is called. The motion control command is started with these
parameter values. Parameter values that are subsequently changed for the motion control
instruction are transferred until the next start of the motion control command. Exceptions
to this are input parameters ”StopMode” of motion control instruction “MC_Power” and
“Velocity” of motion control instruction “MC_MoveJog”. A change in the input
parameter is also applied when “Enable” = true or “JogForward’ and “JogBackward”…
In the example below, observe the indicated sequence. Failure to observe the sequence
will display an axis or command error.
There are three groups for tracking active motion control jobs, those with output parameter
See the results of the instructions’ timing diagram with abort or error conditions. The WinCC
book at about pg. 4000 shows these results.
The charts below show the transition between movements in various different transition modes
in the "Next step" column:
The following instructions are tied to inputs from the switched inputs directly wired to the PLC.
Each input executes a specific action. For instance, I0.0, the first input, executes a drive reset
instruction per the program below.
The Reset Instruction is used to reset the axis. It is referenced to I0.0 which is the first input on
the switch panel on top of the PLC. Use this switch input to reset the axis.
Axis Power
(Enable)
The Power Instruction is used to enable the axis. It is referenced to I0.1 which is the second input
on the switch panel on top of the PLC. Use this switch input to enable the axis.
The Home Instruction is used to home the axis. It is referenced to I0.2 which is the third input on
the switch panel on top of the PLC. If there are no home limit switches, the present position is
used as the home position and absolute moves can be entered following the Home block being
executed
Set Velocity
The Move Velocity Instruction is used to set the velocity of the axis. It is referenced to I0.3.
The Move Relative Instruction is used to trigger a relative move of the axis. It is referenced to
I0.4.
Halt Command
The Halt Instruction is used to halt a move of the axis. It is referenced to I0.7.
The Move Absolute Instruction is used to trigger an absolute move of the axis. It is referenced to
I0.6. It will move the axis to a position relative to the home instruction.
In addition to the discrete instruction listed above, a command table may be used to store the
commands of a sequence of move commands for the Siemens processor. The same command
table can be generated for Allen-Bradley although this feature was never completely made to
work by the instructor or lab tech in the course to date. It would be a challenge for a student to
execute the command sequence for both drives using that feature from the manufacturer’s
software.
Project
Program the Stepper Application using the Siemens PLC, Stepper Module and Siemens HMI to
control the dial for a variable number of complete turns either forward (CW) or reverse (CCW)
at a various number of speeds.
To design the HMI panel, use the description below. The description there describes a simple
single-axis machine. As an automatic sequence, use at least two different rotations. One could
be of 4 turns followed by a dwell followed by a second 4 turns followed by a dwell followed by a
return to home.
Notice the switches on the PLC. They are attached to inputs which set up the motion
application. They may be used for all inputs except those specific to the operation of the
machine such as the auto-manual, jog forward, jog reverse, halt and resume commands. Other
commands such as ‘home’, ‘reset’ and ‘power’ can remain as switches instead of being
incorporated into the HMI.
I0.0-I0.7
Starting Point