Monday, April 27, 2009

Duminda Silva and 17th Amendment, a plea to the opposition

Dear opposition politicians,

Why in the gods name are you being silent while the country is exploited by corrupted politicians?

We are truly disappointing by the lifeless way the opposition is tackling the political issues.A real democracy need a strong opposition. But what we see is an opposition for namesake only...


For instance you can fight for the 17th amendment to be implemented, and as long as it is not implemented you can use that to blast the government. The base is you can make a front with JVP and all leftist parties as well as JHU to make this a successful fight to achieve rights of the people.

Now is the time to wake up and do the duty to our motherland!
It is said that Duminda Silva has murdered a boy and you can use that to highlight the need for independent commissions and the 17th ammendment.Make that your main slogon and we will be there to back you up when the need arises.

Or is it that you truly don't need independent commissions and hope to exploit the corrupted power when you come to power?

So if you are sincere as the opposition please do this for the people.

For a better country filled with freedom and justice!

where the gangs, underworld and thugs have no say!

Thursday, April 2, 2009

OPC for HMI development


How a HMI connects to the PLC


What is OPC?
OPC is open connectivity via open standards. They fill a need in automation like printer drivers did for Windows. See the summary of current and emerging OPC Specifications and OPC Certification.
OPC is open connectivity in industrial automation and the enterprise systems that support industry. Interoperability is assured through the creation and maintenance of open standards specifications. There are currently seven standards specifications completed or in development.
Based on fundamental standards and technology of the general computing market, the OPC Foundation adapts and creates specifications that fill industry-specific needs. OPC will continue to create new standards as needs arise and to adapt existing standards to utilize new technology.
OPC is a series of standards specifications. The first standard (originally called simply the OPC Specification and now called the Data Access Specification) resulted from the collaboration of a number of leading worldwide automation suppliers working in cooperation with Microsoft. Originally based on Microsoft's OLE COM (component object model) and DCOM (distributed component object model) technologies, the specification defined a standard set of objects, interfaces and methods for use in process control and manufacturing automation applications to facilitate interoperability. The COM/DCOM technologies provided the framework for software products to be developed. There are now hundreds of OPC Data Access servers and clients.
Everyone's favorite analogy for needing the original Data Access Specification is printer drivers in DOS and then in Windows. Under DOS the developer of each application had to also write a printer driver for every printer. So AutoCAD wrote the AutoCAD application and the printer drivers. And WordPerfect wrote the WordPerfect application and the printer drivers. They had to write a separate printer driver for every printer they wanted to support: one for an Epson FX-80 and one for the H-P LaserJet, and on and on. In the industrial automation world, Intellution wrote their Human Machine Interface (HMI) software and a proprietary driver to each industrial device (including every PLC brand). Rockwell wrote their HMI and a proprietary driver to each industrial device (including every PLC brand, not just their own).
Windows solved the printer driver problem by incorporating printer support into the operating system. Now one printer driver served all the applications! And these were printer drivers that the printer manufacturer wrote (not the application developer). Windows provided the infrastructure to allow the industrial device driver's solution as well. Adding the OPC specification to Microsoft's OLE technology in Windows allowed standardization. Now the industrial devices' manufacturers could write the OPC DA Servers and the software (like HMIs) could become OPC Clients.
The resulting selfish benefit to the software suppliers was the ability to reduce their expenditures for connectivity and focus them on the core features of the software. For the users, the benefit was flexibility. They could now choose software suppliers based on features instead of "Do they have the driver to my unique device?" They don't have to create a custom interface that they must bear the full cost of creating and upgrading through operating system or device vendor changes. Users were also assured of better quality connectivity as the OPC DA Specification codified the connection mechanism and compliance testing. OPC interface products are built once and reused many times; hence, they undergo continuous quality control and improvement.
The user's project cycle is shorter using standardized software components. And their cost is lower. These benefits are real and tangible. Because the OPC standards are based in turn upon computer industry standards, technical reliability is assured.
The original specification standardized the acquisition of process data. It was quickly realized that communicating other types of data could benefit from standardization. Standards for Alarms & Events, Historical Data, and Batch data were launched.

