You are on page 1of 7

HEM ELECTRONIQUES MIDC MIRAJ (M.S.

)INDIA

Micro Controller Based PID Controller


The system mainly includes following blocks 1) Temperature measurement system. 2) Solid-state relay for driving heater bulbs. 3) Micro controller based control unit. 4) LCD display. Micro Controller based control unit: In this system PIC controller PIC16F870 is used as main controller for the system. This micro controller handles following parameters. 1) ADC Conversion:

2) This has inbuilt ADC with 10 bit resolution, with 5 ADC channels. No of ADC channel is used for ADC ref, which is set at 2557 mv so we get 2557/1023 = 2.49 mv/bit resolution. Temperature data is fed to channel 0 Set Temperature data is fed to channel 1of ADC 3) Output Control: Pin no 14 of PIC 16F870 is used as output to drive solid-state relay. 4V DC pulse is generated to drive SSR. 4) Control Algorithm Block: This micro controller is loaded with very powerful software to control the temperature in two modes a) ON/OFF Mode b) PID Controller 5) Temperature sensing system: In order to sense temperature of the model process i.e. the aluminum block in this example, a PT 100 element (RTD) is used to convert the information regarding temperature into proportional analog voltage. The PT100 element forms a part of Wheatstone bridge circuit, output of which is amplified by the op amp using IC OP07. The amplifier gain is so adjusted that for 100 degree centigrade temperature, an equivalent analog DC voltage of 1 volt or 1000 milivolts is obtained. This represents resolution of 0.1 degree centigrade, which is sufficient for our controller. To check the calibration, additional resistances of 100 and 139 ohms are provided which simulate 0 degree centigrade and 100 degree centigrade for RTD. This analog output is given as input for A to D

Micro controller based PID Controller/1

HEM ELECTRONIQUES MIDC MIRAJ (M.S.)INDIA


conversion. A source of d.c voltage which can be continuously varied by potentiometer also made available for checking the A to D conversion.

6) Solid state relay: A solid-state relay (SSR) switches the heater ON and OFF. The PIC controller controls the heat output by switching the relay ON and OFF for varying duty cycles. As there is no moving contact, which are required to handle large amount of current, the SSR offer good isolation, reliability and nose free operation. The driver transistor on the input of the relay serves three purposes: The triac which comes in series with a.c. power supply and lamp load works as a simple solid state switch controlled by an isolated DC. voltage.

BASIC THEORY OF OPERATION: (PID CONTROL MODE) This set up is designed to demonstrate the working of a typical temperature controller using ON/OFF mode or PID mode of operation. More stress is given on proportional, integral and derivative action. Proportional controller is a mode of control action in which there is continuous linear relationship between values of deviation and manipulated variable. Thus the action of controlled variable is repeated and amplified in the action of the final control element. Even though this is simple mode of control, the main drawback is it produces some off set error in response to load changes. Proportional + integral control: In order to remove the offset associated with the proportional action, combination of P+I is widely used, As a result of integral action, the offset error is almost reduced to zero but the transient response is adversely affected. In other words the integral action is has a destabilizing effect on the process under the condition of load variation. The integral action is identified by its characteristics behavior, which ensures that the rate of change of controller output is proportional to the error. Or output is equal to the integral of error at any time. The output is modified until the error is driven to zero. The integral time is the time required to add and increment the response equal to the original step change of response. KI used here is reciprocal of integral time. Proportional +Derivative control: A derivative control action may be added to proportional control to form P+D action. Derivative control action may be defined as control action in which the magnitude of the manipulated variable is proportional to the rate of change of error. The net effect of derivative action is to shift the manipulated variable ahead by time Td, the derivative time constant. The controller response now leads the

Micro controller based PID Controller/2

HEM ELECTRONIQUES MIDC MIRAJ (M.S.)INDIA


time change of deviation, to this effect the derivative response anticipates. The P+D action gives improved transient response of the process against large changes in the load. However the offset error because of load changes remains almost unaffected. The Proportional + Integral + Derivative action: This action produces smallest maximum deviation and offset is eliminated because of integral action. The derivative action provides improved transient response against load variations. In short the P.I.D. approach to control problem can be summarized in terms of the following mathematical equation. U(t)= Kp e(t) + Ki e(t) +dt + Kd d/dt (e(t) -------------------------(1) Where Kp = Proportionality constant (gain) dimensionless. Ki = Integral time constant (Unit = 1/second) Kd = Derivative time constant (Unit = seconds)

ON/OFF Mode: Only ON/OFF Control with inbuilt dead band of 1 C. For using the system in ON/OFF mode Keep SW1 in ON/OFF Mode. Keep SW3 in Start Mode. Keep SW2 in Normal Mode. PID Control: This system supports, Study of system with P, PI & PID mode. Gain for Kp, KI & Kd can be selected with P2, P3 & P4 pots. 1) For Proportional mode keep Ki, Kd =0 2) For P+I mode keep Kd = 0 3) For P+I+D mode keep Kp, Ki & Kd at default value. (Other than zero) Temperature can be controlled of accuracy of +/- 0.3C For using system in PID mode Keep Sw1 in PID mode. Keep Sw3 in start mode. Keep Sw2 in Normal mode. Test mode: Test mode is basically provided to test temperature measurement system. In test mode you can change the Sw4 from 0C - 100C RTD for each selection it should show temperature At 0C it should show near 0C At 100C it should show near 100C

Micro controller based PID Controller/3

HEM ELECTRONIQUES MIDC MIRAJ (M.S.)INDIA


RTD Ambient / Model Temperature. For using system in test mode Keep Sw3 in Test mode Keep Sw2 in normal mode. Adjusting Kp, Ki & Kd values In the software default values of Kp, Ki & Kd are loaded. when you switch ON the system, system will be configured for P+I+D mode. If user want to change the values then Keep Sw3 in Test mode Keep Sw2 in Mode check side. Then you will get display for Kp, Ki & Kd values. Change of any values of Kp, Ki & Kd will take into effect only when system is in test mode ^ in Mode check Operating Instructions: For Proportional Control (p): 1) Keep Sw3 in Test mode. 2) Keep Sw2 in Mode check. 3) Then keep KI = 0 & KD = 0, now system will be configured for proportional mode. 4) Make proper connection for heater cable, RTD cable & fan cable. 5) Now select system as Sw3 in TEST Sw2 in Normal Sw1 in PID side. 6) If selection is kept as above you will be able to Set temperature with the help of P1, you will see display as below ST = AT =

ST = Set Temperature AT = Actual Temperature 7) Now select system as SW3 in START SW2 in NORMAL SW1 in PID 8) Now system will start in Proportional mode. For P+I mode: All procedure is same as described for proportional mode.

Micro controller based PID Controller/4

HEM ELECTRONIQUES MIDC MIRAJ (M.S.)INDIA


Only at pt (3) Keep KP >0, KI > 0 & KD = 0 then system will be configured for P+I mode.

For P+I +D mode: All procedure is same as described for proportional mode. Only at pt (3) Keep KP >0, KI > 0 & KD > 0 then system will be configured for P+I+D mode Note: For Modes: you can take observation with fan load ON/OFF or by varying fan speed for creating disturbances on the system. Fan provided acts as load on the system by taking more/less away from the modes. Observations: Sr No Set Temperature in Deg C Actual Temperature in Deg C

Readings taken at every 10 seconds.

Conclusions:In ON/OFF Mode:This is two position control i.The controller O/P still swings between 0% and 100 % ,but an additional hysteresis element (Dead band) is incorporated. In Proportional Mode:By Keeping Kp =120 to 130 , ki=0, Kd=0 ,controller will work in Proportional mode .Temperature will settle with error of 2-3 degree Celsius. If you change fan load from low to high, temperature will decrease further leaving offset error. In P+I Keep Kp > 0, Ki > 0 and Kd=0 , PI mode will be selected. Here temperature will settle with error of +/ - 0.5 degree Celsius with oscillations. Temrpature will be controlled irrespective of change in load leaving no off set error. In P + I + D

Micro controller based PID Controller/5

HEM ELECTRONIQUES MIDC MIRAJ (M.S.)INDIA


Keep Kp>0, Ki >0, Kd >0 ,controller will work in P+I+D mode.With Introduction Of D dynamic response will be improved with reduced oscillations before temperature setteles with error of +/- 0.5 degree Celsius.

-------------------------------------------------------------------------------------------------------

Micro controller based PID Controller/6

HEM ELECTRONIQUES MIDC MIRAJ (M.S.)INDIA

FLOW CHART: START

LCD DISPLAY INITIASATION

READ ADC FOR ST, AT

READ SW3

MAIN CONTROL LOOP

TEST MODE DISPLAY VALUES

READ SW1 ON/OFF=1, PID=0

READ SW2

MODE CHECK CONTROL ALGORITHM FOR ON/OFF CONTROL ALGORITHM FOR PID

O/P CONTROL

O/P CONTROL

Micro controller based PID Controller/7

You might also like