Transcription

View metadata, citation and similar papers at core.ac.ukbrought to you byCOREprovided by Universiti Teknikal Malaysia Melaka: UTeM Open Journal SystemDevelopment of Experimental Simulatorvia Arduino-based PID Temperature ControlSystem using LabVIEWH. Muhammad Asraf , K.A. Nur Dalila, A.W. Muhammad Hakim and R.H. Muhammad Faizzuan HonFaculty of Electrical Engineering, Universiti Teknologi MARA,Kampus Pasir Gudang, Jln Purnama, Bandar Seri Alam, 81750 Masai, Johor, tudies on temperature control systems have beencontinued until today even though it has already been wellestablished due to its growingapplications in the industrialprocess, household appliance for cooling/heating, and etc. Witha proper tools and a detailed study, a good control system canbe designed to be robust and relatively free from instabilities.For this, LabVIEW and Arduino are recommended as tools forusers to express their design creativity and implement ideas oncreating systems for temperature control. This is useful foreducational purposes especially for university students to use intheir design projects. This paper proposes a PID control schemeimplemented by using an Arduino microcontroller and VirtualInstrumentation (VI) software called LabVIEW for monitoringand controlling the temperature of a heating element which issensed by thermocouple as the measuring device. Thetemperature is varied accordingly to the several setpoint, anderror will be generated when the measured temperature doesnot reach the originally set point. Experimental results showthat PID controller is capable to track and control the heatertemperature towards the designated reference temperature. Thesmall scale of this system and the ease of use allows Arduino tobe practical in laboratory setting and also as a teaching platformfor basic control programming.Index Terms—Arduino; Virtual Instrumentation (VI);LabVIEW; PID Controller; Heater.I. INTRODUCTIONTemperature control is a necessity in industrial process, evenmore strongly in residential or commercial appliances forbuilding cooling/heating where environment control iscrucial. Proper control system design is essential to ensurethat the environment or process is always operated at optimalconditions [1]. There are many researches that have beenconducted previously using Proportional Integral andDerivative (PID) controller design in several applications.N.Hayatee et.al [2] have designed a PID control forcontrolling the temperature of the refrigerator. A PID wasdeveloped and evaluated with on-off temperature controllerto regulate its inner temperature using MATLAB Simulinksoftware which proves that PID controller is better thanconventional system [2]. Another interesting study that wasdeveloped by Y.Yan et.al has implemented the controller ofPID combined with fuzzy logic for controlling watertemperature. Authors [3] claimed that control viaconventional PID system could not result in a precise controlbecause its controlling parameters are fixed. Thus, the studyintroduces fuzzy control theory which has the feature of betterdynamic performance with the advantages of thetraditional PID control method which has a high stability,precision and strong robustness. Another research has alsobeen made by Ranjan et.al [4] regarding an effective PIDcontroller implemented using Atmel16 microcontroller toregulate the temperature of the air-conditioning in a room.The research also implements the tuning of the PID controllervia Ziegler-Nichols method to achieve optimum temperature.Muslim et.al [5] also investigate the best temperaturecontroller for vacuum distiller using Arduino Mega 2560board. Results showed that PID controller is less superiorthan fuzzy logic controller in terms of settling time andovershoot response. In relation to research work usingArduino for virtual instrumentation has been conducted byBranzila et.al [6], authors have investigated the biosignalsmonitoring in medical sector for accelerating the prediagnosis process by developing the system using severaltoolkits available in LabVIEW for signal processing i.e.advanced signal processing and digital filter design fordeveloping the virtual instrumentation. They claimed thebiosignal processing could be developed in shorter time andlow cost product prototyping. Haider et.al [7] have also usedArduino based virtual instrumentation to conduct research onmonitoring solar panels of the DC power supply remotely. Inthis case GUI via LabVIEW was constructed andimplemented in real time using low cost Arduino Mega2560board instead of LabVIEW Digital Acquisition (DAQ) cardto control, observe and record the readings on voltage, currentand power for providing the information of powerconsumption. The authors claimed to successfully built thesystem at minimal cost. Meanwhile, Teikari et.al [8] proposeda stimulator to be used in vision research field. In this project,light intensity from light emitting diode (LEDs) has beencontrolled via Arduino microcontroller integrated withLabVIEW. Authors [8] developed an open source componentto reduce complexity of design process which is suitable foreducation sector that has limited source or fund whilerequiring no advanced technical skills.To summarize, most of the previous research work focuseither partly on controller design, or on monitoring certainparameter in the system. There is rarely any works onimplementing both elements in a laboratory as a teachingplatform. The lack of virtual controller software andcomplexity in using controllers during project design processimpairs new users to implement any new ideas during project.Designing a system for a case study (for example,temperature measurement and control) and controlling thesystem virtually using a widely used LabVIEW software wille-ISSN: 2289-8131 Vol. 9 No. 1-553

