PID CONTROLLER DESIGN FOR CONTROLLING DC MOTOR

2y ago
44 Views
9 Downloads
3.15 MB
42 Pages
Last View : 13d ago
Last Download : 3m ago
Upload by : Ronan Orellana
Transcription

PID CONTROLLER DESIGN FOR CONTROLLING DC MOTORSPEED USING MATLAB APPLICATIONMOHAMED FARID BIN MOHAMED FARUQUNIVERSITI MALAYSIA PAHANG

“I hereby acknowledge that the scope and quality of this thesis is qualified for theaward of the Bachelor Degree of Electrical Engineering (Power System)”Signature:Name: AHMAD NOR KASRUDDIN BIN NASIRDate: 11 NOVEMBER 2008

PID CONTROLLER DESIGN FOR CONTROLLING DC MOTORSPEED USING MATLAB APPLICATIONMOHAMED FARID BIN MOHAMED FARUQThis thesis is submitted as partial fulfillment of the requirements for the award of theBachelor of Electrical Engineering (Power System)Faculty of Electrical & Electronics EngineeringUniversiti Malaysia PahangNOVEMBER, 2008

ii“All the trademark and copyrights use herein are property of their respective owner.References of information from other sources are quoted accordingly; otherwise theinformation presented in this report is solely work of the author.”Signature:Author: MOHAMED FARID BIN MOHAMED FARUQDate: 11 NOVEMBER 2008

iiiTo my beloved mother, father and sister

ivACKNOWLEDGEMENTIn preparing this thesis, I was in contact with many people, researchers,academicians, and practitioners. They have contributed towards my understandingand thoughts. In particular, I wish to express my sincere appreciation to my thesissupervisor, Mr. Ahmad Nor Kasruddin Bin Nasir, for encouragement, guidance,critics and friendship. Without his continued support and interest, this thesis wouldnot have been the same as presented here. I would like to give my sincereappreciation to all my friends and others who have provided assistance at variousoccasions. Their views and tips are useful indeed. Unfortunately, it is not possible tolist all of them in this limited space. Finally to all my family members where withoutthem I would not be here.

vABSTRACTThis project is a simulation and experimental investigation into thedevelopment of PID controller using MATLAB/SIMULINK software.Thesimulation development of the PID controller with the mathematical model of DCmotor is done using Ziegler–Nichols method and trial and error method. The PIDparameter is to be tested with an actual motor also with the PID controller inMATLAB/SIMULINK software. In order to implement the PID controller from thesoftware to the actual DC motor data acquisition is used. From the simulation and theexperiment, the result performance of the PID controller is compared in term ofresponse and the assessment is presented.

viABSTRAKProject in adalah penyelidikan secara simulasi dan eksperimen B/SIMULINK.Pembangunan simulasi pengawal PID dengan model matematik motor DCmengunankan kaedah Ziegler–Nichols dan kaedah cuba dan jaya. Parameterpengawal PID akan diuji dengan motor sebenar juga dengan pengawal PIDmengunakan perisian MATLAB/SIMULIN. Bagi mengaplikasikan pengawal PIDdari perisian kepada motor DC sebenar, data acquisition card di gunakan. Darisimulasi dan eksperimen, keputusan kecekapan dari pengawal PID dibandingkan darisegi respon dan analisis di lakukan dan dibentangkan.

viiTABLE OF CONTENTSCHAPTERITITLEPAGETITLE STRACTvABSTRAKviTABLE OF CONTENTSviiLIST OF TABLESxLIST OF FIGURESxiLIST OF SYMBOLSxvLIST OF APPENDICESxviINTRODUCTION1.1Background of Project11.2Objective21.3Scope of Work21.4Problem Statement3

viiiIILITERATURE REVIEW2.1IIIPermanent Magnet Direct Current Motor42.2Control Theory52.2.1Closed-Loop Transfer Function62.2.2PID Controller82.3Pulse Width Modulation92.4MATLAB and SIMULINK 11METHODOLOGY3.13.2System Description153.1.1 Mathematical Model19Data Acquisition223.2.1 PCI-1710HG243.2.1.1 Specification253.2.1.2 Installation Guide293.3Real Time Computing313.4Real Time Window Target323.4.1 Setup and Configuration343.4.1.1 Compiler343.4.1.2 Kernel Setup353.4.1.3 Testing the Installation373.4.2 Creating a Real Time Application393.4.3 Entering Configuration Parameters for47Simulink3.4.4Entering Simulation Parameters for49Real-Time Workshop3.53.4.5 Creating a Real-Time Application513.4.6 Running a Real-Time Application52Driver533.5.1 Geckodrive G34054

