100% found this document useful (1 vote)
192 views6 pages

Microprocessor Based Digital PID Controller For Speed Control of D.C. Motor

This paper presents a simple scheme for implementing the Speed Control of D.C. Motor using digital PID algorithm. Intel 8085 microprocessor based hardware is developed for the implementation of the controller. A continuous PID controller is governed by an equation which describes the dynamic time varying behavior of the input or the error signal. This is digitized using numerical approximations and is programmed in the microcomputer.

Uploaded by

Swapnica Garre
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
192 views6 pages

Microprocessor Based Digital PID Controller For Speed Control of D.C. Motor

This paper presents a simple scheme for implementing the Speed Control of D.C. Motor using digital PID algorithm. Intel 8085 microprocessor based hardware is developed for the implementation of the controller. A continuous PID controller is governed by an equation which describes the dynamic time varying behavior of the input or the error signal. This is digitized using numerical approximations and is programmed in the microcomputer.

Uploaded by

Swapnica Garre
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

First International Conference on Emerging Trends in Engineering and Technology

Microprocessor Based Digital PID Controller for Speed Control of D.C. Motor
Dr. M. Meenakshi Professor, Dept. of Instrumentation Technology, Dr. AIT Bangalore, India Email : [email protected] Abstract
This paper presents a simple scheme for implementing the speed control of d.c. motor using digital PID algorithm. Intel 8085 microprocessor based hardware is developed for the implementation of the controller. The system broadly involves interfacing hardware and the software for PID algorithm. A continuous PID controller is governed by an equation which describes the dynamic time varying behavior of the input or the error signal. This is digitized using numerical approximations and is programmed in the microcomputer. This system is a closed loop control system with feedback signal generated by a digital magnetic pickup, which gives a pulse output which is TTL compatible. A digital to analog converter interfaces the power control to the microcomputer. The PID algorithm along with the hardware achieves the speed control of the d.c. motor. The hardware and software are validated in real time by considering different speed settings. digital controller attractive are listed below [2, 3, and 4]: 1. Improved sensitivity, i.e, the controller is more precise. 2. It is more reliable since the number of system components is decreased and the problem of system noise can be successfully eliminated. 3. It offers advanced control capability such as learning control systems. 4. No drift and less effect due to noise and disturbance. 5. It is smaller and lighter than the analog counterparts while the power consumption is minimized. 6. It is usually less expensive than the analog counterpart 7. It offers significant flexibility in programming e.g. by changing the controller parameters or even the control algorithm. To sum, a distinct advantage of the digital controllers is their versatility. The program which characterizes a digital controller can be modified without any variation in the hardware. Due to these glaring comparisons microprocessor based control systems are more interesting and are simpler and cheaper. However as is natural to any physical system microprocessor based control systems have certain limitations such as finite word length effects and time delay encountered in the execution of the algorithm which may affect the real time control system. However, the error due to this is very small and the performance degradation of the closed loop system due to this is negligible. However, these problems are not found in analog systems. Since, the performance degradation of the closed loop system using digital controllers is negligible, here an attempt is made to design and develop a simple digital PID controller for the speed control of a d.c motor. The organization of this paper is as follows. Section 2 briefly explains the process control

1. Introduction
Control is important for most industrial processes to avoid disturbances, which degrade the overall process performance, and hence a great deal of work is being done in this field [1]. Electronic controllers, first introduced many years ago, have gradually excelled in performance over their predecessors both in terms of performance and its economy. They have reached the highest level of sophistication due to the rapid advances made in the industry. Over the past two decades single loop analog controllers have enjoyed a steady popularity in the industry. But now days due to the enormous development that has taken place in the microcomputer systems and accessories digital technology coupled with their diminishing cost, digital controllers are more viable. In many cases, they have replaced their analog counterparts also. The various factors which make the

978-0-7695-3267-7/08 $25.00 2008 IEEE DOI 10.1109/ICETET.2008.256

960

fundamentals and the overview of the speed control system designed for a d.c. motor. Section 2 also explains the hardware details of the speed control system. Software algorithm for the implementation of PID controller is given in section 3. Results and analysis is given in section 4 and finally conclusions are drawn in section 5

