Navigation

  • Page 1

    Open House March 26, 10-2, in Bell Hall Suitable Presentation = B Which groups?

  • Page 2

    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.

  • Page 3

    Programmable Logic Controllers A Concise Exploration

  • Page 4

    Industrial Automation • Common knowledge: computers are used in factories... • Robotic arm, CNC, injection molding

  • Page 5

    Industrial Automation • Donut machine, Ice cream sandwich machines

  • Page 6

    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...

  • Page 7

    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...

  • Page 8

    History • Machines become autonomous. • Common method: relay logic

  • Page 9

    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

  • Page 10

    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

  • Page 11

    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

  • Page 12

    Ladder Logic • Simple “always on” load: [Always_On = 1] note: sometimes illegal • Boring... Load controlled by a single contact: [Switch_Con = Switch]

  • Page 13

    Ladder Logic • Boolean logic - C = A and B • C = A or B

  • Page 14

    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

  • Page 15

    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)]

  • Page 16

    Ladder Logic • Converting between ladder logic and physical electronics is straight forward. • So this…

  • Page 17

    Ladder Logic • …becomes this:

  • Page 18

    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...

  • Page 19

    Industrial Installation CPU Optical Isolation Wiring to Sensors and Machinary

  • Page 20

    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...

  • Page 21

    PLC • Hello World on the PLC. Real hardware: • In ladder logic:

  • Page 22

    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...

  • Page 23

    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

  • Page 24

    PLC • A bit more convoluted: toggling Hello World with a single button. • Remember - Switch state: ON OFF ON OFF • Figure it out

  • Page 25

    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)

  • Page 26

    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

  • Page 27

    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.

  • Page 28

    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

  • Page 29

    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.

  • Page 30

    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

  • Page 31

  • Page 32

    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

  • Page 33

    Add a start switch Use a Latch Enable counter with Latch Add ~Reset to Latch Circuit

  • Page 34

  • Page 35

    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

  • Page 36

    - 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...

  • Page 37

    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

  • Page 38

  • Page 39

    Special Bits Use with Counters named “SeqN” Unchangeable SWITCH (always ON)

  • Page 40

    Special FUNCTION Inputs

  • Page 41

    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...

x