Siemens SIMATIC S7-1500T, SIMATIC S7-1500 Getting Started

___________________
___________________
___________________
___________________
___________________
___________________
SIMATIC
Getting Started
12/2018
A5E46089528
-AA
Warranty and liability
1
Preface
2
Description
3
Preparing the project
4
Adding and configuring technology objects
5
Adding PLC tags and data types
6
Add a global data block for HMI tags
7
Create program for manual mode
8
Create a program for automatic mode
9
Main organization block Main [OB1]
10
Testing the user program
11
Siemens AG Division Digital Factory Postfach 48 48 90026 NÜRNBERG GERMANY
A5E46089528-AA
01/2019 Subject to change
Copyright © Siemens AG 2018. All rights reserved
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
S7-1500T Getting Started with Kinematics Getting Started, 12/2018, A5E46089528-AA
3
Table of contents
1 Warranty and liability ............................................................................................................................... 5
1.1 Security information .................................................................................................................. 6
2 Preface ................................................................................................................................................... 7
3 Description .............................................................................................................................................. 8
3.1 Requirements ............................................................................................................................ 8
3.2 Function scope .......................................................................................................................... 8
3.3 Task .......................................................................................................................................... 9
3.4 User program .......................................................................................................................... 10
3.5 Coordinate systems and positions .......................................................................................... 14
3.6 Program blocks ....................................................................................................................... 15
3.7 PLC tags ................................................................................................................................. 16
3.8 PLC data types ....................................................................................................................... 16
4 Preparing the project ............................................................................................................................. 20
5 Adding and configuring technology objects ............................................................................................ 21
5.1 Adding a kinematics technology object ................................................................................... 21
5.2 Configuring the kinematics technology object ........................................................................ 23
6 Adding PLC tags and data types ........................................................................................................... 25
7 Add a global data block for HMI tags ..................................................................................................... 26
8 Create program for manual mode .......................................................................................................... 27
8.1 Prepare function block ............................................................................................................ 27
8.2 Move kinematics to defined position ....................................................................................... 28
8.3 Controlling the axes ................................................................................................................ 34
8.4 Control of gripper .................................................................................................................... 36
9 Create a program for automatic mode ................................................................................................... 38
9.1 Prepare function block ............................................................................................................ 38
9.2 Querying preconditions ........................................................................................................... 40
9.3 Product type query .................................................................................................................. 43
9.4 Program section product type 1 .............................................................................................. 43
9.5 Program section product type 2 .............................................................................................. 49
9.6 Error handling in automatic mode ........................................................................................... 53
Table of contents
S7-1500T Getting Started with Kinematics
4 Getting Started, 12/2018, A5E46089528-AA
10 Main organization block Main [OB1] ...................................................................................................... 54
11 Testing the user program ...................................................................................................................... 59
11.1 Preparing the watch table and the kinematics trace .............................................................. 59
11.2 Perform test ............................................................................................................................ 61
S7-1500T Getting Started with Kinematics Getting Started, 12/2018, A5E46089528-AA
5
1
Note
The Application Examples are not binding and do not claim to be complete regarding the circuits or equipment shown, or every eventuality. The Application Examples do not represent customer
-specific solutions. They are only intended to provide support for typical
applications. You are responsible for ensuring that the described products are used correctly. These Application Examples do not relieve you of the responsibility to use safe practices in application, installation, operation and maintenance. When us
ing these
Application Examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to this Application Example at any time without prior notice. If there are any dev
iations between the
recommendations provided in this Application Example and other Siemens publications
e.g. catalogs
– the contents of the other documents have priority.
We do not accept any liability for the information contained in this document. Our liability for damages resulting from using the examples, notes, programs, configuration and performance data, etc. described in this Application Example regardless of the legal background is excluded unless required by law, e.g. in cases of willful misconduct, gross negligence, personal injury or death, failure to achieve guaranteed characteristics, fraudulent concealment of a defect or in case of breach of fundamental contractual obligations. The damages for breach of a substantial contractual obligation are, however, limited to foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment.
Any form of duplication or distribution of these Application Examples or excerpts hereof is prohibited without the express consent of Siemens AG.
Warranty and liability
1.1 Security information
S7-1500T Getting Started with Kinematics
6 Getting Started, 12/2018, A5E46089528-AA
1.1 Security information
Siemens provides products and solutions with industrial security functions that support the secure operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines and networks. Such systems, machines and components should only be connected to an enterprise network or the internet if and to the extent such a connection is necessary and only when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
For additional information on industrial security measures that can be implemented, please visit (https://www.siemens.com/industrialsecurity).
Siemens' products and solutions undergo continuous development to make them more secure. Siemens strongly recommends that product updates are applied as soon as they are available and that the latest product versions are used. Use of product versions that are no longer supported, and failure to apply the latest updates may increase customers' exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed visit (https://www.siemens.com/industrialsecurity).
S7-1500T Getting Started with Kinematics Getting Started, 12/2018, A5E46089528-AA
7
2
Purpose of the documentation
This Getting Started leads you step-by-step through the configuration of a kinematics technology object and the creation of the program for the automation task using a specific example.
Basic knowledge required
The following knowledge is required to understand the Getting Started:
● General knowledge of automation engineering
● General knowledge in the field of drive engineering and motion control
Scope of validity of the documentation
This documentation is valid for the S7-1500 product range.
Additional support information
The range of technical documentation for the individual SIMATIC products and systems is available on the Internet (http://support.industry.siemens.com/cs/ww/en/view/109742705).
The online catalog and online ordering system are available on the Internet (http://mall.industry.siemens.com/).
Conventions
During the configuration of the technology objects, only the parameters required for the example from the Getting Started are described.
Only the parameters used in the instructions are shown in the figures. Unused parameters are hidden in the program.
The comments on the tags are optional and are used for the purpose of orientation.
Example project
The example described in this Getting Started is provided as a complete TIA Portal project.
In addition, all program blocks, technology objects, PLC tags, PLC data types and the watch table are made available as master copies. You can load and use these as global library.
S7-1500T Getting Started with Kinematics
8 Getting Started, 12/2018, A5E46089528-AA
3
3.1 Requirements
Software
You need the following software to run the Getting Started:
● SIMATIC STEP 7 Professional V15.1 and higher
SIMATIC S7-PLCSIM V15.1 and higher
As an alternative to simulation via the SIMATIC S7 PLCSIM, you can perform the Getting Started using a real controller SIMATIC S7-1500T (as of firmware version 2.5).
It may be necessary to adjust the application cycle of the "MC_Servo" organization block.
3.2 Function scope
Introduction
In this Getting Started example we show you how to create and configure a kinematics technology object. The programming section shows you how to apply instructions for the different functionalities of the kinematics technology object. The result is a complete user program that consists of the described and applied functionalities.
Overview of functionalities
The following functionalities are covered in the Getting Started:
● Instructions for controlling the kinematics technology object
● Querying the job sequence
● Comparison of the coordinates and coordinate systems
● Travel with and without dynamic adaptation
Description
3.3 Task
S7-1500T Getting Started with Kinematics Getting Started, 12/2018, A5E46089528-AA
9
3.3 Task
Different products are transported on a conveyor belt and are to be distributed onto two different product pallets by a cylindrical robot.
The products first reach the pickup position over a chute at the end of the conveyor belt. At the pickup position, the products are picked up by the robot and transported to the respective pallet.
The transport routes should be as follows, depending on the product type:
Products of product type 1 are stored on pallet 1. On its way to the parking position, pallet 2 is bypassed with the help of additional intermediate destinations.
Products of product type 2 are stored on pallet 2. The parking position is approached directly and without intermediate destinations.
Layout of the work area
Pallet 1 (OCS1, for product type 1)
Pallet 2 (OCS2, for product type 2)
Pickup position (OCS3)
Cylindrical robot 3D (KCS)
The different objects and their position in the workspace (WCS) are to be defined by means of different coordinate systems and frames.
The kinematics coordinate system (KCS) is connected to the kinematics. The position of the KCS within the kinematics is fixed.
The product pallets and their position, as well as the pickup position are to be defined with the user-defined object coordinate systems OCS1, OCS2 and OCS3. This means that the reference for the target position and the target orientation of the kinematics motions to one of the product pallets or the pickup position is directly specified on the respective OCS.
Description
3.4 User program
S7-1500T Getting Started with Kinematics
10 Getting Started, 12/2018, A5E46089528-AA
3.4 User program
Overview
A user program with the following operating modes is implemented for the described task:
No-load operation (machine in idle state)
● Manual mode
● Automatic mode
● Fault
The user program executes all sequences of the task in automatic mode. The products are picked up individually in automatic mode and transported to the parking position. The sequence is repeated until automatic mode is exited.
In manual mode you set the various parameters and use individual functions from automatic mode.
Description
3.4 User program
S7-1500T Getting Started with Kinematics Getting Started, 12/2018, A5E46089528-AA
11
Manual mode
Before you start automatic mode, make all the necessary settings in manual mode.
● Enable connected axes
● Define home position and home interconnected axes
● Define the coordinates of the defined positions
● Move the kinematics to the waiting position (= start position for automatic mode).
In manual mode, you can also move the kinematics to the defined positions using individual motion instructions or change the coordinates.
You can test the gripper function by individually opening or closing the gripper (simulation).
The dynamic parameters allow you to observe the behavior of the kinematics motion when dynamic adaptation is activated and deactivated.
Automatic mode
When automatic mode is called, the following prerequisites for further processing of the program are first queried.
Cyclic queries in automatic mode:
– Is the communication to the drive system available?
– Is the drive switched on?
– Are all axes homed?
Queries during start of automatic mode:
– Is the kinematics in the waiting position?
– Is the job sequence empty?
– Is the size of the job sequence set sufficiently?
When all starting conditions are fulfilled, the program checks whether a new product is available and what type of product it is. With the information about the product type, the kinematics moves to the pickup position and picks up the product.
The subsequent motions between the pickup position and one of the two parking positions are defined as follows, depending on the product type:
Product type 1
Two transition positions are defined for the distance between the pickup position and parking position. Three motion instructions are used to move the kinematics between the pickup position and the parking position. The three motion instructions are executed via the job sequence both for moving to the parking position and for returning to the waiting position.
Product type 2
The kinematics moves with a motion between the pickup and the parking position.
Description
3.4 User program
S7-1500T Getting Started with Kinematics
12 Getting Started, 12/2018, A5E46089528-AA
The product is parked when the parking position is reached. The kinematics then executes a motion to the waiting position.
Description
3.4 User program
S7-1500T Getting Started with Kinematics Getting Started, 12/2018, A5E46089528-AA
13
Motion instructions used
The following instructions are used for the respective moves:
Motion
Instructions Start
Destination
Waiting position Pickup position prod-
uct type 1 / product type 2
"MC_MoveLinearAbsolute" to pickup position Product type 1 / Product type 2
Pickup position with offset for product type 1
Parking position on pallet 1
1. "MC_MoveCircularAbsolute" to the transition position 1
2. "MC_MoveLinearAbsolute" to the transition position 2
3. "MC_MoveCircularAbsolute" to the OCS1
Pickup position with offset
for product type 2
Parking position on pallet 2 "MC_MoveCircularAbsolute" to the
OCS2
Parking position on pallet 1 Waiting position
1. "MC_MoveCircularAbsolute" to the transition position 2
2. "MC_MoveLinearAbsolute" to the transition position 1
3. "MC_MoveCircularAbsolute" to the waiting position
Parking position on pallet 2 Waiting position "MC_MoveCircularAbsolute" to the
waiting position
Definition of the circular path ("CircMode") for the instructions "MC_MoveCircularAbsolute"
With the "CircMode" parameter, you specify the definition of the circular path. In the example project, the default setting "CircMode" = "0" is used for all circular motions and the circular path is calculated using the start, intermediate and end points. With the auxiliary point of the circular path ("AuxPoint"), you specify a point on the circular path via which the end point is to be approached.
The function block "ModeAutomatic" shows an option for calculating the auxiliary points of the circular path. The auxiliary points of the circular path are determined from the distance between the start and end position and are thus in the middle of the distance. The intermediate point is therefore consistent in each case with the specified start and end points.
Description
3.5 Coordinate systems and positions
S7-1500T Getting Started with Kinematics
14 Getting Started, 12/2018, A5E46089528-AA
3.5 Coordinate systems and positions
Kinematics and object coordinates
The values for the kinematics and object coordinates are entered in the Configuration of the kinematics technology object (Page 23).
KCS (Kinematics)
OCS1 (Pallet 1)
OCS2 (Pallet 2)
OCS3 (Pickup position at
the chute)
Position x
2000 mm
1000 mm
3000 mm
3500 mm
Position y
3000 mm 1000 mm 1000 mm 3000 mm
Position z
0 mm
100 mm
100 mm
300 mm
Positions and offsets
The values for the positions and offsets are entered via the HMI tags in the watch table "HMI-Monitor (Page 59)".
Transition position 1
Transition position 2
Position x
3000 mm 2000 mm
Position y
2000 mm
2000 mm
Position z
1800 mm
1800 mm
Offset for waiting position
Offset for product type 1
Offset for product type 2
Position x
0 mm
0 mm
0 mm
Position y
0 mm
0 mm
0 mm
Position z
1000 mm
100 mm
200 mm
Home position
The home position for the interconnected axes can be entered using the corresponding tags in the watch table "HMI-Monitor (Page 59)".
● Axis AxisA1: 10
Axis AxisA2: 1
● Axis AxisA3: 1000
Description
3.6 Program blocks
S7-1500T Getting Started with Kinematics Getting Started, 12/2018, A5E46089528-AA
15
3.6 Program blocks
Function blocks
Function block
Function
Instance data block
"CtrlSingleAxis" Control of axes (ena-
ble/disable, reset, homing)
"InstAxisA1" "InstAxisA2"
"InstAxisA3"
"ModeManual" Manual mode "InstModeManual"
"ModeAutomatic"
Automatic mode
"InstModeAutomatic"
"CtrlGripper" Gripper control (opening,
closing)
"InstGripper"
Functions
Function block
Function
Application
"Compare3D" Function for comparing posi-
tions
Function block "ModeAutomatic" Query whether gripper is in the waiting
position
"DistanceXYHalf" Function for length calcula-
tion according to Pythagoras
Function block "ModeAutomatic" Calculation of the respective auxiliary
point of the circular path for the instruc-
tion "MC_MoveCircularAbsolute".
Global data blocks
Data block
Function
Application
"HMI" Global data block for the
PLC data type "typeUserIn­terface"
Control of technology objects and display of status values in the watch table "HMI-
Monitor"
Function blocks "ModeManual" and "ModeAutomatic"
Description
3.7 PLC tags
S7-1500T Getting Started with Kinematics
16 Getting Started, 12/2018, A5E46089528-AA
3.7 PLC tags
User constants
Define the following global user constants under PLC tags:
Name
Data type
Val ue
Description OPERATING_MODE_AUTO
UInt 3 Automatic mode
OPERATING_MODE_MANU
AL
UInt 2 Manual mode
OPERATING_MODE_IDLE
UInt 0 No-load operating mode
OPERATING_MODE_ERROR UInt 1 Fault operating mode
WCS
DInt
0
Specification of the respective reference system of the specified target position and target orienta­tion
OCS1
DInt 1 OCS2
DInt
2
OCS3
DInt
3
3.8 PLC data types
Overview
For the simple and uniform declaration of tags, add the following PLC data types:
Name
Description
typeAuxPosition
Specification of positions without orientation (x, y, z)
typeExecute
Summary of the parameters for the start of the motion instructions to the defined positions
typePosition
Specification of positions with orientation (x, y, z, A)
typePositionState
Summary of the parameters for the display of reached positions per sequence (0 = position not
reached, 1 = position reached)
typeSystemState
Summary of the parameters for the status display of the axes and the drive
typeUserInterface
Summary of the tags for the HMI
typeAuxPosition
Name
Data type
Description
auxPosition Array[1..3] of
LReal
Define the position without orientation (x, y, z)
Description
3.8 PLC data types
S7-1500T Getting Started with Kinematics Getting Started, 12/2018, A5E46089528-AA
17
typeExecute
Name
Data type
Description
waitingPos
Bool
Move to waiting position
pickupPos Bool Move to pickup position
destination1Pos
Bool
Move to the parking position for product type 1
destination2Pos
Bool
Move to the parking position for product type 2
transition1Pos
Bool
Move to the transition position 1
transition2Pos
Bool
Move to the transition position 2
typePosition
Name
Data type
Description
position Array[1..4] of
LReal
Defining position with orientation (x, y, z, A)
typePositionState
Name
Data type
Description
waitingPos
Bool
Waiting position
pickupPos
Bool
Pickup position
destination1Pos
Bool
Parking position for product type 1
destination2Pos
Bool
Parking position for product type 2
transition1Pos
Bool
Transition position 1
transition2Pos
Bool
Transition position 2
typeSystemState
Name
Data type
Description
communicationOK
Bool
Communication with the drive system is available
driveInOperation
Bool
Drive system in operation
homingDone
Bool
Encoder adjustment completed
Description
3.8 PLC data types
S7-1500T Getting Started with Kinematics
18 Getting Started, 12/2018, A5E46089528-AA
typeUserInterface
Name
Data type
Description
waitingPosOffset
"typePosition"
Offset for the waiting position
product1Offset "typePosition" Offset for products of product type 1
product2Offset
"typePosition"
Offset for products of product type 2
transitionPos1
"typePosition"
Transition position 1 between conveyor belt and parking position 1
transitionPos2
"typePosition"
Transition position 2 between conveyor belt and parking position 1
productType UInt Enter product type
0 = No product / Product type unknown
• 1 = Product type 1
• 2 = Product type 2
operatingMode UInt Selecting the operating state
• 0 = Starting
• 1 = Fault
• 2 = Manual mode
• 3 = Automatic mode
• 4 = Reserved
enableAxes
Bool
Enable axes
executeMoveTo
"typeExecute"
Start motion instructions to the defined positions
interruptMove
Bool
Interrupt current motion
continueMove
Bool
Continue a motion stopped with "interruptMove"
acknowledge
Bool
Acknowledge error
gripper Bool Controlling the gripper
• 1 = Closing
• 0 = Opening
gripperState Bool Status indicator of gripper
• 0 = Open
• 1 = Closed
posState "typePosi-
tionState"
Status display of reached positions per sequence
startChecks "typeSystemSta-
tus"
Axis and drive status display
motionState UInt Status display of motion
• 0 = Inactive
• 1 = Fault
• 2 = Active
• 3 = Reserved
setReferenceAxisA1
Bool
Homing axis "AxisA1"
setReferenceAxisA2
Bool
Homing axis "AxisA2"
setReferenceAxisA3
Bool
Homing axis "AxisA3"
Loading...
+ 46 hidden pages