graduation project report

58
0 Acknowledgment This is an acknowledgement that the following people helped us in accomplishing this project: MSA: Dr. Sameh Noaman Dr. Mohamed Ghazy. Eng. Haitham Eng. Rasha Sakr Eng. Mohamed Moursy Eng. Mohamed Gamal. WorkShop & Electronics Lab Staff Top Group EG: Eng. Sakr Hemdan Eng. Mohamed Abd El Azeez Eng. Mohamed Hassan Eng. Mohammed Atef

Upload: opera988

Post on 25-Nov-2014

615 views

Category:

Documents


3 download

DESCRIPTION

The Project was based on our knowledge of (Embedded Systems) along with (Software Development Process); it included the design of a complete Expansion Unit capable of being installed on most types of Industrial machines, mainly it improves the safety over the expensive components of the machine and adds new features to the machine, also taking into consideration the cost of the entire project which was negligible compared to the cost of the machine.The expansion unit was controlled by a “PIC18 Microcontroller” which was connected with the PLC controlling the machine; we used Embedded C language and microcontroller emulators along with SCADA software and PLC programming software to accomplish the project successfully.

TRANSCRIPT

Page 1: Graduation Project Report

0

Acknowledgment

This is an acknowledgement that the following people helped us in accomplishing this project: MSA: Dr. Sameh Noaman Dr. Mohamed Ghazy. Eng. Haitham Eng. Rasha Sakr Eng. Mohamed Moursy Eng. Mohamed Gamal. WorkShop & Electronics Lab Staff

Top Group EG: Eng. Sakr Hemdan Eng. Mohamed Abd El Azeez Eng. Mohamed Hassan Eng. Mohammed Atef

Page 2: Graduation Project Report

1

Executive Summery An Expansion Unit & a SCADA System was designed to guarantee the safety of the expensive components of most industrial machines and specifically packaging machines; this system also improves the original machine by adding new features. The cost of the added parts and the quality of the product were taken into consideration the design steps of project, and the total cost is very small compared to the price of the entire machine.

The Expansion Unit includes:

• Early error detection in any component in the machine. • Automatic machine shutdown in case of critical errors. • Complete error log containing detailed history of the errors in the machine. • Alarms showing non-critical errors which can be fixed without stopping the machine. • Complete production log containing detailed history of the process of production. • Security measures preventing unauthorized access of reaching important and

sensitive parts of the machine. Overview on the operation of the Expansion Unit & SCADA System:

When the designed Expansion Unit is connected to the machine it observes different parts of the machine such as motors & sensors; it runs different tests continuously on the observed parts without adding any burden on the machine operation and without slowing the production process. Whenever an error happens in any of the observed parts in the machine the Expansion Unit detects that error instantly and takes the appropriate action (depending on the type of error) and it implements that action in the machine through the PLC, and at the same time it sends information of the error to the PLC which in turn sends it to the designed SCADA System which provides an “Error Log” containing detailed information about the error such as the time and the exact position of the error in the machine.

Page 3: Graduation Project Report

2

Table Of Contents

1. Introduction ........................................................................................................ 5 1.1 The Aim of the project .............................................................................................. 5 1.2 Preview on the Science of Packaging ....................................................................... 6 1.3 Outline: ..................................................................................................................... 7

2. Specifications and Features ............................................................................... 8 2.1 Packaging Machine operation ...................................................................................... 8 2.2 Errors in the Machine ................................................................................................. 10 2.3 Expansion Unit operation ........................................................................................... 12 2.4 Features of the designed Expansion Unit: .................................................................. 15 2.5 Inputs, outputs, and limitations: ................................................................................. 16

3. Design Overview ............................................................................................... 17 3.1 Hardware Components: .............................................................................................. 17 3.1.1 Hardware Block Diagram: .................................................................................... 17 3.1.2 Description of hardware components: .................................................................. 18 3.1.2.1 Power Supply .................................................................................................. 18 3.1.2.2 Phase Failure................................................................................................... 20 3.1.2.3 Phase Sequence............................................................................................... 22 3.1.2.4 Phase Failure................................................................................................... 25 3.1.2.5 Control & Communication: ............................................................................ 28 3.1.2.6 Programmable Logic Controller (PLC) .......................................................... 31

3.2 Software Components: ............................................................................................... 33 3.2.1 Software Block Diagram ...................................................................................... 33 3.2.2 Microcontroller Program ...................................................................................... 34 3.2.3 PLC Program ........................................................................................................ 34 3.2.4 SCADA System .................................................................................................... 35

3.4 Flow Chart .................................................................................................................. 36 4. Verification and validation .............................................................................. 39

4.1 Description of the verification process: ...................................................................... 39 4.2 Test Plan: .................................................................................................................... 39 4.3 Test Procedure: ........................................................................................................... 40 4.3.1 Component level testing: ...................................................................................... 40 4.3.2 Sub-System Level Testing: ................................................................................... 41

5. Conclusion: ....................................................................................................... 50 5.1 Project cost details: ..................................................................................................... 51 5.2 Project Schedule: ........................................................................................................ 54 5.3 Team Responsibilities................................................................................................. 56 5.4 Conclusion .................................................................................................................. 50

References ............................................................................................................. 57 Appendix A: Complete System Schematics Appendix B: Program Source Files Appendix C: Useful Datasheets

Page 4: Graduation Project Report

3

