Anda di halaman 1dari 61

THE UNIVERSITY OF THE WEST INDIES ST.

AUGUSTINE, TRINIDAD & TOBAGO, WEST INDIES FACULTY OF ENGINEERING Department of Electrical & Computer Engineering BSc. in Electrical & Computer Engineering

ECNG 2005 Lab and Project Design III Individual Design Project

PI Control of a DC Motor Using a Peripheral Interface Controller

Dale Persad 810000263 Group E

Course Lecturer: Mr. Marcel Byron

Date Submitted: April 19th, 2013

Abstract
Outlined in this project are the design and construction details of a DC motor controller which utilises a PI control strategy. This design was done taking into consideration, the design requirements which were outlined in the project outline (Engineering 2013) such as current limiting, current sensing, and voltage regulation. Other general requirements which were taken into consideration are, standards, laboratory protocol ad industrial standards. This design was also done, in a safe and environmentally conscience manner, taking into consideration, the users and stakeholders involved.

ii

Table of Contents
Abstract ................................................................................................................................................... ii Table of Figures ...................................................................................................................................... iv List of Tables ........................................................................................................................................... v 1 2 Introduction .................................................................................................................................... 1 Background Theory ......................................................................................................................... 2 2.1 2.2 2.3 2.4 2.5 3 DC motor Operation................................................................................................................ 2 Existing Control Schemes for a DC motor and their Advantages and Disadvantages ............ 4 Existing Motor Protection and Current Sensing Technology ................................................ 11 Existing Approaches to Implementation of Control Algorithm ............................................ 14 Existing Approaches for the Measurement of Motor Speed ................................................ 15

Design Approach and Methodology ............................................................................................. 16 3.1 3.2 3.3 3.4 3.5 3.6 Design Brief ........................................................................................................................... 16 Product Design Specification ................................................................................................ 19 Concept design and Evaluation ............................................................................................. 21 Motor & Controller design .................................................................................................... 25 Implementation of PI Controller and Data Processing ......................................................... 35 Other Design Considerations ................................................................................................ 39

Results and Analysis ...................................................................................................................... 50 4.1 4.2 4.3 Presentation of Results ......................................................................................................... 50 Discussion.............................................................................................................................. 53 Conclusion ............................................................................................................................. 54

References .................................................................................................................................... 55

iii

Table of Figures
Figure 1 Components of a DC motor ...................................................................................................... 2 Figure 2 Fleming's Left Hand Rule (TeacherTube 2010) ......................................................................... 3 Figure 3 Block Diagram showing Proportional Control........................................................................... 7 Figure 4 Block Diagram showing Integral Control................................................................................... 8 Figure 5 Block Diagram showing Derivative Control............................................................................... 9 Figure 6 Gantt chart .............................................................................................................................. 18 Figure 7 Block diagram of System ......................................................................................................... 23 Figure 8 DC motor equivalent Circuit.................................................................................................... 25 Figure 9 DC Motor Signal Flow .............................................................................................................. 29 Figure 10 Simplified DC Motor block diagram ...................................................................................... 30 Figure 11 Characteristic Graphs of DC Motor (Jameco n.d.) ................................................................ 31 Figure 12 Block diagram of system ....................................................................................................... 32 Figure 13 Complete block diagram ....................................................................................................... 33 Figure 14 Step response of system transfer function ........................................................................... 34 Figure 15 Step response with compensator ......................................................................................... 34 Figure 16 Simple Flow Diagram of System............................................................................................ 35 Figure 17 PI control Flow Chart............................................................................................................. 35 Figure 18 Sixteen bit addition Routine ................................................................................................. 36 Figure 19 Sixteen by Eight Division Routine.......................................................................................... 36 Figure 20 Display Output Flowchart ..................................................................................................... 39 Figure 21 Phototransistor optical interrupter switch ........................................................................... 41 Figure 22 Display wiring (Best-Micocontroller-Projects 2013) ............................................................. 42 Figure 23 External hardware design ..................................................................................................... 43 Figure 24 Risk Assessment Key ............................................................................................................. 47 Figure 25 Step Response of closed Loop control System ..................................................................... 50 Figure 26 Step Response with Compensator ........................................................................................ 51

iv

List of Tables
Table 1 Advantages and Disadvantages of Open Loop Control .............................................................. 5 Table 2 Advantages and Disadvantages of closed loop control.............................................................. 5 Table 3 Summary of Control Schemes .................................................................................................... 6 Table 4 Advantages and Disadvantages of Proportional Control ........................................................... 7 Table 5 Advantages and Disadvantages of Integral Control ................................................................... 8 Table 6 Advantages and disadvantages of derivative control ................................................................ 9 Table 7 Methods used for DC motor protection................................................................................... 12 Table 8 Summary of current sensing techniques.................................................................................. 13 Table 9 Control Algorithm Implementation .......................................................................................... 14 Table 10 Task description ..................................................................................................................... 16 Table 11 Motor Parameters .................................................................................................................. 25 Table 12 Model parameters.................................................................................................................. 25 Table 13 Conversion of Parameters to Laplace Domain ....................................................................... 27 Table 14 Calculation of Ki and Kp ........................................................................................................... 32 Table 15 Microprocessor Peripherals ................................................................................................... 37 Table 16 Hardware Components .......................................................................................................... 37 Table 17 Different Oscillator modes ..................................................................................................... 42 Table 18 Risk Assessment ..................................................................................................................... 46 Table 19 Summary of Key Parameters .................................................................................................. 50 Table 20 Results of display testing ........................................................................................................ 51

1 Introduction
Motor control is very important in industry especially for the automation of processes. For this design project it is required that one design and build a DC motor controller using PI control. This simple circuit can be implemented in industry of example on a conveyor (ACS 2013), where it is required for the conveyor to move at a constant speed irrespective of how much product is on top of it. Therefore the circuit/conveyor should be able to monitor/measure its speed. If the speed drops or increases above a threshold value, parameters must be adjusted so that the speed of the conveyor/ dc motor returns to its set speed. Finally, protection systems must be implemented to prevent expensive damage to the circuit in the event of: Over voltage and high currents for example during short circuit conditions. High temperature conditions

2 Background Theory
2.1 DC motor Operation
This project is centred on the DC motor. More specifically a 6V brushed DC motor. In this section the operation of this motor shall be explored by disassembling a DC motor from a Team Orion Racing RC car. Permanent Magnets

Stator

Rotor

Commutator Brushes Armature Winding DC Motor Shaft

Figure 1 Components of a DC motor From the above diagram we can see two distinct parts, the stator and the rotor. The stator comprises of two magnets, positioned opposite in polarity, whilst the rotor is metallic structure upon which enamel coated copper wire is wound. The DC motor operates on the principle of electromagnetism and is based on the following laws:

Lenz Law
This law states that an induced electromotive force or voltage in a conductor will produce a current such that its direction will oppose the change which causes it. (McGraw-Hill 2010) From this law, Flemings Left Hand rule was developed.

Fleming Left Hand Rule


His rule states that, the force which is produced due the Lenzs law and the associated magnetic field, will be at right angles to each other (Fleming 1902) as can be seen from the diagram below:

