During my career I have noticed that the knowledge of best practises is lacking when designing, building and commissioning Profinet systems and network.
Having properly designed and configured Profinet builds the foundation for rugged and reliable automation system, that is free of errors and easier to monitor and maintain.
In this article I concentrate on the communication side Class A or B of Profinet realtime time (RT), meaning communication that is typically varying between 1-200ms cycle times between the controller and clients.
”Three strikes and you are out”
By the default Profinet allows two packet losses. If a third packet loss occurs then that client is flagged as lost and alarm is raised. In a case lost safety related client communication the system enters to safemode which usually is the emergency stop procedure.
Keeping the latency as low as possible there should be as few devices in a ring or line topology as possible. Usually automation engineering tools don’t calculate topology in cycle time calculations, only number of devices or clients.
If the lines or number of Profinet clients get too high it will result to too big latency and manifests as sporadic and random packet losses.
Designing the layout
As Profinet is based on Ethernet standard 802.3, the use cases vary a lot. In process control systems (DCS) Profinet can be distributed over very wide areas or just locally inside a small cabinet.
When Profinet is extended over multiple cabinets that are located in different areas, we must take into account electromagnetic interference, EMI. Using CAT5e or higher class shielded and twisted CAT cables is the minimum requirement, but in addition you must have common zero ground running along the cables and cabinets. Grounding and cable strain relief must be used when ethernet leaves or enters a cabinet. In case of improper grounding you are creating antennas that will suck in all king of energy from the environment.
My recommendation is to use optical cables between the cabinets.
Network topology
The main thing that you must consider about Profinet is the latency that each device creates when a communication frame or packet passes over it. If the latency gets too high then the packets will miss their communication window and the CPU counts the frame as lost.
The number of jumps a packet has to make in order to reach its destination is called line depth. To keep the line depth and latency as low as possible, there should be as few devices in a ring or line topology as possible. Prefer to use start topology when possible.
Having a switch with optical ports for in and out going communication and necessary number of ports for cabinet internal devices.
Segregation and segmentation
Profinet controller has a dedicated interfaces for Profinet subnets or domains. In theory and in some cases you need to have multiple Profinet controllers in the same medium (if I recall right the maximum number was 4), how ever this is not best practise.
By default in engineering tool all controllers, clients, Profinet domains will get the same names, same address spaces and IPs, if they aren’t configured in the same project.
Using VLAN based segmentation between Profinet subnets is not approved, but in some cases its doable.
Cleanest and optimal is to keep Profinets in dedicated networks. Profinet communication between other Profinet domains should be made with Profinet couplers or via dedicated networks.
Queues and priorities
Each Profinet device with more than two ports is and act like a switch. Profinet has also dedicated ethernet switches that are configured by default to prioritize Profinet frames.
Profinet frames priority is flagged with a code in the ethernet frame called virtual LAN tag (VLAN ID 0) and priority (PRIO 6). A Profinet/VLAN tag aware switch reads this tag and priority and puts it in a queue. The con here is that if the switch is not Profinet aware then it discards the VLAN tag and priority and then the Profinet frame has lost it’s advantage towards other frames.
If a switch gets has two Profinet frames coming in, in different VLANs they are then treated as equal. It is then depending on the switch processor how fast it performs to clear the packets from the queues.
Optimize
Rule of thum is to configure your Profinet cycles to work as slow as possible. Slowesst possible cycle time can be determined based on your failsafe, positioning, measuring time intervals.
If you have wireless communication involved, start with 128ms or higher cycle times with those clients that are behind the wireless link.
If you have a redundant topology (ring), test and tune profinet cycles by disconnecting and reconnecting the ring. If devices are lost the you can try to slower cycle times. If you need bumpless redundancy in Profinet check RNA and MRPD redundancies.
Use profinet analyzers or wireshark with packet tracing to analyze number of lost packets. The target is zero losses.
Summary
As a rule of thum, remember to check these when designing Profinet networks.
- EMI, optical cables between the cabinets.
- Line Depth, keep number of jumps as low as possible (calculate all ways with worst case).
- Configure your application to as slow io cycles as possible.
- Don’t mix Profinet domains, use hardware segregation and segmentation.
- Don’t send profinet packets over non profinet aware networks, (unless you know what you are doing).
- Wireless is slow.
Useful links:
