pic based plc

21
PIC based PLC Muhammad Uzair Bilal Waqas Maqsud Presentation for: Center for Excellence of Industrial Automation SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCES NUST - PAKISTAN

Upload: waqas-maqsud

Post on 07-Apr-2015

1.123 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Pic Based Plc

PIC based PLCMuhammad Uzair Bilal

Waqas Maqsud

Presentation for: Center for Excellence of Industrial Automation

SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCES

NUST - PAKISTAN

Page 2: Pic Based Plc

Agenda

In this presentation we will mainly cover

• What are PLCs?

• Why do we need PLCs?

• PIC vs. PLCs

• Ladder logic

• PIC based PLCs

• Ladder logic for PIC

Page 3: Pic Based Plc

What are PLCs?

Page 4: Pic Based Plc

PLCs

A programmable logic controller (PLC) or programmable controller is a digital

computer used for automation and electromechanical processes

(Wikipedia)

Page 5: Pic Based Plc

A siemens simatic s7-416-3

Page 6: Pic Based Plc

Applications of PLCs

PLCs are mostly used in industries for

• control of machinery on factory assembly lines

• amusement rides

• lighting fixtures

• Traffic Signal operations

• Very high precision systems such as flight controls

Page 7: Pic Based Plc

NIST Industrial Control Security Test bed

An application of PLC based system

Page 8: Pic Based Plc

PIC vs. Other Controllers

PLCs are typically used when

• cost of developing and maintaining the automation system is high relative to the total cost of the automation

• changes to the system would be expected during its operational life

• Very complex process control, such as used in the chemical industry

Page 9: Pic Based Plc

PIC vs. other controllers contd.

A microcontroller-based design would be appropriate where hundreds or thousands of units will be produced and so the development cost (design of power supplies, input/output hardware and necessary testing and certification) can be spread over many sales and the design needs not to be altered.

Page 10: Pic Based Plc

Microcontroller based PLCs.

Page 11: Pic Based Plc

Microcontroller Based PLC

Aim: To develop a PLC system that uses a microcontroller as its processor. And to use Ladder logic for Microcontrollers

Page 12: Pic Based Plc

PIC vs PLCs

PIC is n industrial grade computer. We can supply a PLC with power

(usually 80-240VAC) and it will accept inputs, and it has outputs, relay

while we need some electronics to be built around a PIC to work like

PLCs.

Page 13: Pic Based Plc

PLC with PIC 16F648A Microcontroller

Page 14: Pic Based Plc

Hardware with PIC16F648A

Main board

I/O extension board

Page 15: Pic Based Plc
Page 16: Pic Based Plc

Main sections of the main board are :

Power

Programming

CPU

Inputs and Outputs.

Power section accepts 12V AC input and produces as outputs 12V DC to be used as the operating voltage of relays, and 5 V DC to be used for ICs, inputs.

Programming the PIC16F648A in circuit, it is necessary to use a PIC programmer hardware and software with ICSP (In Circuit Serial Programming) capability.

Page 17: Pic Based Plc

CPU section consists of the PIC16F648A microcontroller. Although it can run up to 20MHz, in this PLC it is fixed to run at 4MHz with its internal oscillator. This frequency is fixed because time-delays are calculated based on this speed.

Page 18: Pic Based Plc

Programming PIC

Page 19: Pic Based Plc

When programming PIC16F648A, RA5 should be connected to 4PDT switch. RB0, RB6 and RB7 pins are all reserved to be used for an 8-bit parallel to serial converter register 74HC/LS165. Through these three pins and with added 74HC/LS165 registers we can describe as many inputs as we wish. RB0, RB6, and RB7 are the “data in”, the “clock in” and the “shift/load” pins, respectively.

Similarly, RB3, RB4 and RB5 pins are all reserved to be used for 8-bit serial to parallel converter register/driver TPIC6B595. Through these three pins and with added TPIC6B595 registers we can describe as many outputs as we wish. RB3, RB4 and RB5 are the “clock out”, the “data out” and the “latch out” pins, respectively. The remaining unused pins of the PIC16F648A are connected to the “future extension connector”.

• The inputs section introduces 8 discrete inputs for the UZAM_PLC, called I0.0, I0.1, ..., I0.7. Each input can accept 5V DC or 24V DC signals. These external input signals are isolated from the other parts of the hardware by using NPN type opto-couplers (e.g. 4N25).

Page 20: Pic Based Plc

In the beginning of each PLC scan cycle (get inputs) 74HC/LS165 is loaded (RB7 (shift/load) = 0) with the level of 8 inputs and then this data is serially clocked in (when RB7 = 1; through RB0 “data in” and RB6 “clock in” pins). If there is no I/O extension board used, then 8 clock in signals are enough to get the 8 input signals. For each I/O extension board, 8 more clock in signals are necessary.

Page 21: Pic Based Plc