The task of a controller is to adjust the state of a process as measured by some variables, known as the process variable PV, to confirm to a particular value called the set point, SP. The difference between them is known as the error signal and the controller acts on the error and through the agency of another control component acts on the process to change the PV in the desired direction so as to reduce the error signal. There are many modes of controllers and any one of this is selected depending on the closed loop requirements. Broadly speaking, the d.c motor speed control system shown in Fig. 1 comprises of a microprocessor, and digital magnetic pickup to sense the speed of the motor. Also to count the number of pulses generated by the magnetic pickup, an 8253 counter is used. Next the system includes a digital to analog converter at the output end, a firing circuit with pulse amplifier, and a single phase SCR bridge circuit.

2. Fundamentals of process control and overview of speed control system

sampled version of the process variable. The microprocessor finds the error signal by comparing the sample speed with the desired speed. The PID algorithm is performed on the error signal and the control variable is outputted to the DAC. The varying d.c output voltage from the DAC is taken to a firing circuit, which generates a firing sequence. These firing pulses trigger the SCRs which control the power supplied to the d.c motor. Then the error signal is updated and the cycle is repeated.

2.2. System hardware


The required hardware is divided in to number of stages as explained below: 2.2.1 Speed sensing device The first stage of the speed control system is the speed sensing system. The speed of the motor is sensed by using a digital magnetic pickup that generates pulses whose repetition frequency is proportional to the speed of discontinuity. The digital magnetic pickup used in this application has built in signal conditioning network, which eliminates the use of external pulse shaping network and amplifying circuitry. The output voltage is constant regardless of the surface speed improving the accuracy in timing and positioning applications. The output is digital and compatible with most logic circuits (TTL, CMOS etc). The amplitude of these logic pulses can be varied by the supply voltage and for load impedance. The pulse repetition frequency of the output is proportional to the speed of discontinuity. A 60 teeth gear wheel is used as the course of disturbance, so as to have the rpm sampled in one second. These pulses are counted using 8253 timer chip, as described below. 2.2.2 Pulses counting The second stage of the system is the one used to count the pulses generated in the first stage. A gear wheel of 60 teeth is mounted on the motor shaft. The magnetic pickup is mounted at a distance 3mm to 4mm from the gear wheel. For every revolution the pickup gives 60 pulses. Hence, the speed of the motor will be obtained directly in rpm. To measure this speed it is necessary to count the pulses for a specific interval of time, for example, 10 ms. To count the pulses obtained from the pickup, 8253 programmable interval timer (PIT) along with the 8255 programmable peripheral interface (PPI) is used. The 8253 PIT includes three identical 16bit counters that can be operated independently in any one of the six modes. To operate a counter, a 16 bit count is loaded in its register and on command it begins to decrement the count until it reaches zero or when the

2.1 Overview of d.c motor speed control system

Figure 1. Block schematic of a d.c motor speed controller

The digital non-contact type magnetic pickup, which is mounted in front of the 60 teeth gear wheel, picks up disturbances in the magnetic field and conditions them in to pulses of 5V amplitude. These pulses are counted using the 8253 timer. This is the

961

gate signal goes low. The counter can count either in binary or BCD. 2.2.3 D/A conversion Third stage of the system is D/A conversion. The microprocessor outputs the control variable in the form of 8 bits through one more 8255 PPI. The ports A and B of this PPI are programmed as output ports. The outputted datum from the ports is taken to two digital to analog converters. The DAC 08 which is an 8bit digital to analog converter as shown in Fig. 2 is used for this purpose. The output of the DAC which corresponds to LS byte and MS byte are taken to weighted addition circuit. A weighted adder is constructed using two OPAMPs.

the next stage. In order to fire the SCR at an angle, a pulse to appear at zero extending up to 180 degrees is needed. This pulse is obtained by the intersection of a ramp waveform with a d.c voltage that determines the time at which the pulse starts. The above principle is realized in practice as explained below. Consider a ramp voltage waveform shown in Fig.3. When a d.c signal source is superimposed on this waveform, a pulse defined within the limits of intersection of the above two waveforms is obtained by comparator action. This pulse is now used to fire the SCRs. The width of the pulse governs the firing angle of an SCR. In effect, this means the higher the d.c. level, the lesser the pulse width, greater the firing angle, and hence lesser the output voltage.

Figure 2. D to A conversion stage

