Documente Academic
Documente Profesional
Documente Cultură
PROJECT BRIEF
PROJECT NAME BUILDING MANAGEMENT SYSTEM
UNDERTAKEN BY
SUPERVISED BY
INTERNAL EXAMINER
EXTERNAL EXAMINER
STARTED ON
FEBRUARY 2012
COMPLETED ON
JANUARY 2013
DATE
Abstract
Building automation systems (BAS) provide facility managers with the ability to monitor, track, and respond to the performance of facility assets. Round the clock monitoring ensures that all systems function optimally. Appropriately managed building automation systems increase facility assets reliability and reduce maintenance costs. Large organizations can achieve economies of scale by centralizing facility asset monitoring.
TABLE OF CONTENTS
1 Building Management System ..............................................................................................................1 1.1 1.2 1.3 1.4 1.5 Description ..............................................................................................................................2 Block Diagram...........................................................................................................................3 BMS Introduction .....................................................................................................................4 History .....................................................................................................................................5 Benefits of BMS .......................................................................................................................6 1.5.2 1.5.2 1.5.3 1.5.4 1.5.5 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 2 2.1 2.2 2.3 Building Management ..............................................................................................6 Enhancing Staff Productivity ....................................................................................6 ReducedOperating Cost ...........................................................................................6 Increased Reliability of Plants and Services .............................................................7 Protection of People and Equipment .......................................................................7 Installation -Management and Control Functions ...................................................8 Energy-Management Functions ...............................................................................8 Risk-Management Functions....................................................................................9 Information-Processing Functions ...........................................................................9 Facility-Management Functions ...............................................................................9 Fault Detection and Diagnosis, Maintenance Managament..................................10
Functions of BMS......................................................................................................................7
Sensors ...............................................................................................................................................11 Lighting Control Systems ........................................................................................................12 Purpose of Lighting Control Systems......................................................................................12 Basic Components of Lighting Control Systems .....................................................................13 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.4 2.4.1 2.4.2 Lamps .....................................................................................................................13 Ballasts and Dimming Ballasts ................................................................................13 Dimmers .................................................................................................................14 Analogue Control and Digital Control ....................................................................15 Sensors and Control Devices ..................................................................................15 Passive Infrared Sensors (PIR) ................................................................................17 Ultrasonic Sensors ..................................................................................................18 2.4.2.1 2.4.2.2 2.4.3 Fundamental Utrasonic Properties .....................................................18 Speed of Sound in Air as a Function of Temperature .........................18
Programmable Logical Controller (PLC)...............................................................................................23 3.1 History ....................................................................................................................................24 3.1.1 3.1.2 3.1.3 3.2 3.3 The First Programmable Controller........................................................................24 The Conceptual Design of PLC................................................................................25 Today's Programmable Controller .........................................................................25
Programmable Controllers and the Future ............................................................................26 PLC Applications .....................................................................................................................26 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 Chemical/Petrochemical ........................................................................................27 Manufacturing/Machining .....................................................................................27 Power .....................................................................................................................27 Mining ....................................................................................................................27 Food/Beverages .....................................................................................................27 Micro PLCs ..............................................................................................................29 Small PLCs...............................................................................................................29 Medium PLCs ..........................................................................................................29 Large PLCs...............................................................................................................29 Ease of Installation .................................................................................................30 Ease of Maintenance and Troubleshooting ...........................................................30 Processors ..............................................................................................................32 3.6.1.1 3.6.2 3.6.3 3.6.2.1 3.6.3.1 3.6.3.2 Processor Scan .....................................................................................32 The Input Voltage.................................................................................33 Memory Section...................................................................................34 Memory Structure and Capacity ..........................................................34 System Power Supply .............................................................................................33 Memory Overview..................................................................................................34
3.4
3.5
3.6
3.7
Programming Device ..............................................................................................................35 3.7.1 3.7.2 Mini-Programmers .................................................................................................35 Personal Computers ...............................................................................................36
3.8
Input Devices ..........................................................................................................37 Output Devices .......................................................................................................37 Ladder Diagram and the PLC ..................................................................................38 Ladder Diagram Format .........................................................................................39 Ladder Relay Instructions .......................................................................................39
Project Related Trilogy PLC..................................................................................................................42 4.1 Introduction............................................................................................................................43 4.2 4.3 Simulator ................................................................................................................................46 PLC based Project Work .........................................................................................................47 4.3.1 4.3.2 4.3.2 4.4 4.4.1 4.4.2 4.4.3 4.4.3 Motion Sensor ........................................................................................................47 Door Switch ............................................................................................................47 LDR .........................................................................................................................48 Remote Terminal Units ..........................................................................................49 Master Terminal Units ...........................................................................................49 Modbus ..................................................................................................................49 RS-232 ....................................................................................................................50
Communication Module.........................................................................................................49
GSM .....................................................................................................................................................53 5.1 GSM History............................................................................................................................54 5.2 5.3 5.4 5.5 5.6 Mobile Station ........................................................................................................................54 Base Station Subsystem .........................................................................................................55 5.3.1 ABIS Interface .........................................................................................................55 The Base Station Controller....................................................................................................55 Architecture of the GSM Network .........................................................................................56 SMS Through Hyper Terminal ................................................................................................57 5.6.1 5.6.2 5.7 5.8 5.9 5.10 SMS.........................................................................................................................57 Hyper Terminal .......................................................................................................57
Introduction to AT Commands ...............................................................................................57 General Syntax of Extended AT Commands ..........................................................................60 AT Commands for SMS Text Mode ........................................................................................62 GSM Project Work .................................................................................................................63
CHAPTER 1
1.1 Description
There are some inputs like Motion Sensor, LDR, Lights, Fans, AC and Door Switches. These inputs are connected to the PLC. GSM Module is also connected with PLC as an input. One can ON and OFF the lights and fans manually also. First the motion sensor is enabled through SCADA system. When it detects the motion then lights are ON for 5 mints. Then after 5 mints lights are OFF. We can enable the motion sensor with our requirements. For example in the day, we can enable only two motion sensor which only on two lights with the detection of motion. Door switch is used for data logging. If door is opened then it store date and time of door opening and when door is closed then the date and time of door closing is also stored in the PLC memory. Then there is a GSM module which is connected with PLC. There is enable/disable internal relay. When on make it enable through SCADA system, then after the detection of motion, the message is sent to the specific person. This is used for security purpose. It also tells the room in which motion was detected. The another portion of GSM is that we can ON/OFF the AC. When we send the message through mobile then it goes to the PLC memory through GSM module. The GSM module is connected with PLC via RS-232 serial communication port. Then PLC check that message. If the message is wrong then PLC send the message to the mobile user as Command Error and if message is correct then PLC turn the AC ON/OFF. There is a SCADA system which is attached with PLC through RS-232 communication port. SCADA system is a programming tool, which is installed in the PC. One can control all the devices through SCADA programming tool.
SCADA
RS-232
LDRs
PLC
Security System
Door Switches
Rs-232
GSM Module
Mobile
1.4 HISTORY
The earliest automatic control device happened in 270.B.C. The figure given below shows the water clock device.
Rene-Antoine Ferchault de Reaumur had given some ideas of temperature control. Automatic control of steam engine and many attempts on this engine to improve its efficiency also helped on automatic control system in general. In near 1900s the electricity began playing a part in automatic control systems. Elmer Sperry developed first PID-type control. In 1911, this type of PID control was used in ship steering. Then the Foxboro instrument company invented the pneumatic flapper nozzle amplifier. The control law that we commonly associate with the modern PID loop basically came from Nicholas Minorsky. In 1922, he noticed the helmsman and introduces the integral, proportional and derivative type of control same as we are using today.
In the 1920s many instrument companies made the complete boiler system. During the 1930s, Foxboro instrumental company began making improvements in flapper nozzle systems. At that time controllers were very expensive. In 1936, the first organization was made named as industrial instruments and regulators committee. The goal of this organization was to standardize the control design methods and terminology. During 1940s to 1950s, different companies started to improve their products. For example, the Foxboro Company improved controller that was field adjustable. From the 1930s to 1950s, it was the brilliant time for the electrical and electronics which led to the early systems of weapons, communications and semi-conductor circuitry. Due to small-scale electronics, affordable computers were introduced in the market and those computers were constantly evolved from 1950s to till now. BMS as a phrase introduced in early 1970s. there were also other phrases used for building management referred as building automation system (BAS) or energy management system (EMS). It was the advent of MODEM(modulator-demodulator), which converts analog signal into digital signal so that communication can be carried out over a long distances, that led to the latest building management systems.
considered as a part of BMS. Through EMCS or BEMS the building services can be monitored and controlled which is a significant contribution to the energy consumption of buildings.
Installation-management and control functions; Energy-management functions; Risk-management functions; Information-processing functions; Facility-management functions; Performance monitoring and diagnosis; Maintenance management;
Local control functions are basically provides the permission to the building services so that they can work properly and it also provides sufficient services in the building. Local control functions are also subdivided into two parts: Sequencing control Process control
Sequencing control shows the conditions and orders related with bringing the equipments online or moving them offline. In building management system, sequencing control consist of chillersequencing control, light on/off control, fan-sequencing control etc. Process control is used to adjust the control variables so that accurate results can be achieved. The typical process control in building systems includes temperature control, air and water flow rate control and pressure control. For building processes, common feedback control functions are proportional integral derivative (PID) control, step control and modulating control etc.
supervisory control and local control is that supervisory control interacts among all the components and their related variables and it also gives the overall system level characteristics.
Now days, different software tools are used in the facilities management systems such as NetFacilities, ARCHIBUS/FM etc. These softwares provide information management platform which can be web-based, computer-based space management, work-order administration etc. This software gives the real time collaboration. Practically, many facilities management systems still give the single information management systems. Due to the huge data store, these systems cannot get data form integrated building management systems. In the future, the computer aided facilities and maintenance management systems should provide more efficient management tools.
10
CHAPTER 2
SENSORS
11
Different functions or activities require different visual environment. For example, in lecture hall, there is running a power point presentation so, it need the low luminance during presentation so that the audience can see the presentation clearly and comfortably. And if there is no presentation and lecture is on speaking then it requires high level of luminance for pleasant and effective communication. Similarly, if audience enters in a movie theatre then lights should be on so that they can find out there seats but when the movie starts then lights should be off so that audience can see the movie properly and clearly. So, different lighting-systems are required for different functions. Energy efficiency is very important topic related with lighting-control systems. Lighting-systems consume a great portion of building energy. Energy used by lighting-system can be reduced by providing in the areas where the light is needed and providing the right level of lighting. So, the main control functions for this purpose are on/off switching and dimming. Lighting plays a major role to providing comfortable environment in working and living places. In residential buildings, it also affects the satisfaction of occupants. It also affects the productivity of occupants. Different people require different level of lighting. In some countries, light has become a subject of legislation. Major topics are: setting standards for different activities to show its effectiveness; setting standards for the sake of safety and security; setting standards to use latest lighting technologies for energy efficiency. Although energy management is playing great role but creating a beautiful effects of spaces in fashion has become the major driving force. Light systems can be controlled by balancing
12
different light sources or by the change between one light state and the other for the pleasant environment. Lighting systems can be controlled to provide relaxation and pleasant visual environment. Lighting systems can also be controlled for dynamic environments.
2.3.1 Lamps
Typical lamps are used as general purposes like tungsten halogen lamps, fluorescent lamp etc. Other lamps are like high intensity discharge lamp (HID), high pressure mercury lamps, metal halide lamps, xenon lamps and the lamps for special purposes. Artificial electric lighting started in 1870s when the incandescent lamp was invented. It was the main electric light source until todays applications are more competitive light sources. Even today, it is using in many home applications. Fluorescent lamp belongs to the family of discharge lamp. The function of discharge lamp is that light is produced by electrical discharge within the gas. The main type of fluorescent lamps is the straight tubular lamps which are using most commonly today. The features of fluorescent lamps are high efficiency and long life. Now a day, electronics industry is developing rapidly due to which fluorescent lamps are available in very small size. Due to this latest electronics, the lamps and other electronics components are integrated as compact fluorescent lamps. Compact fluorescent lamps are widely using nowadays in special lamps and also in traditional applications of incandescent lamps.
13
Electromagnetic ballasts just only limit the current but do not change the frequency of input power. So the lamp illuminate on each half cycle of the power supply. That is why, fluorescent lights flitter visibly. Latest ballasts are electronically not electromagnetically. In the electronic ballasts voltages are transformed by using solid state circuitry. And the electronic ballast can also change the frequency of power supply while electromagnetic ballasts can not do this. So thats why electronic ballasts can greatly reduce or illuminate flicker in the lamp. Electronic ballasts are more efficient and they can also work on low temperature. Dimming ballasts are for both linear and compact fluorescent lamps. Benefits of dimming fluorescent lamps are given bellow: Flexibility: allows the lighting systems that they can work on different activities for different functions. Energy saving: saves the energy and also reduces the load in the peak demand periods. Higher comfort: by controlling the light level at desired ranges, satisfaction and comfort can be achieved. Increased lamp life: in specific applications where instead of frequently on and off, by dimming the lamps, lamps life is increased.
Dimming ballasts range is 25-100 per cent, 10-100 per cent, or 5-100 per cent. So by choosing one of them, energy can be saved. Different type of applications requires different dimming range like a 3-100 per cent or 1-100 per cent. Dimming ballasts are divided into two parts: Analogue electronic dimming ballasts Digital electronic dimming ballasts
The common analogue method is 0-10V DC as the control input to the dimming ballast. Digital electronic dimming ballast includes microprocessor and other components. It receive, store and send the information. Microprocessor receives the signal, stores the address of ballast and sends status information. Both digital and analogue ballasts control the output of lamp which is depend on control device. Ballasts are wired with the local and central points where the control signal is generated. This control signal can be generated manually or automatically. Analogue ballasts easily available in the market in lower price and available with a wide range of control devices. Digital dimming ballast gives the higher accuracy of control like it addresses individually, group the ballasts, take the gain feedback information from the ballasts and then make a flexible lighting system.
2.3.3 Dimmers
Dimmers are used to change the brightness of the lamps. By varying the voltage of the lamps, the brightness of the lamps can be changed. For this purpose, the dimmable ballasts of the fluorescent lamps are used to vary the output of lamps.
14
Non-electronic dimmers are reactor dimmers, resistance dimmers and transformer dimmers. Modern dimmers are thyristors, transistors and silicon-controlled resistors. Dimmers are available in different size and capacity. Ordinary light switch is used for residential lighting and multiple channel units are used in theatre lighting or architectural applications. Modern dimmers are controlled by digital control system. Other dimmers are controlled through analogue or digital control. Analogue dimmers operate between 0-10V. They have a separate wire for each dimming channel so that they can receive a control voltage signal. While, there is a built-in microprocessor in the modern dimmers. Their working principle is that, they receive the control signal from controllers and then convert that signal into control signal for switches. They also have diagnostic feedback system and then they send that feedback to the controllers.
15
Light sensors give analogue or digital output for the controllers. Light sensors are designed in such a way that provides 1-10V analogue output through which electronic ballasts are controlled. Some light sensors are designed to provide on/off output through which switch is controlled. Light sensors are coupled through communication interface so that measured output can send to the controllers through control network.
It is a device which detects the infrared energy emitted from any object like human body. PIR is not like normal optical sensor which includes LED transmitter and IR receiver to emit energy. PIR does not emit any type of radiation. As mentioned with it name Passive which shows that it can sense the energy not radiates. Human body is a common object which is sensed by PIR sensor, so this sensor is normally used in automatic light switches, door openers etc. Anybody which has temperature above absolute zero radiates infrared energy. A human eye can not see this infrared energy but pyroelectric material only can sense this energy. This material is pasted on the core of the PIR sensor. When it is sensed the infrared energy then it generates a small amount of electric charge. Then there is an amplifier which amplifies the small amount of
16
voltage generated by the Pyroelectric material. Then this voltage is sent to a comparator. It looks the difference between initial reading of signal and the final output. Sometimes PIR sensor fails to sense the IR energy like a reflection of objects during hot sunny days or flash of bright light. But there are many techniques which can solve these problems. First method is that human body radiates infrared energy at the wavelength of 9 to 10um. So the infrared filter is placed in front of PIR sensor which allows passing the infrared waves within the wavelength 10 to 14um. Second method is that a Fresnel lens is placed in front of PIR sensor. It performs two types of functions. First, it focuses the infrared energy onto the sensor which is emitted over a wide area. Second, it divides the area into hot and cold zones. So when a person walks across the sensor, so infrared value is being changed. So it produces varying output signal from the sensor which shows a motion. Then the comparators works on this changing output and respond to this signal. The items that dont move like heaters and lights do not generate the variation in output. So the comparator does not respond these constant infrared sources.
17
These sensors transmit the ultrasonic waves towards the target and target reflects the sound back towards the sensor. So the system measures the time interval between sending the waves and receiving the echo and then system compute the distance to the target with the help of speed of sound in the medium. So normally these sensors are used for distance measurement. There are many types of ultrasonic sensors available in the market based on environmental sealing, electronics features and mounting configurations. These sensors operate on different frequencies so they have different radiation patterns.
18
The graph which is given below shows the wavelength of sound as a function of frequency at room temperature.
19
Microwave sensor radiate microwave energy which spread throughout the detection area same as ultrasonic sensor works. There is a gun diode which emits the energy ranging in x-range and it is similar with the effect to the Doppler frequency shift. So any movement in the detection field may be activating the alarm system. This sensor does not affect the humans and pacemakers.
2.4.3.1 Design
These motion sensors have two types Mono-static: The system in which emitter and receiver lies in one unit Bi-static: The system in which emitter and receiver contains separate units. Mono-static units defined the area of detection. This area of detection depends upon the emitted microwave beam. The range of detection is up to 400 linear feet. One can configure the beam for a particular situation by making long, short or narrow the beam. Whereas the detection range of bi-static sensor is larger than mono-static sensor which is up to 1500 linear feet. While, this sensor does not allow the user to configure its detection area as precisely as the mono-static sensor. These sensors radiate alternating frequencies, activating and deactivating rapidly, followed by the deactivation of the receiver. So the unit noticed these time intervals to detect motion. Time intervals define the periods through which motion is detected by the receiver, known as Cut-Off region. There is the
20
programming mode in the mono-static sensors which allow that motion can be detected only in the specific time periods.
The protection for all the working production halls is most important at all the times. Door sensor is a switch which can which can detect the opening of door or window. The principle of working of all the doors and window is same, no matter how sophisticated. The switch is mounted towards the door or window and there is a magnet which is attached with the window or door frame. When door or window moves away from the magnet then the switch opens and vice versa. And on the basis of opening of switch alarm is activated. So in our project, when a door is open or close then data logging is activated. In the data logging, time and date are saved during the opening and closing of the doors in the specific given time. We are using the door switch made by AH Automation.
21
These sensors are specially used to sense lightness or darkness. Normally, its resistance is very high and sometimes it so high as 1000000 ohms. But when light falls on it, resistance drops dramatically. Sometimes it is referred as photoconductor or Cds device because Cds is a material which shows variation in resistance with the variation of light. LDR is made by high resistance semiconductor material. When light falls on it with a specific frequency then semiconductor material absorbs photons. These photons energize the bound electrons and they jump from valence band to the conduction band. As a result, free electrons conduct electricity by lowering the resistance.
22
CHAPTER 3
PLC
23
3.1 History
In 1968 the first criteria for designing a Programmable controllers has been made which was specified by the Hydramatic Division of the General Motors Corporation. Their primary goal was to Get rid of the high costs related with non-flexibility, relay controlled Systems. Their main purpose is to provide the following specifications. should be low price control system with relay system which are being used Competent and supportive system should be introduced that can manage itself within the industrial environment. Replacement of input and output interface should be simple. Standard form of controller had to be designed, which provides flexibility in a system. The control system should be capable to pass the collected data to a fundamental system. Re-use of the system should be possible. Programming of the controller should be simple so that it can easy to understand by and person.
Control system usually depends on production requirement. If production requirement change control system will also change due to which it becomes very expensive when the change becomes so common. As relays are mechanical devices they also have a very short lifetime which required strict hold to maintenance schedules and also troubleshooting such device was also quite difficult as there are so may relays. As there are multiple that can be controlled using relays so the circuitry is also very complex and confusing. These "new controllers" had to be programmed easily and controlled and also can be easily maintained. The lifetime had to be long and programming changes easily performed. They also had to survive the harsh industrial environment. That's a lot to ask! The answers were to use a programming technique most
24
Like hardware advances, software advances, such as the ones listed below, have led to more powerful PLCs: PLCs have incorporated object-oriented programming tools and multiple languages based on the IEC 1131-3 standard. Small PLCs have been provided with powerful instructions, which extend the area of application for these small controllers. High-level languages, such as BASIC and C, have been implemented in some controllers modules to provide greater programming flexibility when communicating with peripheral devices and manipulating data. Advanced functional block instructions have been implemented for ladder diagram instruction sets to provide enhanced software capability using simple programming commands.
25
Diagnostics and fault detection have been expanded from simple system diagnostics, which diagnose controller malfunctions, to include machine diagnostics, which diagnose failures or malfunctions of the controlled machine or process. Floating-point math has made it possible to perform complex calculations in control applications that require gauging, balancing, and statistical computation. Data handling and manipulation instructions have been improved and simplified to accommodate complex control and data acquisition applications that involve storage, tracking, and retrieval of large amounts of data.
Programmable controllers are now mature control systems offering many more capabilities than were ever anticipated. They are capable of Communicating with other control systems, providing production reports, scheduling production, and diagnosing their own failures and those of the Machine or process. These enhancements have made programmable controllers important contributors in meeting todays demands for higher quality and productivity. Despite the fact that programmable controllers have become much more sophisticated, they still retain the simplicity and ease of operation that was intended in their original design.
3.3.1 Chemical/Petrochemical
26
Finished product handling Materials handling Mixing Off-shore drilling Pipeline control Metal casting
3.3.2 Manufacturing/Machining
Assembly machines Boring Cranes Grinding Material Conveyor Milling Painting Plating Welding
3.3.3 Power
Sorting Load shedding Coal handling Winding Wood Working
3.3.4 Mining
Ore processing Loading/Unloading Water/Waste Management Bulk Material Conveyor
3.3.5 Food/Beverages
Blending Brewing Container Handling Filling
27
Micro PLCs Small PLCs Medium PLCs Large PLCs Very Large PLCs
I/O Count
The A, B, and C overlapping areas in above figure reflect enhancements, by adding options, of the standard features of the PLCs within a particular segment.
28
effectiveness and simplicity labor power has also reduced a lot due to which labor cost has also reduced.
30
CPU Block Diagram In this Figure, the power supply is enclosed inside the CPU; however, the power supply can be separated from the CPU and can be placed next to it CPU can also be called as processor; however, it contains all those necessary elements that make the system intelligent. In general, the processor executes all the instructions that are written in form of ladder logic diagram and then it is stored in the memory system, while the system power supply provides all of the required voltage levels to make sure that proper operation of the processor and memory components are being performed or not.
3.6.1 PROCESSORS
31
The main function of Processor is to the principal function of the processor is to rule and run the activities of the entire system. The system program also known as executive is used to perform such functions. It is basically as supervisory program which is permanently stored in processor and has a purpose of control, process and communicates with other devices through programming device communication between PLC and the user is accomplished. It can also be used to communicate with other field devices, I/0 modules, operator interface. More than one processor can also be used in a PLCs CPU to perform certain operations. The main purpose of doing this is to increase speed of those operations which has to be performed. This process is known as multiprocessing
32
Above figure shows a graphic representation of the scan. This operation is usually performed in top to bottom process and scanning will repeated again and again to perform operations. The time taken for the PLC to perform operations and update the outputs is known as scan time. This time is usually depends on some factors like the amount of memory used in a program larger the memory more will be the scan time and also on the type of instruction are used as some instructions required more time to execute as compared to other instructions. Single scan time can be vary from a few tenths of a millisecond to 50 milliseconds. However, there are some other factors which can affect scan time like remotely controlling the I/Os as it depends upon the distance. Larger the distance more will be the scan time as PLC has to receive and send data remotely. Monitoring control program can also affect scan time as microprocessor sends the status of the coils and contacts.
33
Executive memory is regarded as to be the part of PLC itself where permanently stored program are placed. Activities like Execution of control program. These supervisory programs direct all System activities, such as execution of the control program and communication with secondary devices etc. This memory is not available for the user. The application memory provides the memory space for the user programmed instruction that provides a storage area for the userprogrammed instructions that structure the application program.
1 and if a voltage is not applied then it shows 0, or we can say that a is ON if the stored information is 1 and if the bit is OFF the stored information is 0. This ON and OFF status is known as bit status Sometimes, a processor must handle more than a single bit of data at a time.
3.7.1 Mini-Programmers
Mini-programmers, are the handheld or manual programmers, which are cheap and a convenient way to program small PLCs (up to 128 I/O).Physically, these devices are similar to calculator but their display is quite big. The display screen is usually of LED or dot matrix. Some controllers have also built-in mini-programmers. In some instances, these built-in programmers can be removed from the PLC. They are mainly used for editing and monitoring. These programmers are designed in such a way that they can easily be used with more than one controller or they are more-friendly with other.
35
36
PC connected to PLC
37
3.9 Introduction to ladder programming language: 3.9.1 Ladder Diagram and the PLC
The ladder diagram usually works on conditional statements i.e the operation which are depend on the certain conditions as an input switch is on it has to perform certain operations according to those conditions implemented by the user. Instructions that are executed should be execute in a sequence. This can be done in the form of a circuit diagram and not in coding like c or assembly.
38
Coding can be done inside a logic diagram and these logics are related to field devices attached to any system. Representing ladder logic in the form of circuit diagram will help user to understand easily and also be acceptable in different industries. This type of Circuit diagram is known as Ladder Diagram which is obvious for the engineer or programmer. It plays a very important role for implementing any control system. Figure given below illustrates a relay ladder logic circuit and the PLC ladder language representation of the same circuit. The original ladder language has evolved the ladder programming into a more powerful instruction set. New functions have been added to the basic relay, timing, and counting operations. that is, handle and transfer data within the programmable controller. These instructions are followed by the simple principles of basic relay logic, although they allow complex operations to be implemented and performed. Set of instruction has also been added to the basic ladder logic also include function blocks which operates on a block of data.
39
The input condition is responsible to control the output and to perform functional operations which are in the ladder diagram program. Ladder diagrams achieving this control by using rungs, figure shows the basic structure of a ladder rung. In general, a rung consists of a set of input conditions which is at the start of every rung and an output instruction at the end of the rung (represented by a coil symbol). The contact instructions for a rung may be referred to as input conditions, rung conditions, or the control logic. A ladder rung is TRUE when it has logic stability. Logic stability exists when power flows through the rung from left to right. The execution of an event occurs when continuity is provided to the output. Continuity depends on the path, if it is closed then continuity occurs which allows the power to flow from left to right. In a single rung more than one output coils can exists, which represents the status of the function being performed, will activate the block to perform the instruction. Thus, this instruction says: if the input is ON because the desired logic has continuity, then execute the block instruction.
40
Table lists common ladder relay instructions. In a program, each contact and coil has a given address number, which identifies what is being estimate and what is being controlled. The address number represents the I/O table location of the input/output which are used in the program. A contact can be used throughout the control program in order to evaluate the condition. The format of the rung contacts used in a PLC program depends on the preferred control logic. The placement of contacts is usually depends on the output which has to be controlled. It can be placed in series, parallel or series/ parallel configuration. After the placement is finished that depends upon the logics then the continuity is checked from left to right. If continuity exist, then the rung condition is true if it doesnt then it is false.
timer base is of 1 second then it should be count 20 times to give the delay of 20 seconds to perform specific output operation. Sometimes a delay of .01 sec or more is required as the ON time of PLC is more as compared to the other components. This delay is given to perform a roper operation. Counter instructions are used to count number of events, an example can be of conveyor belt where different types of products can be passed like boxes, bottles and other components and counter will count those components etc. Counters and timers have two values that are a preset value and an accumulated value. The preset value is the required number of ticks that has to be performed before the output turns ON. The accumulated value shows the current value or the number of ticks that have gone during the timer or counter operation. The preset and the accumulated values are stored in their specified register which preset register and accumulated register. The value of both these registers is defined while writing a program.
42
CHAPTER 4
43
4.1 Introduction
The reason of using this PLC is because it is very cheap as compare to other PLCs and in the situation of Pakistan these days people cant afford to buy other expensive PLCs like Allen Bradley and Siemens.
Model: PLC model which we are using is of M-series. I/O ports: It has 24 I/O ports. Software: The software for using this PLC is trilogy and we are using trilogy version 6.31. The
following ladder logic functions are used in this software: The list of functions which are in this programming language are as follow:
The symbols and their function are shown in the above figure
44
In ladder logic programming, first we have to initialize the number of I/Os used according to the program as shown in figure below: The symbol which discussed earlier can be seen in the figure by clicking on circuit and then click on Insert Circuit The I/O table is the table where we initialize our function names which have to be used in the program along with their address. Address in necessary to describe as without it program will unable to run properly. The function names which we described in the I/O table must be used while making ladder logic or else the software wont recognize it. The I/O table can be seen in the figure below:
45
Function name can also be made while writing a ladder logic program in the software by double clicking on the input switch or output coil for example;
There are also some custom functions which we can program according to our requirements.The window used for custom functions is shown in the figure below.
46
This screen can be appeared by clicking on the open cusfn button which is on the middle top of the programming screen. This function is usually used to write the programs in C and assembly language which is store inside the custom function and when this function is called inside the ladder logic program then it perform certain operation depends upon the code that has been written in this function.
4.2 Simulator
This software has a built in simulator which is used to diagnose the ladder logic programming. Once the programming is finished we can check it if the program is working fine or not. From the figure shown below it can be seen that the simulator has separate table for each function like input, timer counter relay and output. In this figure you can see the function names which are made according to the function requirement in the function table. Now the address of these functions can be seen from the left side of these function by clicking on these addresses function will start performing.
47
This is the ladder diagram of controlling Motion sensor through trilogy. Here we are controlling it in such a way that if motion sensor, sense any motion it will turn on the lights and after sensing it, if it doesnt detect any motion it will turn off the lights after 5 minutes. We have generated the delay of 5 minutes by using timer in it. Motion sensor will work only if input switch m_enabled is ON otherwise only mechanical system will work. Here m_enabled is an internal relay. We can ON or OFF this switch by using scada software which is connected to PLC We are also using motion sensor for security purpose which we have discussed in GSM topic.
48
The table given below shows the initialization of numbers in which date and time can be saved during the opening or closing of door on the given times. .
4.3.3 LDR
We are using LDR for outside lightening system. If the intensity of sunlight is low with the specific level then it will turn ON the lights. If the intensity of sunlight is high with certain level it will turn off the lights and that process will goes on. The simple ladder diagram logic of LDR is shown below:
49
Ethernet/modem:
ASCII modem: It is used for Serial communication with RS-232 or 485 4.4.1 Remote Terminal Units
An RTU converts the Analog signals from the equipment to its digital value. Their purpose is to collect digital information and they are installed in the field in the form of small computerized units. RTUs are used to collect information and gather reports from sensors and sends the command to the relays Gathering of data from field devices like pump, valves, alarm etc cant be achieved until The MTU starts a send command.
4.4.3 Modbus
In 1979 Modicon published this serial communications protocol to use it with programmable logic controllers (PLCs). It becomes very famous these days and it is very simple to use, and now it is easily available in the market. It is being used a lot in the industrial environment. The reasons are as follow:
50
It has been developed with industrial applications in mind It is openly published and royalty-free It is easy to position and preserve
By using Modbus, communication between approximately 240 devices connected to the same network can be possible, for example we can measures temperature and humidity and corresponds the results to a computer. To connect supervisory control and data acquisition (SCADA) systems with RTU, Modbus is also used. Each device which have to communicate using Modbus should have a unique address. A Modbus command contains the Modbus address of the device it is planned for. Only the planned device will act on the command, even though other devices might receive it. All Modbus commands also checks the information to make sure that that a command arrives undamaged There are many modems and gateways that support Modbus, as it is a very simple protocol and often copied. Some of them were specifically designed for this protocol.
4.4.4 RS-232
Rs-232 is used for serial communication. USB is faster as compared to RS-232, It is designed to make easier for device drivers to communicate with hardware. USB includes a protocol for transferring data to devices which makes it complex than the RS-232, also USB cant be used for more than 5 meters of cable, so for longer distances, RS-232 is normally used. The data communication links used with peripheral equipment can be unidirectional or bidirectional. If a peripheral is strictly either an input or an output device, then data transmission occurs in only one direction. In this case, a unidirectional serial signal line is all that is required to complete the link. Devices that serve as both input and output devices (e.g., video terminals) require bidirectional links. There are two ways to achieve this bidirectional communication. First, a single data line can be used as a shared communication line. The data can be sent in either direction, but only in one bidirectional communication is required; two lines can connect the PLC to the peripheral. One line would be assigned permanently as an input, while the other would be a permanent output. This mode is known as full duplex.
(a) Unidirectional
51
(b) Half-duplex
52
The EIA RS-232 is a proclaimed standard that defines the interfacing between data equipment and communication equipment that employs serial binary data interchange. This standard defines both the electrical signals and the mechanical details of the interface. A complete RS- 232C interface consists of 25 data lines, which encompass all of the possible signals for simple and complex communication interfaces. Although several of these lines are specialized and a few are undefined, most peripherals require only three to five lines to operate properly. Table 8-3 describes the 25 data lines as specified by the EIA. Figure 8-44a illustrates an RS-232C data communication system using a telephone modem, while Figure 8-44b shows the RS-232 wiring connections from a computer to a smart EIA PLC interface module.
RS-232 wiring connections from a PLC with Computer The RS-232 standard calls for certain electrical characteristics. Some of these specifications are as follow: The signal voltages at the interface point should be a minimum of +5 V and a maximum of +15 V for logic 0; for logic 1, the minimum is 15 V and the maximum is 5 V. The maximum recommended cable distance is 50 feet, or 15 meters; however, longer distances are permissible provided that the resulting load capacitance, measured at the interface point and including the signal terminator, does not exceed 2500 picofarads. The drivers used must be able to withstand open or short circuits between pins in the interface. The load impedance at the terminator side must be between 3000 and 7000 ohms, with no more than 2500 picofarads capacitance. Voltages under 3 V (logic 1) are called mark potentials (signal conditions); voltages above +3 V (logic 0) are called space voltages.
53
54
55
password or personal identity number can be provided from the SIM card for the protection against unauthorized use.
The BTS or Base Transceiver Station is also called an RBS or Remote Base station. Traffic gets sent their first as the base station is under direction of a base station controller. Calls can be gathering from many base stations and passes them on to a mobile telephone switch. From that switch calls can be received and transmit from the regular telephone network.
56
57
58
Connection
Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).
Lock Facility
Perform security-related tasks, such as opening or closing facility locks (AT+CLCK), checking whether a facility is locked (AT+CLCK) and changing passwords (AT+CPWD). (Facility lock examples: SIM lock [a password must be given to the SIM card every time the mobile phone is switched on] and PH-SIM lock [a certain SIM card is associated with the mobile phone. To use other SIM cards with the mobile phone, a password must be entered.])
SMS Read
In order to read any message, syntax will be AT+CMGR=1
59
SMS Deletion
In order to delete any message from memory, Its syntax will be: AT+CMGD=1 It will delete the first message
SMS Write
In order to write a SMS to any number, syntax will be AT+CMGW=03002453603; This command firstly send the request to a given destination and the number send back a sign like > and then we write a message and sent it to the given number shown above
AT Command Operations
There are four types of AT command operations:
Test operation
A test operation is used to check whether a certain AT command is supported by the GSM/GPRS modem or mobile phone.
Set operation
A set operation is used to change the settings used by the GSM/GPRS modem or mobile phone for certain tasks.
Read operation
A read operation is used to retrieve the current settings used by the GSM/GPRS modem or mobile phone for certain tasks.
Execution operation
An execution operation is used to perform an action or retrieve information/status about the GSM/GPRS modem or mobile phone.
Extended Commands
Extended commands are as follow:
60
AT commands that start with "+". All GSM AT commands are extended commands. For example, +CMGS (Send SMS message), +CMSS (Send SMS message from storage), +CMGL (List SMS messages) and +CMGR (Read SMS messages) are extended commands.
Syntax rule 1
All command lines must start with "AT" and end with a carriage return character. (We will use <CR> to represent a carriage return character in this SMS tutorial.) In a terminal program like HyperTerminal of Microsoft Windows, you can press the Enter key on the keyboard to output a carriage return character.
Example
To list all unread inbound SMS messages stored in the message storage area, type "AT", then the extended AT command "+CMGL", and finally a carriage return character, like this: AT+CMGL<CR>
Syntax rule 2
A command line can contain more than one AT command. Only the first AT command should be prefixed with "AT". AT commands in the same command-line string should be separated with semicolons.
Example
To list all unread inbound SMS messages stored in the message storage area and obtain the manufacturer name of the mobile device, type "AT", then the extended AT command "+CMGL", followed by a semicolon and the next extended AT command "+CGMI": AT+CMGL;+CGMI<CR> An error will occur if both AT commands are prefixed with "AT", like this: AT+CMGL;AT+CGMI<CR>
Syntax rule 3
A string is enclosed between double quotes.
61
Example
To read all SMS messages from message storage in SMS text mode (at this time you do not need to know what SMS text mode is. More information will be provided later in this SMS tutorial), you need to assign the string "ALL" to the extended AT command +CMGL, like this: AT+CMGL="ALL"<CR>
Syntax rule 4
Information responses and result codes (including both final result codes and unsolicited result codes) always start and end with a carriage return character and a linefeed character.
Example:
After sending the command line "AT+CGMI<CR>" to the mobile device, the mobile device should return a response similar to this: <CR><LF>Nokia<CR><LF> <CR><LF>OK<CR><LF> The first line is the information response of the AT command +CGMI and the second line is the final result code. <CR> and <LF> represent a carriage return character and a linefeed character respectively. The final result code "OK" marks the end of the response. It indicates no more data will be sent from the mobile device to the computer / PC. When a terminal program such as HyperTerminal of Microsoft Windows sees a carriage return character, it moves the cursor to the beginning of the current line. When it sees a linefeed character, it moves the cursor to the same position on the next line. Hence, the command line "AT+CGMI<CR>" that you entered and the corresponding response will be displayed like this in a terminal program such as HyperTerminal of Microsoft Windows: AT+CGMI Nokia OK
Mode Testing
There are two types of mode text mode and PDU mode. To select one of the mode, its syntax will be as follow: AT+CMGF=1 This command shows that the mobile set is in text mode IF AT+CMGF=0 Then it is in PDU mode
AT+CSMS: Select Message Service AT+CPMS: Preferred message storage AT+CMGF: Message Format AT+CSMP: Set Text Mode Parameter AT+CSCA: Service center Address AT+CSDH: Show Text Mode Parameter AT+CSCB: Select Cell Broadcast Message Types AT+CSAS: save settings AT+CRES: Restore Settings AT+CMGL: List Message AT+CMGR: Read Message AT+CMGS: Send Message AT+CMSS: Send Message from Storage AT+CMGW: Write Message to Memory
63
2) We also using GSM module for tuning the AC ON or OFF. First we save the message in PLC memory for turning ON or OFF the AC then whenever user send a message to GSM module, it will compare the text which is send b the user with the text which is stored in PLC memory. If the text matched then the AC will ON or OFF according to the user requirement.
64
65
66
Initialization
for i=1 to 500 dm[i]=9999 next
Door Opening
for n=1 to 16 if time[1]>=20 & time[2]>=0 | time[1]<=7 & time[2]>=0 then
endif
endif
67
next
Door Closing
for o=17 to 32 if time[1]>=20 & time[2]>=0 | time[1]<=7 & time[2]>=0 then
69
if ctrpv[1]=7 then dm[29]=time[1]*100+time[2] dm[30]=date[3]*100+date[2] endif if ctrpv[1]=8 then dm[31]=time[1]*100+time[2] dm[32]=date[3]*100+date[2] endif endif next
70
BIBLIOGRAPHY Websites
http://www.3gcontrols.co.uk/what-is-bms http://www.reuk.co.uk/PIR-Sensors.htm http://www.technologystudent.com/elec1/ldr1.htm http://www.building-automation-consultants.com/building-automation-history.html http://www.moeller.net/en/products_solutions/solutions/safety/products/safety_door-switches.jsp http://bizsecurity.about.com/od/physicalsecurity/a/security_system.htm http://en.wikipedia.org/wiki/Building_management_system
http://www.privateline.com/mt_gsmhistory/ http://www.wifinotes.com/mobile-communication-technologies/gsm-architechture.html
Books
Shengwei Wang, Intelligent Buildings and Building Automation, published by Spon Press, 2 Park Square, Milton Park, Abingdon, Oxon OX14 4RN, 2010. L.A Bryan and E.A Bryan, Programmable Controllers, Published by Industrial Text Company, Industrial Text and Video Company 1950 Spectrum Circle Tower A-First Floor Marietta, Georgia 30067 (770) 240-2200 (800) PLC-TEXT, 1988, 1997. Hugh Jack, Automatic Manufacturing Systems With PLCs, Version 5.0, May 4, 2007, 19932007.
71