Figure 2 Fleming's Left Hand Rule (TeacherTube 2010) Therefore when a voltage is applied to the rotor this sets up a magnetic field. This magnetic field will interact with the fixed magnets located on the stator. This reaction is such that the forces produced will result in rotational motion. Design features such as the DC motors brushes, along with split ring commutators feeding individual armatures around the rotor which are shown below, allow for the switching of the direction current flow so as to ensure the magnetic force which is produced is always opposite to the magnetic force of the fixed magnets located in the stator. This therefore produces smooth rotational motion along with increased torque.

Mathematical Analysis of DC motor


The DC motor operation can be represented using two main equations the first being: Where: F : Force B : Magnetic Field Strength I : Current L : Length of Conductor : Angle of conductor with respect to magnetic field Equation 1

From the above equation, we can see that for the DC motor the Force is proportional to the, magnetic field strength and by extension the current in the armature. In addition the length and position of the conductor influences the magnitude of the force. From the above equation it can be clearly seen that maximum force will be experienced when the conductor is positioned at right angles to the magnetic field. The second equation which can be used to investigate the DC motor is: Where: T : Torque KT : Motor constant IA : Armature current : magnetic Flux Equation 2

From Equation 2 we can infer that the motor of the DC motor is directly proportional to the current and magnetic flux produced by the armature windings.

2.2 Existing Control Schemes for a DC motor and their Advantages and Disadvantages
Control schemes can be divided into two basic categories, open loop and closed loop systems. (Kuo 1991) These first two systems shall be examined using real life existing examples which utilised DC motors.

Open Loop Control The Electric Toothbrush


The electric toothbrush is a device which is used to brush ones teeth and it utilises a DC motor in its operation along with control circuitry. The function of the control circuitry within the tooth brush is to decrease the speed of the bristles to provide a gentler brushing experience. (Oral-B 2013) It must be noted that is control system does not use a feedback to determine if its output has being achieved. Therefore if excessive force is applied to the toothbrush bristles causing decrease of speed, control system within the tooth brush does not compensate for this by increasing the torque of the DC motor. From this example we can clearly see that with an open loop controller, output errors cannot be corrected, therefore the system cannot compensate for disturbances in the system. This control scheme is only used to simplify and reduce the cost of the toothbrush.

Table 1 Advantages and Disadvantages of Open Loop Control Advantages Disadvantages

Control Circuitry only affects/filters the input. Output is not monitored. Therefore simpler circuitry Low cost easy to implement circuit. Input cannot be adjusted based on output No set point control (Bucknell n.d.)

Closed Loop Control Laptop Central Processing Unit Fan


The function is this system is cool the central processing unit of the laptop computer, CPU so as to prevent overheating. (Erik Steel 2009) With closed loop systems, the output of the system, the temperature of the CPU is continuously monitored so as to maintain a set point temperature. If at any instant of time, the temperature increases above the threshold value, the output will be feed to the input via a comparator which will increase the speed of the DC motor/fan until the temperature returns to its set point value. From the above example we can see that with closed loop control, verification of the output result is achieved and maintained irrespective of disturbances. The table below outlines the advantages and disadvantages of closed loop control. (Kuo 1991) Table 2 Advantages and Disadvantages of closed loop control Advantages Maintenance of steady output can be achieved Disadvantages Complex to design

Careful tuning of output will result in an output More expensive to implement than open loop which can be easily predicted Modelling and errors due to external sources can be reduced (Bucknell n.d.) control systems

Open and Closed Loop can be further integrated with the following Control Schemes: Table 3 Summary of Control Schemes

On/Off Control For example Water pump using pressure switch When water pressure falls below a set point value electric motor is swtiched on Logic Control/Fuzzy Logic Control

Used in control systems in industry where it may be required for the DC motor to be activated based on some external logic input.
Proportional Control Used in electric conveyor systems where a constant speed is required. The torque and speed of the DC motor is adjusted based on the offset from the setpont value. This adjustment is made proportionally to the error. Integral Control Used with DC motor systems with variable loads. The sum of the erros is fed back to the comparator. Produces zero steady state error Slower responce time

Derivative Control Uses extrapolation to predict error. this error is then feed back to comparartor Faster than intergral Control
(Copeland 2013) Proportional, Integral, Derivative Control and a combination of each are most commonly used in industry especially for the control of the DC motor. As a result in the each of these control schemes shall be investigated mathematically and their advantages and disadvantages outlined in the below.

Proportional Control
This form of control can be represented mathematically: Where: Pout = Proportional Term of Output Kp = Proportion Gain E(t) = Error: Output Set Point Equation 3

Laplace Domain transformation of Equation 3: Gp(s) = Kp Equation 4

The above can be further represented using the block diagram below:

Figure 3 Block Diagram showing Proportional Control From the above diagram it can be seen that the output of the system, Y(s) is fed back to the input, U(s), where the difference between the set point and the output is calculated and multiplied by the proportional gain, Kp which is then transmitted to the system to adjust the output. If the value of Kp is large, system instability may occur due to the fact that a large error has to be corrected. If the value of Kp is very small, then the system may take a long period of time to stabilise. (Copeland 2013) These observations, along with others are presented in the table below: Table 4 Advantages and Disadvantages of Proportional Control Advantages Disadvantages

Accurate Analytical model need not be Does not reduce eliminated state error. designed so as to control system. Simple to implement Oscillation of system may be experienced

Suitable for systems which do not require exact Not suitable for systems requiring a set overshoot, peak response and settling time. overshoot and/or peak response and/or

settling time. (Copeland 2013) 7

Integral Control
This form of control can be represented mathematically by: Where: Iout = Integral of output Ki = Tuning parameter of Integral Gain E(t) = Error: Output Set Point Equation 5

Laplace Domain transformation of Equation 5: The above can be further represented using the block diagram below: Equation 6

Figure 4 Block Diagram showing Integral Control From the above block diagram we it can be seen that the integral or sum of the error over a time interval is fed back to the input, where it is multiplied to the integral gain. After which it is fed back into the system. If implement to a system which utilises a DC motor where a set point speed needs to be maintained, the speed shall be adjusted based on how much time has passed and the magnitude of the difference between the set point and output value. The table below outlines further features of this system. (Copeland 2013) Table 5 Advantages and Disadvantages of Integral Control Advantages Capable of reducing steady state error to zero Disadvantages Slow response time Due to slow response time, large variation of output may occur at the instant at which the error occurs (Bucknell n.d.) (Copeland 2013)

Derivative Control
This form of control can be represented mathematically by: Where: Dout = Derivative of the Outputs KD = Derivative gain of System E(t) == Error: Output Set Point Equation 7

Laplace Domain transformation of Equation 7: GP(s) = KD s Equation 8

The above can be further represented using the block diagram below:

Figure 5 Block Diagram showing Derivative Control From the above diagram the characteristics of derivative control can be observed. This control scheme finds the product of the rate of change of error over a period of time and multiples this error by the KD or the derivative gain. (Smuts 2010) Advantages and disadvantages of this scheme shall be explored in the table below: Table 6 Advantages and disadvantages of derivative control Advantages Capable of reducing steady state error to zero Disadvantages Slow response time Due to slow response time, large variation of output may occur at the instant at which the error occurs (Smuts 2010)