Journal of Telecommunication, Electronic and Computer Engineeringmake the understanding of the control design process mucheasier. Therefore, this work aims to propose the use of VirtualInstrument (VI) along with PID-based controllerimplemented within Arduino microcontroller to design abasic heater control system as a sample case study. Usingthermocouple as a measuring element for a basic case studyof temperature control system design is considerably novel,and was rarely pursued before due to the nonlinearity effectthat usually accompanies with the use of thermocouple. Thisexplains why most existing control system that have beenstudied typically integrates thermistor, thermostat orResistance Temperature Detector (RTD) for their sensingapplications [9-11]. The instrumentation is developed for usein laboratory setting which the simulator will be able toreplicate and model the behavior and response of actualequipments and instruments. Arduino is selected due to itslow cost and easy implementation as compared to othermicrocontroller boards such as chipKIT and NI-Rio. Fromthis study, it can benefit users in terms of overcoming thesteep learning curve of designing a control system, while atthe same time provide on-hand, practical learning throughimplementing the acquisition and monitoring concepttowards a physical, realizable system.This paper is organized as following: An overview ofproposed system with its methodology is presented in section2. Section 3 discussed the controller design technique andinterfacing section. Section 4 contains results and discussionobtained from actual implementation of the plant, followedby conclusions derived from the outcome in section 5.II. PROPOSED SYSTEMThe proposed system to be used in this study is aminiaturized heater model - constructed using of a nichromewire as heating element mounted on base platform, with athermocouple sensor that are encapsulated within a smallchamber and a microcontroller. The system block diagramand its schematic can be referred to Figure 1 and Figure 2respectively. A transistor is used as switching device to turnon and off the heater temperature accordingly to the measuredvalue. Initially the user sets the desired reference temperatureby adjusting the Pulse Width Modulation (PWM) to a certaintarget value. During operation, the thermocouple will thenmeasure the heating element temperature and compares it tothe initial set temperature. Based on the difference of thesetwo values, error signal will be generated and converted tovoltage reading into built-in ADC in microcontroller. Thesignal will then be accordingly processed by the designed PID(known as Proportional, Integral and Derivative) controllerand the output signal will be sent to the transistor to adjust thetemperature of the heater. This will be then sensed by thethermocouple, which will be compared to the referencetemperature, restarting the process. This process loop repeatsuntil the heater reaches desired set temperature. Thetemperature detection process is translated into programmingvia LabVIEW which will need to be installed in the PersonalComputer (PC). In order to integrate LabVIEW graphicalprogramming to the measurement signal of the heater system,the interfacing toolkit called LINX is required to be installedas well. Therefore the toolkit serves as a gateway to connectbetween the developed programming and the real time heatersystem.54Figure 1: Block diagram of the systemFigure 2: Schematic diagramA. Controller Selection via Arduino UnoFor this study, Arduino Uno was proposed to be used forcontroller hardware, which is well known for itsimplementation simplicity. The Arduino Uno is the smallestin dimension scale among the Arduino series microcontrollerboard, and is suitable for entry level programming. As asingle board microcontroller, the development platform viaIntegrated Development Environment (IDE) is written in Clanguage [12]. The Arduino Uno [12] is a microcontrollerboard based on the ATmega328. It has 14 digital input/outputpins (of which 6 can be used as PWM outputs), 6 analoginputs, a 16 MHz ceramic resonator, a USB connection, apower jack, an ICSP header, and a reset button. It is able topower up by just using USB or 5V DC power supply [12].The used of Arduino can be implemented in learning andunderstanding the concept of data acquisition, monitoring andcontrol system. Its small size and easy execution allows it tobe used in laboratory where only basic level of programmingis required, or in educational environment as a teaching aidfor introductory course in programming.B. Temperature Measurement of the heaterSeveral methods [13] have been investigated anddeveloped for measuring temperature which include but notlimited to thermistor, Resistance Temperature Detector(RTD), and thermocouple. These sensors [14] rely onmeasuring the characteristic of sensor material that is affectedby the temperature. In this system, thermocouple is selectedas a measuring element. A thermocouple [15] is a sensingdevice consisting of two dissimilar conductors in contact witheach other, where a temperature differential experienced bythe different conductors will induce an electrical potentialdifference due to the Seebeck effect. The Seebeckcoefficients [16] generally vary with respect to function oftemperature, and depend strongly on the conductor types.Thermocouple wire size and attachment method may have ane-ISSN: 2289-8131 Vol. 9 No. 1-5

Development of Experimental Simulator via Arduino-based PID Temperature Control System using LabVIEWeffect on the measurement of surface temperature and thermalcharacterization parameters [17]. Small size and low thermalconductivity thermocouple wires are better to minimize errorsdue to heat losses through the wires. In the system, type Kthermocouple was used for its high temperature measurementranges. The temperature conversion from voltage is known asthermoelectric. In order to obtain the value of temperature,the value of voltage is can be obtained from the Equation (1)of Seebeck Effect [18]. T2 (QA Q B ) dT(1)T1where: εT1,T2aFigure 4: LabVIEW front panel of the system emf produced in volts junction temperature in Kelvin,K thermal transport constant of thetwo metalsIII. CONTROLLER DESIGN AND INTERFACINGHowever, the thermocouple output voltage (emf) producedby the temperature readings are too small to be registered byArduino, therefore an Amplifier (MAX6675) are used in thissystem to upscale the reading of the thermocouple. Thus, theamplified voltage can be read by the Arduino and thenconverted into temperature readings to be viewed on virtualsoftware. The output of the amplifier is defined by Equation(2).VO 5(41 where: VOTJTAOC)(TJ TA )(2) output voltage junction temperature ambient temperatureC. Graphical Programming via LabVIEWControlling the system can be made on the front panel ofthe LabVIEW. LabVIEW has multiple VI to replicate actualinstruments in real life applications. It implements graphicalprogramming language by creating user friendly interfacewithin short development time for experiments and analysisas shown in Figure 3. On the front panel, desired inputtemperature can be set using the slider depending on whattemperature that the system needs (refer to Figure 4). Theoutput will be controlled via the PID control mechanism thatadjusts the temperature according to that value. PID gainpanel consists of proportional, integral and derivative gainneeds to be adjusted and selected manually that yield the bestperformance of the output to converge to referencetemperature. In order to monitor the response, it can beviewed on the front panel in the LabVIEW.Figure 3: Block diagram of the LabVIEWThe temperature control system used for the heaterincorporates PID control scheme to maintain the temperatureat desired setpoint. The hardware and LabVIEW GraphicalProgramming is integrated via LINX toolkit. The detailprocess on the design of PID controller with systeminterfacing is described as following section.A. PID Control SchemeA proportional-integral-derivative controller (PIDcontroller) [19] is a control loop feedback mechanism(controller) widely used in industrial control systems. A PIDcontroller calculates an error value as the difference betweena measured process variable, in this case is temperature and adesired set-point temperature. The controller attempts tominimize the error by adjusting the process through use ofmanipulated gains of PID. With PID, system error can bereduced and the stability of the system are improved, whichis determined by Proportional (P), Integral (I) and Derivative(D) gains. There are many possible structures for PIDcontrollers. Mathematically, the transfer function of thecontroller can be described as Equation (3).u k p e k i e dt k dwhere: ukpkikddedt(3) control signal proportional gain integral gain derivative gainThe error is generated from the differences betweenmeasured temperature and setpoint temperature. Thedifferences value will be sent to the PID controller with thesegains to modify the current error signal. The resultant outputsignal, u is fed towards heater system, to adjust the heatertemperature by turning it on or off.B. Interfacing of LabVIEW and Arduino using LINXLabVIEW Interface for Arduino [20] called LINX is afreeware toolkit developed to interconnect the designedgraphical programming with input output (I/O) of theArduino microcontroller. The I/O is programmed to Arduinowhich waits the command from LabVIEW and react to therequested data [21]. In other words, the system implementsvirtual control which uses LINX to interface between virtualinstrument of LabVIEW and embedded platform of Arduino.The thermocouple amplifier (MAX6675) combines with thee-ISSN: 2289-8131 Vol. 9 No. 1-555

