FPAA Projects PID Temperature control By Subramanian Ramachandran and Lav Thyagarajan Under the guidance of Dr. Stephen Grodzinsky
INTRODUCTION The PID algorithm is the most popular feedback controller used within the process industries. It has been successfully used for over 50 years. It is a robust easily understood algorithm that can provide excellent control performance despite the varied dynamic characteristics of process plant. The Proportional-Integral-Derivative (PID) algorithm As the name suggests, the PID algorithm consists of three basic modes, the Proportional mode, the Integral and the Derivative modes. When utilising this algorithm it is necessary to decide which modes are to be used (P, I or D?) and then specify the parameters (or settings) for each mode used. Generally, three basic algorithms are used P, PI or PID. A Proportional algorithm The mathematical representation is, The proportional mode adjusts the output signal in direct proportion to the controller input (which is the error signal, e). The adjustable parameter to be specified is the controller gain, kc. This is not to be confused with the process gain, kp. The larger kc the more the controller output will change for a given error. For instance, with a gain of 1 an error of 10% of scale will change the controller output by 10% of scale. Many instrument manufacturers use Proportional Band (PB) instead of kc.1 The time domain expression also indicates that the controller requires calibration around the steady-state operating point. This is indicated by the constant term mvss. This represents the 'steady-state' signal for the mv and is used to ensure that at zero error the cv is at setpoint. In the Laplace domain this term disappears, because of the deviation variable representation. A proportional controller reduces error but does not eliminate it (unless the process has naturally integrating properties), i.e. an offset between the actual and desired value will normally exist. A proportional integral algorithm The mathematical representation is, The additional integral mode (often referred to as reset) corrects for any offset(error) that may occur between the desired value (setpoint) and the process output automatically over time. The adjustable parameter to be specified is the integral time (Ti) of the controller.
A Proportional Integral Derivative algorithm The mathematical representation is, Derivative action (also called rate or pre-act) anticipates where the process is heading by looking at the time rate of change of the controlled variable (its derivative). TD is the rate time and this characterises the derivative action (with units of minutes). In theory derivative action should always improve dynamic response and it does in many loops. In others, however, the problem of noisy signals makes the use of derivative action undesirable (differentiating noisy signals can translate into excessive mv movement). Derivative action depends on the slope of the error, unlike P and I. If the error is constant derivative action has no effect. Example of system responses to Controller tuning SET VALUE PRESENT VALUE Terms used to describe the response characteristics of the system are: Overshoot: this is the magnitude by which the controlled variable 'swings' past the setpoint. 5/10% overshoot is normally acceptable for most loops. Rise time: the time it takes for the process output to achieve the new desired value. One-third the dominant process time constant would be typical. Decay ratio: this is the ratio of the maximum amplitude of successive oscillations. Settling time: the time it takes for the process output to die to between, say +/- 5% of setpoint.
COMPONENTS NEEDED 1. AN221K04 Development board from ANADIGM. 2. MCT2E Optocoupler 3. 2N2222 Transistor 4. IRF540 Power Mosfet 5. LM35 Centigrade temperature sensor - produces 10mv/degree centigrade 6. 50 Watt Resistor heating element 7. Bread Board. 8. DC Power supply: +/- 10 V for the FPAA Board. 9. DC Power supply: +5V for the sensor and +20 V for the Solenoid. 10. DC Power supply: 0 5V (variable) for providing the set point voltage. BLOCK DIAGRAM DC POWER SOURCE GND +10V -10V FPAA IP1 + IN1 - IP2 IN2 ON1(-) + OP1(+) +V GND Variable DC Power Source 0 5 V. DC +20 Source GND +5 CV GND +5 V POWER SWITCHING CKT D S D S L CV Vcc Figure 1 : Drain lead of Power MOSFET : Source lead of Power MOSFET : Levitating distance between object and solenoid. : This is the connection to the base of the 2N2222 transistor. A detailed circuit is shown in Figure 2. : The Vcc shown in the diagram above is for the Hall sensor. Note: Dark circles indicate connections.
PROJECT DESCRIPTION A PI Controller was implemented to maintain the temperature of high watt resistor at a set temperature. Given below is a detailed description of the project work LM35D Temperature Sensor This temperature sensor produces a linear voltage with respect to a change in temperature 10mV/degree C. The above PID controller running in the FPAA chip was designed and implemented through the Anadigm Software used for configuring the chip. FPAA PROGRAMMING
The software used: AnadigmDesigner can be downloaded from the website: www.anadigm.com. One has to register online to obtain the authentication code and License key for the same. Programming is done through the serial port of the PC. If a COM port in unavailable, a USB to COM Port converter has to be used. The software contains basic analog modules for easy analog system design. Our goal was to use this programmable board to demonstrate one of the many such capabilities and applications possible as a part of new course in our university. Hence its use and implementation in the magnetic levitation project. Circuits can be easily constructed through a drag and drop option from the CAM list. (CAM : Configurable Analog Modules) PWM CONTROLLER A PWM controller is implemented in the Altera FPGA. The PWM output is given as input to the base of a 2N2222 transistor of a power switching circuit for driving the resistor. POWER SWITCHING CIRCUIT The circuit diagram below shows the connections for rigging up the power switching device. A simple 2N2222 transistor is in series with an optocoupler to transmit the switching pulses to the gate of the power MOSFET. The optocoupler s role is to provide a safe isolation between the low voltage signals and the high voltage/current part of the circuit. DETAILED CIRCUIT DIAGRAM OF THE POWER SWITCHING CIRCUIT MCT2E Figure 2 Pins 3 and 6 of the Optocoupler MCT2E are to be left unconnected.
The PWM code has been written in VHDL. The UP2 Board housing the Altera Flex 10K was used to produce the required PWM signals for the above power switching circuitry. If you need the VHDL file, please email me: sramacha@bridgeport.edu saying who you are and explain your endeavor. For academic reasons of other graduate students at UB accessing my webpage, the code has not been given in this document. Sorry for any inconvenience caused.