Proportional Integral Control


This control scheme can be described as a mixture of both the proportional and integral control systems as a result when implement with industrial DC motor systems, steady state error will be reduced and set point control is also improved due to the introduction of a pole and zero into the open loop of the transfer function. It must be noted however that PI control should be used in situations where it is required that the system tolerates significant overshoot. (Wang 2001)

Proportional Integral Derivative Control


This control scheme incorporates all the features of Proportional Integral Control mentioned above, with the addition of a faster response time. As previously mentioned one of the main disadvantages of Integral Control is its slow response time. (Copeland 2013) It must be noted however that the addition of derivative control not only increases the response time but also introduces inaccuracies in the system due to the its tendency to magnify noise within the system. (Smuts 2010)

10

2.3 Existing Motor Protection and Current Sensing Technology


Industry DC motors are vital to many operations, as a result their failure will is significant downtime and losses. The windings of the DC motor are most susceptible to damage as a result of: Mechanical abuse caused mechanical vibrations, lack of lubrication and lack of maintenance High temperature this will result in the degradation of insulation leading to burn outs. The temperature of a DC motor may rise dude to: o o High operational temperature High amperage in armature may be due to over load of DC motor, a locked rotor or short circuit condition along line. o Lack of maintenance Blockage of ventilation and lack of lubrication will increase frictional forces within DC motor Electrical Faults this will result in a high current flow in windings resulting in burning of insulation. Several factors can produce electrical faults: o Internal Faults this is causes by improper wiring and failure of insulation with in the DC motor. o Under voltage this will result is high currents in the windings, which will produce high temperatures due to I2R causing degradation of insulation leading to fault conditions. o Improper Operation Over-speed, high duty cycle, and continue disconnection and reconnection to voltage source produce overcurrent and overload conditions which result is high temperatures, degradation of insulation and fault conditions. (Blackburn 1998) From the above we can see that it is imperative that systems be put in place to prevent overcurrent and over-temperature conditions with the DC Motor. The table below lists some methods used in industry for DC motor protection and Current and Temperature Sensing:

11

Table 7 Methods used for DC motor protection

Thermal Overlad Relays Bi-Metal Switches - this deform as temperature increase. If set point is exceeded, a switch is tripped, diconnecting motor. Thermistors - incoperated with current sensing circuit. As temperature increases, resistance decrease, therefore current rises to a set point which will disconnect DC motor using a relay Fuses In the event of a short circuit condition and rating of fuse is exceeded, filament with file will burn out resulting is isolation of DC motor Loss of Field Relays In the event of the loss of a winding, dangerous overspeed conditions may occure. Relays incoperated with current sensing circuitry will isolated DC motor. Zero Speed Switch Locked rotor conditions which can result in excessive heating and over current conitions are prevented using this device. When power is applied the control system aticipates a responce from the zero speed switch. If the the switch does not swtich state within a set time, the DC motor is isolated.

Source Protection This protects the DC Motor from surges, harmonics and transients from source. This is achieved by simply using an isolation transformer along with filters/line conditioning circuitry.
(Miller and Miller 2008) From the above we can clearly see that most of these protection systems rely on its ability to measure/sense current. In this section, exactly how this is done in industry shall be explored.

12

Current Sensing Techniques


Table 8 Summary of current sensing techniques

Resistive Shunt This a comprised of a calibrated resistor place in the current path. It produces a voltage drop which is proportional to the current flow according to Ohm's Law. This voltage drop is then amplified by an operation amplifier for easy measuring or operation of cut off components This circuit can be configured for either Unidirectional Low Side current sensing or High Side current sensing. Hall Effect Sensor This non contact form of current sensing is based on the prinicple of induction, where for a given current flow, a proprtional magnetic filed will be produced. This magnetic field produces an EMF due to Faraday's law, which is amplifed and measured. This design and safer and more accurate due to its non contact design, no insertion impedance is introduced.

Inductive Sensors

This system is made up of a wire which is wound around the current carrying conductor. Due to Faraday's law a voltage is inducted in the the wire. Conditioning circuitry along with an operational amplifier work together to create an accurate and isolated form of current sensing.
(Microchip 2010) (NKT n.d.)

13

2.4 Existing Approaches to Implementation of Control Algorithm


The table below outlines some approaches used for the implementation of control algorithms: Table 9 Control Algorithm Implementation

Microcontrollers Algorithm can be implemented using C based code or assembly language. Uses Pluse Width Modulation, PWM which sets a fixed frequency and variable duty cycle. Normally integrated with electronics such as Transistors, Thyristors and H-Bridges to provide the required motor driving wattage. H-Bridges utilises Sign Mgnitude bits whose primary function is to not only vary the power but to switch the rotation of the motor. Locked Anitphase is another version motor control implemented through a H-Bridge and Microcontroller set up. Its function is very similar to that of the Sign Magnitude however only one line is needed to completely control the H-Bridge.

Field Programmable Gate Array Used to execute complex motor control algorithms with increased efficiency. Algorithm implemented using code such as VHSIC hardware description language, VHDL. Capable of implementing algorithms which common micorprocessors can't due to its capability to be implemented with peripherals such as Ethernet, PowerLink and PCI Express. Similar DC motor integration to the Microcontroller. That is utilising solid state electronics. Programmable Logic Control This is most commonly used in industry as it is the most flexible. It is also very easy to program, therefore control algorithms can be implemented using logic symbols and easy to use graphical software supplied by the manufacturer.
(KronoTech n.d.) (Xilinx 2012) (Microchip 2010)

14

2.5 Existing Approaches for the Measurement of Motor Speed


The table below lists the different methods used for the measurement of DC Motor Speed in industry:

Encoders These are physically mounted onto the shaft. The rotational motion of the DC motor generates pulses. Encodes has a high no of pulses per revolution, this therefore results in a better resolution. Since the enoder is physically attached to the shaft, it introduces errors in the measurement. Proximity Sensor Normally mounted close to a gear or bolt on the shaft of the DC motor. As the motor rotates, the promity will vary generating pulses, as the bolt/gear teeth move back and forth from the sensor. Contact less in design, therefore does not introduce errors in the measurement. Number of pulses per revolution is dependant on number of gear teeth/bolts. Normally resolution is very low. Photoelectric Sensors Reflective target is placed on DC motor shaft. When light is shone on this reflective taget, the reflection is captured using an optical transitor which generates pulses. This method is contactless, and number of pulses per revolution is dependant on the number of reflective targets placed onto the shaft. Resolution is therefore low, however no resistance is added to the shaft. Optical Isolator This utilises a Phototransistor Interrupter Switch along with an Interrupter Disc. The Interrupter Disc is attached to the shaft, as the DC motor spins, light from the emitter end of the Phototransistor Interrupter Switch is interrupted by the holes found the on the surfance of the Interrupter Disc. Therefore, light reaches the base of the optical transistor in pluses, thus creating a plused signal. The resolution id dependant on the number of holes in the interrupter disc. In addition the Interrupter disc adds a load and by extension an error to the measured speed.
(Opto22 2013) (Fairchild 2001)

