application for drives - siemens ag · application for drives ... "closed-loop...

81
Application for Drives Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process incl. HMI Configuration Micro Application Example 10

Upload: others

Post on 13-Mar-2020

21 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Application for Drives

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process incl. HMI Configuration

Micro Application Example 10

Page 2: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 2/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Warranty, Liability and Support

We do not accept any liability for the information contained in this document.

Any claims against us - based on whatever legal reason - resulting from the use of the examples, information, programs, engineering and performance data etc., described in this document shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract (“wesentliche Vertragspflichten”). However, claims arising from a breach of a condition which goes to the root of the contract shall be limited to the foreseeable damage which is intrinsic to the contract, unless caused by intent or gross negligence or based on mandatory liability for injury of life, body or health. The above provisions does not imply a change in the burden of proof to your detriment.

The Application Examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. They do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible in ensuring that the described products are correctly used.

These Application Examples do not relieve you of the responsibility in safely and professionally using, installing, operating and servicing equipment. When using these Application Examples, you recognize that Siemens cannot be made liable for any damage/claims beyond the liability clause described above. We reserve the right to make changes to these Application Examples at any time without prior notice. If there are any deviations between the recommendations provided in these Application Examples and other Siemens publications - e.g. Catalogs - then the contents of the other documents have priority.

Copyright© 2004 Siemens A&D. It is not permissible to transfer or copy these Application Examples or excerpts of them without first having prior authorization from Siemens A&D in writing. For questions about this document please use the following e-mail-address:

[email protected]

Page 3: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 3/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Table of Contents

Part A1: Application Description................................................................................. 7 1 The Automation Task................................................................................. 8 2 The Automation Solution ........................................................................ 10 2.1 Required standard hardware- and software components and

components of the application software ("shopping list") ........................... 12 2.1.1 Hardware components ............................................................................... 12 2.1.2 Software components ................................................................................ 12 2.2 Application software components .............................................................. 13 3 Basic performance data .......................................................................... 14 3.1 General ...................................................................................................... 14 3.2 Example for using the calculation matrix shown in chapter 3.3 ................. 16 3.3 Calculation matrix....................................................................................... 17 3.3.1 Acceleration time [ms]................................................................................ 17 3.3.2 Delay .......................................................................................................... 17 3.4 Selected, measured times for verifying the calculated values ................... 19 Part A2 : Function Mechanisms ................................................................................ 21 4 Function Mechanisms ............................................................................. 22 4.1 Description of entire solution structure....................................................... 22 4.1.1 Control unit (S7-CPU 222 and positioning module EM 253)...................... 23 4.1.2 Control of the FM STEPDRIVE and the SIMOSTEP stepper motor .......... 25 4.1.3 Operator control and monitoring of the application with the TD200

text display unit .......................................................................................... 34 4.2 Program and data structure ....................................................................... 35 4.2.1 Organization block " STEP1_MAIN " ......................................................... 36 4.2.2 Subroutine " STEP1_MOTION " ................................................................ 37 4.2.3 Subroutine "STEP1_MSELECT"................................................................ 39 4.2.4 Subroutine "STEP1_PSELECT" ................................................................ 40 4.2.5 Subroutine "STEP1_FCUT" ....................................................................... 41 4.2.6 Subroutine "STEP1_STATUS"................................................................... 42 4.2.7 Variables used in the program ................................................................... 42 Part B: Installation of the Example Application....................................................... 46 5 Installation of Hardware and Software................................................... 47 5.1 Hardware configuration .............................................................................. 47 5.1.1 Installation of the S7-200 CPU and the EM253 positioning module .......... 48 5.1.2 Installation of the FM STEPDRIVE ............................................................ 48 5.1.3 Electrical connection of the components.................................................... 49 5.2 Software installation ................................................................................... 55 5.2.1 Transfer of the application code to the S7-200 CPU.................................. 55 5.2.2 Parameter setting for the FM STEPDRIVE ................................................ 56

Page 4: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 4/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

6 Operator Control via Text Display TD200 .............................................. 57 6.1 Automatic/jog mode ................................................................................... 58 6.2 Selecting and setting profiles ..................................................................... 60 6.3 Display of status information ...................................................................... 61 6.4 Setting the first cut ..................................................................................... 62 Part C: Program Description ..................................................................................... 63 7 Explanation of the main parts of the S7-Micro/Win program............... 64 7.1 Details on the sub-program STEP1_MOTION ........................................... 65 7.2 Details on the sub-program STEP1_PSELECT ......................................... 71 8 Modifying the S7-Micro/Win Program .................................................... 77 8.1 Changing the parameters for motion.......................................................... 77 8.2 Increasing the number of profiles............................................................... 79 8.3 Changing the feedrate................................................................................ 80 8.4 Use of other motor versions ....................................................................... 81

Page 5: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 5/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Preamble

The application described in this document is used for the »controlled positioning of an axis with a stepper motor using the example of a cutting-to-length process, including HMI configuration« and it belongs to the group of controlled positioning procedures. Basically, these procedures can be broken down into "controlled" and "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used for closed-loop controlled positioning must be continuously provided with in-process information on the current position.

The application for controlled positioning described here requires the following component types:

• S7-222 CPU

• EM 253 POSITION

• FM STEPDRIVE

• SIMOSTEP 2Nm (stepper motor)

• TD200 text display unit.

The SIMOSTEP stepper motor mentioned above is also available in other versions with different ratings; the application described here refers to a type of stepper motor which is quite common on the market.

In combination with exactly the components as stated above, the application described in this document offers a Plug&Play solution for linear axes and also includes primary performance data verified under load. But you may also select other products from the specified product types (e.g. SIMOSTEP 4Nm instead of 2Nm) that meet best your specific purpose: Our detailed description of the function mechanisms and of the user program will help you to choose functional features that suit your individual requirements (e.g. with regard to the HW components used).

Furthermore, we give answers to frequently asked questions which will help you to reach your goal step by step (see chapter 8 "Modifying the S7 Micro/Win Program"), e.g. on "how to proceed if you wish to use another type of stepper motor with different ratings".

Page 6: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 6/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

The basic solution principle of this application can be described as follows:

