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 / 
Speed and Position Control of Siemens Servo Drive Using TIA Portal
Advanced

Speed and Position Control of Siemens Servo Drive Using TIA Portal

Siemens
Servo Motors
TIA Portal
Hardware

Introduction

SIMATIC S7-1500 PLC can seamlessly integrate with SINAMICS S200 PN servo drive systems to deliver unmatched performance, equipping users with precise position and speed control capabilities essential for achieving superior motion control in industrial automation.

In this tutorial, you delve into the intricacies of speed control via the SinaSpeed function block and learn about detailed instructions on achieving precise position control using the technology object.

Figure 1.1 offers a visual representation that outlines the automation task, presenting a comprehensive overview of its structure and components.

Figure 1.1: Siemens servo drive speed and position control - Automation task overview
Figure 1.1: Siemens servo drive speed and position control - Automation task overview

Prerequisites

What you will need to follow along with this tutorial:

Servo Drive Speed Control: Hardware Setup

This tutorial section introduces the hardware configuration. Here, you are provided with detailed instructions to ensure successful implementation.

To get started, launch the TIA Portal software, create a project from scratch, and integrate the desired CPU, such as CPU 1511T-1 PN, into the project for further development.

Figure 2.1: Siemens servo drive speed control - Adding PLC to the project
Figure 2.1: Siemens servo drive speed control - Adding PLC to the project

Double-click on the 'Add new device' item in the project tree to open the pop-up screen. Within the screen, choose the 'Drives' category and locate the desired S200 drives from the provided 'Drives & starters' list. Once found, ensure the firmware version is accurate and proceed to modify the device name to 'S200 PN'. Then, press the 'OK' button to incorporate the drive into the TIA project.

Figure 2.2: Siemens servo drive speed control - Adding the desired drive to the project
Figure 2.2: Siemens servo drive speed control - Adding the desired drive to the project

Disregard the security settings that are in place within this application, and instead, select the 'Continue with low-security settings' option to bypass any restrictions. Once the 'Warning' window appears, press the 'OK' button to proceed.

Figure 2.3: Siemens servo drive speed control - Configuring low-security settings for the drive
Figure 2.3: Siemens servo drive speed control - Configuring low-security settings for the drive

Finally, in the 'Summary' section of the security settings window, press the 'Finish' button to complete the process.

Figure 2.4: Siemens servo drive speed control - Finalizing security settings for the drive
Figure 2.4: Siemens servo drive speed control - Finalizing security settings for the drive

Once the servo drive 'Device configuration' window is displayed, navigate to the 'Device view' screen. From there, look for the recently added 'S200 PN' drive and select it. Proceed by clicking on the 'MOT' option, followed by 'Properties' from the Inspector window, and then choosing the 'Motor-selection-1FL2' item. Specify the desired power by inputting the target value into the 'Rated power' filter, or consider using alternative filters for customization. Scroll through the available motors using the scroll bar until you find the desired one, and then proceed with the selection.

Figure 2.5: Siemens servo drive speed control - Selecting the desired motor
Figure 2.5: Siemens servo drive speed control - Selecting the desired motor

Click on the PROFINET Interface of the servo drive. Then, under the 'General' tab of the Inspector window, navigate through the 'Advanced options' to find and select the 'Isochronous mode.' Finally, uncheck the selection for 'Isochronous mode'.

Figure 2.6: Siemens servo drive speed control - Disabling the isochronous mode
Figure 2.6: Siemens servo drive speed control - Disabling the isochronous mode

Trigger the quick startup wizard by double-clicking on 'Guided quick startup,' granting you immediate access to an intelligently designed interface that will systematically guide you through each stage of the quick startup procedure. By assigning the responsibility of motion control from the PLC to the drive, you can activate the desired motion control functionality.

Figure 2.7: Siemens servo drive speed control - Accessing guided quick startup
Figure 2.7: Siemens servo drive speed control - Accessing guided quick startup

Choose the 'Speed control' option. This way, you can customize limits, telegrams, and I/O configurations to perfectly align with the application's specific requirements and operational parameters.

Figure 2.8: Siemens servo drive speed control - Selecting speed control application
Figure 2.8: Siemens servo drive speed control - Selecting speed control application

If you wish to download the offline configuration onto the servo drive, click the 'Perform a download' button under the 'Summary' tab.

Figure 2.9: Siemens servo drive speed control - Downloading offline configuration to the drive
Figure 2.9: Siemens servo drive speed control - Downloading offline configuration to the drive

By double-clicking on 'Devices and networks' in the project tree, its window will appear. After that, transition to the 'Network view' and proceed with configuring the connection between the PLC and S200 PN drive.

