Download PLC Programming: Understanding Combinatorial and Sequential Logic in Factory Automation and more Study notes Systems Engineering in PDF only on Docsity!
MFS605/EE Systems for Factory Information and Control
Lecture 10 – PLC programming (cont.) Fall 2005
Larry Holloway Dept. of Electrical Engineering and Center for Robotics and Manufacturing Systems
PLC Review
- Standard Symbols
- Normally Open relay:
- Normally Closed relay:
- Simple Logic:
– AND
– OR
– NOT
PLC Programming
- Simple Combinatorial Logic
- State logic -- latching
- Sequential logic
Simple Combinatorial Logic
- Key steps:
- Identify inputs and outputs
- For each output, determine expression for what makes it true
- Construct ladder logic to reflect expression
Example
Tank System:
- S1 is turned on whenever level is below LLS switch (LLS=0)
- S1 is turned off when level above ULS switch (ULS =1)
Example
- Motor Control
- Turn on motor when On-switch is pressed
- Turn off motor when Off-switch is pressed, or when temperature sensor is high.
Demorgan’s Laws
- Demorgan’s laws are useful for negating an expression:
( A B ) A B
A B A B
- To describe a reset which is a negated expression, we can either apply Demorgan’s laws or we can create a new rung to create an intermediate signal.
Sequential Logic -- Cascade method
- Sequential Logic has steps.
- The functions that drive the outputs differ depending upon which step is being done
- Use extra state variables to represent which step is active
- Draw state diagram representing steps, indicating what causes changes in the states
- Establish “latching” rung for each step
- Define Output rungs that depend on the steps
- Initialization rung may be required
Example problem….
- Problem… what if temperature sensor is high and start switch is on?
Cascade Method: revisit of tank method
Tank System:
- Two states: filling and not filling
- Start filling whenever level is below LLS switch (LLS=0)
- Go to “not filling” state when level above ULS switch (ULS =1)
Sequential Logic -- Example
- An industrial oven has four states, Off, Preheat, Superheat, and CoolDown. The oven starts in the Off state. If start is pushed,
- then it enters the Preheat state and turns the heater on. It remains in the preheat state until the temperature sensor T1 becomes true, at which time it then enters the Superheat state. In this state, it continues to heat, but locks the oven door. Once temperature sensor T2 becomes true, then it moves to state CoolDown, where the heater turns off. The door remains locked, until the sensor T1 becomes false, at which point the OFF state is entered and the door is unlocked.
- There is a stop switch also, but it only works during the preheat state, and returns the system to off.
Industrial Oven -- state diagram
Cascade method critique
Cascade method:
- Advantages:
- States are explicit – helps in debugging and maintenance.
- Helpful when we have states without unique outputs. (example: supersuperheat).
- Methodical and relatively simple.
- Disadvantages:
- Program is larger than necessary in some cases
- Extra state variables are bits in memory which may be limited resource.
- May depend on operation method of PLC and sequence of rungs (depends on PLC mfg.) - (if updates states while running program, then could “lose” state.)
More advanced structures
- Concurrent parallel paths:
Built-in Sequencer Functions
Timers
Example in SLC500 (Allen-Bradley/Rockwell)
- Timer begins timing when rung goes true
- Timer always reset whenever timer times out
- Counts (using accum) to preset value
- Sets DN when Accum = preset
- Timing in 1 second or 100ths of second
Counters
- Counter similar to timer.
- Increments counter on each false-to-true transition.
Counter example: Wrapper
- Count four products before activating wrapper.
- Ladder Diagrams: Advantages:
- Graphical – easy for simple logic
- Easy for maintenance and diagnosis
- Language understandable by floor personnel ( ~~~~ )
- Ladder Diagrams: Problems:
- Note suited to structured programming
- Poor reuse of logic
- Poor data structuring
- Limited support for complex sequencing
- Limited execution control
- Cumbersome arithmetic
- Efforts to offer better programming options: IEC 61131-
- Standard on programming languages for PLC’s
- IEC = “International Electrotechnical Commision”
- IEC 61131-3:
- Encourages structured programming
- Strong Data Typing
- Execution control
- Sequence control
- Data Structures
- Multiple languages defined