In order to realize a controlled positioning process, the application must be equipped with different standard components (hardware and software. These standard components must be provided by you (see Figure 0-1). The application software delivered relieves you from extensive parameter setting and programming of the standard components and offers you a comfortable solution for your controlled positioning procedures.

SIEMENS

SIMATIC components

(HW+SW)

SIEMENS

Motors &

Drives (HW+SW)

Application

software

(SW) + +

... provided by you ... part of the delivery of the application

Figure 0-1 Basic solution principle of the application

Possible fields of use for this application include • feed units

• material conveyance systems

• paper processing machines

• cardboard processing machines

Page 7: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 7/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Part A1: Application Description

Objectives of Part A1 Part A1 of this document provides the reader with information on the following topics:

• the automation task to be solved

• a possible solution

• the performance and capacity of the overall application

Page 8: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 8/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

1 The Automation Task

A typical industrial case

The following example shows one possible case where the provided application is used.

The example refers to a material conveyance system used to feed cardboard elements to a cutting unit. The cardboard is moved by means of a feed roll and a press roll, whereby the cardboard is "clamped" between the two rolls.

The feed roll is driven by a stepper motor. The cardboard feed rate refers always to a defined length (set length for the cardboard). After the cardboard has been moved forwards by this defined length, it is cut by a knife extending from the cutting block. When cutting is completed, the cut cardboard piece is transported to the next station. The next piece of cardboard can be fed forward and cut.

The cardboard is registered by a sensor located directly behind the cutting block. Before starting the first cut, the cardboard is positioned automatically directly beneath the cutting block, so as to avoid unnecessary waste of material.

The positioning task relevant for this application is the exact positioning of the uncut cardboard for feed movement.

Figure 1-1 Technical task specification

Page 9: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 9/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

"Abstract" approach to the application requirements The application shall be compatible with the "given" hardware components (S7-CPU 222, EM253, FM STEMDRIVE and SIMOSEP stepper motor, TD200; also refer to the components list of chapter 2.1.1).

In combination with the "application software" (see chapter 2.2), the system offers specific performance characteristics which define the range of possible applications that can be realized with this solution.

The Plug&Play version of this application (i.e. in combination with the defined hardware components, see above) is suitable for use with systems that meet the following basic data:

Table 1-1 Basic data of the application Technical date from until

Motor torque 0 2Nm

Accuracy <1mm

Speed 1 rev/sec of the stepper motor shaft

20 rev/sec of the stepper motor shaft

Basically the "application software" is also suitable for use with stepper motors of other capacity classes (of the SIMOSTEP series) which offers an extended range of possible applications with regard to the driving power. The positioning accuracy is normally not affected.

Apart from the technical functions, the application is provided with a very comfortable and cost-effective HMI connection. The criteria to be monitored include the current position and speed as well as the present STATUS of the application. The following functions must be fully operable: automatic ON/OFF, jog mode (forward/backward motion) and individual setting of the feed length.

! Note The application software complies with the above stated requirements without requiring any further programming.

Page 10: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 10/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

2 The Automation Solution

This chapter provides you with detailed information on how this application solves the automation task described in chapter 1. It demonstrates what the application can do and how it works. Its functions are deliberately described in universally applicable terms. Part A2 of this documentation includes in-depth information, which you will only need if you are interested in the detailed processes and the interactions between the individual solution components.

The hardware components illustrated give an overview of the system layout.

Figure 2-1 Hardware components of the automation solution

An S7-200 CPU controls the stepper motor via the modules EM 253 POSITION and FM STEPDRIVE. The FM STEPPDRIVE is the power unit for the stepper motor. Position and motion of the stepper motor are defined by the CPU. The EM253 "POSITION" module transforms these values into pulses (steps) which are then converted into current values for the stepper motor rotation. The stepper motor is connected to a roll by means of a toothed belt. The cardboard is clamped between this feed roll and a press-on roll.

Page 11: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 11/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

The configuration is operated and monitored with the help of a TD200 text display unit (e.g. to define the cardboard length, display of the current position, etc.).

The sections below include information on each hardware element shown in Figure 2-1 and their specific functions for the overall solution of the automation task:

Table 2-1 Functions of the individual hardware components in the overall solution

No. Classification according to Figure 3-1

Hardware element

(Main) Function, properties

1 Visualization Text display unit TD200

• operator control and monitoring (see table 4-2, "HMI displays and their function").

2 Super-ordinate intelligence with I/O modules

S7-CPU 222

• automatic process for feed movement • selection between different profiles • in a special setting-up mode, the cardboard

can be positioned beneath the cutting block where it is registered by a sensor

3

Extension module for positioning tasks (connected to a super-ordinate intelligence)

EM 253 "POSITION"

• converts the travel paths received from the S7-Micro/Win program into pulses

4 Drive FM STEPDRIVE • converts the pulses received from the EM253 into current values for motor movement.

5 Motor

SIMOSTEP stepper motor TYPE 1FL3041-0AC31-0BK0 (2Nm)

• converts the electrical energy into mechanical power.

Page 12: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 12/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

2.1 Required standard hardware- and software components and components of the application software ("shopping list")

2.1.1 Hardware components

Products Component Type MLFB/Order information No. Remarks

Central processing unit S7-CPU 222 (AC) 6ES7212-1BB22-0XB0 1 For CPU connection to mains voltage

Expansion module EM 253 "POSITION" 6ES7253-1AA22-0XA0 1

Text display unit TD200 6ES7272-0AA20-0YA0 1 With cable (2.5m) and installation equipment

Power unit FM-STEPDRIVE 6SN1227-2ED10-0HA0 1

Stepper motor SIMOSTEP 2Nm type 1FL3 1FL3041-0AC31-0BK0 1 Shaft diameter 12mm

Accessories Component Type MLFB/Order information No. Remarks

Connecting cable PC S7-CPU 222 PC/PPI cable 6ES7901-3BF21-0XA0 1

Connecting cable positioning module

power unit 1 The cable must be prepared

individually, see Chapter 5.1.3

Connecting jack on the power unit

15 pin D-SUB female with enclosure 6FC9348-7HX 1 Packing unit: 3 pieces

Connecting cable power unit stepper motor

Power line 10m 6FX5008-5AA00-1CA0 1 3 x 1.5mm² Cu

Fixation for FM STEPDRIVE

SIMATIC S7-300, mounting rail 6ES7390-1AB60-0AA0 1 Length: 160mm

Note This application has been realized without the use of a sensor which is simulated by means of a digital input for each switch (see chapter 5.1.3.6).

2.1.2 Software components

Configuration software Component Type MLFB/Order information No. Comment

Configuration software

S7-Micro/Win 32 V3.2; suitable for use under WIN95/98/ME and WIN NT/2000

6ES7810-2BC02-0YX0 1 With documentation on CD

Page 13: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 13/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

2.2 Application software components

The software required for this application is included in the S7-Micro/Win project.

The table below shows the individual elements of the STEP7-Micro/Win project including a description of their functions and technical data.

Table 2-2 Application software components

Note

The FM STEPDRIVE power unit does not need to be configured separately; the few parameters required can be set directly with the device buttons, see Part B.

No.

Name Function description Technical data

1 STEP1_MAIN (OB1) Calls the sub-programs 2 STEP1_MOTION (SBR0) Automatic and manual motion control 3 STEP1_MSELECT (SBR1) Selects the TD200 displays 4 STEP1_PSELECT (SBR2) Selects the cutting profile and to set the lengths for

the different cutting profiles 5 STEP1_FCUT (SBR3) Places the paper beneath the cutting block and to

activate the initial start of operation 6 STEP1_STATUS (SBR4) Shows information on the present status in plain text,

e.g. "FM STEPDRIVE ready" 7 POS0_CTRL (SBR5) Activates and initializes the positioning module

8 POS0_MAN (SBR6) Changes to manual operation of the positioning module (jog mode)

9 POS0_GOTO (SBR7) Transmits a command to the positioning module for absolute or relative movement to a defined position (defined feed action)

10 POS0_LDPOS (SBR8) This command for the positioning module is used to load a new position value for the "current position" (e.g. 0 to reset the counter)

11 POS0_DIS (SBR9) Enables or disables the output "DIS" of the positioning module required to enable the FM STEP-DRIVE

1892 bytes

12 DATA BLOCK (DB) Includes all default values and the reservations for variables as well as the configuration of the TD200 text display unit

494 bytes

Page 14: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 14/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

3 Basic performance data

3.1 General

Due to the function principle of step motors, the mechanical performance data of the application (theoretical) are already known in advance. This means that when planning a step motor drive, the exact performance data can be calculated.

The data results from motor power, the mass to be accelerated and the friction during positioning.

On this basis a matrix was calculated in this application taking into account the used components. In this matrix the acceleration time (under various frame conditions) was calculated depending on the load momentum and the maximum reachable speed. (Some values were measured at random for verifying the calculated values)

The following formula were used:

StepprmM : Torque of stepper motor [Nm]

FrictionM : Friction momentum of test setup [Nm]

LoadM : Load momentum against position direction [Nm]

maxω : Angular velocity [s-1] (Velocity of round axis) α : Angular acceleration [s-2] (Acceleration of round axis)

J : Momentum of inertia of test setup [Kgm²] (Mass inertia of round axis)

Page 15: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 15/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

onAcceleratit : Time for accelerating to maximum velocity [s]

LoadFrictionStepperm MMJαM ++⋅=

αJ

)MM(M LoadFrictionStepperm =+−

onAccelerati

max

tωα =

onAccelerati

maxLoadFrictionStepperm

J)MM(M=

+−

MonAcceleratiLoadFrictionStepperm

max t)MM(M

ωJ=

+−⋅

The rearranged formula for the acceleration time to maximum velocity shows that the values for

• the momentum of inertia

• the desired maximum velocity

• the momentum (depending on velocity)

• the friction momentum and

• the load momentum

must be known.

! Important All values measured and calculated in this chapter refer to the test setup on which the application was developed. Other mechanical systems have different parameters which must be included in the calculation.

Page 16: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 16/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

3.2 Example for using the calculation matrix shown in chapter 3.3

Fig. 3-1 Application example for using the calculation matrix

The value for the moment of inertia is constant for all boundary conditions and in the used test setup it is J=0.005096 kgm².

Page 17: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 17/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

3.3 Calculation matrix

3.3.1 Acceleration time [ms]

acceleration Existing load momentum [Nm]

Maximum velocity[min-1]

Friction momentum

[Nm]

Torque of stepper motor

[Nm] 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1,0 1,1 1,2 1,3 1,4 1,5 1,6

0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

43 0,3 2 0,013 0,014 0,015 0,016 0,018 0,019 0,021 0,023 0,025 0,029 0,033 0,038 0,046 0,057 0,076 0,115 0,229

109 0,35 2 0,035 0,038 0,04 0,043 0,047 0,051 0,055 0,061 0,068 0,078 0,089 0,106 0,129 0,166 0,233 0,388 1,163

268 0,4 1,9 0,095 0,102 0,11 0,119 0,13 0,143 0,159 0,179 0,204 0,238 0,286 0,358 0,477 0,715 1,43 ∞ ∞

563 0,45 1,75 0,231 0,25 0,273 0,3 0,334 0,376 0,429 0,501 0,601 0,751 1,001 1,502 3,004 ∞ ∞ ∞ ∞

875 0,5 1,6 0,424 0,467 0,519 0,584 0,667 0,778 0,934 1,167 1,556 2,335 4,669 ∞ ∞ ∞ ∞ ∞ ∞

2220 0,55 0,7 7,898 23,69 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞

3.3.2 Delay

If delay values are also calculated, the values are very small. This is due to the fact that the friction of the setup and the load momentum (against positioning) are useful during deceleration. Therefore the calculation yields values which are at large smaller than 1/10 of the jerk time.

The delay time should be at least twice as large as the jerk time, see figure 3-2. For calculated values this is not the case. For this reason, the ramp for the delay was set to the same time as for the acceleration. (The delay time should be at least 2x the jerk time)

Page 18: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 18/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

The relationship between acceleration, delay and jerk time is illustrated in figure 3-2

Fig. 3-2 Relationship between acceleration, delay and jerk time

If values are entered as described above, defined positioning can be performed. This is illustrated in figure 3-4. For acceleration and deceleration for example the same time was used.

Fig. 3-3 Example for equally parameterized acceleration and delay times

The following figures give an example of where the delay time was approximately 1/10 of the jerk time. It clearly shows that the duration of the

Page 19: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 19/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

delay corresponds neither to the parameterized delay time nor to the jerk time. If values are entered as described above, defined positioning can be performed.

Fig. 3-4 Example for parameterized delay time < jerk time (parameterized are: maximum velocity = 148 min-1, startup time 4,67s Delay time 0.15s, jerk time 1.8s)

3.4 Selected, measured times for verifying the calculated values

For checking the calculated values, some random measurements of the acceleration time were performed. Two respective examples are briefly introduced in this chapter. Example measurement 1; load momentum 1 Nm against positioning direction, accelerating to 875 revolution.

Fig. 3-5 Example measurement 1, 1Nm, 875min-1 (Acceleration in 4.67 seconds)

ca. 1,25s

Page 20: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 20/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

At the above depicted positioning process, it was accelerated in 4.67 seconds. The jerk time (for jerk reduction) was set to 40% of the acceleration time.

The following example shows a failed acceleration process. The time for accelerating was selected too small. The stepper motor could not overcome the load momentum during acceleration, in the initial phase it was still accelerated, with increasing speed (and decreasing motor momentum) the load could not be held anymore.

Fig. 3-6 Example 2, 1Nm, 875min-1 , failed acceleration process (Acceleration in 1 seconds)

Accelerates until the motor chagnes and the load pulls against positioning direction

Page 21: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 21/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Part A2 : Function Mechanisms

Objectives of Part A2 : Part A2 of this document provides the reader with information on the following topics:

• explanation of all integrated function elements

• description of the components which can be easily integrated in your own application environment.

Page 22: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 22/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4 Function Mechanisms

The application can really be used immediately without further ado. The installation instructions tell you how to start it without reading this chapter. If you are interested in specific background information and functions of this application or variations thereof, you will require some further information, for example on how to change your program sequences correctly and without too much difficulty into the STEP7-Micro/Win code. This information is provided in the following sections.

4.1 Description of entire solution structure

Figure 4-1 explains the basic structure of the application.

Figure 4-1 Function principle of the application

From a structural point of view, the individual functions of the application can be broken down into different parts which are treated in the following sections:

• Control unit (S7-222 CPU with EM253, see chapter 4.1.1)

• Drive unit (FM STEPDRIVE and SIMOSTEP stepper motor, see chapter 4.1.2)

• Operator control and monitoring (TD text display, see chapter 4.1.3)

Page 23: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 23/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.1.1 Control unit (S7-CPU 222 and positioning module EM 253)

The automation system consists of an S7-CPU 222 and a positioning module EM 253 connected to an expansion bus.

The entire automation system is configured with the help of only one software program (S7-Micro/Win).

4.1.1.1 Controlled positioning process The diagram below illustrates the actual controlled positioning process.

Figure 4-2 Principle of the controlled positioning process

The application program controls operation in automatic mode, i.e. the feed motion of the cardboard pieces by a defined cutting length and the cutting action (simulated in the application via a digital output). During automatic mode, the application program performs the following sequence of steps:

1. The cutting length is received from the HMI interface.

2. The application program of the S7-CPU 222 performs automatic repeat of the procedure. This loop includes the cardboard feed movement and the cutting action.

3. The positioning module converts the set value which represents the real value of a specific unit of measure into pulses which are subject to defined acceleration and brake ramps. The pulses are transmitted to the power section immediately.

Page 24: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 24/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4. After positioning, the positioning module transmits an "OK"-bit (positioning completed) to the program of the S7-CPU 222 (from where a new automatic cycle can be started).

Depending on the information received from the configuration and on the corresponding control task, the positioning module generates specific pulses (direction, distance and speed) for the power section. The transfer of these pulses to the power section and the stepper motor is effected via two outputs (P0, speed and P1, direction). (Other outputs are available for the transmission of any further enable signals and commands to the power section).

Figure 4-3 Illustration of the pulses for motion generated by the positioning module

4.1.1.2 Command interface The command interface is an area in the data block. It comprises several bits which indicate global status information (e.g. automatic mode active) or which are used to control global application functions (jog mode forward/backward motion).

For further information and a detailed description of the command interface, please refer to chapter 4.2.12 "Variables used in the program".

Page 25: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 25/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.1.2 Control of the FM STEPDRIVE and the SIMOSTEP stepper motor

Stepper motor control is effected with the help of an FM STEPDRIVE power unit; this is necessary since the stepper motor must not be connected directly to mains power.

4.1.2.1 FM STEPDRIVE power unit The power unit generates the mains voltage for the currents in the stepper motor winding required for motion. These current values are based on the pulses received from the EM253 positioning module (direction and frequency) and on the parameter settings of the power unit (current reduction and steps).

Figure 4-4 Basic function principle of the FM STEPDRIVE

Page 26: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 26/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.1.2.2 Stepper motor type SIMOSTEP 1FL3041-0AC31-0BK0 The SIMOSTEP stepper motor is a 3-phase hybrid stepper motor (for further information see chapter 4.1.2.3). It offers a maximum number of 10.000 steps of per revolution; this value may also be reduced by setting the power unit correspondingly.

The SIMOSTEP stepper motor can be operated only in combination with a power unit (FM STEPDRIVE) and a control unit for the stepper motor.

When combining the SIMOSTEP step motor with the FM STEPDRIVE power unit, the following step rates (per revolution) can be realized:

Table 4-1 Possible number of steps of the SIMOSTEP stepper motor

Number of steps 500 1000 5000 10000

Step angle 0.72° 0.36° 0.072° 0.036°

Note Due to the large performance range of the SIMOSTEP motors the application can be easily extended/supplemented so as to meet your specific requirements. Chapter 8.4 includes a detailed description of the criteria to be considered if you wish to use a different type of motor.

Note The following chapter includes some theoretical background information on the function principle of stepper motors. However, this chapter is not really necessary for understanding the function principle of the application.

But if you are interested in some in-depth knowledge about the function principle of stepper motors you will find some useful information here.

4.1.2.3 General information on stepper motors There are 3 basic types of stepper motors which are explained in detail in the following:

• permanent-magnet stepper motors (with permanent-field excitation, ordinary version regarding design and function)

• reluctance stepper motors (extended design and function)

• hybrid stepper motors (a combination of the two versions stated above, as realized with the SIMOSTEP stepper motor used in this context).

Page 27: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 27/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.1.2.3.1 Permanent-magnet stepper motors The stepper motor consists, like almost any other electric motor, of a stator and a rotor. With classical stepper motor types, the stator consists of a stationary outer winding and the rotor is a shaft with a permanent magnet or a soft iron (or a combination of both).

If voltage is applied to the stationary winding1 of the stator, a magnetic field is generated which defines the orientation of the permanent magnet on the rotor shaft.This initiates rotary movement until the magnetic fields of the stator winding and of the permanent magnets match.

The stepper motor motion is not a continuous, but stepwise rotation (resulting from the magnetic fields generated in the stator winding).

The following illustration shows that the stator windings must be "switched over" for each step.

Figure 4-5 Principle structure and function of a permanent-magnet stepper motor

This switch-over action must be performed by a stepper motor control unit. The position of the rotor can be re-produced by counting the switch-over operations of the stator windings and by taking account of the angle length passed with each step.

1 One magnetic pair of poles each, i.e. a winding is also referred to as a phase.

Page 28: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 28/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.1.2.3.2 Reluctance stepper motor2 Similar to the permanent-magnet stepper motor type, the reluctance stepper motor consists of a stator with windings and a rotor. The rotor used in this version consists of easily magnetizable soft iron. This results in a magnetization and orientation of the rotor through the magnetic fields of the stator windings.

Figure 4-6 Principle structure and function of a reluctance stepper motor

4.1.2.3.3 Hybrid stepper motor As already implied by its designation, the hybrid motor is a combination of a permanent-magnet stepper motor and a reluctance stepper motor.

As with all types of stepper motors, the windings are located on the stator. The rotor is a shaft with an axial permanent magnet. This shaft is provided with pole shoes which are positioned in such a way that the north and south magnetic poles are in an offset arrangement.

Figure 4-7 Principle structure of a hybrid stepper motor

2 magnetic resistance

Page 29: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 29/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

The diagrams below explain the function of the hybrid stepper motor. As the illustrations are drawn in a two-dimensional plane, the perspective of view is in the direction of the rotor shaft.

Illustration: Description

Stator: The winding arrangement generates 2 north and 3 south magnetic poles. Winding phase 1 is energized.

Rotor: The south pole is on the rear pole shoe, the north pole on the front pole shoe. The orientation of the rotor can be seen from the illustration on the left.

Stator: Winding 1 is supplemented by winding 2 causing a displacement of the magnetic field by 22.5°.

Rotor: The rotor follows the position of the magnetic field and turns by 22.5°.

Stator: Winding 1 is switched off, winding 2 remains energized. As a result, the magnetic field turns again by 22.5°. Rotor: The rotor follows the position of the magnetic field by 22.5°.

Stator: Winding 2 is supplemented by winding 1 in the reverse current direction, the magnetic field is displaced by 22.5°. Rotor: The rotor follows the position of the magnetic field by 22.5°.

Page 30: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 30/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Illustration: Description

Stator: Winding 2 is switched off, winding 1 remains energized with reverse current direction. As a result, the magnetic field rotates again by 22.5°. Rotor: The rotor follows the position of the magnetic field by 22.5°.

Further procedure: From this point, the process is repeated three times until one full revolution is completed (after 16 steps).

Figure 4-8 Function principle of a reluctance stepper motor

The required number of steps per revolution (= resolution, = possible accuracy) can be increased by means of the claw-type structure of the magnetic poles of the rotor and the stator. The layout of the claw-type pole principle is shown in the following illustration. The north and south magnetic poles of the windings are always located opposite to each other. This can be seen in the following illustration.

Figure 4-9 Principle of a claw-type pole arrangement

The figure below shows the offset arrangement of the claws (between north and south magnetic pole) on the rotor.

Figure 4-10 Claw-type pole principle on the rotor (sectional view of a stepper motor)

Page 31: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 31/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

The figure below shows the offset arrangement of the claws (between north and south magnetic pole) on the stator windings.

Figure 4-11 Claw-type pole principle on the stator (sectional view of a motor without rotor)

The table below shows the function principle of the claw-type structure. The function principle is illustrated by a sectional view in the following graphic.

Figure 4-12 Sectional view for the explanation below

In the illustrations the number of claws is reduced to those required for explanation. For better overview, the motor is outlined in "unbent" condition.

As already shown in Figure 4-6, the rotor is provided with two pole shoes with north and south magnetic poles; the positions of the pole shoe claws with regard to windings 1 and 2 are illustrated separately. The "active" magnetic field is highlighted. The illustration begins with the start position and shows four successive steps.

Page 32: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 32/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Illustration: Description

Figure 1 shows the starting position of rotor and stator.

Winding L1 is energized and forms a magnetic field. The north magnetic pole is generated in the winding shown, consequently, the part of the winding not illustrated here forms the south magnetic pole. The south pole of the rotor is attracted and the north pole of the rotor is repelled.

In Figure 2, winding 2 is energized in the reverse current direction, resulting in the formation of a south magnetic pole.

This south pole attracts the north pole of the rotor and repels the south pole: the motor rotates by one step.

In Figure 3, winding 1 is energized in the reverse current direction, resulting in the formation of a south magnetic pole.

This south pole attracts the north pole of the rotor and repels the south pole: the motor rotates by a further step.

Page 33: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 33/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Illustration: Description

In Figure 4, winding 2 is energized, resulting in the formation of a north magnetic pole in the illustrated winding part.

This part attracts the south pole of the rotor and repels the north pole; consequently the motor rotates by one step.

In Figure 5, winding 1 is energized, resulting in the formation of a north magnetic pole.

It attracts the south pole of the rotor and repels the north pole; consequently the motor rotates by one step.

At this stage the motor has moved by exactly one gap and one claw length. The current flow through the winding is the same as shown in Figure 1.

Motor rotation continues by repeating the process.

The number of steps can be increased furthermore by using two windings which are energized at the same time. In this case stepper motor rotation is performed in half-steps.

When increasing the number of claws, a higher number of steps can be realized.

Page 34: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 34/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.1.3 Operator control and monitoring of the application with the TD200 text display unit

Operator control and monitoring is performed with the help of a simple text display unit type "TD200". The TD200 unit is connected to the (PPI-) interface of the S7-CPU 222 with a PPI cable.

Table 4-2 HMI displays and their functions

Display Dis-play no.

Function description

Automatic/jog mode B1 Shows the current position and the current speed. The automatic mode of the application can be enabled or disabled. Manual feed movement is possible when the automatic mode is disabled.

Selecting and setting profiles

B2 This display is used to define the profile and the length.

Status information on the operational condition

B3 This display shows the current status of the application.

Setting the first cut B4 In this display you can start feed motion of the cardboard until it is registered by a sensor (e.g. a light barrier or a Sonar-BERO) directly behind the cutting unit.

You can jump between all displays from any position by pressing the Shift-key and then the button for the display to be shown.

Table 4-3 Shortcuts for display selection

Shift and button corresponds to Display

Shift + F1 F5 Automatic/jog mode

Shift + F2 F6 Selecting and setting profiles

Shift + F3 F7 Status display

Shift + F4 F8 Setting the first cut

Configuration can be performed in the "S7-Micro/Win" development environment of the S7-200 CPUs without requiring an additional software program. Configuration is supported by an assistant program which is located in the data memory of the PLC.

Page 35: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 35/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.2 Program and data structure

This chapter explains the program and data structure of the S7-Micro/Win program which is stored on the S7-CPU 222. The structure of the functions located on the S7-CPU 222 has already been explained in Chapter 4.1.2. The structure of the S7-Micro/Win program is as follows:

Figure 4-13 Overview of the S7-Micro/Win program structure

Legend:

Color Meaning

▄▄▄▄▄▄▄▄▄▄▄ Data block / variables used ▄▄▄▄▄▄▄▄▄▄▄ Subroutines generated by the positioning assistant ▄▄▄▄▄▄▄▄▄▄▄ Activated sub-programs

▄▄▄▄▄▄▄▄▄▄▄ Symbolizes STEP1_MAIN including all sub-programs

The individual program blocks are described in the following sections:

Page 36: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 36/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.2.1 Organization block " STEP1_MAIN "

Fig. 4-14 Structure of organization block STEP1_MAIN

Organization block STEP1_MAIN is processed in each cycle of the CPU. This block is mainly used to activate sub-programs (which are described in the following).

The following steps are successively processed in block STEP1_MAIN:

• Call of the sub-program " STEP1_MOTION " (network 1)

• The bit used to enable/disable the automatic mode is reset in the first cycle of the CPU to prevent unintended machine start when the CPU is booted anew (network 2).

• Call of the sub-program "STEP1_MSELECT" (network 3).

• Call of the sub-program "STEP1_PSELECT" (network 4).

Page 37: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 37/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

• Selection of profile 0 in the first CPU cycle, i.e. after restart of the CPU profile 0 shall be active in any case, not the profile selected before "CPU Stop"! (network 5).

• Call of sub-program "STEP1_FCUT" (network 6).

• Call of sub-program "STEP1_STATUS" (network 7).

• The last action during a cycle is always a reset of the button flag of the TD200 text display unit. (For each button operated the TD200 assigns a certain bit which is stored in the TD200-Wizard flag area. This bit is not reset after "release" of the key.)

4.2.2 Subroutine " STEP1_MOTION "

Figure 4-15 Structure of the sub-program "STEP1_MOTION"

The sub-program " STEP1_MOTION " realizes the functions required for the automatic and manual operating modes.

Page 38: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 38/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

The length used in the automatic operation mode is received from a separate sub-program named "STEP1_PSELECT".

• Initialization of the positioning module by calling the sub-program "POS0_CTRL" (generated by the positioning assistant) (network 1).

• Transfer of pulse release for the FM STEPDRIVE power section; the system checks whether an "enabled" status is present at input E0.0 of the CPU (network 2).

• The automatic operation mode is enabled and disabled by pressing buttons 1 and 2 on the TD200 unit (network 3 and 4).

• Feed motion is activated by calling the sub-program "POS0_GOTO" if automatic mode has been enabled and after a cutting operation has been completed (network 5).

• Simulation of the cutting process; this is effected by using a timer with a delay of 1 second to simulate the cutting process (network 6 and 7).

• If the automatic mode is not active, manual operation can be performed by calling the sub-program "POS0_MAN".

4.2.2.1 Subroutine "POS0_CTRL" (generated by the positioning assistant) The sub-program "POS0_CTRL" activates and initializes the positioning module. This is effected by automatically transmitting a command to the positioning module to load the configuration/profile table each time when the S7-200 changes to the operating state RUN.

4.2.2.2 Subroutine "POS0_DIS" (generated by the positioning assistant) The sub-program POS0_DIS is used to enable or to disable the DIS output of the positioning module. This allows to use this output for the pulse release for the FM STEPDRIVE power unit.

4.2.2.3 Subroutine "POS0_GOTO" (generated by the positioning assistant) The operation POSx_GOTO transmits a command to the positioning module to move to the desired position.

4.2.2.4 Subroutine "POS0_MAN" (generated by the positioning assistant) The sub-program POS0_MAN (manual operation) sets the positioning module to manual operation mode. In this mode the motor can be operated at different rotational speeds or in jog mode in positive or negative direction.

This sub-program is called from the two sub-programs "STEP1_MOTION" and "STEP1_FCUT".

Page 39: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 39/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.2.3 Subroutine "STEP1_MSELECT"

Figure 4-16 Structure of the sub-program "STEP1_MSELECT"

The sub-program "STEP1_MSELECT" is used to process the call commands of the four display messages available in the TD200 text display unit. The bits of the button flags are reset by pressing the Shift button and one of the buttons 1 – 4. These are then evaluated by the sub-program "STEP1_MSELECT" and the corresponding displays are loaded.

In the first CPU cycle the display "Motion Control" is set as start message.

• In the first CPU cycle, the message (display on the user interface of the TD200) "Motion Control" is set (network 1).

• When Shift and button 1 are pressed and if the message bit for "Motion Control" is set, all other message bits are reset (network 2).

• When Shift and button 2 are pressed and if the message bit for "Select Profile" is set, all other message bits are reset (network 3).

• When Shift and button 3 are pressed and if the message bit for "Status" is set, all other message bits are reset (network 4).

• When Shift and button 4 are pressed and if the message bit for "First Cut" is set, all other message bits are reset (network 5).

• At the end of the sub-program, all 4 button flags of the TD200 unit are reset.

Page 40: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 40/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.2.4 Subroutine "STEP1_PSELECT"

Figure 4-17 Structure of the sub-program "STEP1_PSELECT"

The different cutting lengths or profiles are selected via the TD200 by means of a variable which is analyzed in the sub-program "STEP1_PSELECT".

• Compare the profile variable of the TD200 with the value of the corresponding profile; the profile bit will be set when the two values are identical (networks 1-3).

• Check whether the entered values are correct; if a non-existent profile is entered, the next valid profile will be selected (network 4).

• If a profile is active, the profile length must be transferred to the variable for the cutting length (networks 5-7).

• The profile length must be shown on the display (network 8).

• If a new length for a profile has been entered, this length must be copied to the corresponding profile memory location (networks 9-11).

• Reset of the bit to show on the TD200 text display that the "variable is completed".

Page 41: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 41/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.2.5 Subroutine "STEP1_FCUT"

Figure 4-18 Structure of the sub-program "STEP1_FCUT"

• Pressing button 1 initiates feed movement to the sensor (network 1).

• A signal from the sensor stops feed movement (network 2).

• Feed movement is activated by calling the sub-program "POS0_MAN" (the sub-program gives the command 'RUN' until the sensor signal is active) (network 3).

• After a short waiting period (brake operation), the sub-program "POS0_LDPOS" is executed and the current position 0 is loaded (network 4).

• Timer to wait until brake operation is completed (network 5).

• If the timer period has elapsed, set the command "load 0 for current position" (network 6).

• Reset of the command "load 0 for current position" after a positive feedback signal has been received from the sub-program "POS0_LDPOS".

4.2.5.1 Subroutine "POS0_MAN" (generated by the positioning assistant) The sub-program POS0_MAN (manual operation) sets the positioning module to manual operation mode. In this mode the motor can be operated at different rotational speeds or in jog mode in positive or negative direction.

This sub-program is called from the two sub-programs "STEP1_MCONTROL" and "STEP1_FCUT".

Page 42: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 42/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

4.2.5.2 Subroutine "POS0_LDPOS" (generated by the positioning assistant) The sub-program POS0_LDPOS (load position) sets the current position value in the positioning module to a new value. You may also use this operation to define a new zero position for an absolute travel command.

4.2.6 Subroutine "STEP1_STATUS"

Figure 4-19 Structure of the sub-program "STEP1_STATUS"

• Depending on the present status (analysis of the bits for "automatic mode", "feed movement under sensor", ...) the text strings saved in the data blocks are copied to the data area of the TD200.

4.2.7 Variables used in the program

This chapter includes a list of all variables used in the program.

The data block includes, among other things, the command interface of the positioning block and the parameters used in the application.

The table of variables below is broken down into four categories:

• parameters

• internal variables

• command/status interface

• memory area in the data block used by the configuration of the positioning module and by the TD200 text display.

The designations of the variables are symbolic names and/or are explained in a supplementary comment. Furthermore, the list includes the type and kind of variables, as well as the blocks with read or write access to these variables.

Page 43: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 43/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Description of variables Type and kind of variable Program block with access to the variable (R=read, W=write) No.

Symbolic name Comment Type I/Os Flag Timer DB STEP1_ MAIN

STEP1_ MOTION

STEP1_ MSELECT

STEP1_ PSELECT

STEP1_ FCUT

STEP1_ STATUS

POS0_XXX

1 Cutting This bit simulates the

"duration" of the cutting process

Q0.0 W

2 Enable_STEPPDRIVE

This input initiates pulse release for the FM STEPDRIVE

I0.0 R R R

3

Sensor The sensor is placed directly behind the cutting block and transmits a signal to this input

I0.3

R

4

Ein

- und

Aus

gäng

e

STEPDRIVE_ready This input is connected with the ready-for-operation bit (-output) of the FM STEPDRIVE

I0.4

R R R

5 Time_for_cutting Simulates the time required for cutting

T33 RW

6

Tim

er

Time_drive_runout The delay time required between stop of feed motion and actual machine stop (runout)

T37

RW

7 Set_LDPos_to_0 Bit V3.0 RW

8 Done_LDPos Bit V3.1 R W

9 Done_Pos_Goto Bit V3.2 R W

10 Direction_Pos Bit V3.3 W

11 Done_Pos_CTRL Bit V3.4 W

12

Sta

tus/

Kom

man

dos

GO When this bit is set, the program is in automatic operation mode

Bit V3.5 RW R R

13

Sta

tus/

Kom

man

search

When this bit is set, the program is in the machine setting mode (feed motion to the cutting block)

Bit V3.6 R RW R

Page 44: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 44/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Description of variables Type and kind of variable Program block with access to the variable (R=read, W=write) No.

Symbolic name Comment Type I/Os Flag Timer DB STEP1_ MAIN

STEP1_ MOTION

STEP1_ MSELECT

STEP1_ PSELECT

STEP1_ FCUT

STEP1_ STATUS

POS0_XXX

14 Profile_0_on Status: profile 0 is selected Bit V10.0 RW

15 Profile_1_on Status: profile 1 is selected Bit V10.1 RW

16 Profile_2_on Status: profile 2 is selected Bit V10.2 RW

17 MES_Search Status: display "move to cutter block sensor" is active

Bit V314.4 W

18 MES_Status Status: display »Status« is active Bit V314.5 W

19 MES_Profile Status: display "Select profile " is active Bit V314.6 W

20 MES_Motion_CTRL Status: display "Motion Control“ is active Bit V314.7 W

21 Error_pos Status of the positioning blocks Byte VB4 W

22 Speed_Pos Status: current speed of the stepper motor Real VD24 W

23 Position_Pos Status: current position of the stepper motor Real VD28 W

24 Reference to the configuration block of the TD200 unit Word VW0

25 Selected_profile HMI: used to select the profile INT VB392 R

26 TD200_position HMI: this variable indicates the position on the TD200 display

Real VD340 W

27

B&

B, B

edie

nen

und

Beo

bach

ten

TD200_Speed HMI: this variable indicates the speed on the TD200 display

Real VD350 W

28 TD200_profile_length

HMI: this variable indicates the length of the current profile on the TD200 display

Real VD408 W

29

B&

B,

Bed

iene

n un

d

Button_1 These marker bits M16.0 W R R

Page 45: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 45/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Description of variables Type and kind of variable Program block with access to the variable (R=read, W=write) No.

Symbolic name Comment Type I/Os Flag Timer DB STEP1_ MAIN

STEP1_ MOTION

STEP1_ MSELECT

STEP1_ PSELECT

STEP1_ FCUT

STEP1_ STATUS

POS0_XXX

30 Button_2 M16.1 W R 31 Button_3 M16.2 W R 32 Button_4 M16.3 W R R 33 Shift+Button_1 M16.4 RW 34 Shift+Button_2 M16.5 RW 35 Shift+Button_3 M16.6 RW 36 Shift+Button_4

represent the buttons of the TD200 unit

M16.7 RW 37 Status text for TD200, 20 bytes String VB50 W 38 Status text for TD200, 20 bytes String VB70 W 39 Status text for TD200, 20 bytes String VB90 W 40 Status text for TD200, 20 bytes String VB110 W 41 Status text for TD200, 20 bytes String VB130 W 42 Status text for TD200, 20 bytes String VB150 W

43 P0_length Memory location of the length of profile 0 Real VD12 RW

44 P1_length Memory location of the length of profile 1 Real VD16 RW

45 Inte

rne

Var

iabl

en

P2_length Memory location of the length of profile 2

Real VD20 RW

46 length Includes the length actually cut Real VD40 R W

47 Area of the configuration block for the EM253 positioning module; generated by the positioning wizzard

VB190 bis VB299

RW

48 Inte

rne

Var

iabl

en

Area of the configuration block for the TD200 text display unit; generated by the TD200 assistant program

VB300 bis VB474

W W RW RW

Page 46: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 46/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Part B: Installation of the Example Application

Objectives of Part B: Part B of this document provides the reader with information on the following topics:

• how to install the example application with all hardware and software components

• how to use and control the application by using the TD200 unit

Page 47: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 47/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5 Installation of Hardware and Software

The entire application is based on the components stated in chapter 2.2 (standard and special application components) and is ready for use immediately after installation.

The actual commissioning work includes:

• installation of the hardware components (Chapter 5.1)

• software installation and parameter setting for the FM STEPDRIVE (chapter 5.2).

5.1 Hardware configuration

For details on the required hardware components, please refer to chapter 2.2.1.

Hardware installation includes mainly the following steps:

• mechanical installation of the S7-200 CPU with positioning module EM253 (see chapter 5.1.1)

• mechanical installation of the FM-STEPDRIVE power section (see chapter 5.1.2)

• electrical cable connection of the components and of the stepper motor (see chapter 5.1.3)

All these steps are described in detail in the following sections.

Page 48: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 48/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5.1.1 Installation of the S7-200 CPU and the EM253 positioning module

The table below describes all measures required for installation step-by-step.

Table 5-1 Step-by-step installation instructions for the CPU and the positioning module

Step Focus Instruction

1 Mounting the S7-200 CPU Open the snap-on hook on the rear side of the S7-200 CPU and place the CPU rear side on the top-hat rail. Swivel down the CPU towards the top-hat rail until it snaps into place and close the hook. Make sure that the hook snaps in and that the CPU is properly seated on the top-hat rail.

2 Hanging the EM253 positioning module to the top-hat rail

Open the snap-on hook on the rear side of the positioning module and hang it to the top-hat rail with its rear side.

3 Producing the bus con-nection between positioning module and S7-200 CPU

Connect the flat bus cable of the positioning module to the expansion socket of the S7-CPU (beneath the front door).

4 Fixing the EM 253 positioning module to the top-hat rail

Swivel the module downwards towards the top-hat rail until it clearly snaps in and close the hook. Make sure that the hook also snaps in properly and that the positioning module is correctly seated on the top-hat rail.

5.1.2 Installation of the FM STEPDRIVE

The table below describes all measures required for installation step-by-step.

Table 5-2 Step-by-step installation instructions for the FM STEPDRIVE

Step Focus Action

1 Placing the FM STEPDRIVE

Hang the FM STEPDRIVE to the S7-300 mounting rail and swivel it downwards. See illustration below.

2 Fixing the FM STEPDRIVE with screws

Fix the FM STEPDRIVE with the two screws on the bottom of the device. See illustration below.

Figure 5-1 Mounting the FM STEPDRIVE

Page 49: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 49/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5.1.3 Electrical connection of the components

The following steps are to be performed for electrical cable connection:

• Connect the S7-200 CPU to mains voltage (see chapter 5.1.3.1)

• Connect the positioning module to the load current supply of the S7-222 CPU (see chapter 5.1.3.2)

• Connect the TD200 with the S7-222 CPU (see chapter 5.1.3.3)

• Connect the FM STEPDRIVE power unit with the CPU and the positioning module EM253 (see chapter 5.1.3.4)

• Connect the FM STEPDRIVE to mains voltage (see chapter 5.1.3.5)

• Connect the stepper motor to the FM STEPDRIVE (see chapter 5.1.3.6)

• Connect the sensor to the S7-222 CPU (see chapter 5.1.3.7)

5.1.3.1 Connecting the S7-200 CPU to mains voltage

Table 5-3 Step-by-step instructions to connect the S7-222 CPU to voltage

Step Focus Instruction

1 Connecting the CPU to mains voltage

From the photo below you can see how the CPU is connected to mains voltage supply.

Figure 5-2 Connecting the S7-200 CPU to mains voltage

Page 50: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 50/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5.1.3.2 Connecting the EM253 positioning module to the load current supply of the CPU

Table 5-4 Step-by-step instructions for connecting the positioning module to voltage supply

Step Focus Instruction

1 Connecting the positioning module to load current supply

From the photo below you can see how the positioning module is connected to load current supply. Set the TD200 to transmission rate 19,2kBaud.

Figure 5-3 Connecting the positioning module to load current supply

5.1.3.3 Connecting the TD200 unit with the S7-200 CPU

Table 5-5 Step-by-step instructions for connection between the TD200 text display unit and the S7-222 CPU

Step Focus Instruction

1 Connecting the text display unit to the CPU

From the photo below you can see how the TD200 text display unit is connected to the CPU.

Figure 5-4 Connecting the TD200 text display unit to the CPU

Note The voltage supply for the text display unit is provided directly via the PPI cable of the PLC interface.

Page 51: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 51/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5.1.3.4 Connecting the FM STEPDRIVE power unit with the S7-200 CPU and the positioning module At the end of the table below you will find a circuit diagram for better overview of the cable connections to be produced.

Step Focus Instruction

1 Laying the data line for the positioning pulses between positioning module and power unit

The cable used for the connection described here needs to be completed as follows: You need a Sub-D connector (see the list of components/accessories). This Sub-D connector is the counterpiece for the connector socket on the upper right side of the FM STEPDRIVE (pulse interface). This connector must be connected to the upper terminal strip of the positioning module; at this location no extra accessories are required, the cables are fixed with screws. Connect the cables as shown in the following table.

FM STEPDRIVE POSITIONING MODULE

No. Pin no. Designation Designation

1 1 PULSE P0+

2 2 DIR P1+

3 3 ENABLE +5V and T1

4 8 GND M

5 9 PULSE_N P0-

6 10 DIR_N P1-

7 11 ENABLE_N DIS 2 Connecting the signal

interface with the positioning module

FM STEPDRIVE POSITIONING MODULE

Designation Designation

L+ (24V) und Gate_N L+

M (24V) M

Ready_2 CPU I0.4 Table 5-6 Instructions for the connection of the FM STEPDRIVE with the S7-222 CPU and

the positioning module

Page 52: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 52/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Figure 5-5 Overview circuit diagram

Page 53: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 53/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5.1.3.5 Connecting the FM STEPDRIVE to mains voltage

Table 5-7 Instructions for connecting the FM STEPDRIVE to voltage supply

Step Focus Instruction

1 Connecting the FM STEPDRIVE to mains voltage (230V)

Connect the FM STEPDRIVE to voltage as shown in the illustration below.

Figure 5-6 Connecting the FM STEPDRIVE to mains voltage

5.1.3.6 Connecting the stepper motor to the FM STEPDRIVE power unit

Table 5-8 Instructions for connecting the FM STEPDRIVE to the SIMOSTEP stepper motor

Step Focus Instruction

1 Connecting the FM STEPDRIVE with the stepper motor

Connect the stepper motor to the FM STEPDRIVE as illustrated below.

Figure 5-7 Connecting the FM STEPDRIVE to the stepper motor

Page 54: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 54/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5.1.3.7 Connecting the sensor for cardboard registration on the cutting block

! Important The sensor used to register the cardboard beneath the cutting block is not part of the application solution; only the digital input is "operated" at 24V.

The sensor is used to register the cardboard directly behind the cutting block. This enables to position the cardboard exactly beneath the cutting block before starting automatic operation. Feed movement is performed automatically and stops as soon as the cardboard is registered by the sensor. See the illustrations below.

No. Description Illustration

1 After initial setup of the application, the cardboard position is not yet defined.

2 For this

reason, the cardboard is moved beneath the cutting block for adjustment and the positioning counter is set to 0.

When the sensor detects the cardboard, it must issue a +24V signal and be connected to input I0.3. Connect the sensor to the CPU as shown below:

Figure 5-8 Connecting the sensor

Page 55: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 55/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5.2 Software installation

Installation of the S7-Micro/Win software is not part of this documentation. Software installation is a self-explanatory procedure in the usual Windows environment.

5.2.1 Transfer of the application code to the S7-200 CPU

Table 5-9 Instructions for the transfer of the application code to the S7-200 CPU Step Focus Instruction

1 Installing the S7-Micro/Win software Install the S7-Micro/Win software as described in the corresponding instruction manual.

2 Opening the project Open the application code in S7-Micro/Win. Select "File" from the menu bar and select "Open".

3 Setting the connection for communication

Select the menu item "communication" from the operation tree. Enter the connection path in the dialog box and set your CPU correspondingly.

4 Producing the cable connection

Connect the S7-CPU 222 and the PU/PC with a cable line; you must remove the connector of the TD200 unit for the period of data transfer (since this port is used for the communications cable).

Make sure that the cable connection complies with the parameter settings described in point 3.

5 Compiling and downloading into the CPU

Click button "Compile all" in the toolbar. Then click the button "Download".

6 Connect TD200 After your project downloaded on the CPU connect TD200 to the PC/PPI-interface

Page 56: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 56/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

5.2.2 Parameter setting for the FM STEPDRIVE

Table 5-10 Instructions for setting the parameters of the FM STEPDRIVE

Step Focus Instruction

1 Position of the setting parameters

Figure 5-9 Position of the setting parameters

2 Setting the current limit Please set the parameters as shown below.

Figure 5-10 Setting the current limit at the FM STEPDRIVE power unit

3 Setting the number of steps and current reduction for machine stop.

Please set the parameters as shown below.

Figure 5-11 Setting the number of steps and current reduction at the FM STEPDRIVE

Note If you use a different motor than recommended for the hardware components, you must adjust the motor correspondingly at this point.

Page 57: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 57/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

6 Operator Control via Text Display TD200

The conditions described in the chapter on "Installation of Hardware and Software" (chapter 5) must be fulfilled and all devices must be switched on.

This explanation includes all displays available for operator control and monitoring and all values and parameters.

The start-up display of the human-machine interface (user interface for operator control and monitoring) is the "Automatic/Jog mode" display. This is the first display that appears after the CPU changes from the operating mode 'Stop" to 'Run'.

When you press the "Escape" button during operation, the TD200 will change to the next higher (system) menu. In this menu you can choose between the following items:

• display of messages

• AS status display

• TD200 configuration

Note This menu is mentioned only in order to provide a complete overview. For a detailed description please refer to the manual of the TD200 unit. (Here you can set the baud rate to 19,2kBaud)

Select the menu item for the display of messages to return to the display for application control. The individual screens are described in detail in the following sections.

Page 58: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 58/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

6.1 Automatic/jog mode

This display is the user interface for motion control. You navigate into the picture through pressing the keys SHIFT and F1.

Figure 6-1 "Automatic/jog mode" (symbolic illustration)

The top line shows the current position „Pos:“and the current speed „Spd:“ (for feed motion) The buttons "Strt" and "Stp" are used to enable (Strt, F1) or to disable (Stp, F2) the automatic mode of the application. If the automatic mode is activated, the application starts to perform one cutting action, i.e. the first feed movement and the 2nd cutting operation have a defined length. If the automatic mode is disabled, feed movement can be performed manually using the keys "fwd" and "bwd". Button F3 (fwd) initiates forward feed movement, button F4 (bwd) backward feed movement.

Note If only one cut shall be performed, you can intervene manually by pressing the Stop button immediately after the Start button. The application will perform only one cut and will then stop the automatic operation mode.

DANGER

If the function Stp is operated, the application still drives the cycle begun up to the conclusion. The engine will NOT immediately switch off. For this functionality the release (at I0.0) can be taken.

Page 59: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 59/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

The illustration below shows the technical process of the automatic mode.

Figure 6-2 Technical process of the automatic mode

Page 60: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 60/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

6.2 Selecting and setting profiles

This profile is used to select or change the length to be cut. You navigate into the picture through pressing the keys SHIFT and F2.

Figure 6-3 "Automatic/jog mode" (symbolic illustration)

The interface is divided up into two parts – the first line is used for profile selection, the second line to define the length.

When having selected this screen, you will see the message shown in the above illustration. When you press "Enter" you can set the profile ("Select Profile"). As already mentioned in the program description, the application offers selection between three profiles (from 0 to 2). The relevant number is signalled by a flashing box and can be changed by pressing the buttons "▲" (arrow up) and "▼" (arrow down). Press "Enter" to confirm the selected value.

Now the setting field on the selected length value starts flashing. If you don't wish to change the length, press "Escape". If you wish to change the length, repeat the procedure of the previous paragraph (buttons "▲"[arrow up] and "▼" [arrow down]. Use the buttons "Shift+▲" [arrow up} or "Shift+▼" [arrow down] to enter the next digit. Press "Enter" to confirm the newly defined length; the display of the TD200 will then show the Reset-display. With the corresponding key shortcuts you can now call the displays for operation (e.g. Shift + F1 for Automatic/jog-mode).

Note If you select another profile or if you change the length while the application is in automatic mode, the new value will immediately be taken over in the process presently performed.

Page 61: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 61/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

6.3 Display of status information

This display shows the current status of the application. You navigate into the picture through pressing the keys SHIFT and F3.

Figure 6-4 "Status" display (status: motion stopped, FM STEPDRIVE disabled)

The following application states are possible:

• Stop

• Automatic, cutting

• Automatic, feed motion

• Set first cut

In addition, the lower line shows whether the FM STEPRIVE is ready for operation (FM STEPDRIVE ready).

Page 62: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 62/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

6.4 Setting the first cut

Before new start-up of the application (e.g. at the beginning of a work day or after a new delivery) it is necessary to cut the cardboard to a defined start length. This can be set in the following display. You navigate into the picture through pressing the keys SHIFT and F4.

Figure 6-5 "Automatic/jog mode" (symbolic illustration)

Press "Now!" (F5) to start feed movement of the cardboard until it is registered by a sensor (e.g. a light barrier or a sonar-BERO) directly behind the cutting block. Then feed movement will be stopped and the current position is set to 0. When you start automatic operation now, the first cut will be performed. The cardboard has now a defined start.

It may be necessary to set the position manually to 0 (e.g. after manual feed operation) using the button "Set0" (F4).

Page 63: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 63/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Part C: Program Description

Objectives of Part C: The purpose of this section is to

• explain the code details of some core elements in the program

• suggest where extensions might be useful

Requirements This is not an introduction to the S7 Micro/Win programming languages AWL, KOP or FUP. Readers should be familiar with the basics of these languages.

Before reading the code description, it may be useful to study the chapters of Parts A1 and A2.

Page 64: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 64/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

7 Explanation of the main parts of the S7-Micro/Win program

This chapter provides you with some detailed information on the core program parts of this application. The structure of the whole program is described in chapter 4.3.

The core program elements are the sub-programs:

• STEP1_MOTION

• STEP1_PSELECT”

They are used to realize the basic functions of the application. The functions "STEP_MSELECT", "STEP1_FCUT" and "STEP1_STATUS" are only supporting features which offer additional functions for the actual application solution.

In-depth comments on all programs are provided in the application code.

Note The program blocks generated by the positioning assistant are described in the documentation of the S7-CPU and in the online help information for S7-Micro/Win; for this reason, these topics are not dealt in further detail at this point.

The following sections provide detailed information on the above stated core program elements:

Page 65: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 65/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

7.1 Details on the sub-program STEP1_MOTION

All networks of this sub-program are illustrated and explained.

Network 1

Figure 7-1 STEP1_MOTION network 1

In this network, the sub-program POS0_CTRL is called. It activates and initializes the EM253 positioning module. Its function is to load the configuration table of the positioning module from the data block into the module each time the CPU is started anew.

Without this sub-program, the positioning module could not receive commands.

In this network, the two output parameters for position (C_Pos) and speed (C-Speed) are written directly to the display variable of the TD200 configuration block. They can be seen on the "Automatic/jog mode" display.

Page 66: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 66/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 2

Figure 7-2 STEP1_MOTION network 2

This network is also used to call a sub-program of the positioning assistant. Pulse release of the FM STEPDRIVE (ENABLE) is given with the bit DIS_ON; this initiates a "READY" signal from the power unit (after approx. 500ms) at input I0.3 of the CPU and the stepper motor is energized. See the illustrations below:

Figure 7-3 Signal delay

or

Page 67: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 67/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 3

Figure 7-4 STEP1_MOTION network 3

With this bit logic the application is set to automatic mode. When this program block is called the parameter Start# is transmitted in OB 1. It is active,when the display (message) automatic/jog mode has been selected while pressing button 1 simultaneously.

The automatic mode can be selected only if the power unit is ready for operation ("READY").

Network 4

Figure 7-5 STEP1_MOTION network 4

This bit logic is used to re-set automatic mode. When this program block is called the parameter STOPP# is transmitted in OB 1. It is active when the display (message) automatic/jog mode has been selected while pressing button 2 simultaneously.

The automatic mode will be re-set if the power unit is not ready for operation ("READY").

I0.4

I0.4

Page 68: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 68/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 5

Figure 7-6 STEP1_MOTION network 5

The actual automatic feed motion is realized in this network by calling the sub-program "POS0_CTRL" generated by the positioning assistant.

Feed operation is started by means of a negative edge (after completion) of the cutting action. The automatic mode must be active and the power unit must be ready for operation. As long as the application is in the "Set-up mode", start of feed motion will be blocked.

Page 69: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 69/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 6

Figure 7-7 STEP1_MOTION network 6

After successful feed movement or after the system has been set to automatic mode, the cutting operation will be simulated.

Network 7

Figure 7-8 STEP1_MOTION network 7

The simulated cutting process is shown on output Q0.0 (Cutting).

Page 70: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 70/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 8

Figure 7-9 STEP1_MOTION network 8

Manual feed control is enabled by calling this sub-program generated by the positioning assistant. Manual control of the power unit is only possible when Automatic/jog mode is indicated on the operator display and when the power unit is ready for operation (Ready_2 of FM STEPDRIVE). If the application is in setting mode, manual operation is not possible.

Page 71: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 71/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

7.2 Details on the sub-program STEP1_PSELECT

All networks of this sub-program are illustrated and explained.

Network 1

Figure 7-10 STEP1_PSELECT network 1

Compares the value of the selected profile (byte) and sets the bit of the selected profile correspondingly.

Network 2

Figure 7-11 STEP1_PSELECT network 2

Compares the value of the selected profile (byte) and sets the bit of the selected profile correspondingly.

Page 72: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 72/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 3

Figure 7-12 STEP1_PSELECT network 3

Compares the value of the selected profile (byte) and sets the bit of the selected profile correspondingly.

Network 4

Figure 7-13 STEP1_PSELECT network 4

If a profile ≥3 is selected, the highest profile will be selected automatically.

Page 73: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 73/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 5

Figure 7-14 STEP1_PSELECT network 5

If profile 0 has been selected, the length stored in the profile memory area will be copied into the field for the length to be cut.

Network 6

Figure 7-15 STEP1_PSELECT network 6

If profile 1 has been selected, the length stored in the profile memory area will be copied into the field for the length to be cut.

Page 74: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 74/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 7

Figure 7-16 STEP1_PSELECT network 7

If profile 2 has been selected, the length stored in the profile memory area will be copied into the field for the length to be cut.

Network 8

Figure 7-17 STEP1_PSELECT network 8

The presently applicable cutting length is copied to the display variable of the TD200 and can be seen on the "Select profile" display.

Page 75: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 75/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 9

Figure 7-18 STEP1_PSELECT network 9

If the system detects (through a notification bit) that a new value has been entered for the display variable "length", this value will be copied to the profile memory location 0 if this profile is active.

Network 10

Figure 7-19 STEP1_PSELECT network 10

If the system detects (through a notification bit) that a new value has been entered for the display variable "length", this value will be copied to the profile memory location 1 if this profile is active.

Page 76: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 76/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Network 11

Figure 7-20 STEP1_PSELECT network 11

If the system detects (through a notification bit) that a new value has been entered for the display variable "length", this value will be copied to the profile memory location 2 if this profile is active.

Network 12

Figure 7-21 STEP1_PSELECT network 12

The notification bit for changing the display variables will be re-set after the sub-program has been completed.

Page 77: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 77/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

8 Modifying the S7-Micro/Win Program

This chapter describes four possible scenarios as examples of how the application can be adjusted to your individual requirements:

• changing the parameters for motion (chapter 8.1)

• increasing the number of profiles (see chapter 8.2)

• changing the feedrate of the cardboard (see chapter 8.3)

• using different types of stepper motors (see chapter 8.4).

8.1 Changing the parameters for motion

In this chapter you will learn how you can adjust the parameters for motion (referring to the present configuration of the positioning module) to your specific requirements. Important parameters for motion are, for example:

• minimum speed of the stepper motor

• maximum speed of the stepper motor

• speed in jog mode

• acceleration and delay time

• pulses required for one revolution of the stepper motor

• desired unit of measure

• relation of the pulses required for one revolution and the unit of measure used

Note This description refers only to part of the parameters of the positioning module.

Page 78: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 78/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

Table 8-1 Procedure to adjust the motion parameters (configuration of the EM253 positioning module ) to customer-specific basic data.

Step Focus Instruction

1 Opening the project Open the application code in S7-Micro/Win. Select "File" from the menu bar and select "Open".

2 Opening the positioning assistant

3 Selecting the positioning module

4 The system will lead you through the corresponding configuration dialog boxes. There you can change the parameters to suit your specific requirements.

Please note that you should change only those parameters related to motion and mechanical operations!

5 Setting the connection for communication

Select the menu item "communication" from the operations tree. Enter the connection path in the dialog box and set your CPU correspondingly.

6 Producing the cable connection

Connect the S7-CPU 222 and the PU/PC with a cable line; you must remove the connector of the TD200 unit for the period of data transfer (since this port is used for the communications cable).

Make sure that the cable connection complies with the parameter settings described under point 5.

7 Compiling and downloading into the CPU Click button "Compile all" in the toolbar. Then click the button "Download" .

Page 79: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 79/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

8.2 Increasing the number of profiles

The application offers three profiles. In this chapter you will learn how you can increase the number of profiles.

Selection and changes to profiles is realized in the sub-program STEP1_PSELECT, which is to be modified if more profiles are to be integrated.

Note This chapter does not include information on how program changes can be re-programmed again; it contains only the principle procedure how a further profile can be added.

For each profile to be added you require the following variables:

• profile memory location: type Real

• profile active: type bit

Step Focus Description

1 Opening the project Open the application code in S7-Micro/Win. Select "File" from the menu bar and select "Open".

2 Change to the sub-program "STEP1_PSELECT"

Double-click the sub-program STEP1_PSELECT (SBR2) in the operations tree.

3 Extending the profile active analysis

The "profile variable" entered in the TD200 unit is analyzed in the networks 1-3. Here you must add a further network used to activate the new profile. If comparison shows that this profile is selected, the "profile active"-bit will be set.

4 Detection of wrong entries

In network 4 of this sub-program a comparison is performed to check whether the variable is beyond the area of the defined profiles; in this case the highest profile will be selected. Change the value for the number of profiles in this field.

5 Using the length stored in the profile memory location as the cutting length

In networks 5, 6 and 7 the length stored in the profile memory area is copied as the variable for the length to be cut. This is also required for your new profile; add one routine for your profile which corresponds to the networks 5, 6 and 7.

6 Copying the new length to the profile memory location

Networks 9, 10 and 11 copy a newly defined length for the active profile to the corresponding profile memory location. The new profile also requires a network for copying.

7 Setting the connection for communication

Select the menu item "Communication" from the operations tree. Enter the connection path in the dialog box and set your CPU correspondingly.

8 Producing the cable connection

Connect the S7-CPU 222 and the PU/PC with a cable line; you must remove the connector of the TD200 unit for the period of data transfer (since this port is used for the communications cable). Make sure that the cable connection complies with the parameter settings described under point 3.

9 Compiling and downloading into the CPU Click button "Compile all" in the toolbar. Then click the button "Download" .

Page 80: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 80/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

8.3 Changing the feedrate

This chapter explains how you can change the feedrate of the cardboard.

The feedrate is set in the sub-program STEP1_MOTION in network 5 and in the sub-program STEP1_FCUT in network 3. The items to be changed are marked in the following illustration.

Subroutine Illustration

STEP1_MOTION network 5

STEP1_FCUT network 3

Figure 8-1 Text

Page 81: Application for Drives - Siemens AG · Application for Drives ... "closed-loop controlled" positioning processes. In contrast to controlled positioning systems, control units used

Controlled Positioning of an Axis with Stepper Motor Using the Example of a "Cutting-to-Length" Process

V1.0 03/2003 81/81

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2106

1963

_mae

10_g

est_

pos_

schr

itt_D

OK

U_v

00_e

.doc

8.4 Use of other motor versions

If you use a different type of a SIMOSTEP stepper motor, you should adjust the current limit of the power unit to the specific motor. The steps required to set the motor current are described in chapter 5.1.3 which includes details on the parameter setting for the FM STEPDRIVE (Table 5-9).

Table 8-2 Possible torques of the SIMOSTEP stepper motors

Stepper motor type 1FL3041 1FL3042 1FL3043 1FL3061 1FL3062

Torque (Nm) 2 4 6 10 15