Monday 31 May 2010

PLC Basic

HISTORY
Introduced in late 1960's Bedford associates proposed something called a modular digital controller (modicon) to a US car manufacturer.
The MODICON 084 brought the world's first PLC into Commercial production.
Disadvantages of Relay based logic
o Relays are electromechanical devices and so have a limited life.
o Requires strict adhesion to maintenance schedules.
o The size of a complicated relay based system could be mind boggling.
o Complicated internal wiring of so many individual devices.
o No diagnostics and fault finding very difficult.
o Changes in the logic very cumbersome to implement.
Standards
IEC 1131-3: Merging of PLC programming languages under one international standard.
What's inside the box?
The PLC mainly consists of CPU, memory area, and appropriate circuits to receive input/output data. We can consider it to be a box full of hundreds or thousands of separate relays, counters, timers and data storage.
What does each part do?
Internal Relays:
These are connected to the outside world. They physically exist and receive signals from switches, sensors etc. Typically they are not relays but rather they are solid state transistors.
Counters:
These again do not physically exist. They are simulated counters and they can be programmed to count pulses. Typically these counters can count up, down or both up and down.
Timers:
They also do not physically exist. They come in many varieties and increments. The most common types are on-delay and off- delay. Increments vary from 1ms to 1 second.
Output Relays:
These are connected to the outside world. They physically exist and send on-off signals to solenoids, lights etc. They can be transistors, triacs, or relays depending upon the model chosen.
Data Storage:
Typically there are registers assigned to simply store data. They are usually used as temporary storage for math or data manipulation. They can also be used to store data when power is removed from the PLC.
How does a PLC work?
A PLC works by continually scanning a program. We can think of this scan cycle as consisting of three important steps.


Step 1 - Check Input Status First the PLC checks at each input to determine whether it is on or off. It records this data into its memory to be used during the next step.
Step 2 - Execute Program Next the PLC executes the program one instruction at a time. May be the program said that if the first input was on then it should turn off the first output. Since it already knows which inputs are on-off from the previous step it will be able to decide whether the first output should be turned on based on the state of the first input. It will store the execution results for use later during the next step.
Step 3 - Update Output Status Finally the PLC updates the status of the outputs. It updates the outputs based on which inputs were on during the first step and the results of program execution during the second step.
After the third step the PLC goes back to step one and repeats the steps continuously. One scan time is defined as the time it takes to execute the three steps listed above.
The total response time is defined as:
Total Response Time = I/P response Time + Program execution Time + O/P Response Time
Case Study (Level application)
Purpose: Control of lubricating oil being dispensed from the tank. Instrumentation: 2 sensors (One near the bottom & one near the top), PLC Sensor not immersed in liquid they will be ON. When they are immersed they will be OFF.
Logic: Fill motor to pump lubricating oil into the tank until the high level sensor turns on. At that point we want to turn off the motor. It should start only after level falls below the low level
Sensor: We need three I/O's (Inputs & Outputs), 2 are inputs (the sensors) and 1 is an output (the fill motor). Both the inputs will be normally close (NC). We will give each input and output device an address.


Initially the tank is empty so both the sensors for high and low level are not immersed. So they are ON (True). So input 0000 is true and input 0001 is also true. Gradually the tank fills because fill motor (500) is on. After 100 scans the oil level rises above the low level sensor and it becomes open (False).
Notice that even the low level sensor is false there is still a path of true logic from left to right. This is why we used an internal relay. Relay 1000 is latching the output (500) on. It will stay this way until there is no true logic path from left to right. (ie when 0001 becomes false).
After 1000 scans the oil level rises above the high level sensor as it becomes open (ie false). Since there is no more true logic path, output 500 is no longer energized (true) and therefore the motor turns off. After 1050 scans the oil level falls below the high level sensor and it will become true again.
Notice that even though the high level sensor became true there still is NO continuous true logic path and therefore coil 1000 remains false.
After 2000 scans the oil level falls below the low level sensor and it will also become true again.
Specifications
Specifications for Discrete Modules ( General I/O )
Operating Temperature: 0 0 C to 60 0 C
Storage Temperature: -40 0 C to 85 0 C
Operating Humidity: 5% to 95% (non condensing)
Noise Immunity: NEMA standard ICS 2-230
Vibration (Operating): Displacement: 0.015 in peak at 5 to 57 Hz
Acceleration: 2.5 Gs at 57 to 2000 Hz
Shock (Operating): 30Gs (all modules except relay contact)
Isolation: 1500 V
Agency Certification: UL listed
                               CSA certified
                               CE compliant