Table of Figures Figure 1: Packaging process ................................................................................................................. 5 Figure 2: Example of a grain packaging machine ................................................................................ 9 Figure 3: Inside the Control Box .......................................................................................................... 9 Figure 4: Rice grains & Plastic material represent the input & on the right “salt packs” the output ... 9 Figure 5: an illustration of the Expansion Unit .................................................................................. 12 Figure 6: the connection between the Expansion Unit, PLC, Machine & the SCADA Server .......... 12 Figure 7: Hardware Block Diagram ................................................................................................... 17 Figure 8: Power Supply Circuit .......................................................................................................... 18 Figure 9: Power Supply Block Diagram............................................................................................. 19 Figure 10: Phase Failure Circuit ......................................................................................................... 20 Figure 11: Phase Failure Block Diagram ........................................................................................... 21 Figure 12: Phase Sequence Circuit ..................................................................................................... 22 Figure 13: Phase Sequence Steps of operation ................................................................................... 22 Figure 14: Phase Sequence Block Diagram ....................................................................................... 23 Figure 15: Phase Sequence Final Circuit ............................................................................................ 24 Figure 16: Voltage Test Circuit .......................................................................................................... 25 Figure 17: Testing Sensor Voltage ..................................................................................................... 26 Figure 18: Voltage Test Circuit Block Diagram ................................................................................ 27 Figure 19: Voltage Test Circuit .......................................................................................................... 27 Figure 20: Control & Communication Circuit ................................................................................... 28 Figure 21: Input Interface Circuit ....................................................................................................... 29 Figure 22: Control & Communication Circuit Block Diagram .......................................................... 30 Figure 23: Programmable logic controller (PLC) inside the Control Box ......................................... 31 Figure 24: Programmable logic controller (PLC) inside the Control Box Block Diagram ................ 32 Figure 25: Software Transfer Data Block Diagram ............................................................................ 33 Figure 26: SCADA System applied to several Machines................................................................... 35 Figure 27: Example of the Error Log containing critical errors ......................................................... 36 Figure 28: Example of the Error Log containing non-critical errors .................................................. 36 Figure 29: Test Plan ............................................................................................................................ 39 Figure 30: LCD Testing ...................................................................................................................... 40 Figure 31: LCD Testing using Keypad............................................................................................... 40 Figure 32: Connecting Phase Sequence Circuit to Oscilloscope ........................................................ 41 Figure 33: Testing the phase sequence circuit on a single phase source ............................................ 41 Figure 34: The 3 Phase Plug after connection .................................................................................... 42 Figure 35: The 3 Phase Plug after connection .................................................................................... 43 Figure 36: Changing phase sequence (before & after) ....................................................................... 43 Figure 37: output of Flip Flop (before & after) .................................................................................. 43 Figure 38: Connecting the Voltage Test Circuit on a test board. ....................................................... 44 Figure 39: Connecting the Voltage Test Circuit to the Lab Kit ......................................................... 45 Figure 40: output voltages of the voltage test circuit in the two cases ............................................... 45 Figure 41: Connecting the Power Supply on Test Board ................................................................... 46 Figure 42: output voltages of positive regulators ............................................................................... 47 Figure 43: output voltages of negative regulators .............................................................................. 47 Figure 44: Control & Communication Circuit on test board .............................................................. 48 Figure 45: Welcome message & System stable message ................................................................... 48 Figure 46: Welcome message & System stable message ................................................................... 49 Figure 47: Checking password & ending the test program ................................................................ 49 Figure 48: Sponsor Machine ............................................................................................................... 51

Page 5: Graduation Project Report

4

Table of Tables

Table 1: Power Supply Specifications ................................................................ 19 Table 2: Phase Failure Circuit Specifications ................................................... 20 Table 3: Phase Sequence Circuit Specifications ................................................ 23 Table 4: Voltage Testing Circuit Specifications ................................................ 26 Table 5: Control & Communication Circuit Specifications ............................ 30 Table 6: PLC Specifications ................................................................................ 31 Table 7: Microcontroller Program ..................................................................... 34 Table 8: PLC Program ........................................................................................ 34 Table 9: SCADA System ...................................................................................... 35 Table 10: Cost estimate ........................................................................................ 52 Table 11: Graduation Project II Schedule (Weeks 1-13) ................................. 54 Table 12: Graduation Project II Schedule (Weeks 14-21) ............................... 55

Page 6: Graduation Project Report

5

1. Introduction

1.1 The Aim of the project • What’s the importance of the safety of industrial machines? • How could the machine safety be improved? • What are the most important and fragile parts that should be kept safe in a machine? • What are the common errors that appear in an industrial machine? And how are these errors detected?

• How can errors in the machine be detected early enough and automatically? • Can damage or obstruction of the production mechanism be prevented using simple additions to the original machine?

• Why the main goal of the project was improving a “Packaging Machine” specifically?

Figure 1: Packaging process This project presents answers of all the above questions and much more; it demonstrates designing both software and hardware of an “Expansion Unit” to a Packaging Machine; the designed expansion unit will be able to detect errors in the machine before these errors cause any damage; it will have access to the machine as to switch it off when necessary; the expansion unit will include a simple user interface to set its properties and to point to the exact error location in the machine to facilitate the process of fixing it; the project also includes a simple SCADA system which is mainly an “Error Log” to provide detailed information about the type of errors that occurred and the exact timing of the error and other useful information; other improvements to the machine will be further demonstrated in the next parts of this report.

Packing Machine is a very sufficient application to implement this project; because of their need in almost every production line and are considered the final touch in the production mechanism; it’s widely used in food industries, medical industries, military materials packaging and a lot more, Packaging Machines exist in almost every factory.

Page 7: Graduation Project Report

6

The existing packaging machines that are manufactured and are being used in Egypt encounters several problems; and a problem in the packaging machine means halting the entire production line; which means loss of money and time; also the existing machines doesn’t detect the errors early enough which causes huge damage in the machines which in turn costs a lot in order to be fixed.

1.2 Preview on the Science of Packaging -Why is Packaging important? [1]

The science of packaging is an art; and the ability to keep goods protected and confined and totally enclosed; to be able to stock up, sale, or make use of the product. Packaging can be defined as a synchronized system of preparing merchandise for shipping, warehousing, logistics, retailing, and final use. Packaging contains, sells, preserves, transfers, enlightens, and shields. -Some Types of Packaging machines [2]

1. Blister packs, skin packs and Vacuum Packaging Machines 2. Bottle caps equipment, Over-Capping, Closing, Seaming and Sealing Machines 3. Box, Case and Tray Forming, Packing, Unpacking, Closing and Sealing