ix3.5IV55Project Planning56RESULT AND DISCUSSION4.1V3.5.2 Alternative Driver IR2109Controller Design574.1.1 PID Controller584.1.1.1 Zeigler Nichols Method584.1.1.2 Trial and Error Method594.2Simulation without PID Controller604.3Simulation with PID Controller614.4Experiment without PID Controller624.5Experiments with PID Controller66CONCLUSION AND RECOMENDATION5.1Conclusion705.2Future Recommendation71REFERENCES73APPENDICESAPPENDIX A76APPENDIX B77APPENDIX C78

xLIST OF TABLESTABLE NO.4.1TITLETypical Values of Proportional, Integral, and DerivativePAGE59feedback Coefficient for PID-type Controller4.2Speed and Voltage for every 10% duty cycle65

xiLIST OF FIGUREFIGURE NO.2.1TITLEConcept of the Feedback Loop to Control the DynamicPAGE5Behavior of the Reference2.2Closed-Loop Controller or Feedback Controller72.3A Square Wave, Showing the Definitions of ymin, ymax9and D2.4PWM Pulse Generate from Comparing Sinewave and10Sawtooth2.7MATLAB Default Command Windows122.8SIMULINK Running a Simulation of a Thermostat-14Controlled Heating System3.1Block Diagram of the System153.2Geckodrive G340163.3Alternative Driver (IR2109)16

xii3.4Power Supply163.5Oscilloscope163.6Data Acquisition Card (PCI-1710HG)163.7Industrial Wiring Terminal Board with CJC Circuit17(PCLD-8710)3.8Personal Computer173.9Litton - Clifton Precision Servo DC Motor JDH-2250183.10Schematic Diagram of the DC Motor193.11Block Diagram of the Open-Loop Permanent-Magnet21DC Motor3.12Block Diagram of the Open-Loop Servo Actuated by21Permanent-Magnet DC Motor3.13Block Diagram of the Closed-Loop Servo with PID22Controller3.14Pin Assignment273.15Block Diagram of PCI-1710HG283.16PCI-1710HG Installation Flow Chart303.17Simulink Model rtvdp.mdl37

xiii3.18Output Signal rtvdp.mdl393.19Simulink Library Browser403.20Empty Simulink Windows403.21Signal Generator Block Parameter413.22Analog Output Block Parameter423.23Board Test OK Dialog433.24Scope Parameters Dialog Box453.25Scope Window463.26Scope Properties: axis 1463.27Completed Simulink Block Diagram473.28Configuration Parameter (Solver) Windows.483.29Configuration Parameter (Hardware Implementation)49Windows3.30System Target File Browsers.503.31Configuration Parameter (Real-Time Workshop)50Windows3.32Connect To Target and Start Real-Time Code523.33Geckodrive G340 Block Diagram54

xiv3.34Typical Connections for IR2109553.35Flow Chart of Project564.1Simulink Block of PID Controller584.2Detailed Simulink Block of the System604.3Output of DC Motor without PID Controller604.4Detail Simulink Block of the System with PID Controller614.5Output of DC Motor without PID Controller624.6Simulink Block of Experiment without PID634.710% Duty Cycle Pulse634.850% Duty Cycle Pulse644.990% Duty Cycle Pulse644.10Velocity Estimation654.11Complete Simulink Block of the Experiment674.12Velocity Decoder Subsystem Simulink Block68

xvLIST OF SYMBOLSD-duty cycleT-periodTL-load torqueӨr-angleωr-rotor angular displacementia-armature currentEa-Induced emfka-back emf / torque constantra-armature resistanceLa-armature inductanceJ-moment of inertiaBm-viscous friction coefficientTviscous-viscous friction torqueua-armature voltagekp-proportional coefficientki-integral coefficientkd-derivative coefficientTocs-period of self-sustained oscillationkpmax-critical value of proportional coefficient

xviLIST OF APPENDICESAPPENDIXATITLESimulink Block of PID Control DC Motor (Simulation)PAGE76Simulink Block of DC MotorSimulink Block of PID ControllerBSimulink Block of PID Control DC Motor (Experiment)77Simulink Block of Velocity DecoderCEmbedded MATLAB FunctionMATLAB Command78