The OPC server is the intermediate layer which helps the PLC and HMI talk to each other. It acts as interpreter.
Why do we need the OPC server?
It is because there are different HMI software and Different PLCs. If the HMI is manufactured to talk with a specific PLC directly, then it won’t be able to talk with any other (different make), so in order to be able to use any PLC with any HMI, the industry has defined the OPC standard. The HMI software manufacturer should present his specific OPC server software to the clients, and by using that, the clients can connect any PLC (Which supports Modbus) to that HMI .





* DCS - Distributed Control System
* HMI - Human Machine Interface
* SCADA - Supervisory Control and Data Acquisition
* PLC - Programmable Logic Controller
* DAQ-Data Acquisition


Programmable Logic Controllers (PLC)

Specialised hardened computers, referred to as programmable logic controllers (PLCs), are frequently used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events. This leads to precisely controlled actions that permit a tight control of almost any industrial process.
Human-machine interfaces (HMI) or computer human interfaces (CHI), formerly known as man-machine interfaces, are usually employed to communicate with PLCs and other computers, such as entering and monitoring temperatures or pressures for further automated control or emergency response. Service personnel who monitor and control these interfaces are often referred to as stationary engineers.
Automation is now often applied primarily to increase quality in the manufacturing process, where automation can increase quality substantially. For example, automobile and truck pistons used to be installed into engines manually. This is rapidly being transitioned to automated machine installation, because the error rate for manual installment was around 1-1.5%, but has been reduced to 0.00001% with automation. Hazardous operations, such as oil refining, the manufacturing of industrial chemicals, and all forms of metal working, were always early contenders for automation.

PLC ladder Programming
The simple programming language which is used to a program PLC is called ladder language due to its similarity in structure to a ladder. It connects the input to the outputs according to the desired control algorithm. It is very simple and graphical; in short Ladder is a very intuitive language which one can easily learn with ease.

MultiProg
Multiprog is a versatile ladder programming GUI / IDE used to write debug and simulate Ladder programs for various types of PLCs.
Here we consider writing a Ladder program for the ADAM 5100 series PLC.
Install Mutiprog demo provided with the CD.
Creating a new project using the Project Wizard
First we create a new, empty project named 'Demo' using the Project Wizard. After starting the Project Wizard it guides you in six steps through the project creation. Each step is performed in a separate dialog:
• Dialog 1: we enter the project name 'Demo'.
• Dialog 2: for the first POU, which is inserted automatically by the Project Wizard, we choose the programming language LD (Ladder Diagram) and enter the name 'LD_POU'.
• Dialog 3: for the configuration, which describes the characteristic of the connected PLC, we accept the default name 'Configuration' and select the configuration type 'IPC_30'.
• Dialog 4: for the resource, which describes the processor type of the connected PLC, we accept the default name 'Resource' and the resource type 'PCOS_NT'.
• Dialog 5: for the task, in which the defined POU is running, we accept the default settings.
• Dialog 6: shows a project description, which is an overview of the settings we have made in the dialogs 1 to 5.
After clicking 'Finish' in the last dialog, the project will be created and inserted in the project tree window. You can see the newly generated project with its POU 'LD_POU' in the subtree 'Logical POUs' and the configuration, resource and task in the subtree 'Physical Hardware'.
Once the project has been created we can proceed with phase 2: Developing the program code.
In the second phase we develop the program code in Ladder Diagram using the graphic editor. Since the code body worksheet of our LD_POU is already opened we can immediately start editing.
This phase shows you how to:
• Insert a first LD network into the worksheet consisting of a contact (C000) and a coil (C001).
• Insert and declare variables for the LD objects (C000 and C001) using the dialog 'Contact/Coil Properties'.
For the contact the variable 'On_Off' is inserted and declared as global variable. Since this contact is used as ON/OFF switch, which has to be "pressed" by the user, it is declared as located variable and assigned to a physical input address. This means that clicking on the related LED in the I/O simulator sets the variable and starts the timer.
For the coil the variable 'Motor' is declared. This is also a global and located variable, assigned to a physical output address. It represents the motor status, i.e. it lights up in the I/O simulator if the motor runs.
The detailed settings of these objects are listed in the table below.
• Insert the function block TON (Timer On-Delay) into the LD code worksheet using the Edit Wizard. As FB instance name we choose 'Motor Time'. The function block is inserted directly into the existing LD network. As input variable the contact 'On_Off' is used and the coil 'Motor' is connected to the FB output 'Q'.
• Insert and declare a constant and a variable, both connected to the function block TON.
The FB input 'PT' is connected to a time constant 'T#5s' (5 seconds). This input specifies the preset time interval (delay time) after which the FB output 'Q' is set to TRUE and the motor is switched on. Output 'ET' is connected to the variable 'Actual_Time' which delivers the elapsed time interval. For both the constant and the variable the data type 'TIME' is used.
Settings for the LD objects:
Object Variable name Usage Data Type I/O address Scope
Contact On_Off VAR_EXTERNAL BOOL %IX0.0 Global
Coil Motor VAR_EXTERNAL BOOL %QX0.0 Global

After the edit process is finished we have to compile the project as shown in phase 3.
In the third phase we compile the project 'Demo' using the command 'Make'.
Compiling means translating and transforming the contents of the worksheets to special code which can be executed by your PLC or the I/O simulator.
While compiling the project, the message window shows you the compilation process. Any detected errors and warnings (e.g. syntax errors, memory or file problems) are displayed in the appropriate sheet in the message window. Accessing the code body worksheet causing an error message is simply done by double clicking on the corresponding message.
Afterwards we can proceed with phase 4 and download the project to the target.
In the fourth phase we download (i.e. send) the compiled project 'Demo' to the I/O simulator using the control dialog and the dialog 'Download'.
If the project is stored on the simulation (PLC) we can proceed with phase 5 and perform a PLC cold start.
Once the project is downloaded to the target we perform a cold start. While the PLC program is executed on the simulation, we want to verify whether the code is works correctly. For that purpose the system provides several debug tools.
This phase shows you how to
• execute a cold start of the simulation.
• Call the graphic editor in online mode to display online values in the LD worksheet.
• Use the I/O simulator to verify that the On/Off switch for starting the motor works properly.

Creating a HMI to work with the PLC
Why do we need a HMI?
Assume a situation of a heater control. What if the user needs to change the heater temperature set point?
We will have to disconnect PLC from the system and then we will have to edit our program source to reflect the new temperature and download again to the PLC.
With a complex program this will a very time consuming and error prone process. So in order to solve this problem we need a HMI. Then the user will enter the new value to the HMI GUI presented at the touch panel PC and the values of the set point of the PLC will automatically change.








How a HMI connects to the PLC


What is OPC?
OPC is open connectivity via open standards. They fill a need in automation like printer drivers did for Windows. See the summary of current and emerging OPC Specifications and OPC Certification.
OPC is open connectivity in industrial automation and the enterprise systems that support industry. Interoperability is assured through the creation and maintenance of open standards specifications. There are currently seven standards specifications completed or in development.
Based on fundamental standards and technology of the general computing market, the OPC Foundation adapts and creates specifications that fill industry-specific needs. OPC will continue to create new standards as needs arise and to adapt existing standards to utilize new technology.
OPC is a series of standards specifications. The first standard (originally called simply the OPC Specification and now called the Data Access Specification) resulted from the collaboration of a number of leading worldwide automation suppliers working in cooperation with Microsoft. Originally based on Microsoft's OLE COM (component object model) and DCOM (distributed component object model) technologies, the specification defined a standard set of objects, interfaces and methods for use in process control and manufacturing automation applications to facilitate interoperability. The COM/DCOM technologies provided the framework for software products to be developed. There are now hundreds of OPC Data Access servers and clients.
Everyone's favorite analogy for needing the original Data Access Specification is printer drivers in DOS and then in Windows. Under DOS the developer of each application had to also write a printer driver for every printer. So AutoCAD wrote the AutoCAD application and the printer drivers. And WordPerfect wrote the WordPerfect application and the printer drivers. They had to write a separate printer driver for every printer they wanted to support: one for an Epson FX-80 and one for the H-P LaserJet, and on and on. In the industrial automation world, Intellution wrote their Human Machine Interface (HMI) software and a proprietary driver to each industrial device (including every PLC brand). Rockwell wrote their HMI and a proprietary driver to each industrial device (including every PLC brand, not just their own).
Windows solved the printer driver problem by incorporating printer support into the operating system. Now one printer driver served all the applications! And these were printer drivers that the printer manufacturer wrote (not the application developer). Windows provided the infrastructure to allow the industrial device driver's solution as well. Adding the OPC specification to Microsoft's OLE technology in Windows allowed standardization. Now the industrial devices' manufacturers could write the OPC DA Servers and the software (like HMIs) could become OPC Clients.
The resulting selfish benefit to the software suppliers was the ability to reduce their expenditures for connectivity and focus them on the core features of the software. For the users, the benefit was flexibility. They could now choose software suppliers based on features instead of "Do they have the driver to my unique device?" They don't have to create a custom interface that they must bear the full cost of creating and upgrading through operating system or device vendor changes. Users were also assured of better quality connectivity as the OPC DA Specification codified the connection mechanism and compliance testing. OPC interface products are built once and reused many times; hence, they undergo continuous quality control and improvement.
The user's project cycle is shorter using standardized software components. And their cost is lower. These benefits are real and tangible. Because the OPC standards are based in turn upon computer industry standards, technical reliability is assured.
The original specification standardized the acquisition of process data. It was quickly realized that communicating other types of data could benefit from standardization. Standards for Alarms & Events, Historical Data, and Batch data were launched.

