Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
SINAMICS G120 - Runtime
Description: This tutorial teaches you how to run PROFINET communication and check the resultsKeywords: SIEMENS, CP1616, SINAMICS, PROFINET, Runtime
Tutorial Level: INTERMEDIATE
This tutorial teaches you how to run IO Controller wrapper in comination with User Node from previous tutorial, monitor and check the results. We recommend using additional computer connected to LAN Port 4 of CP1616 for easier monitoring and testing of PROFINET communication.
Run the launch file
If you have completed all configuration steps as described in previous tutorials, it is time run existing launch file:
roslaunch siemens_cp1616_sinamics_g120_tutorial siemens_cp1616_sinamics_g120_tutorial.launch
If initialzation succeded, you should notice red error indicators on CP1616 turn off, SINAMICS G120 Control unit LEDs turn to green and get the following terminal output:
[ INFO] [1448395943.558537814]: CP1616: Number of input modules: 1 [ INFO] [1448395943.558698665]: CP1616: Number of output modules: 1 [ INFO] [1448395946.113137768]: Input Data Array: [Total size: 4 bytes] [ INFO] [1448395946.113278175]: I256-259 drive_1_input_topic [4 bytes] [ INFO] [1448395948.893607940]: Output Data Array: [Total size: 4 byte] [ INFO] [1448395948.893726481]: Q256-259 drive_1_output_topic [4 bytes] [ INFO] [1448395948.934291048]: Openning CP1616 in IO_controller mode: done [ INFO] [1448395948.936821033]: IO_controller mode change request-> OPERATE: [ INFO] [1448395948.945518079]: Changing IO_controller mode: done
NOTE: If initialization fails and return errors, please check if yaml config file meets the hardware configuration (addresses, sizes). If errors still occur, please refer to original siemens cp1616 documentation.
Check CP1616 Webserver
If you have configured webserver in HW config, you can connect to CP1616 LAN Port and monitor CP state through Webserver interface. If initialization succedded, CP1616 should report "OPERATE".
Monitor topics
First use rostopic list command line tool to get the list of all active topics:
rostopic list
For this tutorial example, rostopic should return:
/drive_1_input_topic /drive_1_output_topic /rosout /rosout_agg
With default configuration, CP buffers are updated and synchronized with data on topics every 10ms. Using rostopic echo command line tool check if "drive_1_input_topic" is updated regularly.
average rate: 99.983 min: 0.009s max: 0.010s std dev: 0.00042s window: 99 average rate: 99.999 min: 0.009s max: 0.010s std dev: 0.00043s window: 199 average rate: 99.996 min: 0.009s max: 0.010s std dev: 0.00043s window: 299
NOTE: Tutorial node publishes data every 5 seconds, but the synchronization with CP buffers still happens every 10ms.
TIA Portal Diagnostics
Using additional Windows computer allows you to monitor PROFINET communication while running CP1616 application on the Linux machine. To monitor data being recieved by SINAMICS G120 drive unit online, use TIA Portal -> Parameters -> Communication -> Functional View:
You can see that data (STW1, NSOLL_A) generated by our User node are being transmitted to SINAMICS G120 drive properly. Speed setpoint is scaled to SIEMENS notation resulting in goal speed setpoint 500/1000rpm.
You can use Control Panel to monitor actual state of a drive (actual speed, current, voltage, etc):
If everything works properly you should see your drive changing speed from 500rpm to 1000rpm and vice versa in 5 second intervals. This result can be also monitored in more detail by Trace functions. Actual speed value together with torque are shown in diagram below: