Cookies are important for this site to function properly, to guarantee your safety, and to provide you with the best experience. By clicking OK, you accept all cookies. For more information, please access our Privacy Policy.
Table of Contents
Tutorials / 
Siemens PLC Control of Motor Speed Through a Drive Using Telegram 1
Advanced

Siemens PLC Control of Motor Speed Through a Drive Using Telegram 1

Siemens
TIA Portal
Servo Motors
Hardware

‍Introduction

SINAMICS S200 PN is one of the Siemens servo drive systems that offers essential speed control capabilities as part of its core functionality.

This tutorial covers the crucial steps in configuring speed control using a GSDML file with one of the Siemens SIMATIC controllers, the S7-1500 PLC. Get ready to delve into the specifics of two scenarios: basic and function block controls, with detailed descriptions.

Figure 1.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Automation task overview
Figure 1.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Automation task overview

When using SINAMICS S200 PN in speed mode, you can rely on its seamless support for the 'standard telegram 1', which will be discussed in this tutorial. The 'standard telegram 1' is exclusively designed for use in the RT (real-time) mode.

Prerequisites

What you will need to follow along with this tutorial:

  • You need to install the TIA Portal software on your personal computer. Although this tutorial refers to version 18, rest assured that other versions of the TIA Portal will work just fine.
  • You need to be familiar with servo motor commissioning.

Wiring the Hardware

In this setup, the servo drive system runs on a single-phase AC230V power supply, while the SIMATIC system relies on a power supply of DC24V. Keep in mind the significance of checking the power supply voltage. Don't underestimate the consequences of getting the wiring wrong—it can harm the drive or controller. Observe Figure 2.1 to understand how the hardware is configured in this application.

Figure 2.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Hardware wiring
Figure 2.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Hardware wiring

Installing GSDML File

Let's explore the steps involved in installing the GSDML file into Siemens TIA Portal software. Access the GSDML file for SINAMICS S200 PN by downloading it from here. Extract the contents of the zip file.

Figure 3.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Downloading GSDML file
Figure 3.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Downloading GSDML file

Launch the TIA Portal software, switch to Project View, click on the Options menu, and select the option to Manage general station description files (GSD). Choose the source path folder by clicking the corresponding button. Pick the desired GSDML file/files for the installation process. Click on the Install button to initiate the installation of the GSDML file/files. You'll see the installation status displayed in the TIA Portal. Once the installation is complete, press the Close button to dismiss the pop-up screen. Finally, the software starts updating the hardware catalog.

Figure 3.2 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Installing GSDML file in TIA Portal
Figure 3.2 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Installing GSDML file in TIA Portal

Configuration of the Hardware

It's time to discover how to set up the corresponding TIA Portal project and configure the S200 PN drive using standard telegram 1. With TIA Portal software still up and running, let's get busy creating a new TIA Portal project and setting the project name and path according to your preferences.

Figure 4.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Creating PLC control project
Figure 4.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Creating PLC control project

Next, double-click over the Add new device to get the CPU added to the project. Select the Controllers category. In the Controllers list, find the CPU 1511T-1 PN you want to use. Once you've got it, take a quick look to confirm the firmware version of the CPU. Feel free to modify the device name of the CPU according to your preference. Tap on the OK button to officially include the CPU in the project.

Figure 4.2 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Adding desired PLC to the project
Figure 4.2 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Adding desired PLC to the project

Once the Device configuration window opens, flip to the Network view tab. Open up the Hardware catalog. You've got to go through the folders and find your way to SINAMICS under Other field devices -> PROFINET IO -> Drives -> SIEMENS AG.

Figure 4.3 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Locating desired servo drive
Figure 4.3 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Locating desired servo drive

Locate the GSD file labeled SINAMICS S200 PN V6.2 and double-click on it to include this servo drive in the project. Click on the link labeled Not assigned in the S200 PN drive. Pick the 'PLC_1.PROFINET interface_1' as the IO controller you're aiming for.

Figure 4.4 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Adding desired servo drive to the project
Figure 4.4 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Adding desired servo drive to the project

Once you've linked the IO controller to the drive, you will witness the Profinet communication network displayed, just like in Figure 4.5.

Figure 4.5 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Establishing a connection between PLC and servo drive
Figure 4.5 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Establishing a connection between PLC and servo drive

Go back to the Device view after being in the Network view. Pick out the PLC from the options in the dropdown menu. Go with the selection to view CPU properties. Pick the Ethernet addresses in the General properties list to make parameter modifications. Edit the IP address, but be cautious not to set a conflicting custom IP address with another device on this network.

Figure 4.6 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - PLC communication setting
Figure 4.6 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - PLC communication setting

Click on the dropdown menu and choose the SINAMICS S200 PN Drive this time. Go with the option labeled Hardware catalog and click on it. Expand the folder containing the submodules. Choose the 'Standard telegram 1' and place it into the project by double-clicking. After inserting the telegram, you'll find it on the Device overview screen, and the IO address associated with it will be visible. The input and output addresses are both specified to have a length of 4 bytes. The initial input or output address can be customized by the user to accommodate their application.

Figure 4.7 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Servo drive communication method
Figure 4.7 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Servo drive communication method

Within the Device view of the S200 PN drive, open the Properties. Choose the General function from the options available in the General menu. The device name of this servo drive can be customized to align with the user's application. As an example, in this particular application, it has been changed to S200 PN. After modifying the device name, the newly adjusted name will appear.

Figure 4.8 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Modifying servo drive name
Figure 4.8 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Modifying servo drive name

By opening the Ethernet addresses section, making modifications to the IP address is allowed.

Figure 4.9 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Servo drive communication setting
Figure 4.9 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Servo drive communication setting

