Open House March 26, 10-2, in Bell Hall Suitable Presentation = B Which groups?
No Homework • If you feel that you need extra credit, you can do the Washing Machine/PLC homework. Otherwise, I don’t want to impede progress on the project. • Schedule your Design Reviews – MWF at 10 or at 2.
Programmable Logic Controllers A Concise Exploration
Industrial Automation • Common knowledge: computers are used in factories... • Robotic arm, CNC, injection molding
Industrial Automation • Donut machine, Ice cream sandwich machines
Industrial Automation • Not common knowledge: today this is usually accomplished with Programmable Logic Controllers (PLCs) • PLCs are the answer to a variety of needs: durability, reliability, flexibility, scalability, reprogrammability, etc...
Industrial Automation • Why should you care? Because you will run into PLCs... • Median starting salary for entry-level “Electrical Controls Engineer” is $57,452. (EE is $55K, HW Eng is $48K, SW Eng is $53K) [monster.com] • As long as there is industry, it will be computer controlled a...
History • Machines become autonomous. • Common method: relay logic
Relay Logic • Conditional logic can be represented in terms of contacts and coils. • Contact: A simple input switch. • Coil: An output load, e.g., a relay or motor. • Symbolic representation called ladder logic. current
Relay Logic • To clarify: “Ladder Logic” is a notation originally used to describe & document relay logic configurations. • Later became the basis for PLC programming languages
Ladder Logic • Power supply rails drawn as parallel vertical lines on left and right • Connection of rails implies current will flow • An output is “on” when a connection is completed and current flows through the load’s coil
Ladder Logic • Simple “always on” load: [Always_On = 1] note: sometimes illegal • Boring... Load controlled by a single contact: [Switch_Con = Switch]
Ladder Logic • Boolean logic - C = A and B • C = A or B
Ladder Logic • C = not A • A contact with a slash through it is “normally closed.” This indicates a connection when A is NOT triggered. • So when sensor/input A is activated, there is an open circuit
Ladder Logic • Each rung of the ladder is a statement that is asynchronous when implemented in relay logic, but evaluated sequentially by the PLC. • X = (A or B) and (C or D), Y = ~A and [B or (C and D)]
Ladder Logic • Converting between ladder logic and physical electronics is straight forward. • So this…
Ladder Logic • …becomes this:
PLC • The first PLC was invented by Dick Morely in 1978. • Morely designed a computer with three components: a processor, memory, and a logic solver. • “[The logic solver] allowed us to get the speed we needed in this application-specific computer to solve the perceptually simple problem...
Industrial Installation CPU Optical Isolation Wiring to Sensors and Machinary
PLC • The first PLC (the 084) was extremely durable and reliable... • “We used to test the programmable controllers with a Tesla coil that struck a quarter inch to half-inch arch anywhere on the system, and the programmable controller still had to continue to run.” –Morely • FYI, thi...
PLC • Hello World on the PLC. Real hardware: • In ladder logic:
PLC • Not very interesting… how about a “stay-on” variation? (When the switch is released, the light stays on) • PLC benefit: The state of an “output” in one rung may be used as a “contact” in another. • In fact, there are “internal utility relays” – virtual outputs tha...
PLC • Latched (“stay-on”) Hello World: • When the switch is pressed, “Neon” will be active in the first evaluation. • In subsequent evaluations, “Neon” will force itself to stay on. • NOTE: OUTPUTS CAN ALSO BE INPUTS
PLC • A bit more convoluted: toggling Hello World with a single button. • Remember - Switch state: ON OFF ON OFF • Figure it out
S 1 0 1 0 Sinv 0 1 0 1 L 1 1 0 0 N 0 1 1 0 Ninv 1 0 0 1 input: Latch = (Switch AND notNeon) OR (Latch AND notSwitch) Neon = (Latch AND notSwitch) OR (Neon AND Switch)
The logic SW 1 0 1 0 SWInv 0 1 0 1 Neon 0 1 1 0 NeonInv 1 0 0 1 Latch 1 1 0 0 A 1 0 0 0 B 0 1 0 0 C 0 0 1 0 A = SW and NeonInv B = SWInv and Latch C = SW and Neon Latch = A or B Neon = B or C
PLC • PLCs also support a range of special functions: timers, counters, sequencers, memory instructions, etc… • Beyond the basics, they are non-standard and manufacturer-specific.
Timers and Counters •Timer: When enabled it counts down, then enables a rung when it reaches zero •Counter: counts down when pulsed, then enables a rung when it reaches zero
Exercises • Turn 8 LEDs on and off in sequence, repeat. • 1 minute Egg Timer. • Turn a pump on for 60 seconds, then off for 40 seconds, then repeat. Use a switch to start it off.
LEDs: Using a sequencer • Define a Counter output – call it Seq1 • Give it a set value 1 greater than your desired sequences: – e.g. if 4, then 0 thru 4 = a set value of 5 • Use special bits as inputs • Use Seq1:0 to reset the sequencer by defining an output FUNC
Egg Timer IO Table - Inputs: 1/s Clock Outputs: EggDone Counters: Count down from 60 Steps: 1/sec used to trigger counter 60 times When counter at 0, energize EggDone Problem: Use a switch to reset counter Problem: Add a Start Switch
Add a start switch Use a Latch Enable counter with Latch Add ~Reset to Latch Circuit
60 sec ON/ 40 sec OFF Inputs: None Outputs: None Timers: 60 sec, 40 sec. Steps - Count down the 60 sec Timer ONLY WHEN the 40 sec Timer is OFF Count down the 40 sec Timer ONLY WHEN the 60 sec Timer is ON
- A Timer is ON when it is at zero, not when it is counting. - A Timer counts when it is being energized by its circuit. - A Timer is RESET when its circuit is shut off. This is important State1: at startup, Timer40 is OFF so Timer60 starts counting. State2: Timer60 is counting, so Timer60 is OFF...
Extend the problem • Add a pump, on for 40, off for 60 – The pump should be on when Timer40 is counting – Timer40 counts when Timer60 is at zero – Add the pump output with Timer60 Input • Add a Start Switch – Just put a Latch everywhere
Special Bits Use with Counters named “SeqN” Unchangeable SWITCH (always ON)
Special FUNCTION Inputs
Special Bits Normally ON Flag - Norm.ON • You can make use of this flag if you need to keep something permanently ON regardless of any input conditions. This is because a coil or a special function is not allowed to connect directly to the power line (the vertical line on the left end of the la...