The OPC server is the intermediate layer which helps the PLC and HMI talk to each other. It acts as interpreter.
Why do we need the OPC server?
It is because there are different HMI software and Different PLCs. If the HMI is manufactured to talk with a specific PLC directly, then it won’t be able to talk with any other (different make), so in order to be able to use any PLC with any HMI, the industry has defined the OPC standard. The HMI software manufacturer should present his specific OPC server software to the clients, and by using that, the clients can connect any PLC (Which supports Modbus) to that HMI .





* DCS - Distributed Control System
* HMI - Human Machine Interface
* SCADA - Supervisory Control and Data Acquisition
* PLC - Programmable Logic Controller
* DAQ-Data Acquisition

Computer Control of processes

Not just specialized Computers but also General Purpose Computers (PC) is also used in automation. Here we look at how to Control processes solely using General Purpose computers (PC based control).

Software
Software used here is Adamview, a product of Advantech.
Hardware
The hardware needed is popularly referred to as Data Acquisition Modules. The ones we use here are the ADAM 4000 series modules, but usually any module can be used given that they confirm to the open Modbus standard.
The different modules have different uses,
1. Digital input - ADAM-4014
2. Digital output- ADAM-4060
3. Analog input-ADAM-4011/12/13
4. Analog output- ADAM-4021/4024
5. converters- ADAM-4522
6. GSM communication – ADAM-4581 // insert pictures from manual
The modules are supplied with voltage ~20v dc.

Communication
The modules are daisy chained using twisted pair cables using the RS 485 communication protocol. The Communication to computer occur using RS 232 serial (COM) port. A RS 232 to RS 485 converter module is used at the PC side to connect to the serial cable.
Any software can be used with modules of any manufacturer given that all conform to the open MODBUS standard.
Structure of PC based Control

Task
This is the place that the control logic is setup. There is GUI blocks to do mathematical logical operations PID control IO etc... The control logic is implemented using these blocks. If the given blocks are not sufficient the logic can be built by programming with inbuilt visual basic language.
This has DDE and OLE support, thus the software can be used as a data center and logic / GUI can be implemented in VB/C excel etc.
Display
This is the place where the GUI or HMI is setup. The HMI is needed when the set points need to be changed (when a process by process input is needed) or real time values of processes are needed to be displayed for monitoring.
The machine operator interacts solely with the HMI, which is usually a industrial PC with a touch panel screen.
Tag: A tag is an object which helps to connect user input to the control logic.
Note: The Inputs/outputs can be easily connected to the Display without hassle, but we need to make a tag to connect from display to Task.
Steps in designing a Control program
1. Install ADAMview provided with the CD
2. Configure the devices settings ( thermocouple type, IO, communication speed etc ) using ADAM-4000-5000 Utility
3. Start ADAMview Device manager and add required modules (for simulation add DEMO)
4. Start the ADAMview builder utility (This is the HMI/SCADA control software referred to as just ADAMview)
5. Let’s start with a simple application, Control of a Heater. The input is taken from a thermocouple (here it can be simulated (sine wave)) and the output is digital (to a heater).
6. Click on task pane. Add analog input by clicking on AI
7. Inside its properties select device as DEMO
8. Go to Display -> insert label ‘Temperature’->add GUI component -numeric display item-> right click on it ->select input from ->Task1->Al1. Now we have configured this display to get input from the Analog input we set up earlier.
9. Select run and see the analog input in display varying with time. Stop it.
10. Insert label ‘set point’->then insert numeric control display item beside it.
11. Go to Task and add a TAG. Configure it to point to DISPLAY1 -> NCTL1
12. Add digital output ‘DO’ to work area. select device (if not available select DEMO)
13. Now add (SOC1) single calculation block and connect Al1 and tag1 to it.
14. Click on soc1 and configure it as <= (tag1=operand1 , Al1=op2)
15. Connect output of SOC1 to DO1. We have completed the construction of the basic control program.
Now do this to see the status of the heater.
1. Go to Display -> add Indicator
2. Right click on it and choose select ->Task1-> DO1
Now run the program to see the simple control of heater using the PC.
A more complex Program will be included in the CD.

