Effective Teaching Learning Process for PID Controller Based on Experimental Setup with LabVIEW Komal Sampatrao Patil & D.R.Patil Electrical Department, Walchand college of Engineering, Sangli E-mail : komal.1.patil@gmail.com, dadasorpatil@gmail.com Abstract This paper presents low cost general architecture of experiments for dc motor speed control. In order to provide student a more vivid understanding of control system theory which introduces them to Proportional-Integral-Derivative control and design, an experimental teaching control system of dc motor speed control is developed based on graphical programming software LabVIEW. Pulse Width Modulation (PWM) technique is employed to control motor speed. Keywords DC Motor, LabVIEW, PWM. I. INTRODUCTION DC Motor plays a crucial role in research and laboratory experiments because of their simplicity and low cost. There are several types of applications where the load on the DC motor varies over a speed range. These applications may demand high-speed control accuracy and good dynamic responses. So, it is important to make a controller to control the speed of DC motor in desired speed.[3] LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a graphical programming language that uses icons instead of lines of text to create applications. In contrast to text-based programming languages, where instructions determine the order of program execution, LabVIEW uses dataflow programming, where the flow of data through the nodes on the block diagram determines the execution order of the VI s and functions. VI s, or virtual instruments, is LabVIEW programs that imitate physical instruments. LabVIEW VI s contain three components the front panel, the block diagram, and the icon and connector pane. In LabVIEW, you build a user interface, or front panel, with controls and indicators.[5] A VI (virtual instrument) that includes a front panel and a functional diagram is developed with LabVIEW that allows the serial port to read a user selected reference voltage continuously. The PWM signal is sent through the output port of serial port by the VI which in turn controls the motor speed. User from the front panel of the VI may input the amplitude, frequency and also sampling rate of the reference signal, and the desired amplitude of the PWM. The principle developed in this paper will be utilized in future attempts toward controlling robot motion remotely via Internet. II. EXPEIMENTAL SYSTEM DESCRIPTION The experimental hardware setup consist of permanent magnet DC motor manufactured by Maxon Motors, optical encoder, power supply, microcontroller P89V51RD and RS232 serial communication of microcontroller, DC Motor driver. The actual speed of DC motor will be measured by encoder and feedback to microcontroller. In microcontroller, it will calculate the error between the desired speeds with the actual speed. The error will determine duty cycle of pulse-width modulation (PWM) in microcontroller. Then, the duty cycle will send to DC motor driver either accelerate or decelerate DC motor to maintain it at desired speed. The VI developed with LabVIEW software package receives data through UART and displays results on PC. The block diagram of the system is shown in Fig.1. Fig. 1: Block diagram of DC motor speed control system 25
III. DETAILS OF EXPERIMENTS Expt.1: DC Motor Transfer Function Development The Aim of this experiment is to derive analytically the mathematical model of a DC motor using electrical and mechanical equations. For designing proper controller for a given dc motor it is required to find out its equivalent model depends upon its parameters with their symbol are as under. V m - Motor terminal voltage, R m - Motor terminal resistance, L m -Motor armature current, K t -Motor torque constant, K m -Motor back electromotive force constant, m -Motor shaft angular velocity, T m -Torque produced by motor, J eq -Motor armature moment of inertia. The DC motor has both electrical and mechanical properties. For all the above various parameters, the electrical equations describing the open-loop response of the DC motor are: 1.1 1.2 The mechanical equations describing the torque of the motor are, 1.3 1.4 Using eq.1.1-1.4 we obtain the open loop transfer function in terms of the back-emf constant, motor resistance and equivalent moment of inertia. [3] As, Using eq.1.4 and replacing torque in eq.1.3 we obtain, Substituting eq.1.5 and 1.2 in 1.1 we obtain, 1.5 Using motor specifications, Jeq=4.19*10^-7kg.m^2 Km=4.4*10^-3Nm/A Rm=7.45Ω We obtain the transfer function as, 1.8 Expt.2: Validation of Motor Transfer Function Model This experiment will model the DC motor by simply applying a step input to the system and observing its time domain response. Based on the transient response, the DC motor will be approximated as a first order transfer function, and its parameters will be determined consequently. The parameters of the transfer function will be fine-tuned against experimental responses, in order to validate the model. The first order time delay model is obtained by, 2.1 We have to find the parameters K, and t d by carrying out a step test on DC motor. In the open loop mode input to motor is in terms of PWM and output is speed in RPM.The motor is brought to an operating point by applying a suitable step and the plant output is allowed to settle at this value.[1] From this position, a step of appropriate magnitude is applied to the plant and the step response is obtained. From the step data we find out, t 63.2 = Time required for the output to reach 63.2% of steady state value. T 28.3 = Time required for the output to reach 28.3% of steady state value. The parameters of transfer function are calculated as follows, Here, 1.6 Taking Laplace transform of eq.1.6 and grouping we obtain, 1.7 2.2 2.3 2.4 The front panel and is shown in Fig.2.1 The obtained model is validated against the plant response by applying the same step input to model and comparing responses of the plant and the model. 26
The speed of DC motor is controlled using Proportional Integral control system. The block diagram of closed loop system is shown in fig.3.1 The transfer function representing the DC motor speed voltage relation obtained in exp.2 is used to design the PI controller. The input output relation (In Laplace domain) in time domain for PI controller with set point weighting is, Fig.2.1: LabVIEW Front Panel- Validation of Transfer Function Model 3.1 Where, K c is proportional gain, i is integral gain. In this paper we are using the Ziegler Nichols method, Ziegler-Nichol gives rule for determining values of gain K, Integral time, derivative time based on step response characteristics of given plant shown in fig 3.2. Fig. 3.1: Closed Loop Block Diagram Fig.2.2: Step Test The result of step test is shown in the Fig.2.2 for step of 25 PWM. From this result we calculated K, and t d as, K=197 = 0.4146 sec t d =0.008 sec Substituting these values in Eq.2.1 we obtain the transfer function of model as, Expt.3: Speed PI Control Implementation 2.5 The purpose of this experiment is to regulate the speed of DC motor shaft using a PI controller and implement same on motor. Table 1 : PID Control Parameter for Ziegler Nichols method After studying this response we get two constants i.e. Delay time L and time constant T. Ziegler and Nichol suggested to set values of K, i, d according the formulae in Table 1. [2] Finding the K and i values we will perform experiment to check controller performance, to observe that how motor speed tracks the new set point and settles there. The front panel for this is shown in Fig.3.3. 27
Expt.4: PI Set Point Weight Implementation The purpose of this experiment is to examine experimentally the effect of proportional set point weight used when controlling the speed of a DC motor shaft in a PI control scheme. To control the plant, 4.1 Fig.3.2: Step test curve for the Ziegler-Nichols method. The sped is regulated using a modified PI controller of the form, 4.2 Where b sp is called the proportional set point weight or the reference weight, the control voltage is u (t), r (t) is the reference signal and the DC motor output speed is w (t). In this controller the proportional action only acts on a fraction bsp of the reference signal. Using the control signal u(t) above and taking the Laplace Transfer of system, we obtain: Fig.3.3: LabVIew Front Panel-Speed PI Control Implementation Grouping the terms, we obtain 4.3 = Damping ratio 4.4 The closed loop control system will behave as a second order system when b sp =0. In this case, the closed loop PI-control system becomes, [4] 4.5 Fig.3.4: Closed loop response with designed PI controller Using the K and i values obtained from Expt.2 we obtained results for PI controller which are as shown in Fig.3.4.From this result we see that output speed tracks new set point. The front panel is shown in Fig.4.1We will check effect of set point weighting on settling time of system for different b sp values. 28
Integral wind-up situation: We set an appropriate value in the Actuator upper limit and Actuator lower limit inputs. The PI controller block in the LabVIEW provides the anti-wind-up feature. The value of the control effort at which the antiwind-up action should start is provided in the inputs Controller Output high and Controller Output low. Entering appropriate values in these. For example, if you choose Fig.4.1: LabVIEW Front Panel- PI Set Point Weight Implementation Fig.4.2: Closed loop response for different set point weights. The result of this experiment for set point weights 0.5 and 1.0 is shown in Fig.4.2 from this we get that with set point weight equal to 0.5, the time required to reach steady state value is more as compared to that of for set point weight equal to 1. Expt. 5: Effect of Integrator Anti Windup for the Motor speed control The purpose of this experiment is to examine experimentally the effect of Integral Anti Windup (AW). When controlling the velocity of a DC motor shaft in PI control scheme. In this experiment first the wind-up effect of integrator (of PI controller) is created and then the antiwind-up situation is created. The front panel and block diagram is shown in Fig.5.1 we will check effect of integral anti windup here. Fig.5.1 : LabVIEW front panel- Effect of Integrator Anti Windup for the Motor speed control Actuator upper limit = 25, then put a sufficiently high value for Controller Output high, say 50. Then give a sufficiently high RPM set point. We will observe in Fig 5.2 that control effort tries to increase but is limited by the actuator cut- off. The wind-up action will start when the control effort reaches the Controller Output high. After this, the integral action will cease to act and controller output is held at this constant value. Now give a much lower set point. Due to the integral wind-up, the control effort will start decreasing from the value set in Controller Output high. As a result, large time is required to bring the motor speed to the desired low set point. Integral anti wind-up situation: We set the same values in the Actuator upper limit and Actuator lower limit inputs as in the earlier case. This time we wish that the anti-wind-up action begins at the instant when the controller output hits the actuator upper limit. So set the same values in the inputs Controller Output high and Controller Output low as entered in the Actuator upper limit and Actuator lower limit inputs, respectively. Then giving the same sufficiently high RPM set point as in the previous case. We can observe in Fig 5.3 that the control effort starts increasing but is limited by 29
the actuator saturation limits. This time, the wind-up action will start very early, as soon as the control effort reaches the Controller Output high (which is same as the saturation limit). Now give the same low set point as in the previous case. Since the control effort is held at a much lower value due to the anti-wind-up mechanism, it will take much lesser time to bring the closed-loop output (motor speed) to the desired low set point. IV. CONCLUSION This paper gives the idea that a complete engineering education at the undergraduate and graduate levels should provide a synergetic integration of both theoretical and practical knowledge, going from theory to practice and back to theory to interpret the results and refine the theoretical basis of the design. The paper has given a solution for bringing students closer to design reality by the use of virtual laboratories. V. REFFERENCES Fig. 5.2 : Effect of integrator wind up [1] Astrom, K. J. and T. Hagglund (1995), PID Controllers: Theory Design and Tuning. ISA Press. Research Triangle Park, USA. [2] O'Dwyer, A. (2003): Handbook of PI and PID Controller Tuning Rules. Imperial College Press, London. [3] Ramu Krishnan, Electric motor drives: modelling, analysis, and Control, Prentice Hall, London, 2001. [4] K. J. Astrom and T. Hagglund, Advanced PID Control, Instrument Society of America, New York, 2006. [5] Wells, L. K. and Travis, J., LabVIEW for Everyone. Upper Saddle River: Prentice Hall PTR, 1997. Fig.5.3 : Effect of integrator anti-wind up 30