Figure 2.10: Siemens servo drive speed control - Configuring the network connection between PLC and drive
Figure 2.10: Siemens servo drive speed control - Configuring the network connection between PLC and drive

Servo Drive Speed Control: PLC Logic

The main focus of this section is to provide a comprehensive guide on programming the logic of the PLC, ensuring users can effectively carry out the task.

Locate the Main OB1 (organization block) and open it to gain access. Once inside, you can select and move the SinaSpeed function block from the SINAMICS folder under the 'Optional packages' item within the 'Instructions' task card and place it into the designated area of OB1. After the 'Call options' window appears, left-click over the OK button to ensure that the background data block is incorporated into the project automatically.

Figure 3.1: Siemens servo drive speed control - Constructing the PLC logic
Figure 3.1: Siemens servo drive speed control - Constructing the PLC logic

Double-click on the 'Add new block' under the PLC 'Program blocks' folder in the project tree, select the 'Data block' tab, give it a desired name, choose global as your data block type, and press the 'OK' button.

Figure 3.2: Siemens servo drive speed control - Creating the desired global data block
Figure 3.2: Siemens servo drive speed control - Creating the desired global data block

Establish the variables within the global data block that has been created. Following that, make the necessary modifications to the PLC logic to meet the desired requirements. After completing the compilation of the project, proceed to transfer and download it into the CPU of the PLC for operational deployment.

Figure 3.3: Siemens servo drive speed control - Establishing variables for global data block and finalizing PLC logic
Figure 3.3: Siemens servo drive speed control - Establishing variables for global data block and finalizing PLC logic

Servo Drive Speed Control: Execution

Within this section, you will gain an understanding of the procedures involved in operating the PLC logic.

By pressing the eyeglasses icon, you can access a dedicated monitoring interface that provides real-time information and insights on OB1. By adjusting the speed setpoint to the desired value and enabling the axis, the drive will be activated, initiating the rotation of the motor.

Figure 4.1: Siemens servo drive speed control - Adjusting speed setpoint and enabling the axis
Figure 4.1: Siemens servo drive speed control - Adjusting speed setpoint and enabling the axis

By adjusting the speed setpoint to a negative value, you can change the direction of rotation for the motor, thereby altering its rotational behavior.

Figure 4.2: Siemens servo drive speed control - Changing the direction of motor rotation
Figure 4.2: Siemens servo drive speed control - Changing the direction of motor rotation

By deactivating the axis, you will halt the rotation of the motor, causing the status of the 'AxisEnabled' to switch to FALSE, reflecting its deactivated state.

Figure 4.3: Siemens servo drive speed control - Halting motor rotation
Figure 4.3: Siemens servo drive speed control - Halting motor rotation

Servo Drive Position Control: Hardware Setup

Creating a project and incorporating the desired PLC, servo drive, and motor in the TIA Portal follows a similar approach to what you have previously learned in the section on speed control of servo drive.

Initiate the quick startup wizard by double-clicking on the 'Guided quick startup' feature. This action grants you access to a user-friendly interface that guides you through the necessary steps. One of these steps involves assigning the motion control functionality from the servo drive to the designated PLC. Furthermore, you can tailor the telegrams, I/O configuration, and limits to align with the specific requirements of your application.

Figure 5.1: Siemens servo drive position control - Assigning motion control to PLC
Figure 5.1: Siemens servo drive position control - Assigning motion control to PLC

For the offline configuration to be downloaded onto the servo drive, it is vital to left-click over the 'Perform a download' button found under the 'Summary' tab. This step is crucial to complete the process successfully.

Figure 5.2: Siemens servo drive position control - Downloading offline configuration to the drive
Figure 5.2: Siemens servo drive position control - Downloading offline configuration to the drive

Locate the 'Devices & networks' item on the left pane and double-click to open it. Once opened, transition to the 'Network view' and continue by configuring the connection between the S200 servo drive and the PLC, establishing a solid and reliable connection.

Figure 5.3: Siemens servo drive position control - Configuring the network connection between PLC and drive
Figure 5.3: Siemens servo drive position control - Configuring the network connection between PLC and drive

Transition to the 'Topology view' to begin the configuration procedure for the topology connection between the S200 servo drive and the PLC, enabling efficient network communication between the two components.

Figure 5.4: Siemens servo drive position control - Configuring the topology connection between PLC and drive
Figure 5.4: Siemens servo drive position control - Configuring the topology connection between PLC and drive

Move to the 'Network view' and locate the Profinet interface associated with the PLC. Proceed by choosing the 'Properties' in the Inspector window, followed by the 'Real-time settings' under the 'Advanced options' within the 'General' tab. In the settings, configure the 'Synchronization role' to 'Sync master' and ensure the 'Send clock' is set to 1 millisecond.