2.2.4 Design of weighted adder The output of DAC which corresponds to lower significant byte is weighted down by 255 times. This is achieved by making use of a resistor attenuator circuit. The output obtained from the attenuator circuit is added with the output of the other DAC, which corresponds to most significant byte. The output of this stage is a varying d.c, which depends on the variation of the variable to be controlled. i.e., speed of the motor. 2.2.5 Firing circuit The fourth stage of the designed hardware is the firing circuit. The varying d.c obtained from the previous stage is used to derive the control signal to fire the SCRs that are used to convert the a.c to d.c in

Figure 3. Signals at various stages

The circuitry to accomplish the above effect consists of a series of stages as shown in Fig. 4. This consists of the following units. 1. Ramp generation unit 2. Comparator unit 3. High frequency gating unit 4. Isolation and current step up unit

962

Figure 4. System Hardware

2.2.6 Ramp generation unit A sine wave is derived from a step down transformer connected to a.c. mains. The output sine wave obtained from this setup has maximum amplitude of about 10 V. This signal is then fed to an operational amplifier which is used as a zero crossing detector circuit. The resulting square wave is then given to an OPAMP integrator. The time constant is chosen so as to obtain a sharp rise in the exponent signal that will be obtained at the output end of the integrator. A transistor is placed in parallel to the capacitor and is used as a switch. The driving signal to the base of the transistor is a positive spike obtained from as RC differentiator cascade with a diode rectifier circuit. The output of the OPAMP is now a ramp defined between 0 degree and 180 degree of the input, a sine wave signal. An exact compliment of this circuit produces a similar ramp but shifted in phase by 180 degree. 2.2.7 Comparator Unit The ramp obtained as above is compared with a d.c level. The d.c. level is obtained from the DAC, which is connected to the microprocessor. The comparator output is a pulse whose width is inversely proportional to the amplitude of the d.c. signal. Next, the pulse is clamped to 5V by using a zener diode. 2.2.8. High frequency gating unit The pulse obtained from the previous stage is ANDed with a high frequency signal in order to minimize the losses. This high frequency of 1 KHz signal is obtained from a 555 timer operated in the astable mode.

2.2.9. Isolation and current step up circuit The pulses obtained from the previous stage are given to a current amplifier. The current amplifier consists of a pulse transformer and a transistor. The transistor is switched between the saturation and the cut of level and hence the pulse transformer primary carries high and low currents intermittently. At the output end of a transformer primary, it carries high and low currents intermittently. Similarly, at the output of the secondary of the pulse transformer, spikes on both sides of the zero level are obtained. The positive spikes are retained using a rectifier and then clamped to 4.7 V using a zener diode. These spikes are now given to the gate of the SCR and constitute the required firing pulses. The other SCR is fired by a similar but phase shifted sequence of pulses obtained from the complement of the above circuit. Added to the current step up described above the pulse transformer isolates the high voltage converter from the delicate firing circuit. 2.2.10. SCR Bridge circuit The fifth stage of the hardware is the SCR bridge rectifier. Single phase a.c to d.c converters are broadly classified in to two types. i.e. Full controlled converters and Half controlled converters The full bridged converters employ four thyristors while the half bridge converters use only two SCRs and two diodes. Since diodes are cheaper than SCRs, and the firing circuitry required is simpler in this application half controlled converters are preferred over the fully controlled converters. The diodes have common anode connection and are uncontrolled. When the firing delay angle of the SCRs is varied, the d.c output voltage of the bridge circuit can be varied from its maximum value to nearly zero, as the firing delay angle is varied from zero degree to nearly 180 degrees. In the circuit, at firing angle 0, SCR 1 is turned ON, and the supply voltage is applied to the load, load current flows through SCR 1 and D2. When SCR2 is turned ON, SCR1 is commutated off, and the load current flows through SCR2 and D1 until they are reverse biased. At this point SCR2 will still remain in conduction state and the load current will free wheel through SCR2 and D2. During the period of free wheeling there will not be current supplied from the source. Here, the free wheeling diode is used to reduce the ripple content of the rectified voltage. The output of the converter is fed to the motor in order to exercise the speed control.

963