15

3 Design Approach and Methodology


3.1 Design Brief

Project Objectives
The main objective of this project is to design and build a DC motor controller, which utilises a PI control strategy. This objective must be undertaken with the following considerations: Development of a design which incorporates: o o Industrial Standards for an inherently safer and efficient design Business Principles and Practise for efficient time and resource management

This design must be implemented observing: o o Laboratory and Safety Protocols though conducting Risk Analysis Engineering Code of Ethics

Project Plan
These objectives where divided into 12 tasks and undertaken over a 7 week period as showing in the table below: Table 10 Task description Task Duration (days) 1 2 Background Research of DC motor control systems implementation and design Development of conceptual hardware design of Display based on Industrial Standards and Best Business Practise 3 4 5 6 7 Development of algorithm for multiplexing of Display Mathematical Modelling of Motor Development of PI control algorithm Development of conceptual code of PI control algorithm 1 2 3 3 7 1

Development of conceptual motor driving and protection circuitry taking into 2 consideration Industrial Standards and Best Business Practise

Familiarise myself with lab protocols. Conduct risk analysis. Apply appropriated 1 safety measures.

Phased Circuit Construction and Code Development. Circuit will be built in 10 modules. Each module will be tested before another module is built and added

16

to the design: 10 11 12 Module 1 5V Regulator Module 2 PIC16F877 support circuitry Module 3 Multiplexing of 4 Seven Segment Displays Module 4 Current Limiter and Overcurrent Isolation Module 5 Temperature Monitoring and Isolation of Voltage Regulator Module 6 Temperature Monitoring and isolation of DC motor. Module 7 DC motor driver Module 8 Integration of Optical Isolator 3 3 13

Testing of system accuracy, and modifications Recording of results and observations. Compilation of final report

17

The Gantt chart below graphically represents the above data, along with the start and end dates.

Task 1 Task 2 Task 3 Task 4

Task 5
Task 6 Task 7 Task 8 Task 9 Task 10 Task 11 Task 12

Figure

Gantt

chart

18

3.2 Product Design Specification


The specific design specifications of this project bearing in mind performance, environment and product life cycle are detailed below. This table will refer to the different modules for which the project was divided. Industrial standards by which each module adheres to will be included.

Module 1 5V Regulator
Performance Factors - This regulator must be able to accept a voltage range between 6V to 12V, and output a constant 5V. In addition the output must be free of noise and ripples. Operational Environment Considerations This regulator will be used to power the PIC 16F877. Apart from the output being a steady DC at a constant 5V, this circuit will be handled by students. Accommodations must be made. Product Life Cycle Excessive heat has the potential to destroy and diminish the life span of electronics. Regulators tend to get hot especially at high input voltages. Accommodations must be made.

Module 2 PIC16F877 Microcontroller and Circuitry


Performance Factors Requires a voltage of nominally 5V for operation. Exceeding 5.5V will cause damage to the device. PI control algorithm will be implemented on this microcontroller. (Microchip, PIC16F87X Data Sheet 2001) Operational Environmental Considerations apart from insulation and proper circuit design. This device will be integrated with many other modules. Design must effectively utilises PIC16F877 pins. Product Life Cycle Destroyed by excessive voltage and current conditions.

Module 3 Multiplexing of 4 Seven Segment Displays


Performance Factors This device is required to display the speed of the DC motor clearly. They are common cathode displays, with seven control lines each. Each segment of the display operates at 2.0V each. (Jameco n.d.) Operational Environmental Considerations These displays will be operated in bright laboratory environments. Display must be bright enough to be read. These displays will be interconnected and powered by the PIC 16F877. They should not disrupt the operation or the PIC 16F877. Product Life Cycle Easily destroyed by excessive voltage and current conditions.

Module 4 Current Limiter and Current Isolation


19

Performance Factors The current limiter will limited the current to the motor. The current isolation will protect the entire circuit especially the PIC16F877 from short circuit conditions. Immediate and reliable reaction is required of this circuit.

Operational Environmental Considerations this circuit will be supplied with 12V. There is also be a high power demand.

Product Life Cycle Lifespan will decrease as a result of high temperatures. Accommodations must be made.

Module 7 DC Motor Driver


Performance Factors This driver circuit is required to be integrated with the PIC16F877, where it is required to be able to vary the supply voltage to the DC motor from 3V to 12V whilst not exceeding the maximum rated current of the DC motor of 0.57 A (NICHIBO 2002) Operational Environmental Considerations this circuit must not negatively affect the operation of the PIC16F877. Product Life Cycle Lifespan is negatively affected by, current overload in the windings as well as excessive heat. Necessary accommodations must be made.

Module 8 Optical Isolator


Performance Factors must be able to accurately measure the DC motor speed in revolutions per minute in real time. And must communicate this information effectively with the PIC16F877. Emitter voltage must not exceed 1.7V whilst sensors emitter to collector voltage must not exceed 4.5V (Fairchild 2001) Operational Environmental Considerations this circuit must not negatively affect the operation of the PIC16F877. Product Life Cycle negatively affected by high voltages and currents.

20

3.3 Concept design and Evaluation


Having outlined the design specifications for each module, the process of conceptualising the design can now begin. Each module has an associated hardware requirement, whilst some modules require both hardware and software design. The conceptualisation of each module will all exhibit a similar theme, which is one of Simple Intelligent Design.

Module 1 5V Regulator
Performance Factors Design will utilise L7805CV regulator, which gives a 5V output and accepts a voltage range of 6V to 16V. Output will be conditioned using appropriate capacitors. Operational Environment Considerations Appropriated colour codes to distinguish, 5V and 12V output, positive and negative. LED will be used to indicate that circuit has power. A switch will also be installed. Product Life Cycle Heat sinks and over-temperature circuitry shall be implemented on regulator.

Module 2 PIC16F877 Microcontroller and Circuitry


Performance Factors Both power sources of PIC16F877 to be connected to ensure reliable power supply. Oscillator output wire to PIC16F877 will be kept short as possible to prevent noise from distorting the signal. Operational Environmental Considerations wiring will be done again following colour codes. Product Life Cycle All wiring was done flat, cut to exact lengths to avoid loss of connection and short circuits.

Module 3 Multiplexing of 4 Seven Segment Displays


Performance Factors Multiplexing of signal lines to optimise the use of PIC16F877 pins. Due to rapid switching using transistors, power drawn from pins was reduced. Operational Environmental Considerations Grey automotive tint was applied to the displays to improve visibility. The grey tint will improve the contrast of the display. Product Life Cycle Resistor pack was chosen so as allow maximum illumination without exceeding rated current. Resistors were also implement on the base of the NPN transistors.

Module 4 Current Limiter and Current Isolation


21

Performance Factors Ensures that current supplied to the DC motor will not exceed rating stipulated in datasheet. A relay will be used along with a current sensing circuit to isolated entire circuit in the event of a short circuit.

Operational Environmental Considerations in the event of a short circuit condition, apart from the relay tripping, a red LED will be triggered along with an audible alarm, the form of a piezo buzzer.

