Develop organized PLC program to help control and troubleshooting
A PLC program dictates the working of an automated system. Every motion in the cell is controlled by specific section of the PLC program. It is important to structure the PLC program in such a way that it reduces troubleshooting time and easy to manage.
"Unstructured programming to control actuators will not cause an issue in troubleshooting when there are three actuators. It will create a nightmare when there are several hundreds"
Engineers have perfected a reliable structure for an actuator motion in a PLC program. It is commonly known as "5-Rung Programming Structure". There are 5 steps in the program, hence the name.
Precondition
Safe Condition
Command
Complete
Fault
A typical actuator program structured in 5-Rung structure is shown below.
Before we discuss the steps, the following assumptions are made
Auto_Mode: Automatic mode of the machine or respective station.
Manual_Mode: Manual mode of the machine or respective station. It is associated with a push button 'Manual_PB' to trigger manual motion from the HMI.
Feedback_Sensor: The sensor feedback that turns on when the actuator is in position. There could be multiple sensors to indicate extended and retracted position.
Precondition
When the machine/station is in auto mode, this section defines when to start the motion. All conditions to start the motion is added on this rung. If there are multiple conditions, add all those in parallel.
Safe Condition
It is important to make sure the actuator motion is safe to execute. All safety conditions are added in this section. This includes, any robot clear signals, E-Stop and safety gates signals. In position signals of other actuators are also added in this section to prevent possible collision between actuators.
Command
Command signal is generated using the combination of auto mode and precondition or manual mode and manual push button. Safety condition is also checked before turning on the command signal. This is the signal going to the peripheral device to start the motion. It could be a pneumatic valve or hydraulic valve or even an electronic actuator.
Complete
Once the motion starts, the program will be waiting for a feedback signal for motion complete. In case of a cylinder, there will be magnetic reed switches or limit switches on both ends of the stroke. This generate extended or retracted signals. These are called in-position signals. This signal is important to make sure the motion actually happened and the complete signal is turned on which indicate motion is complete.
Fault
A fault signal is generated when the command is generated and the logic is waiting for the complete signal for a set period of time. This waiting time depends on the size and speed of motion. Usually, a four seconds timer is used in pneumatic actuators. It can take longer to complete a motion in case of turn table or roll up door.
Fault messages are important when it comes to trouble shooting. An actuator will have minimum two fault messages predefined in the logic. It is up to the programmer to add more fault messages such as both as signal on at the same time or extended signal turned on for a retracted motion command.
Following a well structured programming style will help integration troubleshooting and maintenance of a system. It is important to add enough fault messages on the HMI to help the technician to identify the root cause of the problem within seconds. This will help reduce down time and improve machine efficiency.
Thank you for sharing the concept. It makes a lot of sense now when I look at the PLC program.