05 Motion Control
05 Motion Control
05 Motion Control
Basic Workshop
• Basic 2
• Hardware
24
• Technology Object
33
• Program 53
Why Motion?
Motion Control
increasingly substitutes mechanical solutions
Every S7-1200 and S7-1500 includes integrated motion functionality in the firmware!
Functionality
S7-1200 S7-1500
Open loop speed control
Open loop position control
Closed loop speed control
Closed loop position control
Homing
Control loop
Basic structure of a positioning control
PLC Inverter
S7-1500 SINAMICS
User- MC-Interpolator MC-Servo Control Unit (CU) Power Module
program [OB 92] [OB 91]
Evaluation Encoder
TM-Modul
Evaluation
OB 91
OB Servo OB91 and OB92 are always executed with the ratio 1:1
Output PIP
IPO Event
Default priorities:
MC-Inter- - OB91: 25
polator
OB 1 - OB92: 24
OB 92
Content of the MC-OBs are not modifiable
Topology
Connection of drives to the S7-1500 S7-1500 S7-1200
S7-1500
Flexible drive connection:
PROFINET IO / PROFIBUS DP / Analog (V/I)
S7-1500
Flexible encoder connection:
Direcly to the drive
(central or decentral)
Hardware configuration
Programming
PLC
User program
Motion control instructions
Firmware
Position controller, Interpolator, …
Drive
Inverter
(Speed controller, Monitoring, …)
Structure
User program S7-1500 S7-1200
- Disable/enable axis
Technology - Acknowledging errors
object (TO) - Move axis in jog mode
Firmware - Motion with speed preset
- Stop axis
- Home/set axis
Drive /
- Relative positioning
External encoder
- Absolute positioning (Homing required)
Structure
Technology object
S7-1500 S7-1200
PLC TOs…
… represent the real drives in the PLC
User- … are the interface between real drive and user program
program
Firmware
Advantage:
Dimensioning and parameterization of the drive is
Drive / independant from user programm!
External encoder
Structure
Technology object
S7-1500 S7-1200
PLC
S7-1200 S7-1500
User-
program
Available SpeedAxis
TOs for Axis_PTO PositioningAxis
motion
Technology External encoder
object (TO)
Firmware
Quantity 4 axes X TOs
Drive /
External encoder
Structure
Technology object
S7-1500 S7-1200
Technology object
PositioningAxis
Structure
CPU firmware S7-1500 S7-1200
PLC
CPU firmware
User-
program
Communication with the drive
Technology
object (TO) Cyclic actualization of the TO-DBs
Firmware
Execution of the motion instructions
Drive /
External encoder
Structure
Drive S7-1500 S7-1200
User-
program The drive can be parameterized either via Startdrive or Starter
Firmware
Drive
Communication
Overview
Control word 1 (STW1) and Status word 1 (ZSW1) are transferred always!
STW1 and ZSW1 are defined in the PROFIdrive specification:
Telegram PZD 1 PZD 2 PZD 3 PZD 4 PZD 5 PZD 6 PZD 7 PZD 8 PZD 9
STW1 NSOLL
1 Speed setpoint 16 bit
ZSW1 NIST
STW1: Control word 1 STW2: Control word 2 G1_STW: Encoder 1 Control word
NSOLL: Speed setpoint ZSW2: Status word 2 G1_ZSW: Encoder 1 Status word
ZSW1: Status word 1 XERR: Position deviation G1_XIST1: Encoder 1 actual position 1
NIST: Speed actual value KPC: Position controller gain factor G1_XIST2: Encoder 1 actual position 2
Communication
Available encoder telegrams
STW2_ENC G1_STW
81 1 encoder channel
ZSW2_ENC G1_ZSW G1_XIST1 G1_XIST2
STW2_ENC G1_STW
1 encoder channel
83
Speed actual value ZSW2_ENC G1_ZSW G1_XIST1 G1_XIST2 NIST
Startdrive
Firmware
Motion handling
• Basic 2
• Hardware
24
• Technology Object
33
• Program 53
Adding a drive
Parameterization/Commissioning Parameterization/Commissioning
via STARTER via Startdrive in the TIA Portal
GSD(ML) drives
Add a drive via GSD(ML) file
Network view
Drives can be inserted using GSD(ML) files, Siemens drives are preinstalled.
Insert drive
Assign the
drive to a PLC
GSD(ML) drives
Telegram and configuration
Device view
Device view
1
Click on the
interface
3
4 Insert
Further telegram
settings
Drives with Startdrive
Overview
Features
Network view
Device view
Adding a
power module
Configuration of the
device looks similar
to other devices
Drives with Startdrive
Parameterization
Commissioning
and diagnostics
Integrated trace
Motion Control
• Basic 2
• Hardware
24
• Technology Object 33
• Program 53
Workflow:
2 Configuration
1 3 Commissioning
2
3
4
4 Diagnostics
Overview
Adding a new technology object
Assign name
2
Assign DB
number
Choose
TO type
1
Configuration
Overview
Configure
axis
Extended parameters
they are predefined and
changeable if necessary
Configuration
Symbols
Unit settings
Selection of a rotary axis:
Drive
Special feature:
Choose an
available drive
Configuration
HW Interface
Encoder
Possibility1 3
Possibility 2
Possibility 1:
Connection to the drive
Possibility 2:
Connection via technology module (TM) Selectionofofana
Selection
TM modul
encoder
Possibility 3:
Connection via PROFINET/PROFIBUS
Configuration
HW Interface
Possibility 2
Communication
2
3 Encoder settings 1
3
• Encoder type
• Resolution
3
Configuration
Extended parameters
Extended parameters…
… are all predefined
… could be changed optionally
Categories:
- Mechanics
- Limits and default values
- Emergency stop
- Homing
- Position tracking
- Closed loop control
Commissioning
Overview
Technology object
Configuration
Commissioning
Diagnostics
Technology object
PositioningAxis
Commissioning
Control Panel
Overview
2 Motion control
3 Information
Commissioning
Control Panel
Workflow
Activate axis
2
Security warning
Commissioning
Control Panel
Workflow
2 1
Select the
operation mode
Commissioning
Control Panel
Workflow
Start motion
Enter motion
values
Commissioning
Control Panel
Workflow
Online information
Diagnostics
Overview
Technology object
Configuration
Commissioning
Diagnostics
Technology object
PositioningAxis
Diagnostics
Status- and error bits
Diagnostics
Status and error bits
Diagnostics
Motion status and PROFIdrive interface
Diagnostics
Watch content of the
PROFIdrive telegrams
Watch online values
of the drive
DB editor
Technology datablock
Content:
Configuration data
Setpoint values
Actual values
Status information
2
Motion Control
• Basic 2
• Hardware
24
• Technology Object
33
• Program
53
Workflow:
2
User program
Adding first program parts
1
User program
Programming with PLCopen
Insertion of a
MC_block from
the library
3 2
Available MC_blocks
MC_Home
MC_Halt
(homing)
Basics of MC_blocks:
Every block has basic parameters
(not every block has all basic parameters)
Every block needs to be assigned to a TO Axis Technology object
(Drag&Drop of a TO to the block)
Execute Start instruction with a rising edge
Done Instruction was being executed
Busy Instruction is active
Command Instruction was aborted by another instruction
Aborted
Error Error pending
ErrorID Error information
Shortcut from the block to Besides the basic parameters, every block has
the corresponding TO specific parameters (e.g. velocity, position, …)
Example program
Enable axis
Acknowledging errors
Programming recommendations for S7-1200 and S7-1500 with STEP 7 (TIA Portal)
http://support.automation.siemens.com/WW/view/en/67582299
Migration:
Migration production plants– http://support.automation.siemens.com/WW/view/en/83558085
Migration PLC´s – http://support.automation.siemens.com/WW/view/en/83557459
Migration Vizualisation – http://support.automation.siemens.com/WW/view/en/76878921
Migration communication – http://support.automation.siemens.com/WW/view/en/83558087
Migration periphery – http://support.automation.siemens.com/WW/view/en/83558994
Let us know if there is anything
we can support you with!
For further information and support, please contact:
Mr. Tran Van Hieu
SITRAIN Manager – Digital Industry Academy
Siemens Vietnam
Email: tran-van.hieu@siemens.com
www.siemens.com.vn
www.facebook.com/Siemens.Vietnam