Journal of Telecommunication, Electronic and Computer Engineeringthermocouple then with Arduino SPI Digital Pin (13 SCK, 12SO and 10 CS) to allow LabVIEW to read data from Arduinodirectly using SPI. Firstly, the connection of Arduino withLabVIEW is initialized with the help of LINX. The SPI isconfigured before entering the loops and the data are obtainedfrom array of digital data on Arduino. The data is stored inarray and converted into temperature in the LabVIEW. Theoutput displays the temperature which is connected to the PIDprocess variable (sensor). The PID value can be adjustedusing PID gain and output range on the front panel. Theoutput of the PID is connected to the Duty Cycle to controlPWM of the Arduino, thus adjusting the temperature of thesystem.IV. SIMULATIONS, EXPERIMENTAL RESULTS, ANDDISCUSSIONSA simple experimental testing is aimed to demonstrate theoutput of the heater system. Shown from Figure 5 to Figure 7is the output response for the system after the experiment hasbeen conducted for 25%, 50% and 75% set points. Itcompares between reference temperature and the measuredtemperature. In order to test the system, the set point is variedaccordingly to several values which are based on PWMindicator. The results can be seen on the graph which showsthe differences between the setpoint value and the currenttemperature as well as the time taken. Taking the settling timeand percent of overshoot as criterion, the PID controller needsto be tuned to result the best performance with less overshootwhile reaching settling time at shorter time. Therefore thePID value will be adjusted accordingly until the systemachieves good performance criterion.From Figure 5 it can be observed that for the system toreach the desired temperature, it requires 119 seconds. Firstthe system was set to heat up nichrome wire to 32.5oC. It roseslowly to the set point. Then when the temperature is reduced,the system takes longer time to reach the value. From Figure6, the graph shows that with PID the time taken for the systemto reach desired temperature is slower by 58 seconds. Whenthe temperature is set to 51oC the PID gain value needs to beadjusted so that the desired criterion will be satisfied. Fromthis exercise, this front panel can be used as a simulator forreal time PID temperature tracking as well as PID controlsystem.Figure 6: Setpoint is set at 50% with PID value adjustedFigure 7: Setpoint is set at 75% with PID value adjustedV. CONCLUSIONDesigning temperature control system and other similarproject can be made easier with the assistance ofmicrocontrollers and LabVIEW software. This experimentshows the usefulness of using virtual instrumentation indesign applications as it allows many virtual instruments thatcan be used directly without the need of physical devices tobe connected to LabVIEW. It is recommended to practice andapply the use of Arduino Uno and LabVIEW especially foruniversity students due to its simplicity, reduced cost andaccessibility to entry level programmers without requiring toohigh of a technical skills. This experiment is a gooddemonstration of the use of the aforementioned tools as partof a system design project.ACKNOWLEDGMENTThe authors would like to acknowledge the UniversitiTeknologi MARA for providing financial support under theAcademic and Research Assimilation (ARAS) Phase 1/2016research grant with Project No. 600-IRMI/DANA 5/3/ARAS(0079/2016).REFERENCES[1]Figure 5: Setpoint is set at 25% with PID value adjusted[2]56Kastner, W.; Neugschwandtner, G.; Soucek, S; Newman, HM.(2005).Communication systems for building automation and control.Proceedings of the First Asian Pacific Conference on Biomechanics,(93)6,1178-1203.N.H., A.Hamid; M.,M.Kamal; and F.H.,Yahaya.(2009). Applicationof PID controller in controlling refrigerator temperature. 5the-ISSN: 2289-8131 Vol. 9 No. 1-5