Machines 4. Cleaning, Sterilizing, Cooling and Drying Machines 5. Feeding, Orienting, Placing and Related Machines 6. Filling Machines: managing powdered products * 7. Label dispensers aid peel and apply labels more capably 8. Package filling and Closing Machines 9. Product recognition: labeling, marking, etc. 10. Shrink wrap Machines 11. Shape, fill up and close up Machines

-Brief History of Process control and its affect on packaging machines.

• 1959: After years of research Siemens presented an intelligent controlling technology (SIMATIC G) based on transistorized circuits; in the next few years packaging machines evolved greatly on the basis of this technology which enabled machines to follow a certain sequence of events to get the final product.[3]

• 1968: After the birth of the first PLC as a response to the needs of the American automotive manufacturing industry; the technology affected packaging machines and made it possible for further development and features to be added.[4]

• 1975: Distributed control system (DCS) was introduced; it made it able for entire system of controllers to be connected by networks for communication and monitoring. This made it possible to widen up the base of the packaging machinery on the basis of this new technology. [5]

* This project is specifically concerned with type (6) in this list and more specifically it handles powdered and any types of grains such as rice, sugar, salt, etc

Page 8: Graduation Project Report

7

1.3 Outline: (Specifications ad Features) section will demonstrate the overall functionality of the packaging machine Expansion Unit and how it operates step by step beginning from the connection to the machine & all the way to handing the errors in the machine; then the features of the unit is shown and the different capabilities of this improvement project; then an overview of the inputs such as sensors and the outputs will be stated and the limitations that should be taken into consideration.

The next part is the (Design Overview) section which presents the factors of designing the Expansion Unit and the different errors affecting the industrial machines in general & the Packing machines in specific; then all the hardware needed in this machine will be stated with a quick description about each and with the reasons of using this hardware; then a complete block diagram of the unit will be presented. The next part of this chapter presents the software components of the entire project which is mainly classified into three parts the Microcontroller Program, the PLC Program, and the SCADA System; the design of each part will be demonstrated & the function of each part & a block digram of the whole software components with explanation flowcharts. (Verification and Validation) section presents a step by step test plan for verifying the project functionality. A complete table of every used component and its cost will be presented in the (Cost Estimate) section then in the (Project Schedule) section a week by week table to show the progress and time plan of the project; then the tasks of each team member will be presented & finally the results of the project and the handled problems and their solutions will be presented in the (Conclusion) section.

Page 9: Graduation Project Report

8

2. Specifications and Features 2.1 Packaging Machine operation

In order to be able to improve the “Grain Packaging Machine” a complete understanding of the machine operation steps should be done. The machine packs any types of grains in either transparent bags or colored ones; and is adjustable for the amount of grains packed and the speed of production. -Overall process is as follows (*): 1. Supply the machine with the desired grains to be packed. 2. Supply the machine with the desired packaging material. 3. Set the machine to the type of packaging material (either transparent or colored). 4. Set the suitable heaters temperature using the temperature controller. 5. For the first pack we’ll need to set the rollers carrying the packaging material to the

right position as to avoid any flaws in the packed bags; the rollers are provided with motors that can set it’s position as desired and controlled by the PLC.

6. When turned on the plastic sheet will move on the rollers by the aid of motors. 7. The plastic sheet will pass on a metallic collar; which is responsible for spinning the

sheet to take the shape of a bag, and then the sheet slides over a column* with its new shape.

8. When the required length is achieved the motor stops sliding the sheet and a vertical heat sealer moves in by an air piston to seal the sheet vertically.

9. While the vertical sealer works another horizontal heat sealer moves in by an air piston sealing the sheet from the bottom.

10. Several containers filled with grains are provided with an electronic gate controlled by the PLC which opens at this stage for a certain amount of time and certain amount of rotations to fill the bag with the required amount of grains.

11. Once filled the motors start to move the sheet once again until the same length is again achieved and so the motor stops.

12. This time the vertical sealer works the same manner but the horizontal one seals the bottom of one bag and the top of the other.

13. A cutter slides in from the horizontal sealer and cuts the lower bag which has been completely sealed. (**)

14. The bags drop repeatedly a moving belt which moves them for the next production line stage.

(*) The Machine is provided with an interface screen and buttons for the primary setting process or for manual control. (**) The cutter doesn’t work in the first cycle of operation because there is no filled bag yet.

Page 10: Graduation Project Report

9

Figure 2: Example of a grain packaging machine

Figure 3: Inside the Control Box

Figure 4: Rice grains & Plastic material represent the input & on the right “salt packs” the output

Page 11: Graduation Project Report

10

2.2 Errors in the Machine

After understanding the machine operation; some of the common errors that occur in industrial machines will be introduced; and some errors specific to packaging machines. Common industrial machine errors • Phase Failure: Most machines operate on a three phase power source; simply if one of the three phases encounters any problem that makes it fail; this drop of power supply causes serious damage to the machine. • Phase Sequence: As was explained before that industrial machinery operate on three phase power sources, each line has its specific phase; some conditions (such as loss of electric power) can cause the sequence of the three lines to be interchanged; this misses with the sequence of the phases, which may cause the motors and other devices in the machine to operate in the opposite direction; of course this can cause huge damage in a lot of machines that is mono directional. • Voltage Disturbance: Different parts of a machine needs different voltage levels; such as sensors and motors and controllers; each device in a machine has a voltage range that it can operate in sufficiently, if the voltage supplied to any device drops below the minimum value or exceeds the maximum value; this will cause the device to either get damaged or to operate insufficiently, in some parts such as sensors this would cause great damage to the machine and its sequence of operation. • Motor Overload: The National Electric Code (NEC) defines Motor Overload Protection as that, which is intended to protect motors, motor-control apparatus, and motor branch-circuit conductors against excessive heating due to motor overloads and failure of the motor to start. Motor Overload Protection is also commonly referred to as “Running Protection”. [6]

