Tip 23: How to Use Integrated Pulse Outputs for Open-Loop Control Positioning with a Stepper Motor
Version 4.1. Updated 08/00
Overview:
Positioning tasks differentiate between closed-loop control and open-loop control operations. Stepper motors do not require continuous position control and therefore are used in open-loop control mode. This program example achieves relative positioning with a stepper motor drive by using the integrated pulse outputs of the SIMATIC S7-200 CPU 224. Although a reference point is not necessary for this type of positioning, the example describes a simple procedure for specifying a reference bit because, from a practical standpoint, it makes sense to assign a fixed reference point to an axis. Next, this example program uses an input byte in binary format to provide the CPU with the positioning angle. From this information, the program then calculates the number of required positioning steps and causes the CPU to read out a corresponding number of control pulses.
Unassigned GND
1M 1L+
Siemens
Out .0 .1 .2 .3
CPU 224
Signal interface
L+ (24V) M (24V GND) Gate_N 24 VDC power supply
SF Run Stop
.0 .1 .2 .3 .4 .5 .6 .7 In
MSTILL ZERO
Parameter switch
Ready2
Motor connection
u v w
I1.1:
I1.0: Motor start Motor stop I1.4: Set/delete reference point I1.5: Direction of rotation switch
Stepper motor
Description FM STEPDRIVE
The FM STEPDRIVE power section is used to drive three-phase stepper motors. Motors in the lower range of performance can be driven with 5 W to 600 W.
Clock pulse
Each positive pulse edge causes one step of the motor if it is ready to run and has 24 V at the GATE N input.
DIR
Direction of rotation
For a de-energized signal input DIR, the motor turns clockwise; for an energized signal input, the motor turns counterclockwise.
If the ENABLE input is energized, the power section is enabled. The level of the motor phase current that is set can be changed with a pulse width modulated signal. After the ENABLE input is activated, the power section reports that it is ready by means of the output READY1_N.
Ready status
Signal Interface
The signals of the higher level controller that are fed in at the PULSES input can be enabled for driving the motor by means of the GATE_N input of the signal interface. The signal interface has 24V inputs. Inputs: GATE_N
When there are 24 V at the GATE_N input, the signals that are pending at the PULSES input are used for driving the stepper motor. For 0 V, the pending signals are disabled. In the zero position of the internal ring counter, there are 24 V at the ZERO output. After the ENABLE input is activated, the power section reports that it is ready by means of the READY2 output. If the clock pulse signal is disabled by means of the GATE_N input and the motor is brought to a standstill, this standstill is acknowledged by the MSTILL signal.
Parameter Switch:
1000 steps/revolution
Voltage Conversion for the Driver of the Stepper Motor The following figures show how you can easily create a circuit in order to connect the programmable logic controller to the drive of the stepper motor that requires a 5V current-sinking signal.
5V
CPU 224
380
FM STEPDR Pulses
24 V
5V 100 Pulses_N
TTL
As an option, you can also use a Calex converter (such as a Model 8502) to generate a 5V current-sinking signal.
Load resistor
Out .0 .1 .2 .3
Note: For the pulse train output (PTO) function, the switching times of the outputs for the switching procedures On/Off and Off/On are different. This difference is evident as a distortion of the relative duty cycle. The PTO outputs require a minimum load of 10% of the rated load in order to generate clean transitions. Without the load, the stepper motor could lose steps when switching from one pulse rate to another.
Program Description
Input and Output Definitions
Inputs: I0.0 to I0.7 I1.0 I1.1 I1.4 I1.5 Outputs: Q0.0 Q0.2 Q0.3 Q1.0 Pulse Output Direction of Rotation Indicator Drive Enabled Indicator Reference Angle Indicator Reference Angle (in binary format) Motor START Motor STOP Set/Delete Reference Angle Direction of Rotation