Product Life Cycle a LM350T will be used in this design. This component doesnt generate much heat, however a heat sink will be installed to prolong lifespan.

Module 7 DC Motor Driver


Performance Factors TIP31C configured in a Darlington Pair will be used for the control and driving of the DC motor. Operational Environmental Considerations Due to the fact that they high powered transistors and their configuration, the switching/control of the DC motor can be accomplished without drawing too much power from the PIC15F877. Product Life Cycle two TIP31C will be used in this design. This component doesnt generate much heat, however a heat sink will be installed to prolong lifespan.

Module 8 Optical Isolator


Performance Factors Resistors will be installed in series with the emitter and the senor to achieve optimal working conditions outlined in the datasheet. Operational Environmental Considerations will be integrated with PIC16F877, resistor will limit sinking current to less than 25mA. It must be noted that all power supplied to each module will be regulated and protected by overcurrent isolation circuitry. The above can be represented using a block diagram which can be used to distinguish the skill sets required for the production of the entire system.

22

Figure 7 Block diagram of System From the above diagram one can see that the two min skill sets need in this design project is control systems and microprocessor programming. All of the modules previously mentioned will work together to achieve the projects objectives, a detailed explanation of this process will listed below.

Operation Detail
Set point seed will be determined by a potentiometer which will be interfaced with the PIC16F877. The output of the potentiometer will be analogue voltage, which will be fed into the PIC16F877, where it will be converted to a digital 10 bit binary format. This conversion process will ignore the two lowest bits, whilst the remaining 8 bits will be used to as the set point speed of the DC motor. The PI control algorithm employs a feedback loop. This therefore requires the output measured speed to be fed back to the PIC16F877. The speed measuring process will be achieved via, Module 8 along with an interrupter disc. The hardware design of this process was introduced previously. When properly interfaced with the PIC16F877, the phototransistor along with the interrupter disc, will convert the rotational motion the DC motor, to a series of pulses which are fed to the PIC16F877, where it will be counted for a specific period of time. The counted value, is then stored in a register with in the PIC16F877, this 8 bit value, is then compared to the set point value, set by the potentiometer. From this comparison an error value is determined, which will be integrated and scaled so that the output voltage can be adjusted to the set point value if need be. Therefore under no load conditions the error value will be minimal, little or no adjustments will have to be made to the output.

23

However if a load was added to the DC motor, its RPM will decease below the set point value. Module 8 will measure this drop in speed, transfer this information to the PIC16F877, where it will be processed, stored and compared to the set point. The error value will be determined. Proportional and integral operations will be performed on this value, which will then be used to adjust the PWM output to Module 7 DC motor driver.

24

3.4 Motor & Controller design


In this section mathematical modelling along with the determination of parameters and performance characteristics of design will be undertaken.

Mathematical model of the Motor and Load


The following table outlines the DC motor parameters which will be used: Table 11 Motor Parameters Product Number Voltage Range Nominal Voltage Current Stall Current Torque Speed Efficiency Length of Shaft Diameter of Shaft Pc-280-16210 3VDC 12VDC 6VDC 0.28A 0.98A 18gcm 4260RPM 47.6% 11 mm 2 mm

From these parameters we can develop an equivalent circuit, which is shown below:

Figure 8 DC motor equivalent Circuit Other Parameters which will be used, not shown in the diagram above, are listed in the table below: Table 12 Model parameters Parameter Jm Ji Description Motor moment of Inertia Load moment of Inertia Units

kgm2 kgm2

25

Jeq bm beq bl Ka Kb

Inertia of Motor and Load Equivalent Moment Motor Friction Co-efficient Motor and Load equivalent friction co-efficient Load Friction Co-efficient Motor Torque Constant Back EMF constant

kgm2 kgm2
Nm/A

kgm2
Nm/A Vs

Having outlined all the parameters of the system we can now convert the equivalent circuit to the Laplace domain. From examination of the equivalent circuit we can infer the following: When a voltage, Ea(t) is applied to the armature of the DC motor, a current Ia(t) will follow due to the resistive, Ra and inductive Ia components. Due to Lenzs Law, and the permanent magnets in the stator, the current in the armature will produce a torque in the motor, which will produce a turning motion. This motion will result in the creation of a back EMF.

The table below summarizes the conversion of parameters to the Laplace Domain:

26

Table 13 Conversion of Parameters to Laplace Domain Operation Process and Reasoning Result

Conversion of Voltage to Applying Kirchhoffs Voltage Law to equivalent circuit Current in Laplace Domain Laplace Transformation of expression for

Making Current,

the subject of the formula. From this expression

we can infer that the current can be found by dividing the difference of between of the applied voltage and the back EMF. Therefore block diagram should include Conversion of Current to A force is experienced in the armature, due to the application of a Torque in Laplace Domain voltage, thus inducing a current. This force can be represented by: This force also generates a torque, where r is the distance between the axis of rotation and the winding. Substituting the expression for Force, F into the expression for Torque, T gives Therefore the Armature Torque Constant, Ka can be represented Substituting for Ka reveals that a Ka block may be used to represent the system Torque Conversion of Torque to Moment of inertia of motor with load

27

Speed in Laplace Domain

Co-efficient of motor with load Since no gears were used in this design n = 1. Appling Newtons Laws. Where: is the Angular Acceleration is the Angular Velocity gives gives

Laplace transform of Substituting for

Therefore the following block is needed Conversion of Speed to Back From Lenzs Law, where: E.M.F in Laplace Domain is Magnetic Flux

Total/Net Magnetic Flux, where: A is Area passed through by the armature winding.

This Area can be represented by, where: is the distance passed through by winding is the corresponding angle traversed into the expression

Substituting the expression for Area traversed, for Lenzs Law, Taking and substituting into

28

Therefore a Kb block may be used to relate Eb(s) to w(s)

Based on these calculations the block diagram for the signal flow of the DC motor used in this design project is shown below:

Figure 9 DC Motor Signal Flow Transfer Function of Block diagram:


( )

Equation

29

Assuming: Armature Coil inductance = 0 Therefore beq = 0

Block diagram can be simplified:

Figure 10 Simplified DC Motor block diagram Simplified transfer function: Equation 10

Having developed the simplified transfer function, determination of the key motor parameters must be done.

Determination of Key DC Motor parameters


This analysis will be shown in the table below: Operation Value of Jeq Process and Reasoning The moment of inertia of the motor and load, where: Equation for the moment of inertia Calculating moment of inertia of shaft, where: is the diameter of shaft = 2mm is mass of shaft 0.02 kg Result

Calculating moment of inertia of load/ rim, where: is the diameter of rim = 30mm is the mass of rim 0.005 kg

Therefore moment of inertia of DC motor

The equivalent moment of inertia is found using, where is the Load/Rim component 30

As a result, Value of Ka

, therefore

Expressing Ka as a function of Torque and Armature Current. From this equation, a linear characteristic between Torque and Armature Current is indicated. The gradient of the linear line in Characteristic Curve for DC motor graph, see Figure 11 can be used to determine Ka Using the points (0.5, 40) & (0,0), Ka was determined. Final answer was multiplied by 9.81gcm to take in consideration gravitational field strength.

