0% found this document useful (0 votes)
69 views

PLC Programming Techniques - Part 1

Uploaded by

Rafael Riesgo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

PLC Programming Techniques - Part 1

Uploaded by

Rafael Riesgo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

PLC Programming Techniques 1

PLC Programming 
Techniques   – Part 1

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 1
PLC Programming Techniques 1
Lesson Objectives

• Introduction regarding basic PLC Texts and their


advantages and limitations.
• Take a look at basic hardware configurations for
moving equipment
• Build a simple program covering Automatic and Manual
Modes
• Include ideas for Cycle Start and End of Cycle
• Discuss various Faults, their meaning and possible
application.

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 2
PLC Programming Techniques 1
PLC Texts

• Many pages devoted to introduction to Binary Logic


operations including AND, NAND, NOR and XOR gates
(to name a few).
• Conversion and Binary Logic Simplification exercises
• Boolean Logic to Ladder Conversion

• Although good basic and introduction to Logical Systems,


most of this has very little to do with Programming
Machines or Automation on a Factory Floor.
• Some exercise are still very basic and do little to
explain systematic approaches to controls.

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 3
PLC Programming Techniques 1
Challenge

To discuss system programming, we must start by


defining the system being controlled and make some
assumptions regarding its operation.

Example:
• Simple machine with a cylinder that must advance and
return.
• Could be some events that precede the cylinder motion
• A Process is started once the Cylinder is the Advanced
and held in Position.
• Solenoid type must be defined (see next slide).

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 4
PLC Programming Techniques 1
+ Vdc Auto PB Input Card

• Begin by defining some standard


