Saturday, June 2, 2007

Introduction to PLC (Programmable Logic Controller)

Programmable logic controllers, also called programmable controllers or PLCs, are solid-state members of the computer family, using integrated circuits instead of electromechanical devices to implement control functions. They are capable of storing instructions, such as sequencing, timing, counting, arithmetic, data manipulation, and communication, to control industrial machines and processes.

Programmable controllers have many definitions. However, PLCs can be thought of in simple terms as industrial computers with specially designed architecture in both their central units (the PLC itself) and their interfacing circuitry to field devices (input/output connections to the real world).

The typical system components for a modularized PLC are:

1. Processor.

The processor (sometimes call a CPU), as in the self contained units, is generally specified according to memory required for the program to be implemented. In the modularized versions, capability can also be a factor. This includes features such as higher math functions, PID control loops and optional programming commands. The processor consists of the microprocessor, system memory, serial communication ports for printer, PLC LAN link and external programming device and, in some cases, the system

power supply to power the processor and I/O modules.

2. Mounting rack.

This is usually a metal framework with a printed circuit board backplane which provides means for mounting the PLC input/output (I/O) modules and processor. Mounting racks are specified according to the number of modules required to implement the system. The mounting rack provides data and power connections to the processor and modules via the backplane. For CPUs that do not contain a power supply, the rack also holds the modular power supply. There are systems in which the processor is mounted separately and connected by cable to the rack. The mounting rack can be available to mount directly to a panel or can be installed in a standard 19" wide equipment cabinet. Mounting racks are cascadable so several may be interconnected to allow a system to accommodate a large number of I/O modules.

3. Input and output modules.

Input and output (I/O) modules are specified according to the input and output signals associated with the particular application. These modules fall into the categories of discrete, analog, high speed counter or register types. Discrete I/O modules are generally capable of handling 8 or 16 and, in some cases 32, on-off type inputs or outputs per module. Modules are specified as input or output but generally not both although some manufacturers now offer modules that can be configured with both input and output points in the same unit. The module can be specified as AC only, DC only or AC/DC along with the voltage values for which it is designed. Analog input and output modules are available and are specified according to the desired resolution and voltage or current range. As with discrete modules, these are generally input or output; however some manufacturers provide analog input and output in the same module. Analog modules are also available which can directly accept thermocouple inputs for temperature measurement and monitoring by the PLC. Pulsed inputs to the PLC can be accepted using a high speed counter module. This module can be capable of measuring the frequency of an input signal from a tachometer or other frequency generating device. These modules can also count the incoming pulses if desired. Generally, both frequency and count are available from the same module at the same time if both are required in the application. Register input and output modules transfer 8 or 16 bit words of information to and from the PLC. These words are generally numbers (BCD or Binary) which are generated from thumbwheel switches or encoder systems for input or data to be output to a display device by the PLC. Other types of modules may be available depending upon the manufacturer of the PLC and it's capabilities. These include specialized communication modules to allow for the transfer of information from one controller to another. One new development is an I/O Module which allows the serial transfer of information to remote I/O units that can be as far as 12,000 feet away.

4. Power supply.

The power supply specified depends upon the manufacturer's PLC being utilized in the application. As stated above, in some cases a power supply capable of delivering all required power for the system is furnished as part of the processor module. If the power supply is a separate module, it must be capable of delivering a current greater than the sum of all the currents needed by the other modules. For systems with the power supply inside the CPU module, there may be some modules in the system which require excessive power not available from the processor either because of voltage or current requirements that can only be achieved through the addition of a second power source. This is generally true if analog or external communication modules are present since these require ± DC supplies which, in the case of analog modules, must be well regulated.

5. Programming unit.