The next important part of this work is the development of the software. The software is developed to implement all the functions explained in the previous sections. The main steps involved in the software development are as follows: First of all initialize the 8253 PIT to act as counter. Also initialize the 8255 PPI to meet the requirements. By making gate terminal high, now sample the pulses to 8253 for some finite time, which is the sampling time. Next get the measurement of the motor speed from magnetic pickup sensor in terms of digital value. Next it is fed to microprocessor; error signal is generated by subtracting it with desired speed value. Next, PID algorithm is implemented on this error signal. The resultant controlled variable is outputted to DACs.

3. Software Development

programmed in machine language. The integral equation may be written as :

X (t ) = {wd w(t )}dt + X (t 0 )


t0

(5)

Where X(t0) is the initial value of X(t) The trapezoidal integration rule is used to approximate the definite integral. Let t = nT and t0 = (n-1)T

{w ( )
n 1 T

nT

T w(t )}dt = {w d T } [w(nT ) + w(n 1)T ] (6) 2

3.1 Implementation of PID algorithm


Implementation of PID controller requires the implementation of three modes i.e P, I and D actions. For integration part, rectangular integration approximation as given in Eq. 1 is used.

Thus the value of X(t) can be computed using the desired input wd and the data for w(nT) and w(n-1)T at t = nT. For convenience it is assumed that the computation time delay (the time required to execute the PID algorithm) is equal to one sampling period T. This means that the integral computational result will be at t = (n-1) T and Eq. 6 is digitized by the following state equation. T [w(nT ) + w(n 1)T ] + X (nT ) (7) X (n + 1)T = (w T )
d

e (t )dt = [s + e (nT )]t


i i 0

(1)

where X(nT) is the initial state of X(n+1) T. The derivative part of equation is approximated using the backward difference equation.

where s = ei (t ) + ei (2t ) + ...... is the sum of errors calculated from previous samples. Ei(nt) =sample taken at time t specified in the integral t = time between samples The derivative part is approximated using backward difference equation as:.

The PID control algorithm in discrete time form thus becomes K [e (nT ) ei (n 1)T ] (9) e (n + 1)T = K e (nT ) + K X (n + 1)T + d i
i p i i

d [ei (t )] ei (nT ) ei (n 1)T = dt T

(8)

where ei(t) is the variable to be controlled. This is also represents the error signal given by: (3) ei(t) = wd(t) w(t) where wd is the desired speed and w is the load speed. In discrete time system an analog to digital and a digital to analog converter is employed to convert the error signal in to digital form and the control to analog form to drive the d.c. motor respectively. The input to the microprocessor is then the digitized error signal ei(nT) that is represented by: (4) ei(nT) = wd(nT) w(nT) where n = 1,2,3.and T is the sampling period. The microprocessor is used to implement the PID controller by describing the digital controller by its continuous equation. Here the equation 1 is digitized by numerical approximation method and then

d [ei (t )] ei (nT ) e(n 1)T = dt T

(2)

This algorithm is implemented keeping in mind that the time required to perform the computation and output the result is small compared to the sampling time, T. If this time is not true, then the value of ei(nT) must be predicted at time (n-1) T and the computation performed for ei((n+1)T) during the time interval (n1)T to n. Prediction methods require detailed knowledge of the plant under control and increase the software demands on the microcontroller, however and are rarely worthwhile. Therefore Eq. 9 is implemented using an 8085 microprocessor.

4. Results and Analysis


In the beginning the proper functioning of the hardware is tested by giving simulated signals. After getting satisfactory results, the speed control system is integrated in to the d.c. motor and it is verified in real time. For the validation, the experiment is repeated for different speed settings. It is found that the designed PID controller is able to control the speed as per the requirement.

964

5. Conclusion
This paper describes design and validation of PID controller which performs the essential function of closed loop control of d.c motor. Magnetic pickup sensor is used for the measurement of speed and thyristor firing circuit, which generates the pulses with variable pulse width, is used at the output end to control the speed of the motor through a wide range by varying the pulse width. The results of the closed loop control for various constant speeds have been verified, which validates the system. It is seen that the constancy of speed with a varying load is better with closed loop than with the open loop control.

6. References
[1] [2]

[3] [4]

B.C. Kuo, Automatic control system, 3rd edition M.K. Refal, Microprocessor based digital controllers for d.c motor speed control, IEEE Transactions on control systems, Vol, 10 Dec. 86 Bibbero . R.J., Microprocrsssor in Instrumenattion and control, John wiley, NY USA (77) S. Siskind, Electrical Machines, Mc Graw Hill Publications.

965

You might also like