Manual PB PLC inputs.
• All N.O. for simplicity (although there is
typically a mixture of N.O. and N.C.
Hand/Auto • Could be Physical PB or even inputs from
Reset HMI

Cycle
Start PB For this example, addressing is not necessary
and will not be discussed

Cycle
Stop PB
N.O. = Normally Open
N.C. = Normally Closed
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 5
PLC Programming Techniques 1
Complication Factors not Addressed:

Programming Techniques is a very difficult subject to discuss since


how the program is written will depend heavily on many other
mitigating factors such as:

• Safety Issues related to valves (Estop energy release, moving a


pneumatic cylinder without first being pressurized, need to hold in a
position, speed and response of mechanical systems etc.).
• Pneumatic versus Hydraulic
• Single Sided Spring Return
• Double Sided - Detent versus Spring Return
• 3 Position versus 2 Position
• 3 Position Center Blocked
• 3 Position Center Vented or Return to Tank

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 6
PLC Programming Techniques 1
+ Vdc
Input Card
Adv’d LS
• Outputs move a pneumatic cylinder
to an Advanced Position and then
Return it (Home) again.
Ret’d LS • Double sided, electrically held, spring return
to center.
• Center position vents all energy but could
also be blocked if necessary.

Output Card Adv. Sol. 0 Vdc

Supply Advance

Ret. Sol.

Exhaust
Return

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 7
PLC Programming Techniques 1

Machine at Communication Permission


‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
I/O Power Home Interlock Okay To Start Cycle
‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐‐

• A typical machine, system or process will have conditions that are required
for starting of the cycle.
• Permissions are particular to each machine, system or process with a few
suggestions noted here.
• The next few slides show some samples of simple machine programming.
• For these examples, Latches --- (L) --- will not be used. Seals, it can be
argued, are a better choice.

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 8
PLC Programming Techniques 1
Auto Mode Manual Hand / Auto * Cat 0 Auto

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

Auto P.B. Conditions Mode Reset Fault Mode


‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Auto
Mode
‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

Auto Hand / Auto Manual


Manual P.B. Mode Reset Mode
‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Manual
Mode
‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
• Mode selection is best handled by Sealing Circuits and a Reset that
is required to switch Modes.
• There may be some additional conditions for Auto. Typically less
conditions for Manual Mode.
*Cat 0 Fault:  See last slide
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 9
PLC Programming Techniques 1
Auto Cycle Permission Machine Cycle Cat 0 In
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

Mode Start P.B. to Cycle Start Complete Fault Cycle

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
In End of Cycle
Cycle Request
‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐

End of Cycle In End of Cycle
Request P.B. Cycle Request
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

* Cat 2
Fault • Once in Auto Mode, a cycle can be initiated.
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐ • Stop at the End of a Complete Cycle.
End of Cycle -- OR --
Request • End of Cycle Request allows continuous
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐ operation or stop once current cycle is complete.

*Cat 2 Fault:  See last slide
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 10
PLC Programming Techniques 1
Auto Return Advance
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

Step F Mode Cylinder Cylinder

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Advance
Complete
‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐
Manual Advance Return
Mode Cyl P.B. Cyl P.B.
‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐
Advanced Stabilization  Advance
Limit Sw. Timer Complete
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ TON ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐
0.200s

• In Automatic Mode the cylinder advances when Step 7 Activates.


• In this example Step 7 contains the necessary permissions to Advance.
• A 200ms debounce or stabilization time is used.

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 11
PLC Programming Techniques 1

Auto Advance Return Start

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

Cycle Complete Cylinder Process


‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Start
Process
‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐

• Advance Complete is not mode dependent so Auto Cycle is required for the
Process to Start.
• Start Process is used to seal around Advance Complete.
• Seal may not be required but if the Advance Proximity “flickers” due to the
Process (ie: Press moving the part slightly), the Operation will not be interrupted.
• Fault logic should hand abnormal conditions.

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 12
PLC Programming Techniques 1
Process Auto Return Return
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

Complete Mode Complete Cylinder

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Return
Cylinder
‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐
Manual Return Advance
Mode Cyl P.B. Cyl P.B.
‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐
Returned Stabilization  Return
Limit Sw. Timer Complete
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ TON ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐
0.200s

• In Automatic Mode the Cylinder returns after the Process is complete.


• A 200ms debounce or stabilization time is used to ensure the cylinder
has Returned Completely.
• The Return Seal is broken once Stabilization is complete.

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 13
PLC Programming Techniques 1
Stabilization 
Returned Advanced Return
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Timer
Limit Sw. Limit Sw. Complete
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐
TON
‐ 0.200s

• Resist the temptation to add additional conditions.


• Use fault logic to detect and act on anomalies.
• If, in this case, the Advance Switch were to stick Closed, the program
would now fail to detect that the Cylinder has Returned possibly creating
erroneous fault states and limit recovery options

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 14
PLC Programming Techniques 1
Returned Advanced Switch

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

Limit Sw. Limit Sw. Fault


‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Switch Fault
Fault Reset
‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐
Advance Advanced Motion 
Timeout
Cylinder Limit Sw. Fault
‐‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ TON ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Motion Fault 10.0s
Fault Reset
‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐

• Fault logic can be tricky without a clearly defined fault detection strategy.
For example, will the machine execute an Immediate or End of Cycle Stop?
• It is a good practice to hold Fault Bits on until Explicitly Reset to aid in
Diagnosing the Root Cause.
• Note that resetting may seem to clear a motion fault but then see a
reoccurrence at the next cycle.

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 15
PLC Programming Techniques 1
Switch General

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

Fault Reset Fault


‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐

‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Motion 
Fault
‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
General Acknowledge 
Fault Oneshot or Silence Alarm
‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(    )‐‐‐‐‐‐‐

Alarm ‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐[   ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
• Some simple logic to trigger a Fault Bit and also an Alarm Bit for Annunciation.
• In this example, Alarms can be Acknowledged or Silenced; however, if a Fault
still exists when the Reset Button is Pressed, the Alarm Annunciation will be
re-triggered.
• Depending on the number of expected faults, this method might not be
optimal.

1Feb2020 ELNC9203 – PLC & HMI II 16


PLC Programming Techniques 1
Category Definitions

Cat 0: Stopping by immediate removal of power to the machine


actuators (i.e., an uncontrolled stop). Traditional E-stop.

Cat 1: A controlled stop with power available to the machine actuators


to achieve the stop and then removal of power when the stop is
achieved.

Cat 2: A controlled stop with power left available to the machine


actuators. Traditional End of Cycle Stop

Wording varies depending on the specification


(IEC 60204-1, NFPA 79, CSA C22.2 No. 301)

1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 17

You might also like