CHAPTER 6: SFC PROGRAMING
LANGUAGE (Grafcet)
1. Introduction
2. Operation principle
3. Construction method
4. Application exercises
Bộ môn Cơ điện tử 1
INTRODUCTION
SFC means
“Sequential Function Chart”
2
INTRODUCTION
3
OPERATION PRINCIPLE
Out command can be placed at any possition.
4
CONSTRUCTION METHOD
5
CONSTRUCTION METHOD
6
CONSTRUCTION METHOD
Assign devices of a PLC in the created process drawing.
1) Assign a state relay to a rectangle indicating a process. At this time, assign a
state relay (S0 to S9) to the initial process.
After the first process, arbitrarily assign state relay numbers (S20 to S899) except
the initial state relays. There are latched (battery backed) type state relays(S500
to S899) whose ON/OFF status is stored against power failure.
The state relays S10 to S19 are used for special purposes when the IST (FNC 60)
instruction is used.
7
CONSTRUCTION METHOD
Assign devices of a PLC in the created process drawing.
2) Assign a device to each transfer condition. NO contact and NC contact are available for a transfer
condition. If there are two or more transfer conditions, AND circuit or OR circuit is available.
3) Assign a device (output terminal number connected to external equipment, timer number, etc.)
used for an operation performed in each process. Many devices such as timers, counters and
auxiliary relays are provided in a PLC, and can be used arbitrarily.
If there are two or more loads such as timers and counters which are driven at the same time, two
or more circuits can be assigned to one state relay.
4) When performing repeated operations or skipping some processes (jump operation), use “ ” and
specify the jump destination state relay number.
8
CONSTRUCTION METHOD
Use memory flag M8002 to initiate S0 in Ladder program block.
Then switch to SFC to write SFC program
9
CONSTRUCTION METHOD
10
NOTES
11
NOTES
How to use “ ” and “”
Use to JUMP to any state relay position.
Use to reset sate relay.
“” sẽ tự động thêm vào
khung cờ trạng thái khi có
lệnh nhảy đến nó.
12
EXAMPLE
Pulse generation
13
EXAMPLE
Fountain control
1) Cyclic operation (X001 = OFF, X002 = OFF)
When the start button X000 is pressed, the outputs turn ON in the order “Y000 (wait indication)
→ Y001(center lamp) → Y002 (center fountain) → Y003 (loop line lamp) → Y007 (loop line
fountain) → Y000(wait indication)”, and then the outputs return to the wait status. Each output
is switched in turn every 2 seconds by a timer.
2) Continuous operation (X001 = ON)
Y001 to Y007 turn ON in turn repeatedly.
3) Stepping operation (X002 = ON)
Every time the start button is pressed, each output turns ON in turn.
14
EXAMPLE
15
Practice #18- Mixing tank
16
GHW#3 – 3 motors system control
Gồm 2 chế độ Auto/Manual dùng Switch
chuyển chế độ.2 chế độ chạy độc lập khi
chuyển chế độ toàn bộ hệ thống dừng hẳn chờ
người vận hành nhấn Start
Ở chế độ Auto:Nhấn Start động cơ 1 chạy sau
5s động cơ 2 chạy.Cả 2 động cơ chạy trong
vòng 10s thì dừng và động cơ 3 chạy.Động cơ
3 chạy 5s thì dừng 5s và lặp lại như vậy 5 lần
thì động cơ 1 chạy lại và lặp lại chu trình như
ban đầu.Nếu nhấn Stop hệ thống dừng lại
Ở chế độ Manu:Nhấn Start Động cơ 1 và 3
chạy.Nhấn Stop động cơ 1 và 3 dừng động cơ
2 chạy 5s thì dừng. (3 động cơ dùng nguồn 3
pha 380)
Thiết kế phần cứng và vẽ sơ đồ đấu dây cho hệ
thống.
Lập trình theo yêu cầu
17
CHAPTER 7: Specialized functions on PLC
1. Introduction to special function modules
2. specialized function modules
3. Expansion module in/out
4. Temperature sensor module
5. A/D and D/A modules
6. Position control module using stepper motor or servo
Bộ môn Cơ điện tử 7. Communication on PLC 18
Introduction to special function modules
Caùc öùng duïng giao tieáp I/O taùc
ñoäng tröïc tieáp Caùc öùng duïng giao tieáp I/O ñaëc
bieät
Weight input module
Weight input modules are
special types of analog
interfaces designed to
read data from load cells
A weight input module provides the excitation voltage for load cells, as well as the
necessary software for calibrating load cell circuits. A weight module sends an
excitation voltage to a load cell and reads the signal created by the weight force
exerted on the cell
Thermocouple Input Modules
In addition to standard analog voltage/current input interfaces that can receive
signals directly from transmitters, special analog input interfaces can also accept
signals directly from sensing field devices. Thermocouple input modules, which
accept millivolt signals from thermocouple transducers, are an example of this
type of special preprocessing interface.
Different types of thermocouple input modules are available, depending on the
thermocouple used. These modules can interface with several types of
thermocouples by selecting jumpers or rocker switches in the module. For
example, an input module may be capable of interfacing with thermocouples of
(ISA standard) type E, J, and K.
Thermocouple Input Modules
Thermocouple interface connection diagram.
RTD Input Module
Resistance temperature detector (RTD) interfaces receive
temperature information from RTD devices. RTDs are temperature
sensors that have a wire-wound element whose resistance changes
with temperature in a known and repeatable manner. An RTD in its
most common form consists of a small coil of platinum, nickel, or
copper protected by a sheath of stainless steel.
These devices are frequently used for temperature sensing because of
their accuracy, repeatability, and long-term stability.
RTD Input Module
An RTD module converts changes in resistance into
temperature values, available to the processor in either
°C or °F.
RTD Input Module
RTD devices are available in 2-, 3-, and 4-wire
connections.
PID Modules
Proportional-integral-derivative (PID) interfaces are
used in process applications that require continuous closed-
loop control employing the PID algorithm. These modules
provide proportional, integral, and derivative control
actions according to sensed parameters, such as pressure
and temperature, which are the input variables to the
system.
PID Modules
Illustration of a PID control process.
PID Modules
Once the module detects an error, the control loop modifies the
control variable (CV) output to force the error to zero.
PID Modules
The control algorithms implemented by a PID module:
PID Modules
The PID module receives the process variable in analog form and computes the error difference
between the actual value and the set point value.
First, the module formulates a proportional control action based on an output control variable that
is proportional to the instantaneous error value (KPE).
Then, it initiates an integral control action (reset action) to provide additional compensation to the
output control variable. This causes a change in the process variable in proportion to the value of
the error over a period of time (KI or KP/TI).
Finally, the module initiates a derivative control action (rate action) adding even more
compensation to the control output (KD = KPTD). This action causes a change in the output control
variable proportional to the rate of change of error.
These three steps provide the desired control action in proportional (P), proportional-integral (PI),
and proportional-integralderivative (PID) control fashion, respectively.
PID Modules
PID Modules
Positioning Interfaces
Encoder/Counter Interfaces
Encoder/counter modules interface encoders and high-speed counter devices
with programmable controllers. This type of module operates independently of
the processor and I/O scan.
Applications include closed-loop positioning of machine tool axes, hoists, and
conveyors, as well as cycle monitoring of high-speed machines, such as can-
making equipment, stackers, and forming equipment.
There are two types of encoder/counter interfaces: absolute and incremental.
Absolute encoders provide an angular measurement of the shaft.
Incremental encoders measure shaft rotation over distance by outputting a fixed number of
pulses per shaftrotation.
Encoder/Counter Interfaces
The communication between an encoder/counter interface and the
processor is bidirectional. The module accepts the preset value and
other control data from the processor and transmits values and status
data to the PLC memory.
The interface also lets the PLC know when the marker and limit
switch are both energized, indicating a home position.
Typically, the length between the module and the encoder should not
exceed 50 feet, and shielded cables should be used.
Encoder/Counter Interfaces
Stepper Motor Interfaces
The motion of a stepper can be accelerated, decelerated,
or maintained constantly by controlling the pulse rate
output from a stepper module.
A stepper interface generates a pulse train that is
compatible with the stepper translator, indicating distance,
rate, and direction commands to the motor.
Stepper Motor Interfaces
Stepper Motor Interfaces
Example:
Suppose that the 200-step motor is operating at half-stepping
conditions (400 steps per revolution) and that the leadscrew has 5
threads per inch. What are the step angle and linear displacement
per step used in the system?
Stepper Motor Interfaces
Stepper motor interfaces operate in two modes: single-step
profile mode and continuous profile mode.
Single-step profile mode:
Stepper Motor Interfaces
Continuous profile mode:
Stepper Motor Interfaces
Stepper Motor Interfaces
Each axis is independent of
the other, executing its own
single-step or continuous
profile mode. The beginning
and end of each axis motion
may be different.
Stepper Motor Interfaces
The beginning and end of
the motion commands for
each axis occur at the
same time. A profile of one
of the axes may start later
or end before the other
axes (see Figure), but the
move that follows will not
occur until all axes have
started and ended their
motions.
Stepper Motor Interfaces
The use of a
position/velocity
feedback scheme (see
Figure 8-26) can
greatly improve the
operation of a stepper
motor control system,
because this scheme
provides closed-loop
positioning control.
Servo Motor Interfaces
Servo motor interfaces are used in applications requiring control of
servo motors via servo drive controllers.
A servo motor is a specially designed motor that contains a permanent
magnet.
The speed of a servo motor can be easily varied by changing the input
voltage to the motor.
A servo module provides the drive controller with a ±10 VDC signal,
which defines the forward and reverse speeds of the servo motor.
Servo Motor Interfaces
Typical applications
of servo positioning
include grinders,
metalforming
machines, transfer
lines, material-
handling machines,
and the precise
control of servo
driver valves in
continuous process
applications.
Servo Motor Interfaces
Servo positioning controls operate in a closed-loop system, requiring
feedback information in the form of velocity or position.
Servo control interfaces may receive velocity feedback in the form of
a tachometer input, or positioning feedback in the form of an encoder
input, or both.
The feedback signal provides the module with information about the
actual speed of the motor and the position of the axis.
Servo Motor Interfaces
Figure shows a servo
control configuration
block diagram. PLCs
that have positioning
control capabilities
require two modules—
one to implement the
servo control task and
one to receive feedback
and close the loop.
Some manufacturers,
however, offer complete
servo control for one
axis in a single module.
Servo Motor Interfaces
Servo control, like
stepper motor control,
can occur in either
single-step or continuous
positioning mode (see
Figure 8-30). Depending
on the manufacturer,
multiaxis control can also
be synchronized in either
single-step or continuous
mode.
Servo Motor Interfaces
The PLC processor sends all of the move and position information,
including acceleration, deceleration, and the final and feed velocities,
to the servo module.
Servo Motor Interfaces
Servo motor interface
connection diagram.
Servo Motor Interfaces
When servo interfaces are used for positioning control, the feedback
resolution provided by the system is a key issue.
For example, if an interface uses a leadscrew (a rotational-to-linear
motion translator) for axis displacement and an encoder to provide a
feedback signal to the servo module, the user must know the
leadscrew pitch, the number of encoder pulses per revolution, and the
multiplier value in the encoder section of the interface.
Fuzzy Logic Interfaces
Offered by a few PLC manufacturers, provide a way of
implementing fuzzy logic algorithms in PLCs. Fuzzy
logic algorithms analyze input data to provide control of
a process.
Fuzzy Logic Interfaces
Fuzzy logic modules are an integral part of the advanced capabilities
of today’s programmable controllers. They help to bridge the gap
between the discrete and analog decision-making functions of a PLC.
In essence, fuzzy logic modules allow PLCs to “reason,” letting them
interpret data in an analog-type form instead of just as ON or OFF.
The “reasoning” capabilities of fuzzy modules allow them to provide
finetuned control of analog processes, as well as nonlinear and time-
variant processes, like tension and position control.
Fuzzy Logic Interfaces
Fuzzy logic modules can provide this type of human-like
judgment.
Temperature sensing in (a) a normal PLC and (b) a PLC with fuzzy
logic capabilities.
Fuzzy Logic Interfaces
Fuzzy logic modules work with other modules to input and
output process information according to fuzzy control
algorithms. These algorithms are based on user-
programmed rules, which are formed by IF conditions and
THEN actions. A fuzzy module analyzes its inputs
according to the IF conditions and then outputs control data
according to the corresponding THEN action.
EX:
Fuzzy Logic Interfaces
Fuzzy logic control is even more practical when multiple rules exist. For example,
a fuzzy I/O module may receive data from a field device measuring the input
process temperature, as well as from a field device measuring the outside
environmental temperature. In this case, the module could combine two rules to
determine a more precise acceptability level, resulting in a more precise output
action.
For example, IF the input temperature is 75°F and IF the outside environmental
temperature is 70°F, THEN the acceptability level is 0.63, so turn the control
element a little less (perhaps 8 degrees) clockwise.