Sensors in Industrial Automation


Thermocouple

Thermocouples are a widely used type of temperature sensors. It gives a mV output which is proportional to the temperature of the junction. They are cheap and interchangeable, have standard connectors, and can measure a wide range of temperatures.

Linear Transducer

Measures linear distance uses potential division as measuring principle an encoder is used for the angular motion.

Load cell

Force transducers are used in all industrial weighing applications.

Humidity sensor

Humidity sensors are used in all climate control processes.

Pressure sensors

Uses the strain gauge principle to measure pressure.

Level sensors

Measures the level of a liquid/solid in container.

Proximity Switches

Usually used to detect material in a conveyor. Gives a digital output according to the sensing of material. There are 4 types, Capacitive, Inductive, Magnetic and photoelectric.

Industrial Automation a first hand experience



In this era of technological marvels spanning from terrestrial travel to cloning, automation of every aspect of Industry is the future of our species.
From the Stone Age, Iron Age to the Modern atomic age, humans have strived to make their lives easy, safe and comfortable by using technology. Technological improvement has been an offspring of that burning passion of humanity.
The manner that this objective has been achieved is through automation. In other words technology has been the creation of humans, to automate the various tasks that are necessary for living.
Automation has done wonders for mankind. The superb efficiency, precision and accuracy can never be achieved by manual methods.
With an ever increasing population, we are straining the already fragile balance of nature. As the resources are decreasing in an exponential manner, it is an obvious fact that automation is the only hope for the survival of our kind. Therefore it is of utmost importance that the future engineers are aware of the basics of industrial automation.
Industrial automation is the use of robotic devices to complete manufacturing tasks. In this day and age of computers, industrial automation is becoming increasingly important in the manufacturing process because computerized or robotic machines are capable of handling repetitive tasks quickly and efficiently.
Machines used in industrial automation are also capable of completing mundane tasks that are not desirable to workers. In addition, the company can save money because it does not need to pay for expensive benefits for this specialized machinery. There are both pros and cons for a company when it comes to industrial automation.
On the plus side, with soaring healthcare costs, paid days off, vacation time, and other costly employee benefits, companies can save money with industrial automation. While robotic machinery can initially be extremely expensive, the loss of monthly wages for production workers leads to incredible savings for the company.
While machinery used for industrial automation can break down, it does not happen often. If it does, only a handful of maintenance or computer engineers are needed to handle repairs and get lines running smoothly again.
In addition, many plants hire dozens of production workers for a variety of shifts and need to close on certain days. Industrial automation, however, allows a company to run the plant twenty-four hours a day, 365 days a year, without paying overtime. This fact alone can add up to significant savings.
E.g.:
A company that employs forty-eight factory workers on three different shifts and closes on weekends, for example, can save thousands of dollars with industrial automation. This is particularly true if weekend work is necessary, which means overtime pay of time and a half must be paid for Saturday work and double-time for Sunday. This equates to an additional twelve hours of pay per employee. Of course, life insurance, 401K benefits, dental insurance, health insurance, pension coverage, and disability also contribute to the expense.

Industrial automation can eliminate the need for all forty-eight jobs.
The robotic machinery used for industrial automation may only involve a monthly payment until the machinery is paid for, a couple technicians to keep the robotic machinery running, and electricity costs.

Taken from IEEE UOM visit to Merbok


Merbok, A fully automated factory in the Horana industrial zone manufacturing MDF boards. The specialty; the rubber logs are put in from one end and the manufactured boards are received from the other end of the manufacturing line. The whole plant is controlled by PLCs.