Value of Kb

Ka is equal to Kb due to the fact that they both have the same base units. It must be noted however that the units of Kb are

Value of Ra

Armature resistance was measured using an Inductance Capacitance meter.

Figure 11 Characteristic Graphs of DC Motor (Jameco n.d.) Having determined the key parameters of the motor, this values can be substituted into the transfer function, Equation 10.

31

Simplified transfer function: Equation 11

Further simplification: Equation 12

Determination of Suitable Performance Characteristics


Having determined the transfer function of the DC motor, the block diagram can be modified to suit:

Figure 12 Block diagram of system The transfer function of the above block diagram and by extension the entire system:
( )

Equation 13

General transfer function of system: Equation 14

Comparing Equation 13 to Equation 14, so as to determine suitable values for KI and Kp. This process will outlined in the table below: Table 14 Calculation of Ki and Kp Operation and Reasoning Setting the term to zero, to simply operations
Eq. no

Result

i ( )

Let General representation equation be

ii

Comparing the denominator and simplifying Eq (i) iii and Eq (ii) Using Peak Overshoot Mp = 0.05, Settling time, t2% iv 32

= 0.15s Taking of both sides and simplifying for v vi vii

expression for Where is equal to

Substituting for Substituting for

and ts into Eq (vi) in Eq (ii)

viii

ix

Having determined a Kp and Ki, they can be added to the block diagram:

Figure 13 Complete block diagram Transfer function of entire system can be found by substituting into Equation 13:

Justification of Controller Choice


Testing using Equation 10, function, meets the system specifications, that is: Peak Overshoot Mp = 0.05, Settling time, t2% = 0.15 was done using Matlab to prove that transfer

33

Transfer function for the entire system step response was plotted in Matlab. The Overshoot was 18.1% whilst the settling time was 0.424 seconds. These values were very of, from the system specifications. As a result, sisotool in Matlab was used to determine the compensator.

Figure 14 Step response of system transfer function

Modification of the Transfer Function resulted, in an


Overshoot of 4.02% and a settling time of 0.122 seconds. Both of these values were within the specifications of the system design. The compensator used to achieve these values was 10. As a results the new values of Ki and Kp are, 0.855 and 7.841 respectively

Figure

15

Step

response

with

compensator 34

3.5 Implementation of PI Controller and Data Processing

Algorithm/Flow chart
The diagram below shows a basic flow chart of the system operation:

Figure 16 Simple Flow Diagram of System In this section, focus shall be placed on the implementation of the PI controller. The following diagram illustrates the flow process:

Figure 17 PI control Flow Chart

Implementation of Algorithm on PIC16F877


The operation which is required to be performed is Proportional and Integral control, from the above block diagram we can see the error signal first need to multiplied by a proportional gain.

35

This is done using an 8 x 8 multiplication routine which is shown above. The integral operation of the PI control, will be implemented, using summation, where the total of all errors will be added to a particular register. This contents of this register will be added to the contents for the register, containing the results of the proportional process. The diagram below outlines the 16 bit addition routine:

Figure 18 Sixteen bit addition Routine

Considerations for Appropriate Scaling Values


The values of Ki = 0.9and Kp = 7.8 to one decimal place, is too small of a value to be interpreted by the PIC16F877. As a result the 8 x 8 multiplication routine above had to be implemented to increase their values, by a factor of 10, before they are implemented in the PI control routine. The result from the PI controller routine will be a sixteen bit value. In order for this value to be process by the PWM module, it must first be converted to an 8 bit value. This is done using a sixteen by eight division routine which is shown below:

Figure 19 Sixteen by Eight Division Routine.

36

Choice of PIC16F877 Peripherals


Table 15 Microprocessor Peripherals Peripheral RC2/CCP1 Reason This pin was configured as a PWM output. This output voltage varies from 0-5VDC. When integrated with the DC motor driver circuitry, provides speed variation. TIMER1 This was configured in the count mode. When integrated with the phototransistor/Speed measuring module, it is used to count the pulses generated. RC1/T10SI This pin was configured as the input from the Speed measuring module to the PIC16F877, and works along will TIMER1 to count the pulses generated. RD0 RD7 These were used as output pins for the display, done by configuring TRISD. PORTD was chosen to perform this function mainly for ease of wiring. RA1 RA4 There were used as output pins for the switching of the display transistors to enable multiplexing. These pins were chosen again, for ease of wiring. RA0 CLKIN This pin was configured to be used as the analogue input for the set point value. This pin was configured with the 4MHz oscillator. This examples the timing of the circuit.

Hardware Justification
The follow table is a list of all the hardware components used in this design project along with their purpose. Table 16 Hardware Components Component PIC16F877 X1 Justification Flexible high performance RISC CPU, with Interrupt, PWM and Timer features and peripherals L780CV 10uF & 1uF TIP31C LM350T 4MHz Oscillator H21A1 X1 Optical interrupted switch. Can be configured to give a digital output 37 X1 X1 X2 X1 X1 5VDC regulator will 6-16VDC input range Filter 5V regulator output High power transistor, capable to switching high loads Configured to be used as a current limiter for DC Motor Used to enable PIC16F877 time keeping capabilities

which can be interpreted by PIC16F877 2N3904 GNS-3011Cx X1 X4 Cost effective, fast switching solution for multiplexing of display. Operates with 2VDC, therefore can be easily integrated with PIC16F877, without drawing too much power from its pins. Diode Relay LM324AN LM35DZ LEDs X1 X2 X2 X1 X3 To prevent Back EMF To isolate circuit Current amplification for Cut off Temperature Sensing Used as warning and notification lights to indicate circuit is on, or overcurrent relay has tripped

38

3.6 Other Design Considerations

DC Motor speed Output


The PWM feature of the PIC16F877 was used to vary the DC motor speed output and was implemented by configuring the TIMER2 and CCP1 modules. A duty cycle of 500 Hz causes the motor to spin, and this frequency is adjusted using the following equations:

Equation 15

Equation 16 If the T2CON register is configured to a prescalar of 1:16 and the TMR2 register is configured to zero and the PR2 register is configured to 255, a PWM output of 500Hz would be generated. It must be noted that the value of the duty cycle was varied by changing the value of the CCP1L register.

Display Output
As part of the design specification for this project, it is required that the RPM be displayed on the four seven segment displays. As stated earlier, these displays will be connected to Port D, and since they are common cathode, their part to ground will be controlled by four transistors each, which will be connected to pins RA1 to RA4. This configuration allows for a process of multiplexing to occur. Multiplexing allows multiple signals to be sent along the same line, in our case, four different digits logics will be sent along the same set of lines periodically. Each display is switched on and the others are switched off, exactly when that particular display information is being transmitted. This process of switching each display on occurs at a rate of 20ms, which is too fast for the human eye to detect. Benefits of this system are, a reduction of power, wiring and smarter utilization of the PIC16F877 resources.

Figure 20 Display Output Flowchart 39

40

Speed Input Routine