Hazardous Area Classification: Class I, Division 2 Hazardous Environment

Specifications for Input Modules
Voltage Category 24 V ac/dc or 125 V dc
Number of Inputs 16
Points per Common 16 / individually isolated
Operating Voltage Ac 10 to 30 V ac
                           Dc: 10 to 30 V dc
Backplane Current Consumption 0.085 A
Signal Delay (max) on = 9 ms, off = 9 ms
Off State Voltage (max) 20.0 V dc
Off State Current (max) 0.8 mA
Nominal Input Current Ac: 8 mA at 24 V ac
                                  Dc: 8 mA at 24 V dc
Inrush Current (max) 0.02 A
Typical wiring Schematics for Analog Input Devices
2 Wire Transmitters


3 Wire Transmitters

4 Wire Transmitters



Start-up Procedures
This, of course, assumes that you have already debugged the program to be certain it is working as you intended it to. If not, it is probably a good time to do so by using a simulator/emulator or perhaps by breaking the program into blocks for piece checking.
  • Verify power is off to the PLC.
  • Open all E-stops so the machine will not run until we want it to.
  • Disconnect output wiring terminals from output modules to
  • Disable the outputs until we are ready for them.
  • Generally you should check and re-check equipment installation to make sure all is well. Are the sensors adjusted? Are all bolts properly torque? Belts are tight? etc.
  • Check to verify that all PLC modules have been inserted into the Base properly.
  • Check that all wires are fully inserted into their proper Connection points.
  • Check to make sure all communication cables are connected. If the PLC requires dip-switches to be set for communications, verify that this has been done.
  • Verify that the proper power is connected to the PLC. Does it require 110VAC or 24VDC or... whatever it is; make sure the connections are proper.
  • Verify the PLC will NOT be powered up in run mode.
  • Power-on PLC.
  • Check CPU LEDs. Are any on? Any error lights on? Power down and correct the fault if necessary and then repeat from the beginning.
  •  Check input module LEDs. Are any on? Should any be?
If all is well, let's power down and move on to checking the inputs!
Input Checking Procedures
  • Verify power is off to the PLC.
  • Open all E-stops so the machine will not run until we want it to.
  • Make sure all outputs are disconnected from the PLC.
  • Verify all body parts are out of the way and don't test the inputs with ANY body parts. Use a safe device (like a test rod) to test them.
  • Power-on PLC.
  • Activate input devices one-by-one and verify the appropriate LED on the input module turns on. If it doesn't, check the devices wiring.
  • If the wiring is ok, verify the device is working and when in doubt, try another input point on that module. If it still doesn't work, try connecting it to another module. If it works now, probably there is a fault with the original module, so replace it and begin again.
  • Continue on until all input devices and module input points have passed the tests. If all is well, let's power down and move on to checking the outputs!
Output Checking Procedures
  • Verify all body parts are out of the way
  • Verify power is off to the PLC.
  • Open all E-stops so the machine will not run until we want it to.
  • Use a simple debug program to test your outputs. Generally we won't use the original program. Create a simple debug rung like this:
Input output
-| |---( )--
Let 'input' be a simple toggle switch connected to an unused input or use an internal relay when available. Output will be the address of actual output we are testing.
If you're really lucky, your PLC will have a force function available for your debugging use. In that case, we can manually force each output on in succession to test them.
o Regardless of which method we're using, energize each output via the PLC program one at a time. Each time, ensure the safety of the surrounding people and the machine itself.
o If the output device does not turn on, verify that the appropriate output LED does indeed turn on. If the LED is on, check the wiring to the output device. If the wiring is ok, check the device itself to verify it is working as we believe it should. If the LED does not turn on, verify that the address is correct within your program.

Final Verification Procedures
  • Verify all body parts are out of the way
  • Verify power is off to the PLC.
  • Open all E-stops so the machine will not run until we want it to.
  • Reconnect everything that needs to be connected.
  • Clear the PLC memory. Generally, we can do this via our PLC programming software.
  • Download the final working version of our PLC program.
  • Verify once again that everything is connected and safe. Then, run the program.
  • Troubleshoot the machine when and as necessary to ensure all is working as needed.
  • When you are happy with the performance, make a last backup copy of the program and store it in a safe place. It will be needed again when you least expect it. Yes, you will need it and someday you'll be extremely happy to have that backup. And don't forget to create backup copies of the documentation...

No comments:

Post a Comment

Popular