CHAPTER 1INTRODUCTION1.1Background of ProjectPermanent magnet direct current motor (PMDC) have been widely use inhigh-performance electrical drives and servo system. There are many difference DCmotor types in the market and all with it good and bad attributes. Such bad attributeis the lag of efficiency. In order to overcome this problem a controller is introduce tothe system.There are also many types of controller used in the industry, such controller isPID controller. PID controller or proportional–integral–derivative controller is ageneric control loop feedback mechanism widely used in industrial control systems.A PID controller attempts to correct the error between a measured process variableand a desired set point by calculating and then outputting a corrective action that canadjust the process accordingly. So by integrating the PID controller to the DC motorwere able to correct the error made by the DC motor and control the speed or theposition of the motor to the desired point or speed.

21.2ObjectiveThe objectives of this project are:i.To fulfill the requirement for the subject BEE4712: Engineering Project.ii.To explorer and apply the knowledge gain in lectures into practicalapplications.iii.To control the speed of DC motor with PID controller usingMATLAB/SIMULINK application.iv.To design the PID controller and tune it using MATLAB/SIMULINK.v.To compare and analyze the result between the simulation result using a DCmotor mathematical model in MATLAB/SIMULINK and the experimentalresult using the actual motor.1.3Scope of WorkThe scope of this project is;i.Design and produce the simulation of the PID controllerii.Simulate the PID controller with the modeling of the DC motoriii.Implement the PID simulation with and actual DC motoriv.The comparison of the simulation result with the actual DC motor

31.4Problem StatementThe problem encounter when dealing with DC motor is the lag of efficiencyand losses. In order to eliminate this problem, controller is introduce to the system.There’s few type of controller but in this project, PID controller is chosen as thecontroller for the DC motor. This is because PID controller helps get the output,where we want it in a short time, with minimal overshoot and little error.

CHAPTER 2LITERATURE REVIEW2.1Permanent Magnet Direct Current MotorA DC motor is designed to run on DC electric power [3]. An example isMichael Faraday's homopolar motor, and the ball bearing motor. There are two typesof DC motor which are brush and brushless types, in order to create an oscillatingAC current from the DC source and internal and external commutation is userespectively. So they are not purely DC machines in a strict sense [3].A brushless DC motor (BLDC) is a synchronous electric motor which ispowered by direct-current electricity (DC) and which has an electronically controlledcommutation system, instead of a mechanical commutation system based on brushes[4]. In such motors, current and torque, voltage and rpm are linearly related [4].BLDC has its own advantages such as higher efficiency and reliability, reducednoise, longer lifetime, elimination of ionizing sparks from the commutator, andoverall reduction of electromagnetic interference (EMI). With no windings on therotor, they are not subjected to centrifugal forces, and because the electromagnets arelocated around the perimeter, the electromagnets can be cooled by conduction to themotor casing, requiring no airflow inside the motor for cooling [4]. The disadvantage

5is higher cost, because of two issues. First, it requires complex electronic speedcontroller to run.2.2Control TheoryControl theory is an interdisciplinary branch of engineering and mathematicsthat deals with the behavior of dynamical systems [7]. The desired output of a systemis called the reference [7]. When one or more output variables of a system need tofollow a certain reference over time, a controller manipulates the inputs to a systemto obtain the desired effect on the output of the system [7].Figure 2.1 Concept of the Feedback Loop to Control the Dynamic Behavior of theReferenceIf we consider an automobile cruise control, it is design to maintain the speed of thevehicle at a constant speed set by the driver. In this case the system is the vehicle. Thevehicle speed is the output and the control is the vehicle throttle which influences the enginetorque output. One way to implement cruise control is by locking the throttle at the desiredspeed but when encounter a hill the vehicle will slow down going up and accelerate goingdown. In fact, any parameter different than what was assumed at design time willtranslate into a proportional error in the output velocity, including exact mass of the