In order to determine the speed of the DC motor a phototransistor optical interrupter switch was integrated with the PIC 16F877 as shown in the diagram below. When the interrupter disc, which is attached to the shaft of the DC motor is spun, the phototransistor generates a pulsed output signal, due the fact that the light from the emitter of the device is being continuously blocked and revealed to the base of the transistor. This output waveform is fed to pin RC1, which was configured as a TIMER1 peripheral in count mode. The count will be interrupted every time the pulse transitions from high to low. The speed is measured every 0.5 seconds where the measured value is stored in a register. This stored value to output to the display and is used for comparison against the set point value for PI control.

Figure 21 Phototransistor optical interrupter switch

Improvement of Resolution of the Speed Sensor


This can be done, by increasing the number of holes or interrupts in the interrupter disc. In computer mice, the scroll wheel utilises this technology, however, a greater resolution is required due to precision required from this device. As a result the no of interrupts in the interrupter disc found on a computer mouse is close to 200. Desktop printers require an extremely high resolution. Thousands of minute opaque lines are drawn on a clear plastic to create, this particular high resolution interrupter disc. (BiPOM 2002)

Design of circuitry to meet current and voltage requirements of the displays


The Seven Segment displays, require 2VDC at 150mA for optimum operation. (Jameco n.d.) However the PIC16F877, sources 5VDC. In addition, LEDs have a very low resistance, therefore connecting across a source without a load, can cause a dangerous high current flow due to ohms law.

41

In order for the seven segment displays to be safely integrated with the PIC16F877, they must be connected in series with a resistor pack. This will not only reduce the voltage, to the display but will also limited the circuit current. Calculation for the value of this resistor is shown below: Equation 17

Figure 22 Display wiring (Best-Micocontroller-Projects 2013)

Justification for Choice of Oscillator


An Oscillator is need so as to provide an accurate and stable periodic clock signal to the microcontroller. (Microchip, PIC16F87X Data Sheet 2001) There are different oscillator modes which are outlines in the table below: Table 17 Different Oscillator modes Mode HS XT LP RC Description High power consumption Designed for use with Crystals and Resonator of 1 to 4 MHz, with moderate power consumption, accurate and fast clock rate. Low power consumption. Slowest clock rate Used in applications where precision is not necessary

Examination of the above table reveals that the XT oscillator is the best choice for this design project, because it is the most accurate, energy efficient and has a fast clock rate.

42

Justification of Component values for Current Sensing, DC Motor Protection and Diver Circuit

5V regulator

Relay
Current Sensing Ckt

Current Limiter Ckt

Current Limiting Resistor for CKT on LED

Diode to blk back EMF

Motor Driving Ckt

Optical Transistor

Figure

23

External

hardware

design

43

Determination of R3: ( ) Equation 18

4.85 (PS the value in the diagram above was just included for simulation and is not actual value used)

For complete hardware justification see Table 16.

Laboratory Protocol
General Rules Students should not be allowed to enter the laboratory without wearing proper shoes and clothing. Proper shoes can be described as close toed shoes whist proper clothes can be describe as clothing which covers ones body appropriately. Therefore knee high pants and skirts are not allowed. Excessively loose clothing should not be worn. Students should not wear long hanging jewellery nor should persons with long hair style have it loose. This is to prevent personal injury as a result of items being caught in apparatus. Bags, food stuff or liquids should not be brought into the laboratory. Desk space is valuable. Bags clutter equipment and can become a fire hazard. Liquids and food stuff have the potential to damage equipment if they are spilled onto it. This may also result in personal injury or loss of life. Equipment Use When using the soldering iron please switch off after use. Also switch on the vacuum fan whist soldering. Long term inhalation of solder fumes can be harmful to ones health. When using voltage supply, do not cover ventilation holes. This can be a fire hazard. When using multi-meter do not tug on leads. Neatly wrap leads after use and place back into the storage compartment. The leads should never be cut or altered. When using your bread board, please be aware that the maximum current rating of the board is 0.5 A. Also one should not use resistors specified to be greater than 0.5 Watts.

44

Never alter, modify or move equipment from its original location. Ask the laboratory assistant for assistance or permission. Never should network cables be unplugged or altered.

45

Risk Assessment
Table 18 Risk Assessment Hazards Persons Affected Burns from Soldering Students TeachingAssistants Possible Effect of Hazard
Likelihoo d of the Hazard Severity of the

Level of the risk

Precautions

Hazard

Soldering involves the use of a soldering iron, which is 5 required to be at very high temperatures in order to melt solder. If the soldering iron gets in contact with an individuals body this could lead to severe burns, but rarely death. Damage to personal and university

It is recommended that students wear heat resistant soldering gloves whist soldering. In addition if pays to be careful and alert whilst performing this task

equipment is also probable Inhalation Students Whist soldering especially at high temperatures, lead 2 from the solder atomize, therefore becoming air borne. Lead is poisonous. Prolonged exposure to solder fumes can lead to the development of asthma. Due to improper use or poor quality of wire cutters and 3 strippers, students can damage their hands trying to strip wire. 3 M 5 E It is therefore recommend that students switch on the vacuum fan when soldering. This will prevent the inhalation of the fumes. In order to mitigate this risk, pre-cut and pre stripped wire can be used. Automatic wire stripping tools can also be used. Wearing gloves can be beneficial.

of Solder TeachingFumes Assistants Lab Staff Chafing Students

and Injury Teachingto Hands Assistants whist stripping wire

46

Burns due Students to hot TeachingAssistants

The transistors which are used in the voltage regulator 3 are capable of producing a significant amount of heat. As a result, bodily contact with these particular components can lead to personal injury.

Students

should

be

aware

of

components that have the potential of reaching high temperatures. These components should be identified and labelled. Wearing gloves whilst

compone nts

operation is also recommended Electrical shock Students TeachingAssistants The voltage regulator being designed has a considerable 3 amount of voltage and current associated with the design. If a student gets in contact with an un-insulated conductor that is powered, he runs the risk of experiencing an electric shock. Fire Hazard Students TeachingAssistants Lab Staff Combustible objects may get into contact with hot 3 components or apparatus such as the soldering iron. 5 E 3 M Students show check circuit before powering on for exposed conductors. Teaching Assistants should also

double check the circuit s before being powered. Students are to place the soldering iron back into its holder after use. Also ventilation holes of equipment should never be blocked.

Figure

24

Risk

Assessment

Key 47

Occupational Safety
In this section we will examine the Occupation Safety and Health Act of Trinidad and Tobago 2004 as it relates to this design project It is stated is the act in Section 22 that no young person should be allowed to operate equipment unless he or she is fully trained to do so. In Section 23 it is stated that persons working in an industrial environment, in our case a laboratory environment, should wear protective clothing. Students are required to wear clothing that is conducive to a laboratory environment as described previously. A

Subsection states that signs should be placed outside of the laboratory, warning laboratory users of the rules and guides especially concerning protective wear. This can be found on the door on the Electronics Lab. Section 24 deals with the production of dust and fumes. Fumes which are produced in this design are due to the soldering process. A vacuum fan can be found at the soldering station hence complying with the act which states that the production of harmful dust and fumes should be dealt with so as to prevent inhalation.

