Tuesday, October 22, 2019

Logical Gate, Symbols, Truth Table and functions

Electric Logic
•Logical values can easily be expressed by electrical circuits.
•“True” or “1” can be defined as voltage on a wire while “False” or “0” can be defined as no voltage. We will use positive logic.
 •Analog values can be anything while digital only has discrete values, 0 or 1 •Electrical devices called “gates” can implement the logical

Logic Gates & Symbols


Note that gates can have more than 2 inputs

Truth table of all gates:


AND gate



•The AND gate is an electronic circuit that gives a true output (1) only if all its inputs gives a true output (1) only if all its inputs are true. A dot (·) is used to show the AND operation i.e. A·B. Note that the dot is sometimes omitted i.e. AB
Inputs and Outputs
•The inputs can be considered as logical (true or false) values.
 •You can also think of the inputs as voltage (true) or ground (false).
•The output of the gate will also be voltage (true) or ground (false).

Ladder logic in PLC for AND gate is shown below.It gives similar result as AND logic gate.

                                      

OR gate



•The OR gate is an electronic circuit that gives a true output (1) if one or more of its gives a true output (1) if one or more of its inputs are true. A plus (+) is used to show the OR operation.

Ladder logic in PLC for OR gate is shown below.It gives similar result as OR logic gate.
                                                 

NOT gate



•The NOT gate is an electronic circuit that produces an inverted version of that produces an inverted version of the input at its output.
•It is also known as an inverter.
 •If the input variable is A, the inverted output is known as NOT A.
•This is also shown as A', or Ā ,with a bar over the top  A’

Ladder logic in PLC for NOT gate is shown below.It gives similar result as NOT logic gate.



NAND gate


•This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate.
•The outputs of all NAND gates are true if any of the inputs are false.
 •The symbol is an AND gate with a small circle on the output. The small circle represents inversion.

Ladder logic in PLC for NAND gate is shown below.It gives similar result as NAND logic gate.



NOR gate



•This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate.
 •The outputs of all NOR gates are false if any of the inputs are true.
 •The symbol is an OR gate with a small circle on the output. The small circle represents inversion represents inversion.

Ladder logic in PLC for NOR gate is shown below.It gives similar result as NOR logic gate.

                                           

EX-OR gate



•The 'Exclusive-OR' gate is a circuit which will give a true output if either, but not both, of its two inputs are true.
•An encircled plus sign ( ) is used to show the EX-OR operation.

Ladder logic in PLC for EX-OR gate is shown below.It gives similar result as EX-OR logic gate.




EX-NOR gate


•The 'Exclusive-NOR' gate circuit does the opposite to the EX-NOR gate.
 •It will give a false output if either, but not both, of its two inputs are true.
•The symbol is an EX-NOR gate with a small circle on the output small circle on the output.
•The small circle represents inversion.
•Logic gates representation using the Truth table.

Ladder logic in PLC for EX-NOR gate is shown below.It gives similar result as EX-NOR logic gate.




Logical Equivalence

•Circuits are logically equivalent if they produce the same truth table output. Similarly we can make many Logic using Logical gates as shown below.






                      Three Input one output AND gate is shown below:
Four input AND gate is shown below:


Two input,Three input and Four input OR gates are shown below:

OMRON PLC

Today we are going to start OMRON PLC
Omron Corporation is kyoto based company. Omron was established by Kazuma Tateisi in 1933 (as the Tateisi Electric Manufacturing Company) and incorporated in 1948. The company originated in an area of Kyoto called "Omuro (御室)", from which the name "OMRON" was derived. Prior to 1990, the corporation was known as Omron Tateisi Electronics. During the 1980s and early 1990s, the company motto was: "To the machine the work of machines, to man the thrill of further creation".
Omron's primary business is the manufacture and sale of Industrial Automation components, equipment and systems.
Omron Oilfield & Marine is a provider of AC and DC drive systems and custom control systems for oil and gas and related industries.(Source: Wikipedia)
There are various models of PLC but we study with Basic PLC to understand program and its functions better. Below is the description of OMRON model:

Software: CX programming for CP1E
Manufacturer: OMRON
Communication port: USB
Communication Driver: CX programmer host
Series: CP1E-N20DR-D

If you get trouble in installing or connection you can send your queries on my mail.

Before starting programming we should know the Addressing for OMRON PLC. These are
Input: 00:00, 00:01, 00:02, 00:03………..00:11
Output: 100.00, 100.01, 100.02   …………100.07
Timer (o/p): T0, T1, T2…………………… T255
Counter: C0, C1, C2…………………… C255
Memory bit: H0.00, H0.01, H0.02…….
Memory Word: D0, D1, D2…………………… T2149
Timer address: [TIM 00 # present value]
Counter address: [CNT 00 # present value]
Compare Instruction: [=S1 # S2]……….. Comparing two memory word or two integer or memory word and integer.
Arithmetic Instruction
Addition: [+ D1 D2 D3] ……..   Addition of D1 and D2. Result stored in D3.
Subtract: [- D1 D2 D3]   ……..   Subtract of D1 and D2. Result stored in D3.
Multiplication: [* D1 D2 D3]….  Multiplication of D1 and D2. Result stored in D3.
Division: [/ D1 D2 D3]   ……..   Division of D1 and D2. Result stored in D3.


We study its more function as we start programming on it from tomorrow. 

Memory size and Memory organization 2019

MEMORY SIZE


PLCs are available with memory sizes ranging from as little as 256 words for small systems up to 2 Meg (million) for the larger systems. Memory size is usually expressed in K values: 2K, 4K, 16K and so on. K actually stands for 1000 but represents 1024 because the numbering systems used with PLCs is binary system, We use every day that is base 10.


While it is common for PLCs to measure their memory capacity in words, it is important to know the number of bits in each word. A PLC that uses 8-bit words would have half the memory capacity of a PLC that uses 16-bit words. For Example, the PLC that uses 8-bit word has 65,536 bits of storage with an 8K word capacity (8*8*1024 = 65536), whereas a PLC using 16-bit words has 131,072 bits of storage with the same 8K memory. It is important to know the word size of any given PLC before memory size can be accurately compared.


The actual size of the memory required depends on the application. In the event that future expansion is planned, there are two options: Buy a PLC with more memory than is presently necessary to allow for future expansion: or buy a PLC that meets present needs and add memory when the need arises.


MEMORY ORGANISATION

For PLC to function properly and control a process it must be able to perform the user program repeatedly, accurately and speedily, which is achieved by processing all information in binary signals. Binary information has only two states: 1 and 0 (ON or OFF, HIGH or LOW, TRUE or FALSE). There is nothing in between state or condition.


THE PROCESSOR MEMORY

It consists of hundreds or thousands of locations that are referred as words. Each word is capable of storing binary data in the form of binary digits (1 or 0). The number of bits that a word can store will depend on the system of PLC. Words can be made up to 32 bits, 16 bits or 8 bits. The 16 bit word is the most common.


ADDRESSING WORDS

In the memory serves the same function as the addresses used for homes or apartments. For example, Word 100 represents a specific word location in memory just like N100 Lincoln represents the address of an apartment building. The bits in word 100 are found by referencing a given bit number, just like the occupant of the apartment complex is found by a given apartment number. Since a bit of information can only be a 1 or 0 (ON or OFF). How is the status of bits within a word determined? Words that store the status of individual bits for input devices are set to 1 (ON) of 0 (OFF) depending upon the status of the input devices that the bit location represent. Other bits are set to 1 or cleared to 0 by the processor in response to the logic of the user program, RELAY LADDER LOGIC, or special instructions, which in turn controls the status (ON or OFF) of other bits that represent output devices.

Memory- RAM, ROM, PROM, UVPROM or EPROM, EAROM, EEPROM

Memory section of the processor consists of hundreds or thousands of locations where information is stored. It is divided into two parts, User and Storage. The User memory is for storage of the program, which contains the ladder logic, or instructions that control the driven equipment. The Storage memory is used to store information such as Input/output status, timer or counter preset/ accumulated values and internal control relays etc. that are necessary for the processor to control the equipment.


The Memory chips used in processor can be separated into two distinct groups; Volatile (One that loses its stored information when power is removed) and Non Volatile (It has ability to retain stored information when power is removed, accidentally or intentionally). Back up Batteries included in the processor power supply protect volatile memory. The battery may be the sized dry cells rechargeable Nickel Cadmium or non-rechargeable alkaline, lithium types.

To change the battery we should back up our files and switch off mains before removing from PLC else it causes loss of program.

Memory types: The most common type of volatile memory is

RANDOM ACCESS MEMORY (RAM): Information can be written into or read from RAM chip and is often referred to as read/ write memory. Information stored in memory can be retrieved or read. While write indicates that the user can program or write information into memory. Random access refers to the ability of any location (address) in the memory to be accessed or used. RAM is used for both the user memory and storage memory in many PLCs. Since RAM is volatile, it must have battery backup to retain or protect the stored program. Various forms of RAM include MOS and CMOS - RAM (Complementary Metal Oxide Semiconductor – RAM). CMOS – RAM is very popular because it has very low drain current when not being accessed (15 micro amps) and information stored in memory can be retained by as little as 2 V DC. A typical fully charged lithium battery is rated 2.95 V at 1.75 amps / Hour and normally holds or protects a program for 60 days or longer.





The most common type non volatile memories are

READ ONLY MEMORY (ROM) : A common non volatile memory do not require battery backup and retains information or program when power is lost. Read only indicates that the information stored in memory can be read only and cannot be changed. Information in ROM is place by the manufacturer for the internal use and operation of the PLC and The manufacturer does not want the information changed or altered.


PROM (PROGRAMMABLE READ ONLY MEMORY) : It allows initial and/ or additional information to be written into the chip. PROM may be written into only once after being received from the PLC manufacturer. This type of memory is used to prevent un authorized program changes. Another method of restricting access to program is to use PASSWORD (Software Lock). They allow access to the program to those personal who know the correct password.


UVPROM – EPROM (ULTRAVIOLET PROGRAMMABLE READ ONLY MEMORY – ERASABLE PROGRAMMABLE READ ONLY MEMORY) : UVPROM is ideally suited when program storage is to be semi – permanent or additional security is needed to prevent unauthorized program change. UVPROM chip also referred to as EPROM. EPROM has a quartz window over a silicon material that contains the electronic IC’s. This window is normally covered by an opaque material, but when the opaque material is removed and the circuitry exposed to ultraviolet light, The memory content can be erased. Once erased, The EPROM chip can be reprogrammed using special programmer. After programming, the chip window must once again be covered with an opaque material such as electricians tape to avoid undesirable alteration of memory.


EAROM (ELECTRICALLY ALTERABLE READ ONLY MEMORY) : These chips can have stored program erased electrically. This is accomplished by applying different positive (+) and Negative ( - ) voltage values to specific circuit points (Supplied in the manufacturers literature).Once erased this chip also can be reprogrammed.

EEPROM (ELECTRICALLY ERASABLE PROGRAMMABLE READ ONLY MEMORY) : This is also referred to as Double EPROM or E2PROM. It is the chip that can be programmed using a standard programming device and can be erased by the proper signal being applied to the erase pin. This is primarily used as non – volatile backup for the user program RAM. If the user program in RAM is lost or erased, a copy of the program stored on an EEPROM chip can be downloaded in RAM. It is common on some PLCs for the processor to load the program from E2PROM chip into RAM memory, Each time the processor is powered up or after a power failure.


We study more on memory in next blog.

Processor Unit - PLC




Processor unit houses the microprocessor, memory and communications circuitry necessary for the processor to operate and communicate with the I/O and peripheral equipment. The DC power required for the processor is provided either by a power supply that is integral part of the processor unit or by separate power supply unit. Processor is “Brain” of plc which is decision maker that controls the operation of equipment to which it is connected. It also controls the operation of output devices that are connected to output modules based on the status of the input devices and the program that has been entered into memory.


Processors control as few as 8 or as many as 40000 real word inputs and outputs. The larger the number of input and output devices that are required for the process, the more powerful the processor must be to properly control the number of I/O that will be connected.




The processor may be self-contained unit or may be modular in design. Processor scan does the following:

1. Determine status of input devices

2. Interpret logic of program (read and solve ladder logic)

3. Update (Turn “ON” or “OFF”) output devices

4. Communication with connected devices and housekeeping (Update internal timers, counters and   registers)



Normally, before any output devices can be turned ON or OFF, The processor has to scan the entire program that is in user memory. The program may be only of few rungs or it may be hundreds of pages in length, depending upon the equipment that is being controlled. Some input devices operate so  fast that by time the user program can be read and solved and outputs updated, the input device may be changed positions more than once since the processor originally determined its status at the start of the scan. It may be true for an output device that may be updated sooner than as regular scan will allow. To solve the problem, Many PLCs have special program instructions that allow critical or high speed Input and output devices to be actually interrupting the scan when it is reading the program and allow I/O devices to be updated immediately.



Example for collecting bottles at required quantity at required time is shown below……


We study about Memory, Memory chip and is application in next blog.

MODBUS, RS 232, RS 485, RS 422 and Cable screen

 Mod Bus : It is transmission protocol for process control system in context to other buses. There is no transmission medium is defined.
It defines a digital communication network to have one master and one or more slave devices. Either a single or multi-drop network is possible. All message transactions are initiated by MASTER. Euro-therm instruments communicate using the MODBUS RTU binary protocol.

The JBUS protocol is identical in all respect but one to the modbus protocol. The one difference concerns the parameter or register address. Both use numeric index but JBUS index starts at ‘0’ while MODBUS index starts at ‘1’.
MODBUS TCP allows a host computer to connect to a remote serial port and to talk to  a MODBUS communicating device via an interconnecting Ethernet LAN using special MODBUS TCP driver. AS far as the slave instrument is concerned, The transaction is standard MODBUS transaction. It has 1-247 slaves.
Note: If you want sample master slave message transaction or information it carry then send me mail or comment your queries below.

The protocols that user can choose are
1.       RS  232
2.       RS 485
3.       RS 422
4.       Cable screen

RS 232
This standard alows a single instrument to be connected to a pc, a Programmable Logic Controller or similar devices using a cable length of less than 15 m.


RS 422
Strictly speaking, RS 422 is a standard permitting  ‘point to point’ connection between two communicating instruments using a full duplex, differential signals on two pairs of wires.
In principle, therefore, an RS 422 link only aloows a single instrument to be connected to a PC. However, Many instrument provide an enhanced version of RS422 that also meet full electrical requirements of RS 485 described above. This allows upto 31 units of loads to be connected on the same network, But only with 5 wire electrical connections. The transmission and reception of data use two pairs of twisted cable, With a separate cable provided as circuit common.

Pins of RS 232 and RS 422 hardware ports




RS 485
This standard allows one or more instruments to be connected (Multi-dropped) using a two wire connection, with cable length of up to 1200 m. A maximum of 31 unit loads or instruments and one master may be connected in this way. The balanced differential signal transmission is less prone to interference and should be used in preference to RS 232 in noisy environments. RS 485 is recommended for plant installation. Although RS 485 is commonly referred to as a two wire connection. A separate cable is often provided for linking the circuit commons.


Difference between RS 232, RS 422 and RS 485 is shown below:




Transceiver model of RS 232, RS 422 and RS 485 is shown below. You should use as your requirements in Automation industry.



Cable screen
The use of screened cable with the screen/Shield connected to earth is recommended as it provides additional protection against noise. To prevent earth-loop problem, The cable screen should be connected to electrical earth at one point only- normally at the supervisory computer end of the cable. The screen must not be used as circuit common.

We will discuss the LAN configuration tomorrow which is very much important as field buses.

Logical Gate, Symbols, Truth Table and functions

Electric Logic •Logical values can easily be expressed by electrical circuits. •“True” or “1” can be defined as voltage on a wire whil...

Smart Chapter