Development of Experimental Simulator via Arduino-based PID Temperature Control System using ational Colloquium Signal Processing & Its Applications, CSPA,378-384.Yang,Y.; and Bian, H. (2012). Design and Realization of Fuzzy Selftuning PID Water Temperature Controller Based on PLC. 4thInternational Conference Intelligent Human-Machine Systems andCybernetics (IHMSC), (2),3-6.Ranjan,S.; Sharma, A.; Chaudhary, P. (2014). An effectivetemperature controller system using PID mechanism. InnovativeApplications Conference of Computational Intelligence on Power,Energy and Controls with their impact on Humanity (CIPECH),182185.M.A.,Muslim; and A., Salmi. (2014). Design and Implementation ofTemperature Controller for a Vacuum Distiller. Proceeding of theElectrical Engineering Computer Science and Informatics. (1)1:198201.M.,Branzila; and V., David. (2013).Wireless intelligent systems forbiosignals monitoring using low cost devices. 19th Symposium IMEKOTC,18-19.Khuwaja, A.A.; and Sattar, A. (2015).Solar power remote monitoringand controlling using Arduino, LabVIEW and web browser. PowerGeneration System and Renewable Energy Technologies (PGSRET), 14.Teikari, P.; Najjar, RP.; Malkki, H.; Knoblauch, K.; Dumortier, D.Gronfier, C.; and Cooper, HM. (2012). An inexpensive Arduino-basedLED stimulator system for vision research. Journal of neurosciencemethods, (211)2,227-236.Andersson, H.; Mattsson, V.; and Senek, A. (2015). Implementation ofPID control using Arduino microcontrollers for glucose measurementsand micro incubator applications.Patel, PV.; and Joshi, NP. (2014). Human Body TemperatureMonitoring System. International Journal of Innovative Research andDevelopment, 28;3(2).A., Silva; M.T., Restivo; and J., Gabriel. (2013). Haptic device demousing temperature feedback. Experiment @ International Conference(exp. at'13), 172-173.Zhao, JJ; Zhao, XB; Li, XH; Zhang, B.; Wang, B.; Zhang, W. (2014).Fasteners State Detection System Based on Wireless Data TransferModule. Applied Mechanics and Materials, Trans Tech Publications,3924-3927.Childs, PR; Greenwood, JR.; and Long, CA. (2000). Review oftemperature measurement. Review of scientific instruments, (71)8,2959-2978.[14] K., Santhosh; and B. Roy. (2012). An Intelligent TemperatureMeasurement Technique Using J Type Thermocouple with an OptimalNeural Network. Sensors & Transducers, (147)12, 6.[15] Fraden J.(2015).Handbook of Modern Sensors: Physics, Designs, andApplications(5th ed) . Springer.[16] S.B., Riffat; and X. Ma. (2003).Thermoelectrics: a review of presentand potential applications. Applied Thermal Engineering. (23)8:913935.[17] M., Neitz; and J., Neitz. (2000).Molecular genetics of color vision andcolor vision defects. Archives of Ophthalmology, (118)5:691-700.[18] D.M., Rowe. (2005).Thermoelectrics handbook: macro to nano. CRCpress.[19] B.,Nagaraj; and N., Murugananth. (2010). A comparative study of PIDcontroller tuning using GA, EP, PSO and ACO. IEEE InternationalConference Communication Control and Computing Technologies(ICCCCT), 305-313.[20] Jamaluddin, A.; Sihombing, L.; Supriyanto, A.; Purwanto. A.; andNizam, M. (2013). Design real time Battery Monitoring System usingLabVIEW Interface for Arduino (LIFA). Joint InternationalConference Rural Information & Communication Technology andElectric-Vehicle Technology (rICT & ICeV-T), 1-4.[21] V.J., Devi; and R. Sasikala.(2015) Design of An Automized MicroAerial Vehicle (MAV) for Surveillance on Land, Air and in WaterJournal of Chemical and Pharmaceutical Sciences,(974);2115.[22] Basnayake, BA; Amarasinghe, YW.; Attalage, RA.; Udayanga, TD;and Jayasekara, AG. (2015). Artificial Intelligence Based SmartBuilding Automation Controller for Energy Efficiency Improvementsin Existing Buildings. International Journal of Advanced AutomationScience and Technology,40(40).[23] Chunfeng, W.; Qingqing, W.; Feifei, Z.; and Wenliang S.(2011)Design of Monitoring and Controlling System Based on CC-Link inGreenhouse. Journal of Agricultural Mechanization Research,12:040.[24] Zeebaree, SR.; and Yasin, HM. Arduino Based Remote Controlling forHome: Power Saving, Security and Protection.(2014). InternationalJournal of Scientific & Engineering Research,5(8).[25] Jadhav, P.; Shaikh, A.; Kalwale, A; and Kale, A.(2016) EmbeddedWeb Server. International Journal on Emerging Trends inTechnology,1(3).[26] Reshma, KV.; Dhanoj, M.; Mathew, RA.; and Divya, K.(2015) PatientMonitoring System Using GSM Interfaced With LabVIEW.The International Journal of Science and Technoledge,3(4):1.e-ISSN: 2289-8131 Vol. 9 No. 1-557

e-ISSN: 2289-8131 Vol. 9 No. 1-5 53 Development of Experimental Simulator via Arduino-based PID Temperature Control System using LabVIEW H. Muhammad Asraf , K.A. Nur D