Code of Practise
The following is a summary of the codes of practice for engineers as stipulated by the Registered Professional Engineers in Queensland. It is subdivided into three categories. Obligations to Society Engineers should be informed of the environmental, social and economic consequences of their actions or decisions. They should act honestly, with integrity and fairness. They should always perform steps to protect the health and welfare of the community. They should have a special regard to and try to reduce the effects on the environment.

Obligations to Clients or Employers Engineers should be truthful and honest. Never should their intention be to mislead or misrepresent their organisation. They should always warn clients or users of the consequence of disregarding advice. They must be open to their employers and disclose any conflict of interest. They must always keep private information confidential.

General Professional Obligations 48

Engineers must bring their knowledge, expertise and care to any task. They should not engage in fraudulent behaviour. They should never promise, accept or receive bribes. They should continue to develop their skill and expertise.

Industrial Standards
The following are Industrial Standards by which, this project abides: Trinidad and Tobago bureau of standards wire colour code. NFPA 70E Standard for electrical Safety in the work place. ANSI/NEMA ICS 61800-1 standard for low voltage adjustable speed electric motors.

49

4 Results and Analysis


4.1 Presentation of Results
Table 19 Summary of Key Parameters Parameter Ra La Ka Kb Jeq Beq Kp Ki Calculated Value 20.01 7.85 x 10-3 7.85 x 10-3 9.04 x 10-6 kgm2 0.0855 0.7841

Tests Performed for Evaluation

Figure 25 Step Response of closed Loop control System

50

Figure 26 Step Response with Compensator

Accuracy of Speed Displayed


This test was performed using a hand held tachometer. Table 20 Results of display testing Measured Speed 510 625 853 1401 Displayed Speed 540 678 953 2031

Protection Module Test


Current Cut off The protection module was simulated using a 1k pot across input the resistance was varied and current measured so as to stimulate a short circuit condition. PIC16F877 and DC motor were

51

removed from the circuit. At a current exceeding an average of three tests, 0.30 A, relay opened disconnecting circuit. Voltage Regulation Input voltage was varied from 6VDC to 16VDC, output remained at steady 5.1VDC. When connected to oscillator minimal ripple was observed. Current Limiter Again a short circuit condition was simulated using a pot. Current value never exceeded 0.30 A

System Response to difference Input Conditions


Difference loads was added to the system, whilst an oscilloscope was positioned across DC motor input. The speed was monitored both by the display and the tachometer. Upon addition of the load an increase in voltage was observed and an increase in speed when then averaged to the set point value.

52

4.2 Discussion
From the results in the previous section it was observed that the different modules operated as they should, when compared to the calculated or measured values.

The display module


This was fairly accurate for small rpms. However there was large inaccuracies at larger values. It must be noted however that a large about a vibration occurs at these higher rpms does due to the imbalance of the interrupter disc. This may contribute to the error.

The Protection Module


This module was very successful. This was verified using measurements using the oscilloscope, voltmeter and ammeter. In addition fault conditions was simulated to see the protection, the response time in action.

The PI Controller
This module was also successful, however it was notices that the settling time that is for the system to reach back to its set point after the over shoot was long, approximately 2 seconds. I believe this is an error with my code, and will be correct before the oral presentation.

53

4.3 Conclusion
This design project was indeed a rewarding experience as it may be aware if the importance of control systems and microprocessors in the world today. There are countless example where this simple project is used in our everyday lives and I believe that is paramount that especially electrical and computer engineers understand this design project. In addition this project also made me aware of the different protection systems, which can be applied not only to my circuit but to real life DC motors in industry.

54

5 References
ACS. 2013. http://www.automatedconveyors.com/. Accessed March 13, 2013. http://www.automatedconveyors.com/. Best-Micocontroller-Projects. 2013. A PIC microcontroller frequency counter using TMR1. Accessed April 10. http://www.best-microcontroller-projects.com/frequency-counter.html. BiPOM. 2002. BiPOM Electronics. Accessed April 5, 2013.

http://educypedia.karadimov.info/library/encoder.pdf. Blackburn, J.Lewis. 1998. Protective relaying: principles and applications. 358. CRC Press. Bucknell. n.d. An Introduction to Control Systems. Accessed March 9, 2013.

http://www.facstaff.bucknell.edu/mastascu/econtrolhtml/Intro/Intro1.html. Copeland, Brain. 2013. ECNG 2009. myelearning. Accessed April 8, 2013.

http://myelearning.sta.uwi.edu/course/view.php?id=16600. Engineering, Department of Electrical & Computer. 2013. ECNG 2005 Course Page. myelearning. 25 February . Accessed March 16, 2013.

http://myelearning.sta.uwi.edu/mod/resource/view.php?id=267581. Erik Steel. 2009. eHow tech. Accessed March 13, 2013. http://www.ehow.com/how does_4927808_laptop-cooling-fan-work.html. Fairchild. 2001. H21A1 Phototransistor Optical Interrupter Switch. Fairchild Semiconductor Corporation. Fleming, John Ambrose. 1902. Magnets and Electric Currents. 173-174. London: E&F Spon. Jameco. n.d. GND-3011Cx Data Sheet. Jameco Electronics. KronoTech. n.d. PLC Adavantages and Disadvantages. Accessed April 2, 2013.

http://www.kronotech.com/PLC/Advantages.htm. Kuo, Benjamin. 1991. Automatic Control Systems. New Jersey: Prentice Hall. McGraw-Hill. 2010. McGraw-Hill Science & Technology Dictionary. McGraw-Hill. Microchip. 2001. PIC16F87X Data Sheet. Microchip Technology Inc. . 2010. techonline. Accessed April 10, 2013. http://www.techonline.com/educationtraining/education-training/tech-papers/4204475/Current-Sensing-Circuit-Concepts-andFundamentals/viewpdf.

55

Miller, Rex, and Mark Miller. 2008. Industrial Electricity and Motor Controls. 384. McGraw-Hill. NICHIBO. 2002. Jameco. Accessed April 2, 2013.

http://www.jameco.com/Jameco/Products/ProdDS/231829.pdf. NKT. n.d. NK Technologies Current Sensing . Accessed April 10, 2013.

http://nktechnologies.com/current-sensing.html. Opto22. 2013. Rpm Measurement Techniques. Accessed April 4, 2013.

http://www.opto22.com/documents/1784_RPM_Measurement_Techniques_Technical_Not e.pdf. Oral-B. 2013. Power Brushes. Accessed April 2, 2013. http://www.oralb.com/products/electrictoothbrush/. Smuts, Jacques. 2010. Derivative Control. Control Notes. 3 May. Accessed April 1, 2013. http://blog.opticontrols.com/archives/153. TeacherTube. 2010. teacherTube. designmate. 06 February. Accessed March 03, 2013. http://www.teachertube.com/view_item.php?item=CD2915E69546904E&type=photos. Wang, Xiaoyan. 2001. Modeling and Implementation of Controller for Switched Reluctance Motor. Master of Science Thesis, Virginia: Virginia Polytechnic Institute and State University. Xilinx. 2012. avnet. 11 December. Accessed April 3, 2013. http://www.em.avnet.com/enus/design/drc/Pages/Xilinx-Spartan-6-FPGA-Motor-Control-Development-Kit.aspx.

56