PLC Control with the Move Instruction

Get ready to understand how to use the MOVE instruction to take charge of the S200 PN systems. Access the Default tag table or create a new one under the PLC tags folder. Make the new PLC tags using the specific address highlighted in Figure 5.1. The input and output addresses should align precisely with the details provided in Figure 4.7 for the speed setpoint, control word, actual speed, and status word.

Figure 5.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Creating tags for programming logic
Figure 5.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Creating tags for programming logic

Locate the main Organization Block (OB1) under the Program Blocks folder and double-click on it to access it. Choose the Instructions task card. Drag the MOVE instruction from the Basic instructions -> Move operations folder and drop it onto network 1. Set up the programming logic according to the representation displayed in Figure 5.2.

Figure 5.2 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Programming logic using Move instruction
Figure 5.2 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Programming logic using Move instruction

By double-clicking over the Add new watch table item, you can generate a new watch table named Watch table_1 and have it instantly open. Make modifications to the watch table by incorporating status monitoring and control operations, mirroring the configuration displayed in Figure 5.3.

Figure 5.3 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Creating watch table 
Figure 5.3 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Creating watch table 

Figure 5.3: PLC control of motor speed through a drive using Telegram 1 -

Select the PLC_1 folder, and proceed to compile the project and download it to the PLC by left-clicking their icons on the top toolbar.

Figure 5.4 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Compiling and downloading the project
Figure 5.4 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Compiling and downloading the project

Access the Watch table_1 by double-clicking on it. Enable variable monitoring and forcing functionality by clicking the monitor button, represented by the eyeglasses icon.

Figure 5.5 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Bringing the watch table into online mode
Figure 5.5 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Bringing the watch table into online mode

Customize the control word to the value of 16#047E and change the speed setpoint, setting it to 16#0500. Click on the Modify button to initiate value changes. Once you've adjusted the control, you will see the status of the drive reflecting the update. In the case of telegram 1, it's important to note that the speed setpoint serves as the reference setpoint, and the value 16#4000H corresponds to 100% of the reference speed in P2000.

Figure 5.6 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Modifying the control word and speed setpoint
Figure 5.6 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Modifying the control word and speed setpoint

Activate the drive by changing the control word to the value of 16#047F and ensure monitoring of the status of the servo drive.

Figure 5.7 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Activating servo drive
Figure 5.7 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Activating servo drive

Switch the control word to the value of 16#047E to halt the servo drive and keep track of its situation for monitoring purposes.

Figure 5.8 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Deactivating servo drive
Figure 5.8 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Deactivating servo drive

Consider the necessary adjustments by modifying the control word to 16#0C7F to initiate the servo drive in the opposite direction and monitor its status accordingly.

Figure 5.9 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Activating servo drive in the opposite direction
Figure 5.9 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Activating servo drive in the opposite direction

Adjust the control word to the value of 16#0C7E or 16#047E to bring the servo drive to the stop mode, and remember to survey its status effectively.

Figure 5.10 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Deactivating servo drive using different control word value
Figure 5.10 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Deactivating servo drive using different control word value

PLC Control with the SinaSpeed Function Block

Let's explore how to utilize the SinaSpeed function block for smooth control of the S200 PN system like a pro. Go ahead and access the Default tag table or whip up a fresh tag table within the PLC tags folder. Start generating the PLC tags using the specified address displayed in Figure 6.1.

Figure 6.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Generating tags for programming logic
Figure 6.1 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Generating tags for programming logic

Within the Default tag table, jump over to the System constants view. Search for the target hardware identifier within the list and capture the value assigned to this constant variable.

Figure 6.2 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Locating servo drive hardware identifier
Figure 6.2 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Locating servo drive hardware identifier

Locate the Main OB1 (Organization Block) within the Program Blocks folder and double-click on it. Select the Instructions task card. Grab the SinaSpeed instruction from the Optional packages folder and release it onto Network 1 using drag and drop action. Customize the name of the data block as per your preference, and you can let TIA Portal automatically assign the DB number or manually assign it yourself. Confirm the insertion of the function block to the project by pressing the OK button. This is a reminder that you can download the function block and its documentation from here.

Figure 6.3 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Adding SinaSpeed function block for programming logic
Figure 6.3 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Adding SinaSpeed function block for programming logic

Implement the logic in your program based on the visual representation depicted in Figure 6.4. When dealing with the HWIDSTW or HWIDZSW, you can assign a constant variable name or directly allocate a constant variable value. Perform project compilation and then proceed to download it to the PLC.

Figure 6.4 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Configuring SinaSpeed function block
Figure 6.4 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Configuring SinaSpeed function block

Activate the program logic monitoring mode by pressing the eyeglasses button.

Figure 6.5 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Bringing the logic to online mode
Figure 6.5 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Bringing the logic to online mode

Adjust the speed setpoint value and activate the axis to initiate the drive.

Figure 6.6 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Activating servo drive
Figure 6.6 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Activating servo drive

Set the speed setpoint to a negative value, re-enable the axis, and observe the motor rotating in the opposite direction.

Figure 6.7 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Activating servo drive in the opposite direction
Figure 6.7 - Siemens SINAMICS S200 Servo Drive System | PLC control of motor speed through a drive using Telegram 1 - Activating servo drive in the opposite direction

Conclusion

In conclusion, you learned about PLC control of motor speed through a servo drive using Telegram 1. You figured out how to establish the connection for this automation task and how to wire the hardware. You became acquainted with downloading and installing the GSDML file of your desired servo drive. You understood how to configure your hardware (PLC and servo drive) in TIA Portal. Finally, you grasped how to set up your PLC control using the Move instruction or implementing the SinaSpeed function block to observe the status of the motor speed.