Common packaging machine errors (*) • Inverter Errors: Inverters are mainly responsible for the controlling the speed of the motors in the machine, inverters are programmed separately from the PLC to give the required functions, if any errors occur in an inverter it can cause damage to the motors or to the products, the inverter type used in the packaging machine we’re working on is (AC Tech SCL Series) this type of inverter provides its own error detection mechanism but unfortunately it does not notify the PLC about the errors occurring, and as the inverter is actually installed inside the control box it’s not always observed by the working staff, so in case if an error happens it go on un noticed which is very dangerous. (*) These errors are common in the studied machines which are made in Egypt.

Page 12: Graduation Project Report

11

• Security Violation: Some of the most important operating parts of the packaging machine such as inverters, temperature controllers, and most important the PLC, these parts are contained in a box which is called the (Control Box), the mentioned box is often kept open or closed but not at all secure, this may cause undesired access to this critical part of the machine, and the slightest missing in any device contained in the control box may cause great damage to the entire machine. • Container Empty: As this project is mainly concerned with packaging machines, it’s obvious that any packaging machines will mostly contain a container; this container contains the material to be packed (ex. grains); simply if the container gets empty this will cause halting of the production process. • Packaging Material Empty: Same as the previous, the packed product should be packed in some kind of material (in our case plastic sheet) if this material supplied to the machine is finished (empty) this will once again cause halting of the production process.

Page 13: Graduation Project Report

12

2.3 Expansion Unit operation

Figure 5: an illustration of the Expansion Unit

Figure 6: the connection between the Expansion Unit, PLC, Machine & the SCADA Server

Page 14: Graduation Project Report

13

(1) On/Off Switch: To start/stop the Expansion Unit (EU). (2) Keypad: To choose the settings required for the unit and to navigate through other

functions. (3) Connection to the PLC: This connection provides communication between the Expansion

Unit the PLC already running the entire machine and to adapt the EU to improve the machine; it must communicate with machine through its PLC.

(4) Signals from the machine: Signals from the machine include signals coming from the

sensors installed in the machine & other signals from different parts of the machine to provide full coverage needed by the EU to do its part in improving the machine operation in the best manner.

(5) To 3 Phase Power Source: This is the same source that provides power to the machine,

this plug provides power to the EU & at the same time the EU runs tests on the 3 phase source to assure that no errors occur that can affect either the machine or the EU.