6vehicle, wind resistance, and tire pressure [7]. This type of controller is calledan open-loop controller because there is no direct connection between the output ofthe system (the engine torque) and the actual conditions encountered; that is to say,the system does not and cannot compensate for unexpected forces [7].For a closed-loop control system, a sensor will monitor the vehicle speed andfeedback the data to its computer and continuously adjusting its control input or thethrottle as needed to ensure the control error to a minimum therefore maintaining thedesired speed of the vehicle. Feedback on how the system is actually performingallows the controller (vehicle's on board computer) to dynamically compensate fordisturbances to the system, such as changes in slope of the ground or wind speed [7].An ideal feedback control system cancels out all errors, effectively mitigating theeffects of any forces that may or may not arise during operation and producing aresponse in the system that perfectly matches the user's wishes [7].2.2.1Closed-Loop Transfer FunctionThe output of the system y(t) is fed back through a sensor measurement F tothe reference value r(t). The controller C then takes the error e (difference) betweenthe reference and the output to change the inputs u to the system under control P.This is shown in the figure. This kind of controller is a closed-loop controller orfeedback controller. This is called a single-input-single-output (SISO) controlsystem; MIMO (i.e. Multi-Input-Multi-Output) systems, with more than epresentedthrough vectors instead of simple scalar values. For some distributed parametersystems the vectors may be infinite-dimensional (typically functions).

7Figure 2.2 Closed-loop controller or feedback controllerIf we assume the controller C, the plant P, and the sensor F are linear and timeinvariant (i.e.: elements of their transfer function C(s), P(s), and F(s) do not dependon time), the systems above can be analyzed using the Laplace transform on thevariables. This gives the following relations:Solving for Y(s) in terms of R(s) gives:The expressionisreferredtoasthe closed-loop transfer function of the system. The numerator is the forward (openloop) gain from r to y, and the denominator is one plus the gain in going around thefeedback loop, the so-called loop gain. Iflarge norm with each value of s, and if, i.e. it has a,then Y(s) isapproximately equal to R(s). This means simply setting the reference controls theoutput.

82.2.2PID ControllerPID Control (proportional-integral-derivative) is by far the widest type ofautomatic control used in industry. Even though it has a relatively simplealgorithm/structure, there are many subtle variations in how it is applied in industry[5]. A proportional–integral–derivative controller (PID controller) is a genericcontrol loop feedback mechanism widely used in industrial control systems [1]. APID controller will correct the error between the output and the desired input or setpoint by calculating and give an output of correction that will adjust the processaccordingly. A PID controller has the general formWhere Kp is proportional gain, Ki is the integral gain, and Kd is the derivative gain.The PID controller calculation (algorithm) involves three separateparameters; the Proportional, the Integral and Derivative values [1]. The Proportionalvalue determines the reaction to the current error, the Integral determines the reactionbased on the sum of recent errors and the Derivative determines the reaction to therate at which the error has been changing [1]. The weighted sum of these threeactions is used to adjust the process via a control element such as the position of acontrol valve, the power supply of a heating element or DC motor speed andposition.

92.3Pulse Width ModulationPulse-width modulation (PWM) of a signal or power source involves themodulation of its duty cycle, to either convey information over a communicationschannel or control the amount of power sent to a load.Pulse-width modulation uses a square wave whose pulse width is modulatedresulting in the variation of the average value of the waveform. If we consider asquare waveform f(t) with a low value ymin, a high value ymax and a duty cycle D (seefigure 2.3), the average value of the waveform is given by:Figure 2.3 A Square Wave, Showing the Definitions of ymin, ymax and DAs f(t) is a square wave, its value is ymax for. The above expression then becomes:and ymin for

10This latter expression can be fairly simplified in many cases where ymin 0 as. From this, it is obvious that the average value of the signal ( ) isdirectly dependent on the duty cycle D.The simplest way to generate a PWM signal is the intersective method, whichrequires only a sawtooth or a triangle waveform (easily generated using a simpleoscillator) and a comparator. When the value of the reference signal (the green sinewave in figure 2.4) is more than the modulation waveform (blue), the PWM signal(magenta) is in the high state, otherwise it is in the low state.Figure 2.4 PWM Pulse Generate from Comparing Sinewave and Sawtooth

11MATLAB and SIMULINK2.4MATLAB is a high-performance language for technical computing. Itintegrates computation, visualization, and programming in an easy-to-useenvironment where problems and solutions are expressed in familiar mathematicalnotation. Typical uses include: Math and computation Algorithm development Data acquisition Modeling, simulation, and prototyping Data analysis, exploration, and visualization Scientific and engineering graphics Application development, including graphical user interface buildingMATLAB is an interactive system whose basic data element is an array thatdoes not require dimensioning. This allows you to solve many technical computingproblems, especially those with matrix and vector formulations, in a fraction of thetime it would take to write a program in a scalar non-interactive language such as Cor Fortran.The name MATLAB stands for matrix laboratory. MATLAB was originallywritten to provide easy access to matrix software developed by the LINPACK andEISPACK projects. Today, MATLAB engines incorporate the LAPACK and BLASlibraries, embedding the state of the art in software for matrix computation.MATLAB has evolved over a period of years with input from many users. Inuniversity environments, it is the standard instructional tool for introductory andadvanced courses in mathematics, engineering, and science. In industry, MATLAB isthe tool of choice for high-productivity research, development, and analysis.MATLAB features a family of add-on application-specific solutions calledtoolboxes. Very important to most users of MATLAB, toolboxes allow you to learn

12and apply specialized technology. Toolboxes are comprehensive collections ofMATLAB functions (M-files) that extend the MATLAB environment to solveparticular classes of problems. Areas in which toolboxes are available include signalprocessing, control systems, neural networks, fuzzy logic, wavelets, simulation, andmany others.When you start MATLAB, the MATLAB desktop appears, containing tools(graphical user interfaces) for managing files, variables, and applications associatedwith MATLAB. The following illustration shows the default desktop. You cancustomize the arrangement of tools and documents to suit your needs.Figure 2.7 MATLAB Default Command W

4.1 Simulink Block of PID Controller 58 4.2 Detailed Simulink Block of the System 60 4.3 Output of DC Motor without PID Controller 60 4.4 Detail Simulink Block of the System with PID Controller 61 4.5 Output of DC Motor without PID Controller 62 4.6 Sim

Related Documents:

PID-controller Today most of the PID controllers are microprocessor based DAMATROL MC100: digital single-loop unit controller which is used, for example, as PID controller, ratio controller or manual control station. Often PID controllers are integrated directly into actuators (e.g valves, servos)File Size: 1MBPage Count: 79Explore furtherWhen not to use PID-controllers - Control Systems .www.eng-tips.comPID Controller-Working and Tuning Methodswww.electronicshub.org(PDF) DC MOTOR SPEED CONTROL USING PID CONTROLLERwww.researchgate.netTuning for PID Controllers - Mercer Universityfaculty.mercer.eduLecture 9 – Implementing PID Controllerscourses.cs.washington.eduRecommended to you b

Fig.4.1 Step response using P controller Fig.4.2 Fig.4.3 Fig.4.4 Fig.4.5 Step response using PID controller Fig.4.6 Comparison of bode plot for smith predictor and PI . Step response of IMC PDF control structure Step response of PDF controller Step response using PI controller Step response using PID controller Step response using PI controller

Bruksanvisning för bilstereo . Bruksanvisning for bilstereo . Instrukcja obsługi samochodowego odtwarzacza stereo . Operating Instructions for Car Stereo . 610-104 . SV . Bruksanvisning i original

fuzzy controller are 69.9 % and 67.9 % less than PID controller. 6. CONCLUSION Theses. Paper This paper presents the control of the level in a single tank using different two type controllers PID and fuzzy. From program simulation that built it was indicates that the fuzzy controller has more Advantages to the system than the PID controller.

SPEED CONTROL WITH PID CONTROLLER A proportional-integral-derivative controller (PID controller) is widely used in industrial control systems. It is a generic control loop feedback mechanism and used as feedback controller. PID working principle is that it calculates an error

Plot System Responses . (time-domain response) or Bode plots (frequency-domain response). For 1-DOF PID controller types such as PI, PIDF, and PDF, PID Tuner computes system responses based upon the following single-loop control architecture: For 2-DOF PID controller types such as PI2, PIDF2, and I-PD, PID Tuner computes responses based upon .

Currently, PID controller has been used to operate in electric furnace temperature control system because its structure is simpler compared to others. However, the issue of tuning and designing PID controller adap-tively and efficiently is still open. This paper presents an improved PID controller effic

Access to Accounting Software – SAMS – Assessment book . 2 . Notes for students . This sample assessment is designed to demonstrate as many of the possible question types you may find in a live assessment. It is not designed to be used on its own to determine whether you are ready for a live assessment. In a live assessment, you will be required to upload documents as part of your evidence .