The agreed PLC programming language standards are:
- Ladder Diagram (LD)
- Function Block Diagram (FBD)
- Structure Text (ST)
- Instruction List (IL)
- Sequential Function Charts (SFC).
1. Ladder Diagram (LD)
Ladder Logic or Ladder Diagram is a graphical PLC programming language. Take an example of a Press Machine (Figure 12-6). Input devices (Start switch (S1), Limit Switch (S2), stop switch (S3) and power supply for input devices, are connected to the PLC input module, while the actuator in the form of a contactor and power supply for output devices are connected to the PLC output module. The Press Machine will work if there is a signal from the input (S1 is pressed) and the machine cover has touched the limit switch. These input signals are processed by the PLC through PLC program instructions (logic operations). The results of the operation are in the form of output signals that will activate the press machine. The machine will stop working if S3 is pressed. Figure 11.7a: shows the control circuit for a press machine. Physical components are depicted by symbols.
Figure 11.9: Sectional View of a Press Machine
Figure 11.10a: PLC & Press Machine Control Interface Device
Figure 11.10b: Press Machine Control Wiring Diagram
The Logic Control in (Figure 11.10b) will have the same control logic as the Ladder Diagram in Figure 11.10c. The terminations on the input and output modules are marked with terminal numbers. For example: switches are connected to terminals 1, 2 and 3 of the input module, contactors are connected to the output terminals. This illustrates that the PLC processor and its program are between the input and output modules.
Figure 11.10c : Ladder Diagram for Press Machine Control
I1 : Alamat input memori untuk saklar S1
I2 : Alamat input memori untuk saklar S2
I3 : Alamat input memori untuk saklar S3
K : Alamat output untuk Kontaktor. Jika kontaktor aktif, mesin press akan mulai bekerja
00, 01: nomor rang
The PLC program above in the Ladder Diagram has 2 ranks, with input instructions on the left and output instructions on the right. Input instructions in ranks 00 and 02 contain data addresses I1, I2 and I3, so that the input voltage of terminals 1,2 and 3 will determine whether the instruction is forwarded (if correct) or not forwarded (if incorrect). The contactor is an internal memory bit that functions as an internal relay. In a PLC, the number of virtual relays used will be in accordance with the number of instructions for the virtual relay address, and this number is limited by the size of the PLC memory.
2. Function Block Diagram
PLC programs such as Ladder Diagrams can be described in the form of power flow or signal flow in a sequence, using logic function diagram blocks (Logic Gates). Basically there are 3 types of logic function blocks, namely AND, OR and NOT (INVERSE). While other logic functions can be built by combining the three basic logic functions.
Table 12-4: shows the standard symbols for basic logic function blocks and the characteristics of each function, shown through truth tables and Boolean algebra expressions.
a. Basic Operations and Logic Gates and Truth Tables
Logic 1 can be interpreted as: the component is active, there is voltage or signal at a terminal, the switch is active, the motor is rotating, etc. While Logic 0 can be interpreted as the opposite (the switch is not active, there is no voltage, the motor is not rotating, and so on).
b. Implementation of Logic Gates, Ladder Diagrams and Timing Diagrams
Table 11.3: Implementation of Logic Gates, Ladder Diagram and Timing
Table 11.4: Relay Circuit & Logic Configuration
3. Text or List of Instructions
PLC program writing can also be done with text lists or notations. The following is an example of a PLC program written according to the DIN EN 61131-3 Standard, and the STEP 5 or STEP 7 Program standards, for basic logic operations.
Table 11.5: Symbols & Text Notation for PLC Programming
Getting to Know PLC Types
PLC types are divided into 3 based on their operating method:
- Rack or Address based System
- Tag Based System
- Soft PLC or PC based control.
1. Rack Based PLC Type/Address Based System
PLC as in Figure 11.5: PLC with racks. called Address Based System, because the input and output (I/O) modules in the rack are the input or output signal traffic path through the address that corresponds to the place where the rack is installed.
Input or output modules generally function as:
- a) Interface Terminal where external devices can be connected
- b) Signal conditioning circuit that bridges the PLC signal type with signals obtained from external devices.
The addressing method can differ from vendor to vendor. But in general it is as follows:
I: (No. Rak/slot) / (No. Terminal) untuk modul input,
dan
O: (No. Rak/Slot) / (No. Terminal) untuk modul output
For example: The DC module is placed in input slot/rack 2, terminal 5, and the output module is placed in output slot 5, at terminal 12.
Maka modul input tsb dituliskan I:2/5
dan modul output dituliskan O:5/12
2. Tag Based PLC Type
Some vendors use this type, because it can be used for high language software (not machine language), such as BASIC and C. In this type, the addressing system, naming of input and output device variables can be created when the system is designed. Each variable is a tag and each is given a name. If a tag or variable is defined, then the data type indicated by the tag or variable will be declared.
3. Soft PLC or PC Based Control
PC (Personal Computer) can be used to emulate (execute program instructions while running the controlled device) PLC.
In industry, a PC's I/O card can be used as an interface for external devices outside the PLC, and the PC can function as a PLC.
Soft PLC is effectively used for On-Off control or a sequential control process, and other controls that only require a little numerical calculation.
Basic Principles and How PLC Works
1. PLC Architecture and Working Principles
PLC Architecture and Working Principles
2. PLC Working Principle
- The PLC control program will work with a sequence of steps as illustrated in the flow diagram of Figure 11.3.
- First, the PLC through its input module will read the input signals obtained from the input components (sensors, switches, machine outputs, etc.) and store them in the input interface module.
- The control program (for example, as shown in the image (ladder) will control the instructions to change the input signal into an output signal (according to the instructions) and store it on the output interface module. So the PLC will work based on the control program and not because of the signal received from the input device.
- The output signals stored on the output interface will work according to the instructions it receives.
Figure 11.3: PLC Working Principle
3. PLC Based System
PLC Processor. The heart of the PLC is the PLC processor. In Figure 11-4: Example of a PLC-Based System, the PLC processor is surrounded by input modules on the left, output modules on the right, and the power supply on top. For larger systems, PLC blocks are arranged in racks.
Figure 11.4: Example of a PLC-Based System
1). Backplane
Inside the rack there is a bus structure (which functions as a data interface) and a power supply for the PLC modules, which is called the backplane.
Figure 11.5: PLC with Racks
2). Processor and Power Supply
The processor is a central processing unit (CPU) that will perform all logical operations and carry out all mathematical computations. In the rack the number of processors can be more than one. The processor works by getting power supply from the PLC Power Supply module.
3). Programming Tools
This device is connected to the processor, and is used to enter programs, download programs or to edit existing programs in the PLC. The programming device can be a PC (Personal Computer) or a Handheld programmer (Figure page 14).
Figure 11.6: Programmer Device (handheld)
4). Input and output interfaces
This device can be a special module or fixed (part of a PLC system unit). The number of I/O ports for each PLC is fixed (cannot be changed) for each model (8, 14, 20, 40 etc.).
Input interface forms a link between the PLC processor and external components or devices used to measure physical quantities through sensors, such as heat, pressure, etc. or on/off devices, such as switches. These input components are usually called field devices. PLC input modules can also function as signal conditioners, namely converting various voltage levels into DC voltages of 0 to 5 V required by the PLC processor. Input interface modules consist of:
- a) DC Input Module (Current Sinking),
- b) DC Input Module (Current Sourcing),
- c) AC/DC Input Module.
The output interface forms a link between the PLC processor and external components or devices or systems. The output interface module consists of:
- a) DC Output Module (Current Sinking)
- b) DC Output Module (Current Sourcing)
- c) AC Output Module
- d) Relay Output Module.
3. Input Interface
a) DC Input Module (Current Sinking)
The Input Sinking Module is a module that flows current into the module input terminal, if the input is activated. Therefore, current flows out of the input components (sensors, switches, and so on). So the input components in this case function as a current source (Current Sourcing), where each component has a common measurement point. While the input module has a single common.
Figure 11.7a: DC Input Module (current Sinking)
b) DC Input Module (Current Sourcing)
Input sourcing modules channel current out of the input terminal to the input component, if the input is activated. So, the input components, in this case, function as current sinking components. Therefore, the signal at the input component terminal will be channeled to ground, if the input is activated.
Figure 11.7b: DC Input Module (Current Sourcing)
c) AC/DC Input Module
This module can receive/send current (current can come out or come into the input terminal), alternately every half cycle. The upper interface will work as a current source or current receiver. The lower interface is used for sensor output or switch with AC source.
Figure 11.7c: AC/DC (Current Sourcing) Input Module
4. Output Interface
a) DC Output Module (Current Sinking)
Figure 11.8a: DC Output Module (Current Sinking)
b) DC Output Module (Current Sourcing)
This module flows current out of the output terminal to the actuator. The output component functions as a current receiver (Current Sinking). All commons of the output components are connected to the negative side of the DC power supply, while the common terminal of the module is connected to the positive side of the power supply.
Figure 11.8b: DC Output Module (Current Sourcing)
c) AC Output Module
This module connects the AC voltage to the AC type actuator and is never referred to as a current source or output current receiver. The AC source is connected between the common module and the AC output component. The AC module can be used on all AC type actuators if the voltage is appropriate.
Figure 11.8c: AC Output Module
d) Relay Output Module
This module has Normally Open (NO) relay contacts for each port, which allows a larger load current to flow, which can drive both DC and AC output components. The block diagram of the relay output module interface is shown in Figure 12-8d.
Figure 11.8d: Relay Output Module
PLC Based Equipment Failure Tracking
Since the first time PLC was used in the Vintage Car Division of Modison Motor Company, in 1970, PLC has undergone extraordinary evolution. The growth and development of PLC manufacturing companies has also been extraordinary rapid along with the increasing use of PLC in companies that use automation machines.
1. Understanding & Definition of PLC
Various definitions of Programmable Logic Controller (PLC) are used to explain its meaning:
- PLC is a microcomputer system that people can use to control processes in industry.
- PLC is an industrial computer specifically designed to control manufacturing machines and systems in a wide variety of fields.
- PLC is a special electronic component based on one or more microprocessors that is used to control industrial machines. (James A. Rehg, 2007).
2. PLC versus PC
Similarities between PLC and PC:
- have a motherboard,
- processor,
- memory and slots for expansion.
Table 11.1: Differences between PLC and PC (Personal Computer)
Figure 11.1: Example of a PLC
Figure 11.1: Example of a PLC
3. PLC Applications in Industry
PLC applications in control systems vary widely, from On/Off to more complex ones. PLCs are generally used for:
- Automatic drilling machine
- Production machines
- Packing machine
- Beverage packaging machine
- Press machines, and so on.
Microprocessor I/O Communication
1. Information to and from the Microprocessor
A robot's microprocessor must be able to receive information from various sensors or other input devices (light, sound, motion sensors, information from a PC keyboard, etc.), and be able to send commands to multiple operators or send commands to sensors (to turn sensors off or on).
Managing all of this information at one time is very difficult. First, the processor speed problem, can be used multiplexing techniques, namely switching (serving) many jobs very quickly, so that the jobs will appear to be done at once. Second, the I/O circuit (with instructions) takes/sends data through a data bus, as shown in Figure 9.4.
Figure 9.4: Robot I/O Block Diagram
2. ADC (Analog to Digital Conversion)
Microprocessors can only process data in digital format. While the natural quantities captured by the sensor are analog. Therefore, these analog quantities must be converted into digital quantities so that they can be processed by the microprocessor. This digitization process is carried out by a device called an Analog-to-Digital Converter (ADC). The stages of digitization include: Sampling, quantization, and coding to digital quantities.
Figure 9.5: Analog - to - Digital Conversion Process
Sampling
The first process of analog to digital conversion is sampling, which is dividing the analog signal into several parts with equal time intervals, as shown in Figure 9.11 above. The number of samples is determined by the sampling frequency.
Quantization
After the analog signal is divided into several parts (according to the sampling frequency), then each part is quantized, that is, given a value according to its analog value, as shown in the second part (middle) of Figure 9.11. In this example, the quantization result value is shown in Table 9.1.
Binary Code
The final stage of A/D conversion is to generate binary code based on the quantization values obtained from the previous stage.
3. DAC (Digital to Analog Conversion)
Robot arms and other parts can move because they receive instructions from the microprocessor according to a program written by a programmer. The instructions in the microprocessor are of course in the form of digital data, while the robot's drive usually works analogously. Therefore, digital data from the microprocessor (in the form of commands to move a part of the robot) to the drive needs to be converted into analog format. This Digital to Analog converter device is called a DAC (Digital to Analog Converter). Many DACs are available in the form of ICs.
Logically, every binary value can be converted into an analog value, so that an infinite analog output measurement value will be obtained. In reality, this is not possible, because in electronic circuits, the output voltage is limited by the DC power supply voltage used in the circuit.
Figure 9.6: DAC in IC form
Maximum value of DAC analog output = DC Power Supply Voltage used on DAC
Example:
A 4-bit DAC has a reference voltage of -5 V. R1 = 2Rf (this is the MSB); R2 = 4Rf; R3 = 8Rf; R4 = 16Rf (this is the LSB). This DAC will have an output with a voltage range between 0-5V, because it has a reference voltage of 5 V. The value of each step = 5/24 = 0.3125 V. In the Op-amp there is a gain of -Rf / R. Because the LSB value of this DAC is 1/16, the step value is calculated by -1/16 (-5V) = 0.3125 V. The maximum output of the DAC is (24 -1) x step value = 15 x 0.3125 V = 4.6875 V. Figure 9.8 shows that all input switches are open, this means that the DAC input = 0000, and in this condition the DAC output = 0V. To determine the output value between 0 -- 5 V, then convert the input binary value to decimal, then multiply by the step value. For example: binary input 0110 = 6 decimal. The DAC output is 6 x 0.3125 V = 1.875 V.
Figure 9.9: Example of Digital – Analog Value Conversion via Step Waveform