(6) LCD Screen: It provides a simple interface between the EU and the user. (7) Indication LEDs: These leds indicate if any error occurs in the machine (the red leds

indicate “critical errors” & the green leds indicate (non critical errors). (8) PLC: The (programmable logic controller) responsible for controlling the machine. (9) Connections to the Machine: Connections between the PLC and different parts of the

machine. (10) SCADA Server: The “supervisory control and data acquisition” server responsible for

collecting information provided by the PLC about the machine; the information collected will then be used to form the “Error Log” and the “Production Log”; this information will be given to the PLC from the Expansion Unit which will then be sent to the server via the (communication port) included in the PLC.

Page 15: Graduation Project Report

14

Operation Steps of the Expansion Unit: 1. Connecting the signals coming from the machine to the Expansion unit input port

(ex. The signals coming from the heat sensors installed on the motors). 2. Burning a new program on to the PLC to make it realize the presence and the

functions of the Expansion Unit.

3. Connecting the Expansion Unit to the PLC through the PLC input ports.

4. Connecting the PLC to the designed SCADA system.

5. Connecting in the 3 phase plug in the Expansion Unit to the same 3 phase power source supplying the machine.

6. Switch On the Expansion Unit.

7. A welcome message will appear on the LCD Screen and then another message

indicating that the machine is stable (running without errors) will appear.

8. To set different settings of the Expansion Unit open the options menu using the keypad; the options menu will appear on the LCD Screen and then any type of provided settings can be modified (ex. setting a new password to the “Control Box” Access).

9. In case if any error occurs in the machine the following will happen:

I. Expansion Unit will take the appropriate action either by stopping the machine & giving a warning through the LCD and the Indication leds or by only giving a warning without stopping the machine this will depend on the type of error (critical or non critical).

II. The Expansion Unit will send the error data to the SCADA server through the PLC to add it to the error log with detailed information.

Page 16: Graduation Project Report

15

2.4 Features of the designed Expansion Unit:

The Expansion Unit will include the following features: • Phase Sequence error detection. • Phase failure detection.

• 12 Voltage test points. • Inverter error detection.

• Motor Overload Protection.

• Advanced Security System for the “Control Box”.

• Container nearly empty alarm. • Packing Material neatly empty alarm. • Detailed Error Log.

• Detailed Production Log.

• Simple user settings interface.

• Automatic Stopping of the machine in case of any critical errors.

Page 17: Graduation Project Report

16

2.5 Inputs, outputs, and limitations:

The Expansion Unit will need Inputs to provide information necessary to detect errors and to take appropriate actions to protect the machine; and consequently it will produce outputs to execute those actions.

-Inputs: • The voltage input supplying any point needed to be tested. (*) • The Maximum and the Minimum voltage limits for any tested point. • A Signal from overload current detector on motors. • A Signal from the temperature sensor to detect excess heat from the motor. • A Signal from the inverter to notify if error occurs. • The same 3 phase power source that supplies the machine.

-Outputs:

• A signal to stop the machine when necessary. • Communication signals between the expansion unit and the PLC controlling the

machine. • Notification LEDs, messages, and alarms to notify that an error has occurred. • Communication signals between the PLC and the SCADA to provide required

information. -Limitations:

• Testing Voltage limits between 5V and 24V. • Colored packaging material such as colored plastic should have certain colored marks

repeated at specified length; to be able to detect the begging and ending of each pack.

(*) To test any device for voltage disturbance, we’ll need 3 inputs first is the voltage input to the device (the voltage being tested) the second is the maximum voltage which the voltage input should not exceed and the third is the minimum voltage which the voltage input should not drop below.

Page 18: Graduation Project Report

17

3. Design Overview 3.1 Hardware Components: 3.1.1 Hardware Block Diagram:

Figure 7: Hardware Block Diagram

Page 19: Graduation Project Report

18

3.1.2 Description of hardware components: 3.1.2.1 Power Supply Circuit:

Figure 8: Power Supply Circuit

Page 20: Graduation Project Report

19

Description: The power Supply designed is mainly used to supply the Expansion Unit with the voltage levels needed to operate different circuits in the unit, but another important use of the power supply is the to provide the (Voltage Test Circuit) with the reference voltages needed according to the tested device; this will be further explained in the “Voltage Test Circuit”.

Table 1: Power Supply Specifications

Input Voltage 380V AC

NUMBER OF PHASES Three Phase

Output Voltage (-12V,-9V,-5V,+5V,+9V,+12V) DC DIMENSIONS 9.4*5.8 CM

Figure 9: Power Supply Block Diagram

Page 21: Graduation Project Report

20

3.1.2.2 Phase Failure Circuit:

Figure 10: Phase Failure Circuit Description:

The Phase Failure Circuit receives power from the same three phase power source supplying the machine; then it does full wave rectification on each phase of the three phases separately; it transforms each phase from 220V AC to 5V DC; now there are three 5V signals; then all the 3 signals will be sent directly to the “Control & Communication Circuit”. In the Control & Communication Circuit the three signals will be the inputs of a “3 inputs AND Gate”; now the main idea relies on the fact that if all the three phases are working properly the output of the AND Gate will be High; otherwise if one or more of the phases isn’t working properly the output of the AND Gate will drop to low. The AND Gate output is monitored by the control circuit & in case a high to low transition occurs the control circuit will send a signal to the PLC to the stop the machine immediately to prevent any damage; and then the PLC will send the error information to the SCADA Server to add it with details to the “Error LOG”

Table 2: Phase Failure Circuit Specifications

Input Voltage 380V AC

NUMBER OF PHASES Three Phase

Outputs 3 outputs (each 5V) DIMENSIONS 11* 8.6 CM

Page 22: Graduation Project Report

21

Figure 11: Phase Failure Block Diagram

Page 23: Graduation Project Report

22

3.1.2.3 Phase Sequence Circuit:

Figure 12: Phase Sequence Circuit

Figure 13: Phase Sequence Steps of operation

Page 24: Graduation Project Report

23

Description: [7] § The Phase Failure Circuit receives power from the same three phase power source supplying the machine; the Sign waves from phases A, B, and C are half wave rectified & then shaped by the MPS5172 Transistor to produce A’, B’, and C’.

§ The shaped outputs are then combined together in the AND Gates G1, G2, and G3 to produce the wave forms X=A’.C’, Y=A’.B’, and Z= B’.C’.

§ The pulses X Y Z appear sequentially; this sequence will change to YXZ if (for instance) the B and C phases are interchanged.

§ The X, Y, and Z pulse trains are applied to D-Flip Flops FF1 & FF2 in such a way that the output (Q1) of FF2 will be high in case the sequence is Y X Z & will be low in case the sequence is X Y Z.

Table 3: Phase Sequence Circuit Specifications

Input Voltage 380V AC , 12V DC

NUMBER OF PHASES Three Phase

Outputs 1 output 12V DC DIMENSIONS 5.5* 5.5 CM

Figure 14: Phase Sequence Block Diagram

Page 25: Graduation Project Report

24

Figure 15: Phase Sequence Final Circuit

Page 26: Graduation Project Report

25

3.1.2.4 Phase Failure Phase Failure Circuit:

Figure 16: Voltage Test Circuit

R1=10K Ohm, R2= 10M Ohm, R3= 3KOhm

Page 27: Graduation Project Report

26

Figure 17: Testing Sensor Voltage

Description: The Voltage Comparator operates as follows:

Inputs Outputs - > + 0 V + > - + 12 V

§ If the voltage supplied to any device exceeds the maximum voltage specification or decreases than the minimum voltage specification.

§ The output of the comparator sends a signal to the Control Circuit. § The Control Circuit sends a signal to the PLC to stop the machine immediately. § The PLC sends the error information to the SCADA Server.

Table 4: Voltage Testing Circuit Specifications

Input Voltage 12V DC

Outputs 24 outputs 12V DC DIMENSIONS 14.5* 8 CM

Page 28: Graduation Project Report

27

Figure 18: Voltage Test Circuit Block Diagram

Figure 19: Voltage Test Circuit

Page 29: Graduation Project Report

28

3.1.2.5 Control & Communication:

Circuit:

Figure 20: Control & Communication Circuit

Page 30: Graduation Project Report

29

Figure 21: Input Interface Circuit

Description:

The Control & Communication Circuit is core of the Expansion Unit; it handles the following tasks: § It Controls the entire process of the expansion unit; It receives signals from

different parts of the system & it analyzes these signals & it takes the appropriate action depending on its analysis.

§ It Controls all the settings of the Expansion Unit which are set using the Keypad § It Controls the LCD which is used as the interface between the Unit and the User. § It communicates with the PLC through its output pins & it sends information to

the PLC which in turn sends it to the SCADA Server.

The Control & Communication Circuit receives 19 inputs from the following: § 1 input from the Phase Sequence Circuit. § 1 inputs from the Phase Failure Circuit. § 2 inputs from the Voltage Test Circuit. § 10 inputs from the Keypad. § 1 input from the level sensor in the Container. § 1 input from the infrared sensor on the packing material. § 1 input from the temperature sensor in the motor. § 1 input from the overload current sensor in the motor. § 1input from the inverter.

v The Number of used pins as inputs in the PIC18F4321 in this project are 15 inputs; and as mentioned 19 inputs are needed so an encoder was used which can receive 9 inputs and only use 4 inputs from the Microcontroller so the number of input pins was increased to 20 pins (15+9-4).

Page 31: Graduation Project Report

30

v The Input interface circuit shown is only one block of the circuit; this block is repeated for each input pin of the microcontroller; the function of this circuit is to adjust the input voltage to the microcontroller of 5V because for example the phase sequence failure sends the signal to the microcontroller 12V which is not suitable to the microcontroller.

The Control & Communication Circuit produces 16 inputs from the following: § 2 outputs indicating the motors errors. § 2 outputs indicating the sensor errors. § 1 output to the Electronic Lock in the “Control Box”. § 1 output indicating the inverter error. § 1output indicating the Phase Failure error. § 1 output indicating the Phase Sequence error. § All the Previous outputs will also be used to communicate with PLC. § 8 outputs to the LCD module.

Table 5: Control & Communication Circuit Specifications

Input Voltage 5V DC

Number of inputs 20 (9+11)

Outputs 16

Figure 22: Control & Communication Circuit Block Diagram

Page 32: Graduation Project Report

31

3.1.2.6 Programmable Logic Controller (PLC)

Figure 23: Programmable logic controller (PLC) inside the Control Box

Description:

The Programmable Logic Controller (PLC) already exists in the machine so a PLC will not be added; the program running on the existing one was just modified, the PLC is the core of the machine; it controls the sequence of the entire machine operation. The program code running on the PLC was modified to suit the new additions to the machine; it receives information from the Expansion Unit and it takes the appropriate actions based on this information; also it sends the error data and the production data to the SCADA Server.

Table 6: PLC Specifications

Siemens LOGO! 24RL Specifications

24 VDC Voltage 8 outputs Outputs 10 A Max. Load Current 12 inputs Inputs 4 Number of inputs to be

used in analog mode 10.8 V Power Supply lower limit 28.8 V Power Supply upper limit 126 x 90 x 55 mm Dimensions

Page 33: Graduation Project Report

32

Figure 24: Programmable logic controller (PLC) inside the Control Box Block Diagram

Page 34: Graduation Project Report

33

3.2 Software Components: The Software in this project is divided into 3 components

3.2.1 Software Block Diagram

Figure 25: Software Transfer Data Block Diagram

Software Components

Microcontroller Program

PLC Program SCADA System

Page 35: Graduation Project Report

34

3.2.2 Microcontroller Program

The Microcontroller is used in the (Control & Communication Circuit) in the Expansion Unit; the Program Code for the microcontroller is responsible for the entire operation of the Expansion Unit & the interface with the user & the Communication with the PLC.

Table 7: Microcontroller Program

PIC18F4321 Type of Microcontroller used

Embedded C Language used for programming

MPLAB v8.10 Software used for programming

Hi-TECH C Compiler Compiler

DIY K128 PICmicro Programmer v141204

Communication Software used

Program Source Code is available in “Appendix B”

3.2.3 PLC Program The PLC is already included in the machine; it holds and executes the program responsible for the entire machine operation steps. The program code of the PLC was modified to add the new improvements added by the Expansion Unit; the modification in the program code made the PLC capable of receiving information from the Expansion Unit; and to stop the machine depending on this information in case of any critical errors; also the modifications in the program code made the PLC capable of sending information to the SCADA Server through the PLC communication Port.

Table 8: PLC Program

Siemens LOGO! 24RL Type of PLC used

Ladder Logic Language used for programming

STEP 7 MicroWin Software used for programming

S7-200 OPC Communication Software used

Program Source Code is available in “Appendix B”

Page 36: Graduation Project Report

35

3.2.4 SCADA System

The supervisory control & data accusation server (SCADA) designed in this project is simple construction of an “Error Log” & a “Production Log”. This SCADA system is designed based on the fact that most factories has more than one industrial machine; and adding the Expansion Unit to these machines will continually collect information about each machine. It’s much easier to collect all these information in one server and present it using simple logs; this will make it easier to observe the entire industrial mechanism. Also the same system can be expanded to collect information from several factories or an Industrial zone.

Table 9: SCADA System

Windows Control Center “WINCC v6”

Software used for Design

Microsoft SQL2000 Other Software needed

Step 7 License

S7-200 OPC Communication Software used

Figure 26: SCADA System applied to several Machines

Page 37: Graduation Project Report

36

Critical Errors: When the error occurs it will be shown in the error log as a red message

Figure 27: Example of the Error Log containing critical errors

Critical Errors: When the error occurs it will be shown in the error log as a green message

Figure 28: Example of the Error Log containing non-critical errors 3.4 Flow Chart

Page 38: Graduation Project Report

37

Expansion Unit Software Flow Chart

Page 39: Graduation Project Report

38

Page 40: Graduation Project Report

39

4. Verification and validation

4.1 Description of the verification process: Testing & verifying the functionality of the project is very important; it must be taken step by step to make sure that each stage of the project works properly; in the test stage the Expansion Unit will be exposed to different factors which may effect the flow of the mechanism to test its ability to overcome any error or to totally stop if required.

4.2 Test Plan:

1. Each component will be test separately 2. The system will be divided to 3 sub-systems which will be tested one by one. 3. The entire system will be tested as a unit.

Figure 29: Test Plan

Page 41: Graduation Project Report

40

4.3 Test Procedure: 4.3.1 Component level testing: PLC: Each pin of the PLC was tested to operate as an input and an output using well known test codes; communication port is tested for communicating with a PC; the timing of the PLC is calculated to make sure of the timer accuracy. Sensors: Proximity sensors were tested by passing a metal piece in front of it in different distances number of times and each time the sensor produced a signal which was examined using an oscilloscope; the signal produced a voltage compatible with input of the PLC. Color sensors were tested by passing different grades of colors in front of it several times it responded to one color only and produced a signal when it recognized that color. LCD & Keypad: The LCD & keypad were connected to the microcontroller & then they were tested using a well known test code which is available in “Appendix C”; the test code was designed to display on the LCD the symbol of the key pressed & the testing was successful as shown in the photos.

Figure 30: LCD Testing

Figure 31: LCD Testing using Keypad

Page 42: Graduation Project Report

41

4.3.2 Sub-System Level Testing: 4.3.2.1 Phase Sequence Circuit:

1. First step was connecting the phase sequence circuit at the transistor points to the oscilloscope.

Figure 32: Connecting Phase Sequence Circuit to Oscilloscope

2. The next step was connecting the circuit to a single phase source; the outputs were

supposed to be 3 identical square signals (because the inputs were half wave rectified).

Figure 33: Testing the phase sequence circuit on a single phase source

Page 43: Graduation Project Report

42

3. The third step was to test the circuit using a 3 phase power source; at this point a

problem was encountered because a place containing a 3 phase source had to be founded and permission had to be granted to test on it. A 3 phase source was found in the University workshop but a new plug had to be connected by the aid of the university electric technician.

Figure 34: The 3 Phase Plug after connection

4. Now the circuit is ready to be tested using a 3 phase source; so the first step was repeated but this time the output should be 2 signals (because only one oscilloscope was available) & the 2 signals had to be in different phases.

Page 44: Graduation Project Report

43

Figure 35: The 3 Phase Plug after connection 5. Now After making sure that the sequence of operation is correct; the last step of

testing was to test when changing phase sequence(interchanging 2 phases with each other) the output of the flip flop was to make a transition from high to low & vice versa.

Figure 36: Changing phase sequence (before & after)

Figure 37: output of Flip Flop (before & after)

The “Phase Sequence Circuit” Test was done successfully.

Page 45: Graduation Project Report

44

4.3.2.2 Voltage Test Circuit:

The Voltage Comparator operates as follows: Inputs Outputs - > + 0 V + > - + 5 V

1. First step was connecting “voltage test circuit” on a test board

• Now 15V was applied on the –ve input & 5V was applied on the +ve input the output was as 0V.

• Then Now 5V was applied on the –ve input & 15V was applied on the +ve input the output was as 15V.

Figure 38: Connecting the Voltage Test Circuit on a test board.

Page 46: Graduation Project Report

45

2. The second step was connecting the “voltage test circuit” (on PCB) to a Lab kit; then connecting inputs of the voltage comparator to two different voltages; as in this photo.

Figure 39: Connecting the Voltage Test Circuit to the Lab Kit

3. Now step number was repeated once again • 15V was applied on the –ve input & 5V was applied on the +ve input the

output was as 0V. • Then 5V was applied on the –ve input & 15V was applied on the +ve input

the output was as 15V.

Figure 40: output voltages of the voltage test circuit in the two cases

The “Voltage Test Circuit” Test was done successfully.

Page 47: Graduation Project Report

46

4.3.2.3 Power Supply: 1. The first step was connecting the “Power Supply Circuit” on test board; & connecting

it to a single phase source.

Figure 41: Connecting the Power Supply on Test Board

2. The Voltage regulators were then changed one by one; (7805, 7809, 7812) for

Positive values (5V, 9V, 12V) & (7905, 7908, 7912) for negative values (-5V, -9V, -12V).

The positive voltage regulators gave the following values:

7805 +4.7V 7809 +6V 7812 +11.5V

. The negative voltage regulators gave the following values:

7905 -4.8V 7909 -6V 7912 -11.7V

Page 48: Graduation Project Report

47

Figure 42: output voltages of positive regulators

Figure 43: output voltages of negative regulators

The “Power Supply Circuit” Test was done successfully.

Page 49: Graduation Project Report

48

4.3.2.4 Control & Communication Circuit:

Testing the control circuit was done by using a simple program code; the process of testing was shown in the next photos. 1. First Step is to connect the control circuit on test board.

Figure 44: Control & Communication Circuit on test board

2. Now a message notifying that this is a test is displayed; then a another message announcing that the system is running (system stable; without errors) & telling the user to press (0) to open options menu

Figure 45: Welcome message & System stable message

Page 50: Graduation Project Report

49

3. The next step after the user pressed (0) was to ask the user to enter password; initially the password was “000000”.

Figure 46: Welcome message & System stable message

4. Now the control circuit will test if the password is correct or not; if the password is

correct it will display a message ending the test process.

Figure 47: Checking password & ending the test program

The “Control & communication Circuit” Test was done successfully.

Page 51: Graduation Project Report

50

5. Conclusion: 5.1 Conclusion

The Expansion Unit is a great improvement to most machines and specifically packing machines; the ideas that was available at the beginning of the project were almost totally changed because after doing extensive research we found that some ideas were not practical & other ideas were not useful; but along the way more ideas were founded which were really needed to improve the machine. Those ideas were implemented one by one & several problems through out the process were encountered but they were fixed one by one; but still once again a minor change in the project had to be done because of the problems that occurred. At the end of the project we found that the Expansion Unit did improve the features of the packing machine significantly; & the cost of the unit compared to the total cost of the machine is almost negligible even though it added a lot to the value of the machine. The Project could be improved in many ways; new ideas could be added; more complicated errors in the machine could be detected or even fixed; the SCADA system could be improved to add new options & to widen its base; the most important improvement to the Expansion Unit is to make it capable of suiting any type of machine with minimum modifications. The entire effort that was done in this project added a lot to our experience; we learned about industrial machines, SCADA systems, PLCs, power components, and a lot more.

Page 52: Graduation Project Report

51

5.2 Project cost details: Sponsor:

Top Group Egypt Details:

TOP GROUP was founded in 1995 in 10th of Ramadan city. Top Group Egypt is famous for manufacturing different types of packaging machines.

Offer:

(Top Group Egypt) supported us with a complete packaging machine handling its entire cost, without the added components which we will pay.

Figure 48: Sponsor Machine

Page 53: Graduation Project Report

52

Table 10: Cost estimate

Circuits Manufacturing PCB Circuits Price Phase sequence Phase failure

Voltage comparator Power supply Control circuit Output interface Total Price 290

Detailed costs of components Circuit Quantity Spare parts Price

Voltage Comparator Circuit comparator 8 3 1.5*11=16.5 resistor 5k ohm 8 8 0.05*16=0.8 pin header 8 3 0.5*11=5.5 Total Price 22.8 Phase Sequence Circuit

resistor 100k ohm 9 3 0.05*12=0.6 diode mr4001 3 1 0.75*4=3 transistor 2n2222 3 1 0.25*4=1 inverter mc14572 1 1 3*2=6 and gate mc14081 1 1 1.75*2=3.5 d-flip flop 14013 1 1 3.75*2=7.5 transformer 12v 3 1 35*4=140 Total Price 161.6

Phase Failure Circuit

pin header 4 1 0.5*5=2.5 bridge 2w04 3 1 2.5*4=10 capacitor 2200 uf 3 3 1*6=6 regulator 7805 3 2 1.5*5=7.5 capacitor 1 uf 3 2 0.25*5=1.25 Total Price 27.25

Page 54: Graduation Project Report

53

Circuit Quantity Spare parts Price Control & Communication circuit

keypad microcontroller pic18f4321 Lcd lmb162abc Ic 74147 oscillator 4MHZ resistor 330 ohm resistor 10 k ohm capacitor 22pf Total Price 175.1 Output Interface Circuit

resistor 1k ohm 1 1 0.05 diode 1n4001 1 1 0.75*2=3 relay 5pin 12v 1 1 4*2=8 transistor bc547 1 1 0.25*2=0.5 Total Price 11.55

Power Supply Circuit transformer 12v 1 1 35*2=70 pin header 7 3 0.5*10=5 bridge 2wo4 1 1 0.25*2=0.5 capacitor 2200uf 6 6 1*12=12 capacitor 1uf 1 1 0.25*2=0.5 regulator 7805 1 2 1.5*3=4.5 regulator 7809 1 2 1.5*3=4.5 regulator 7812 1 2 1.5*3=4.5 regulator 7905 1 2 1.5*3=4.5 regulator 7909 1 2 1.5*3=4.5 regulator 7912 1 2 1.5*3=4.5 Total Price 115

Other Electric Technician 10 Reports printing 90

Overall Project Price 890 LE

Page 55: Graduation Project Report

54

5.3 Project Schedule:

Graduation Project II (from 1/2/2010 to 28/6/2010):

Table 11: Graduation Project II Schedule (Weeks 1-13)

Week Task

1-2 1. Research on each component of the Packaging Machine & the errors affecting each part.

2. Research on the best methods of detecting or avoiding these errors.

3. Discussing our research results with the responsible Engineers at the sponsor factory in order to get permission to do modifications on the provided machine; these modification are needed to complete our project successfully.

3-4 1. Preparing the final report containing a list of all the ideas that could be included in our project.

2. Discussing the report with our Supervisor to choose which ideas to include in our project; and the methods of implementing these ideas.

5 Meeting with Engineers in the factory to come to an agreement about the final work schedule to start working in the project.

6-8 1. Preparing the “Block Diagram” of the project.

2. Designing the circuit of each block in the "Block Diagram”.

3. Testing each circuit on simulation software (MultiSim).

4. Making a list of all components included in the entire project; & the Spare parts needed.

9 1. Finding vendors with the best prices of each component.

2. Making a list of the entire components price; and the total cost.

3. Purchasing the needed components.

10-11 Work was paused because of “Mid Term Exams”

12 Testing each single component separately (component level testing).

13 1. Testing each circuit separately on test board. (Sub-System level testing)

2. Designing the PCB layouts of each circuit after it’s tested successfully on test board.

Page 56: Graduation Project Report

55

Table 12: Graduation Project II Schedule (Weeks 14-21)

Week Task

14 Implementing the PCB Circuits.

15 Testing each circuit separately on PCB in the university labs. (Sub-System level testing)

16 1. Connecting all the circuits together and installing them in one single unit (Expansion Unit).

2. Designing the SCADA System.

17 1. Connecting the Expansion unit to the PLC in the packaging machine in the sponsor factory; and assembling different parts of the machine with connections from the Expansion Unit.

2. Testing the features of the Expansion Unit one by one by forcing errors in the machine & observing the unit’s response. (Complete System Testing)

18-19 Work was paused because of “Final Exams”

20-21 1. Finalizing the Final Report.

2. Preparing the Graduation Project Presentation.

3. Presentation Training & Rehearsals.

Page 57: Graduation Project Report

56

5.4 Team Responsibilities

Mohamed Ragaei

074163

Mohab Gamal

061301

Mohamed Shibl

073178

• Designing the complete SCADA System.

• Designing & testing the “Voltage Testing” Circuit.

• Research on the Inverter errors & the methods of detecting them.

• Modifications in the PLC software.

• Modifications & additions in the machine.

• Cost Management.

• Research on non-critical errors & the methods of detecting them.

• Research on Motor errors & the methods of detecting them.

• Component level testing.

• Implementing the Expansion Unit Box.

• Designing & testing the “Phase Sequence” circuit.

• Designing & testing the “Phase Failure” circuit.

• Preparing Reports.

• Testing Circuits on Simulation Software.

• Designing & testing the “Control & Communication” circuit.

• Designing PCB layouts.

• Implementing & finalizing the PCBs.

• Preparing the places & the equipment required for testing.

• Designing the Expansion Unit Box & assembling all the circuits in it.

• Complete System Testing.

Page 58: Graduation Project Report

57

References

[1] The Science of Packaging. In Wikipedia. Retrieved December 24, 2009 from http://en.wikipedia.org/wiki/Packaging_engineering

[2] Packaging Machines. In Wikipedia Retrieved December 24,2009 from http://en.wikipedia.org/wiki/Packaging_and_labeling

[3] SIMATIC. Retrieved from http://w1.siemens.com/history/en/innovations/industryautomation.htm [4] PLC History. In Wikipedia Retrieved December 24,2009 from http://en.wikipedia.org/wiki/Programmable_logic_controller

[5] Distributed Control System (DCS).In Wikipedia Retrieved December 24,2009 from http://en.wikipedia.org/wiki/Distributed_control_system [6 ] Motor Overload. Retrieved June 1,2010 from http://www.kilowattclassroom.com/Archive/MotorOL.pdf [7] Phase Sequence. Retrieved June 5,2010 from http://www.epanorama.rackhost.net/schematicsforfree/Power Electronics/Generation_and_Generator_Control/Power phase sequence detector.pdf