Position Control of A Drive Via S7 1200
Position Control of A Drive Via S7 1200
For questions about this document please use the following e-mail address:
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
Automation Solution
Configuration
Code Elements
History
Appendix
SIMATIC
CE-X7 - Positioning a Sinamics
S110 Servo Drive with S7-1200
Motion Control
Automation Task
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
The Application Examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any 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 of safely and professionally using, installing,
operating and servicing equipment. When using 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 these
application examples at any time without prior notice. If there are any deviations
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.
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 Application Example 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). The damages for a breach of a substantial
contractual obligation are, however, limited to the 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.
It is not permissible to transfer or copy these application examples or excerpts of
them without having prior authorization from Siemens Industry Sector in writing.
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
Table of Contents
Table of Contents
Warranty and Liability ................................................................................................. 4
1
Automation Task................................................................................................ 6
1.1
1.2
Configuration ................................................................................................... 28
3.1
3.2
3.3
3.4
3.5
3.6
3.7
Code Elements................................................................................................. 42
History............................................................................................................... 43
Appendix .......................................................................................................... 44
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
1 Automation Task
Automation Task
1.1
Application environment
A servo motor is to be moved with a servo drive by Siemens Sinamics S110 and
using the pulse interface of a S7-1200 CPU1214C. Both the servo drive and the
S7-1200 CPU have an individual internal pulse counter each, whose count
represents the current position. Before moving to an absolute position, the counter
of the S7-1200 CPU has to be synchronized with the physical position of the axis.
Figure 1-1
Drive
Controller
Pulses
Direction
Counter
Position
Synchronous
Counter
Position
Pos
Encoder
Position
-40
-30
-20
-10
10
20
30
40
50
The task consists of absolute positioning independent of start position and velocity
(Figure 1-2). The S7-1200 technology object axis with the respective PLCopen Motion Control function block provides the necessary functions.
On the basis of the stored
velocity in v [mm/s]
the moved distance s in [mm] is calculated based on the current start position
and the target position is approached.
Figure 1-2
Velocity
V
a
d
Time
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
1 Automation Task
1.2
Component list
Products
Table 1-1
Components
Note
1.
6EP1332-1SH71
2.
S7-1200 CPU1214C
6ES7214-1AE30-0XB0
DC
3.
6AV6647-0AG11-3AX0
optional
4.
6SL3210-1SB12-3AA0
230V
5.
6SL3040-0JA00-0AA0
Pulse/direction variant
from firmware v4.3
6.
1FK7032-5AF21-1UA0
DRIVE-CLiQ
7.
6SL3054-4ED00-0AA0
Optional, if CU305
already existed with old
firmware
Note
Copyright Siemens AG 2010 All rights reserved
ConfigurationExample_x7_V2d0_SinamicsS110_en.doc
Qty
Accessories
Table 1-2
Components
Qty
Order number
Note
8.
Power cable
6FX5002-5CG01-1AB0
9.
6FX5002-2DC00-1AB0
10.
Commutation inductor
6SE6400-3CC00-4AB3
Optional
11.
12.
Limit switch
Specialist dealer
Mechanically operated
13.
Specialist dealer
Inductive
14.
Specialist dealer
Make contact
15.
1m
Specialist dealer
Connection of
pulse/direction signals to
encoder interface of
CU305 DP
16.
Specialist dealer
Load resistor
17.
Specialist dealer
Note
L,N
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
1 Automation Task
Programming package
Table 1-3
Component
Qty
18.
6ES7822-0AA00-0YA0
19.
6SL3072-0AA00-0AG0
Note
Note
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
Automation Solution
2.1
Wiring diagram
L+
M
11
RPS
Fwd Limit
Rev Limit
EMC STOP
CPU 224XP
A7
5.X133.2 (Alarm Reset)
5.X133.3 (Clear Position)
5.X133.1 (Enable Servo)
5.X23.13 (Sign)
5.X23.15 (Pulse)
R=330 (2W)
16
PM340
Figure 2-2
L
N
PE
10
9
6.X100 - DRIVE-CLiQ
M
W
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
CU305DP
Figure 2-3
L+
M
6.X100 - DRIVE-CLiQ
X23
X23
2.Q0.1
2.Q0.0
1: No
2: No
3: No
4: No
5: No
6: No
7: Ground
8: No
9: No
10: No
11: No
12: No
13: PTO-Sign
14: No
15: PTO-Pulse
16: No
15
X132
X132
X133
2.I1.0
2.I1.1
2.I1.2
Starter v4.3
1: Servo Ready
2: Alarm
3: Standstill/In Position
4: No
5:No
6: No
7: No
8: No
17
Note
X133
2.Q0.4
2.Q1.1
2.Q0.5
1: Enable Servo
2: Alarm Reset
3: Clear Position
4: No
5: Ground
6: No
7: No
8: No
Please observe all valid safety regulation and pay attention to the instructions
from the handbook when connecting the AC 230V power supply of the Sinamics
S110.
http://support.automation.siemens.com/WW/view/en/33940571
ATTENTION
Make sure a good conductive connection between the servo drive and the
(grounded) metal mounting plate is provided.
Ensure all devices in the cabinet are earthed using short earthing lines with
a large diameter and that they are connected to a common earthing point
or earthing bar.
Use shielded control lines
Run control lines as far separated from power cables in separate
installation channels as possible. Crossings between power and control
lines should be at a 90 angle.
Connect the protective conductor of the motor to the earth connection (PE)
of the respective servo drive.
The line ends should be properly terminated, making sure that unshielded
lines are kept as short as possible.
Use shielded lines for motor connections; earth the shielding both on the
converter and the motor side using cable clamps.
10
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
2.2
X133.1
3L+
Q0.4
X133.5
I
S7-1200 digital PNP outputs
To operate the servo drive, the following input signals are used:
Using the encoder interface of the servo drive for pulse/direction signals
The internal X23 encoder interface of the CU305 is used to control the drive with
pulse/direction signals. Only the pins 7, 13 and 15 are used according to Table 2-1.
Table 2-1
Pin
Signal name
Technical details
1-6
not relevant
Ground
812
not relevant
13
BP
Pulse/direction interface: direction
not relevant
B track positive
AP_DAT
Pulse/direction interface: pulse
A track positive
14
15
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
11
2 Automation Solution
X23.15
R=330
3L+
Q0.0
X23.7
I
S7-1200 PTO output
Drive X23
Figure 2-6
Without load resistor
Logic 1
Logic 0
12
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
Figure 2-7
With load resistor
Logic 1
Logic 0
Incorrect wiring of the digital outputs of the S7-1200 CPU can lead to the
destruction of the outputs.
ATTENTION
1M
internal
I0.0
I
S7-1200 digital input
Note
X132.1
All digital inputs of the S7-1200 CPU which are connected to the common
potential 1M can only read PNP signals. Please observe this when wiring the
hardware switches.
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
13
2 Automation Solution
The following output signals are used for the servo drive feedbacks:
Servo ready
14
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
2.3
1 revolution = 360
The velocity of the motor is determined by the number of pulses output per second.
Using the S7-1200 CPU1214C, a maximum of 100,000 pulses per second (pps)
can be output.
Figure 2-10
slow
1
o
fast
1
o
Time
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
15
2 Automation Solution
S
Start/Stop
Time [seconds]
Acceleration time
2.4
Delay time
16
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
Figure 2-13
Velocity
S0
Time
S7-1200
Sinamics S110
Pulses
Direction
+
Counter
Setpoint
Counter
Actual
Encoder signal
Set Position
S0
Time
2.5
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
17
2 Automation Solution
= 3000 rpm
= 100,000 pps
Calculation:
PMotor
f
f CPU
60 s
CPU
TMotor
TMotor
60 s
100000 pps 60 s
3000rpm
2000 ppr
PMotor
PMotor
Result:
Copyright Siemens AG 2010 All rights reserved
ConfigurationExample_x7_V2d0_SinamicsS110_en.doc
To reach the nominal speed of the motor, whilst taking into account that the
maximum frequency is 100,000 pulses per second, a number of 2000 pulses per
revolution has to be set. This results in a position accuracy of 0.18 per pulse.
A smaller number of pulses per revolution would mean that the nominal speed is
exceeded. Limiting the maximum frequency of the S7-1200 prevents the exceeding
of the nominal speed at a lower number of pulses per revolution.
Note
Using the additional SB 1222 DC signal board enables the PLC to increase the
maximum control frequency to 200,000 pulses per second
TMotor
f CPU 60s
PMotor
Calculation:
Increase of the number of pulses per revolution to 4000 ppr.
100000 pps 60 s
TMotor
4000 ppr
TMotor 1500rpm
18
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
Result:
At double position accuracy of 0.09 per pulse the nominal speed of the motor
increases to 1500 revolutions per minute at a constant maximum frequency of
100,000 pulses per second.
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
19
2 Automation Solution
2.6
Figure 2-14
To meet all functions of this configuration example, the following program blocks
are required which must be called cyclically in the user program.
Table 2-2
No
1.
20
Program block
MC_Power
Function
Enabling/disabling of the axis
2.
MC_Reset
3.
MC_MoveJog
Jog mode
4.
MC_MoveVelocity
5.
MC_Home
6.
MC_Halt
7.
MC_MoveAbsolute
8.
MC_MoveRelative
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
2.7
Figure 2-15
2.8
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
21
2 Automation Solution
2.9
Figure 2-17
2.10
0: the rotation direction is controlled via the sign (+/-) of the speed indicated
The Busy output is active as long as the axis is moved via this block.
22
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
Figure 2-18
2.11
Homing (MC_Home)
The controller has to know the physical position of the axis before the servo motor
may be moved defined via a pulse sequence.
Learning the physical position (homing) shall be explained using a linear axis. This
axis consists, for example, of a spindle that is connected to the servo motor. One
revolution of the motor is to correspond to 2000 pulses and one unit length [LU] of
the spindle.
Figure 2-19
Limit switch
(backward)
-50
-40
-30
-20
-10
10
Limit switch
(forward)
20
30
40
50 LE
It is assumed that the axis depicted green in the picture is by default located left of
the reference point switch on position 0.
The axis is moved by a positive edge on the Execute input of the MC_Home
block at a defined speed and in a defined direction.
In the configuration of the technology object you define in which direction and with
what speed the axis is to be moved. (Chapter 3.4, Configuration). The axis is only
moved in accordance with this configuration when the value 3 is pending at the
Mode input of the MC_Home block.
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
23
2 Automation Solution
Figure 2-20
Three different cases can occur which have an influence on homing the axis.
Case 1: starting position left of reference point; deceleration to slow speed is
complete before reaching the negative edge
Copyright Siemens AG 2010 All rights reserved
ConfigurationExample_x7_V2d0_SinamicsS110_en.doc
Case 2: starting position left of reference point; deceleration to slow speed is not
complete before reaching the negative edge
In case deceleration to slower velocity is not achieved before reaching the negative
edge of the reference point switch, the axis is stopped. Subsequently, the axis is
moved backwards at slow velocity until the positive edge of the reference point
switch. The axis is stopped again and then moved forward at slow velocity, up to
the negative edge.
Figure 2-22
24
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
Figure 2-23
The Busy output is active as long as the axis is moved via this block. Once the
block was successfully run through, the HomingDone status bit is set to TRUE
in the data block of the axis technology object.
2.12
Additionally, every active job can be interrupted by triggering a new job. It is always
only the job triggered last that is active.
Example: the axis is currently moved at preset velocity. If the jog mode is now
activated, the job with preset velocity is deleted and jog mode is active.
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
25
2 Automation Solution
2.13
Figure 2-25
If the block is started by a positive edge at the EXECUTE input, the number of
pulses required for reaching the target position is calculated on the basis of the
current position and the target position. The motor is then, if possible, accelerated
up to the indicated velocity and is then stopped with delay at the target position.
2.14
26
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
2 Automation Solution
Figure 2-26
When the block is started by a positive edge at the EXECUTE input, the axis is
moved by the set distance at the selected velocity. The direction results from the
sign (+/-) of the distance.
DANGER
2.15
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
27
3 Configuration
Configuration
3.1
Table 3-1
No
Instruction
Note/picture
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
28
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
3 Configuration
3.2
Note
On the Internet site on which you have downloaded this documentation you will
find a STARTER project in which the configuration for the SINAMCIS S110 listed
in the component list (chapter 1.2), has already been performed. It only has to be
loaded to the device. In this case, reconfiguration is not necessary.
Table 3-2
No
Instruction
1.
2.
3.
4.
SINAMICS S110
CU305 DP
Version 4.3
5.
Comment/picture
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
29
3 Configuration
No
Instruction
Select an object name
Click Next.
7.
6.
Comment/picture
Click Next.
8.
30
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
3 Configuration
No
9.
Instruction
Comment/picture
Select a motor:
10.
Select:
11.
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
31
3 Configuration
No
12.
Instruction
Comment/picture
Position control
Configure the pulse/direction interface:
Encoder channel: 2
13.
14.
3.3
Table 3-3
No
Instruction
Note/picture
1.
*.zip
2.
*.ap10
3.
4.
32
additional module
IP address
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
3 Configuration
No
5.
Instruction
Note/picture
4
3
6.
7.
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
33
3 Configuration
3.4
Note
Table 3-4
No
Instruction
1.
2.
3.
34
Note/picture
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
3 Configuration
No
Instruction
4.
5.
6.
7.
Note/picture
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
35
3 Configuration
No
8.
3.5
No
1.
36
Instruction
Note/picture
Loading software
Instruction
Note/picture
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
3 Configuration
3.6
Commissioning
No
Instruction
1.
2.
Note/picture
Click Manual
the CPU will automatically be online
Then click Enable to activate the servo
drive
3.
4.
Go to Homing mode
Start homing
5.
Go to Positioning mode
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
37
3 Configuration
No
6.
Instruction
Note/picture
Error
If an error is pending, you can reset it by
clicking Acknowledge.
For example, you can simulate an error by
actuating a hardware limit switch.
The respective last error message is displayed
in the bottom line
Diagnostics
No
Instruction
1.
2.
3.
Alarm drive
After an error, which the servo drive detects, a
restart is necessary.
4.
38
Note/picture
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
3 Configuration
No
5.
Instruction
Note/picture
Note
The technology object "axis" creates a global data block in which all parameters
and the current state of the axis is stored.
By entering the symbolic name of the axis, these values can be accessed in the
user program during runtime.
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
39
3 Configuration
3.7
No
Instruction
1.
2.
3.
Comment/picture
*.al10
Via PC runtime you can test all the features described in this documentation. All
important status messages are displayed. In case of an error a message text is
displayed.
I/O fields highlighted in blue, provide only read access. In the yellow I/O fields
values can also be written.
The bar diagram indicates the position of the axis. The ramp displayed shows
whether the axis accelerates, decelerates or whether it moves at constant velocity.
Flashing buttons indicate that an action must be performed.
40
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
3 Configuration
Figure 3-1
Note
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
41
4 Code Elements
Code Elements
The software examples are available on the HTML page from which you have
downloaded this document.
Table 4-1
No
File name
Contents
CE_x7_S7-1200_v2d0.zip
2.
CE_x7_STARTER_v2d0.zip
STARTER project
1.
42
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
5 History
History
Version
Date
Modification
03.10.2009
V2.0
19.01.2010
V1.0
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227
43
6 Appendix
Appendix
44
CE-X7 - Positioning a Sinamics S110 Servo Drive with S7-1200 Motion Control
V2.0, Entry ID: 38391227