Figure 5.5: Siemens servo drive position control - Configuring synchronization and IO communication
Figure 5.5: Siemens servo drive position control - Configuring synchronization and IO communication

Servo Drive Position Control: PLC Logic

The main objective of this tutorial section is to familiarize you with the process of programming the logic in the PLC.

Locate the 'Add new object' under the 'Technology objects' folder within the 'PLC_1' in the project tree and then initiate a double-click to open it. Once opened, navigate to the 'Motion Control' category and opt for 'TO_PositioningAxis.' Proceed by modifying the name of this technology object, and finalize the process by clicking OK.

Figure 6.1: Siemens servo drive position control - Creating technology object for positioning
Figure 6.1: Siemens servo drive position control - Creating technology object for positioning

Upon opening the 'PositioningAxis' window, set the fundamental parameters to correspond with the specific requirements of the application being worked on.

Figure 6.2: Siemens servo drive position control - Configuring fundamental parameters
Figure 6.2: Siemens servo drive position control - Configuring fundamental parameters

Locate and click on the 'Drive' item, then proceed by clicking the ellipsis (...) button to reveal additional options. Among the available choices, under the 'Profinet IO-System' folder, choose your desired drive. Once that is done, opt for the target device and confirm the selection by clicking the green check mark.

Figure 6.3: Siemens servo drive position control - Selecting the desired drive for applying technology object to it
Figure 6.3: Siemens servo drive position control - Selecting the desired drive for applying technology object to it

Within the 'Extended parameters' section, fine-tune the extended parameters to best fit the requirements of the current application scenario.

Figure 6.4: Siemens servo drive position control - Configuring extended parameters
Figure 6.4: Siemens servo drive position control - Configuring extended parameters

Locate the 'Main [OB1]' under the 'Program blocks' folder within 'PLC_1', and perform a double click to open it. Make modifications to the PLC logic to incorporate the necessary changes based on Figure 6.5. For this purpose, you can use programming blocks under the 'Motion Control' folder within the 'Technology' option on the 'Instruction' pane. Initiate the project compilation and subsequently transfer it to the PLC via downloading.

Figure 6.5: Siemens servo drive position control - Finalizing PLC logic
Figure 6.5: Siemens servo drive position control - Finalizing PLC logic

Servo Drive Position Control: Execution

Generate a comprehensive 'Watch and force table' that allows concurrent monitoring of the created watch table and organization block, facilitating simultaneous observation and manipulation of data and program execution.

Figure 7.1: Siemens servo drive position control - Creating the desired watch and force table
Figure 7.1: Siemens servo drive position control - Creating the desired watch and force table

By utilizing the 'Enable' command present in MC_POWER, you can activate the axis, which subsequently causes the 'Status' of MC_POWER to be set to True.

Figure 7.2: Siemens servo drive position control - Enabling the status of MC_Power
Figure 7.2: Siemens servo drive position control - Enabling the status of MC_Power

After enabling the drive, a positional reading of 6.14 is obtained in the context of this application, but it is worth noting that this value can vary in other applications.

Figure 7.3: Siemens servo drive position control -  Measuring the drive’s actual position
Figure 7.3: Siemens servo drive position control -  Measuring the drive’s actual position

Initiate the execution of relative positioning, and once the position is completed, the resulting actual position is measured to be 106.14.

Figure 7.4: Siemens servo drive position control -  Enabling relative positioning and measuring the drive's actual position
Figure 7.4: Siemens servo drive position control -  Enabling relative positioning and measuring the drive's actual position

Initiate the execution of the homing process, and once the homing procedure concludes, the current position is measured to be 0.0.

Figure 7.5: Siemens servo drive position control - Enabling the homing process and measuring the drive’s actual position
Figure 7.5: Siemens servo drive position control - Enabling the homing process and measuring the drive’s actual position

Initiate the execution of absolute positioning, and once the positioning task is completed, the resulting actual position is measured to be 100.0. The execution of absolute positioning is exclusively possible when the axis has achieved the homed status.

Figure 7.6: Siemens servo drive position control - Enabling absolute positioning and measuring the drive’s actual position
Figure 7.6: Siemens servo drive position control - Enabling absolute positioning and measuring the drive’s actual position

Conclusion

In conclusion, you learned how to control the speed and position of the Siemens S200 PN servo drive system using SIMATIC S7-1500 PLC hardware and TIA Portal software. These features empower automation engineers with the essential capabilities of precise position and speed control, enabling them to achieve exceptional motion control and elevate their industrial automation operations.