Professional Documents
Culture Documents
Training center
EHA
Training center
LG PLC training course
Level 1 (beginners level)
Pre-requisites
Duration
Description
Technology
Target audience
contents
:
:
:
None
6 days two hours per day
Basics of PLC Operation and programming
LG K7M/MK-120S
PC
KGL and other appropriate Software
All person that are required to deal with PLC
circuits and PLC programming.
Lesson 1:
Digital signal
Digital input device
Digital output device
PLC architecture "PLC inside view"
PLC circuit wiring and interface
Lesson 2:
Ladder logic
Memory map
KGL programming software
Lesson 3:
Timers
1. On delay timer
2. Off delay timer
3. Mono stable timer
Examples
using master controller tool
Lesson 4:
Counters
Examples
Lesson 5:
Step controller "sequence controller"
and its' applications
Lesson 6:
How to choose suitable PLC for your
application
General notes
Course Philosophy:
Training depends mainly on Practical applications. The
course contents are spread out over a 6-day period one lesson
per day every lesson is two hours, thus allowing absorption of
technical data through practical example. Training manuals are
supplied to the student for future reference. Included in the course
is a copy of the entire PLC and HMI reference manuals in soft
copy version.
Once a student has completed the LG PLC course level I,
he/she will be able to:
Create basic PLC programs.
Understand the internals of a PLC.
Have practical experience in choosing and
connection and programming of PLC.
Be ready to advance to the LG PLC course level II.
Lesson1
introduction to PLC
Main points
Digital Signal
Digital input Devices
Digital output Devices
PLC in side view
Hardware wiring
Digital Signal
Definitions of Digital Signal
Inductive Sensors
Inductive sensors use currents induced by magnetic fields to detect
nearby metal objects. The inductive sensor uses a coil (an inductor)
to generate a high frequency magnetic field as shown in Figure.
FEATURES:
Size: 8-12-18-30 mm diameter
2-wire DC, 3-wire DC or 2-wire AC models available
Normally open or normally closed
Shielded or non-shielded models
3-wire DC available NPN or PNP
Standard or long body versions
LED indication of output status
2 meter cable
Capacitive Sensors
Capacitive sensors are able to detect most materials at distances up
to a few centimeters. Recall the basic relationship for capacitance.
In the sensor the area of the plates and distance between them is
fixed. But, the dielectric constant of the space around them will
vary as different materials are brought near the sensor. An
illustration of a capacitive sensor is shown in Figure. an oscillating
field is used to determine the capacitance of the plates. When this
changes beyond a selected sensitivity the sensor output is
activated.
NOTE:
For this sensor the proximity of any material near the electrodes
will increase the capacitance. This will vary the magnitude of the
oscillating signal and the detector will decide when this is great
enough to determine proximity.
These sensors work well for insulators (such as plastics) that tend
to have high dielectric coefficients, thus increasing the capacitance.
But, they also work well for metals because the conductive
materials in the target appear as larger electrodes, thus increasing
the capacitance as shown in Figure. In total the capacitance
changes are normally in the order of pFard
Electro Hydraulic Automation (EHA)
(+202)4941760-499377
Fax.(+202)49192896
- 10 -
The sensors are normally made with rings (not plates) in the
configuration shown in Figure. In the figure the two inner metal
rings are the capacitor electrodes, but a third outer ring is added to
compensate for variations.
Without the compensator ring the sensor would be very sensitive to
dirt, oil and other contaminants that might stick to the sensor.
Example: (CYLINDRICAL TYPE WITH LEADS)
Part number: CR18-8DN
Form autonics CR Series
FEATURES:
Size: 18mm or 30 mm
3-wire DC or 2-wire AC models
normally open or normally closed
3-wire DC available NPN or PNP
Adjustable sensitivity
Detecting distance to 15mm
LED indication of output status
2 meter cable
IP66 (18mm) or IP65 (30mm)
SOLENOIDS
Solenoids are the most common actuator components. The basic
principle of operation is there is a moving ferrous core (a piston)
that will move inside wire coil as shown in Figure 5.1. Normally the
piston is held outside the coil by a spring. When a voltage is applied
to the coil and current flows, the coil builds up a magnetic field that
attracts the piston and pulls it into the center of the coil. The piston
can be used to supply a linear force. Well known applications of
these include pneumatic values and car door openers.
VALVES
The flow of fluids and air can be controlled with solenoid controlled
valves. An example of a solenoid controlled valve is shown in Figure
the solenoid is mounted on the side. When actuated it will drive the
central spool left. The top of the valve body has two ports that will
be connected to a device such as a hydraulic cylinder. The bottom
of the valve body has a single pressure line in the center with two
exhausts to the side. In the top drawing the power flows in through
the center to the right hand cylinder port. The left hand cylinder
port is allowed to exit through an exhaust port. In the bottom
drawing the solenoid is in a new position and the pressure is now
applied to the left hand port on the Top and the right hand port can
exhaust. The symbols to the left of the figure show the schematic
equivalent of the actual valve positions. Valves are also available
that allow the valves to be blocked when unused.
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 executing your program
during the second step. Based on the example in step 2 it would now turn on the first
output because the first input was on and your program said to turn on the first output
when this condition is true. 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 3 steps listed above.
Memo
Hardware wiring
1.5
Input wiring
Dc 24v
Output wiring
Wiring precautions:
Re-check the input voltage for the input part. If a voltage over the
maximum switching capacity (24V) is applied, it can cause faults,
destruction or fire.
Before applying the power to part that has polarities, be sure to
check its polarities.
During drilling or wiring, do not allow any wire scraps to enter the
PLC. It can cause malfunction and fault.
Wiring I/O wires with high voltage cable or power supply line can
cause malfunction or disorder.
Be sure that any wire does not pass across during input LED (I/O
status will not be clearly identified).
If an inductive load has been connected to output part, connect
parallel surge killer or diode to a load. Connect the cathode of diode
to the + part of the power supply.
Be cautious that strong shock does not applied to the I/O part.
Do not separate the PCB from its case.
Memo
Lesson 2
Main points
Ladder Logic
Memory Map
KGL Programming Software
2.1
Ladder Logic
Example1:
Now let's compare a simple ladder diagram with its real world
external physically connected relay circuit and see the differences.
Figure (1.6)
Example 3:
MOTOR START WITH LATCH
Make a program to control motor through push button but motor
not stop after releasing the button but can stop by pushing push
button (P1)
P0
COM
K
24VDC
P1
P40
K
COM
24VDC
M
220VAC
[[[[[[[[[[[[[[[
memory mapping
2.2
To study PLC you must know the memory mapping of the data
memory of this PLC, the PLC data memory is divided into several
parts , every part have a name & special specifications , these parts
called devices .
MK 120S DATA MEMORY DEVIDED INTO
1- P area
2- M area
3- K area
Example:
Example:
Note:
No. of points (mxx) limited to plc software point
For example for master k120s from m000 to
m191f (191*16= 3056 marker)
3- K keep relay
This device the same like m device but it can keep its value even if
power off and on again.
Example:
K0 internal imagine input or output in plc can
Keep its value even power off and on again.
Note:
No. of points (kxx) limited to plc software point
For example for master k120s from k00 to k31f
(31*16= 496) Keep relay.
(I.e. if power off while k0 was on, when power turn on again we
Will find k0 on)
Example:
F10 always no flag.
F11 always off flag.
Note:
You can get list of flags by click f3 from the keyboard then select
flags
Programming software
2.3
Memo
Memo
Lesson3
Main points
Timers
Examples
Using Master controller tool
Timers
3.1
1 TON
ON DELAY TIMER
2 TOFF
3 TMON
MONOSTABLE TIMER
Let's now see how a timer works. What is a timer? It's exactly what
the word says.. It is an instruction that waits a set amount of
time before doing something. Sounds simple doesn't it.
On-Delay timer
This type of timer simply "delays turning on". In other words, after
our sensor (input) turns on we wait x seconds before activating a
solenoid valve (output). This is the most common timer. It is often
called TON (timer on delay)
Off-Delay timer
This type of timer is the opposite of the on-delay timer listed
above. This timer simply "delays turning off". After our sensor
(input) sees a target we turn on a solenoid (output). When the
sensor no longer sees the target we hold the solenoid on for xseconds before turning it off. It is called a TOFF (timer off-delay)
and is less common than the on-delay type listed above. (i.e. few
manufacturers include this type of timer)
Let's now see how to use them. We typically need to know 2 things:
1. What will enable the timer? Typically this is one of the
inputs.(a sensor connected to input P0000 for example)
2. How long we want to delay before we react. Let's wait 5
seconds before we turn on a solenoid, for example.
When the instructions before the timer symbol are true the timer
starts "ticking". When the time elapses the timer will automatically
close its contacts. When the program is running on the plc the
program typically displays the elapsed or "accumulated" time for us
so we can see the current value. Typically timers can tick from 0 to
65535 times.
This timer is the on-delay type and is named T0. When the enable
input is on the timer starts to tick. When it ticks 10 (the preset
value) times, it will turn on its contacts that we will use later in the
program. Remember that the duration of a tick (increment) varies
with the time base used. (I.e. in MK 120s I can set some timers the
time base 100msec, others to the time base 10msec ...)
In this diagram we wait for input P0 to turn on. When it does, timer
T000 (a100ms increment timer) starts ticking. It will tick 100 times.
Each tick (increment) is 100ms so the timer will be a 10000ms (i.e.
10 second) timer. 100ticks X 100ms = 10,000ms. When 10 seconds
have elapsed, the T000 contacts close and P40 turns on. When
input P0 turns off (false) the timer T000 will reset back to 0 causing
its contacts to turn off (become false) thereby making output P40
turn back off.
To get help on timers just click F10 (dialogue box will appear)
then SELECT TON FROM the LIST THEN CLICK help
To put timer in the ladder diagram click F10 from the keypad,
dialogue box will appear then write the following expression
Instruction
op1 op2
Where:
Op1 is the timer number, in MK120s there are 256 timer
from T0 to T255
Op2 is the delay time multiplied by 0.1 sec
(To make 10 sec delay then make op2=100)
Example
To put on delay timer with 100sec delay do the following Click F10---write Ton Tn 1000 as n any number from 0-255
Hint:
Dont use the same timer more than one
Hint:
Every timer has a bit or contact take the same name of the timer
for example t10 is contact of the timer T10 this bit condition depend
on its timer condition.
Examples
3.2
1-TON Example
2-TOFF example:
Write a program to operate a lamp for 20 sec if I hit a button.
Solution connect the button with P0 and connect the lamp with P40,
the program are as following
When push the button P0 get on the contact T0 get on, when
release the button P0 get off T0 will keep on for 20 sec then get off
Extra
Examples
Example1:
Motor with two direction with time
OBJECT:
Make a program to control motor with two directions with two
DEFFERINT TIME.
SOLUTION:
When start p.b (P0) pushed motor run in forward direction so Till
certain time (T144) then motor stop running at forward direction
(P40 off ) and reverse direction Begin till certain time (T145) then
motor stop running at backward direction (P41 off ) and run
forward again and so on.
Example 2
When click start pushbutton we want the conveyer to run with the
sequence C---10sec delayB20sec delay ---A when I click stop I
want the conveyer to stop with the sequence C10sec delayb-10
sec delay
Master Control
3.3
Let's now look at what are called master controls. Master controls
can be thought of as "emergency stop switches".
An emergency stop switch typically is a big red button on a
machine that will shut it off in cases of emergency. Next time
you're at the local gas station look near the door on the outside to
see an example of an e-stop.
Note:
We're not implying that this instruction is a substitute for a "hard
wired" e-stop switch. There is no substitute for such a switch!
Rather it's just an easy way to get to understand them.
The master control instruction typically is used in pairs with a
master control clear (reset). Abbreviated as MCS/MCSCLR (master
control/master control reset),
Memo
Memo
Lesson4
Main points
Counters
Examples
Using Positive edge and negative tool
Counters
4.1
1- CTR
2- CTU
3- CTD
4- CTUD
RING COUNTER
UP COUNTER.
DOWN COUNT
UP DOWN COUNTER
Hint:
every counter have a bit or a contact, these bit state change
depending on the state of it's counter for example if the counter is
CTU then it's bit will have 0 as the present value in the counter less
than the set point, when the present value in the counter is more
than or equal the set point the bit of this counter will be 1
Hint:
The bit of any counter take the same number of these counters, as
c100 is the bit of the counter c100
CTU+EXAMPLE
CTD+EXAMPLE
CTUD+EXAMPLE
CTR+EXAMPLE
MAKE A WATCH
Make a program to make out contact after 1 month
Solution:
make counter (C1) with enable F93 ( this is special clock flag for 1
sec ) C1 preset value is 60 his counter express seconds , so after1
minute (60 second) C1 make pulse to C2 (minute counter) and C2
after 60 minute (Pulse) give pulse to C3 ( hour counter) and when
hour counter reach 24 Hour (pulse) give C4 (month counter).
3- STORE EXAMPLE
OBJECT:
Store with maximum capacity 200 car, has two gates each one
has sensor make a program to output signal when store empty
and other one when full
Solution:
By up down counter, up enable (P0) from entrance gate and down
enable from exit Gate and compare counter value if less than 1 out
EMPTY signal (P40) and if
Greater Than 200 out FULL signal (P41)
4.2
After 100 scans, NO P0 turns off (becomes false, user release the
push button connected P0). The logic remains in the same state as
"next scan" shown above. (D doesn't react therefore the logic
stays the same on rungs 2 and 3)
On scan 101 NO P0 turns back on. (Becomes true, user re push
the button)
When P0 get on m10 get on for one scan cycle, when P0 get
off m12 get on for one scan cycle
EXAMPLE:
OBJECT:
Great knife driven by motor, make a program to operate this knife
through selector and when Overload occur knife sops and never
run again before make the selector off and ON again
Solution:
As it requested the run command hanged on the rising edge of the
SELECTOR So we have to take the rising edge of the SELECTOR by
D command on marker (m10 for example) And use this marker for
run the motor (P40) and when overload point come (P1) motor
stop and will not work till p1 return to its initial position and the
next rising edge come again by changing the SELECTOR from ON
to off and make it ON again
Memo
Lesson5
Main points
STEP CONTROLLER
Step controllers like no. of ladders each one contain of no. of stairs
Only one stair (step) can be on and all stairs for this ladder are off.
For example:
For ladder S00.00 (it varies from S00.00 to S00.99) Step S00.00
ON firstly and if any step come (like S00.07) S00.00 OFF.
Last in priority
(sequence command)
OUT Sxx.xx
Step controller
SET xx.xx
In this method I can only move from step to the next step (the
next only) by SET order, and there are two conditions
1- The previous step was ON before trying to SET this step (for
example to SET S00.02 S00.01 must be ON first)
2- Use SET order
Notes:
Only the first step (for example S00.00 for ladder S00) can come at
any time (i.e. If we SET S00.00 for ladder S00 at any time S00.00
will be ON)
Example:
Memo
Lesson6
Main points
Memo
Memo