The programming unit allows the engineer or technician to enter and edit the program to be executed. In it's simplest form it can be a hand held device with a keypad for program entry and a display device (LED or LCD) for viewing program steps or functions, as shown in Figure 2-4. More advanced systems employ a separate personal computer which allows the programmer to write, view, edit and download the program to the PLC. This is accomplished with proprietary software available from the PLC manufacturer. This software also allows the programmer or engineer to monitor the PLC as it is running the program. With this monitoring system, such things as internal coils, registers, timers and other items not visible externally can be monitored to determine proper operation. Also, internal register data can be altered if required to fine tune program operation. This can be advantageous when debugging the program. Communication with the programmable controller with this system is via a cable connected to a special programming port on the controller. Connection to the personal computer can be through a serial port or from a dedicated card installed in the computer.


Friday, June 1, 2007

Introduction to PIC16F877A Microcontroller

Microcontroller PIC16F877A is one of the PICMicro Family microcontroller which is popular at this moment, start from beginner until all professionals. Because very easy using PIC16F877A and use FLASH memory technology so that can be write-erase until thousand times. The superiority this Risc Microcontroller compared to with other microcontroller 8-bit especially at a speed of and his code compression. PIC16F877A have 40 pin by 33 path of I/O.
PIC16F877A perfectly fits many uses, from automotive industries and controlling home appliances to industrial instruments, remote sensors, electrical doorlocks and safety devices. It is also ideal for smart cards as well as for battery supplied devices because of its low consumption.EEPROM memory makes it easier to apply microcontrollers to devices where permanent storage of various parameters is needed (codes for transmitters, motor speed, receiver frequencies, etc.). Low cost, low consumption, easy handling and flexibility make PIC16F877A applicable even in areas where microcontrollers had not previously been considered (example: timer functions, interface replacement in larger systems, coprocessor applications, etc.).In System Programmability of this chip (along with using only two pins in data transfer) makes possible the flexibility of a product, after assembling and testing have been completed. This capability can be used to create assembly-line production, to store calibration data available only after final testing, or it can be used to improve programs on finished products.

High-Performance RISC CPU:

  • Only 35 single-word instructions to learn
  • All single-cycle instructions except for program branches, which are two-cycle
  • Operating speed: DC – 20 MHz clock input DC – 200 ns instruction cycle
  • Up to 8K x 14 words of Flash Program Memory, Up to 368 x 8 bytes of Data Memory (RAM), Up to 256 x 8 bytes of EEPROM Data Memory
  • Pinout compatible to other 28-pin or 40/44-pin PIC16CXXX and PIC16FXXX microcontrollers

Peripheral Features:

  • Timer0: 8-bit timer/counter with 8-bit prescaler
  • Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via external crystal/clock
  • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
  • Two Capture, Compare, PWM modules
  • Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™ (Master/Slave)
  • Universal Synchronous Asynchronous Receiver
  • Transmitter (USART/SCI) with 9-bit address detection
  • Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls (40/44-pin only)
  • Brown-out detection circuitry for Brown-out Reset (BOR)

Analog Features:

  • 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)
  • Brown-out Reset (BOR)
  • Analog Comparator module (Two analog comparators , Programmable on-chip voltage reference (VREF) module , Programmable input multiplexing from device inputs and internal voltage reference , Comparator outputs are externally accessible)

Special Microcontroller Features:

  • 100,000 erase/write cycle Enhanced Flash program memory typical
  • 1,000,000 erase/write cycle Data EEPROM memory typical
  • Data EEPROM Retention > 40 years
  • Self-reprogrammable under software control
  • In-Circuit Serial Programming™ (ICSP™) via two pins
  • Single-supply 5V In-Circuit Serial Programming
  • Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation
  • Programmable code protection
  • Power saving Sleep mode
  • Selectable oscillator options
  • In-Circuit Debug (ICD) via two pins

CMOS Technology:

  • Low-power, high-speed Flash/EEPROM technology
  • Fully static design
  • Wide operating voltage range (2.0V to 5.5V)
  • Commercial and Industrial temperature ranges
  • Low-power consumption
(Continued with how to programming PIC16F877A)