Paraeter Identification of Transfer Functions Using MATLAB Mato Fruk, Goran Vujisić, Toislav Špoljarić Departent of Electrical Engineering The Polytechnic of Zagreb Konavoska, Zagreb, Croatia ato.fruk@tvz.hr, gvujisic@tvz.hr, toislav.spoljaric@tvz.hr ABSTRACT - This paper describes a procedure for identifying the transfer function paraeters by using Matlab's Syste Identification Toolbox (SIT). The procedure is explained for obtaining nuerical data using a digital oscilloscope in a forat suitable for loading the data into Matlab and processing within the SIT. The easured data series connected RLC circuits were analyzed. Also, using the speed response of separately excited DC otor with and without soothing coil was easured, and transfer functions were obtained. I. INTRODUCTION Soeties, in process analysis, there is a lack of possibility to access certain parts of the exained syste, whether the structure of the syste is not known, or the knowledge of atheatical odel needed for syste analysis is insufficient. In that case, the process needs to be tested with known function, and tie response needs to be obtained and handled with either conventional or odern techniques. This article describes the way in which Matlab and Microsoft Excell are connected. Measureents are ade with digital oscilloscope. Input and output signal processing is exained before testing and paraeter identification of transfer functions of the syste is calculated via Matlab's Syste Identification Toolbox. A set of exaples including voltage response in RLC circuit and speed response of separately excited DC otor is being used. II. PROCESS ANALYSIS Process analysis is defined as an iterative procedure that cobines theoretical analysis and experiental exaination. Matheatical odel of the process is obtained by eans of input-output process signals. The advantage in using experients is that they do not require detailed specific knowledge of researched syste, and siple atheatical odels that describe the syste can be given as a result. The disadvantage of this analysis is that an earlier research syste ust exist as well as the fact that the results have liited application for siilar systes. Input signal is chosen on the basis of knowing the process a priori. When using paraeter procedures (odel structure is unknown), iterative calculation is used for obtaining the eleent order and its dead tie (transportation lag). Paraeter estiation is being repeated until process and odel are successfully atched. For identification of continuous processes the signal ust be discretized, so it could be processed through various nuerical ethods. When using discrete signals, one ust take into consideration eleents such as sapling frequency, nuber of bits for coding the received signal and quantization noise. u Real syste (process) Model Θ Algorhyt for defining odel paraeters ys ym + rs + - y + e* Condition Fig. 1 Identification based on paraeter estiation III. PARAMETER IDENTIFICATION IN MATLAB Paraeter identification can be calculated by using Syste identification toolbox (SIT), a tool that exists under Matlab since version 6.5. SIT is a tool for creating atheatical odels, and is based on collecting input/output data of the syste. It has a GUI that is user friendly in odel building. Certain knowledge in syste odelling is needed when choosing the odel in SIT, because atheatical odels process the easured data. Model can be defined by adjusting settings of the assued process odel, until odelling is satisfactory accurate according to the input data in SIT package. Fig. Syste identification toolbox Fig. shows a graphical interface. On the left side of the interface there is a space for entering the iport data which need to be entered in associated windows. This can be done by using the following coand: MIPRO 013/CE 697
data = iddata (output,input,t s ) In the above entioned case iport data (Fig. 9) will be equal to data, and iddata is the coand which enters data in Syste Identification Toolbox. In parentheses, output defines easured output data, input defines easured input data, while T s defines sapling tie (tie base for collecting saples by eans of the easuring instruent used). One ust take into consideration that atrices containing input and output data ust have the exact nuber of rows. This eans that the quantity of output data ust be the sae as the quantity of input data. It is not necessary that one set of input data gives one set of output data, but it is necessary that atrices have the following for: [output] = [n]x[k] [input] = [n]x[1] A. CONNECTION BETWEEN MATLAB AND MICROSOFT EXCELL Connecting of the two packages entioned above takes place when easured data are acquired in the forat that is not copatible with Matlab based processing. Most digital oscilloscopes have the ability to save easured data as docuents in forats such as text or CSV (coa separated values). These forats are copatible with Microsoft Excell, and Microsoft Excell has the ability (in for of add-in) to forward this data to Matlab. In Excell, when Excell options window is opened, entioned addin is selected and then button Go... needs to be clicked (Fig. 3). When add-in is installed, in Excell options window, under Add-Ins options, a package for connecting with Matlab will appear, which gives the possibility to convert atrices fro Excell forat to Matlab forat and vice versa (Fig. 5). Fig. 5 Access toolbar in Excell for exclink add-in Furtherore, an explanation for loading data fro Excell to Matlab's workspace will be given, based on the exaple of easured data on real syste (RLC circuit) B. PARAMETER IDENTIFICATION BASED ON REAL SYSTEM (RLC CIRCUIT) Input and output data for RLC series circuit have been acquired by using digital oscilloscope, where output data are observed as voltage on capacitor. Nuerical data are saved in.txt forat. On the basis of tie response of voltage drop on capacitor paraeters have been defined using conventional ethods, and then given as data to Syste Identification Toolbox. The results have been copared. Transfer function of the RLC series circuit is as follows: G RLC where: K K K () s 1 n ws Tw s s n ns s 1 s n n 1/ T 1/ LC, R / L n w n (1) Fig. 3 Connecting Excell with Matlab Then, on the next window click Browse... and find the directory containing installed Matlab package. Inside that directory there is a toolbox directory which contains exlink directory. Inside exlink directory there is a file naed exclink.xla and this file is a software expansion used for connecting Excell with Matlab (Fig. 4). Fig. 4 Path to exclink.xla Fig. 6 Tie response of voltage drop on capacitor of the RLC series circuit Fig. 6 shows that paraeters of the second order transfer function are: - K = 1 (gain), - t p = 3 s (oent of peak overshoot), - y = 8,5 V (peak overshoot), - y st = 5 V (steady state value). Fro these values paraeters of the second order transfer function can be defined by these forulas: y yst 1 rad e ; 0,118; n 1074 y st t p 1 s The second order transfer function is as follows: G RLC 1074 1 1074 0,118 1074 s s 1 110 s 86,7 10 s 3 6 By using SIT to obtain transfer function, the procedure is faster and sipler than using conventional ethods. This procedure is explained in next few steps. First, all data are being transferred fro Excell to Matlab's () (3) 698 MIPRO 013/CE
workspace. This can be done by selecting data atrix that is to be transferred fro Excell, and by clicking the putatrix button. This coand executes the action of transferring data atrix to Matlab, after typing desired nae for Matlab variable (Fig. 5, 7). Fig. 7 Transferring data atrix fro Excell to Matlab Output data need to be transferred after transferring the input data. In Fig. 9 window shows that it is needed to define sapling frequency (sapling period) in SIT package. Furtherore, inside coand line on Matlab's workspace the coand for data entering needs to be typed in, as follows: RLC = iddata(izlaz,ulaz,0.00/15) These three variables (RLC, ulaz, izlaz) are being held as data in Matlab's workspace. Inside the workspace, with ident coand, a graphical interface can be opened. Created and adjusted data need to be entered in this interface. Fig. 9. Data entering in SIT Now, inside the ain enu of SIT, RLC variable is entered. RLC is also found inside Working data and Validation data windows. However, it is ipossible with oscilloscope to save only a useful part of the response, one need to adjust interval for data processing by using preprocesses. Fig. 10 Defining interval for data processing After preprocessing, input data for SIT can be utually copared in three categories: Tie plot, Data spectra and Frequency function. Fro these graphs a ost suitable set of input data can be chosen to process. Fig. 8 Entering data in SIT After pressing Data object in the drop-down enu, a window will appear, in which the nae of data set for SIT needs to be entered. In workspace variable the nae of a variable for further data processing needs to be typed in. If the variable is accurately structured, SIT will autoatically set the sapling interval, while for Starting tie a value 0 is preferred for RLC series circuit (Fig. 9). Fig. 11 Possibilities of using preprocess analysis of input data in SIT MIPRO 013/CE 699
Fig. 11 shows that the ost suitable set of data is green pattern - RLCe. First saple, naed RLC, is not suitable because it has a nuber of higher overtones, it does not start with step function and it has a transportation lag. At he beginning RLCef has a high overshoot in step function. Due to these criteria the ost suitable signal for observation is RLCe. Furtherore, it can be concluded that it is not always desirable to go to great lengths when adjusting signal for processing. The processing itself, in SIT, begins in drop-down enu, when choosing Working data where one can choose process odels. A window appears, used for defining process odel estiation. On the right side of the window, it is clear that previously analyzed odel still exists. By pressing Model output, a coparison between calculated and easured data will be shown, and in the right corner of the window the accuracy of calculated odel due to easured data will appear. If accuracy is satisfactory, the graphs can be calculated by using LTI Viewer, or the odel itself can be transferred into Matlab's workspace. Fig. 1 Process odels Fig. 1 shows a process odel used for transfer function paraeters calculation. Before using this process odel, knowledge of odel itself is needed. Fig. 6 shows a odel that is siilar to the second order eleent with exponentially daped response. It is known that this eleent has a pair of coplex conjugated roots, and so the paraeters are set, as shown in Fig. 1. Precaution needs to be taken by carefully setting Bounds. It can happen that SIT calculates coefficients that are set on a boundary. This eans that either a odel is not chosen properly, or boundaries need to be expanded. After these paraeters are set, by pressing Estiate SIT calculates transfer function paraeters for defined odel. Fig. 13 shows the eleents that appear in aboveentioned window. This window now contains syste identification after odel processing. Fig. 14 A coparison between input data and calculated odel Accuracy is easured with relative difference between easured and calculated data, and is equal to 96.88%. By double clicking PU icon, a window containing paraeters K p, T w, ζ and a transfer function of the odel will appear (Fig. 15). By coparing paraeters gained fro conventional ethod and paraeters calculated by SIT, it can be seen that no significant difference between the exists. Final transfer function is as follows: 1, 0031 1, 0031 G RLC 4 7 0,145 s 1, 710 s8,34 10 s (4) 1 s 1095 1095 Sall difference in data exists because a calculation based on graph reading is not copletely accurate, a quantization noise exists, and noise present on oscilloscope probe during the easuring also exists. Fig. 7 shows iniu voltage difference between two consequent saples that equals 0.065 V. Fig. 13 SIT window after calculating odel process Fig. 15 Model paraeters 700 MIPRO 013/CE
Because a siple laboratory odel is used, capacitor voltage does not show any significant distortion (noise). However, larger and ore coplex odels are ore subject to inaccuracies of easuring eleents and distortions that result fro electroagnetic disturbances in signal cables. C. PARAMETER IDENTIFICATION BASED ON REAL SYSTEM (SEPARATELY EXCITED DC MOTOR) As the second exaple for data processing, a odel of separately excited DC otor is chosen. This type of otor is siply regulated and it has linear static characteristics, therefore it is suitable for educating purposes as the second order eleent with daping tie response. Its transfer function is: ( s) 1 1 G 1( s),( uz M ( ) 0) t s (5) U ( s) K 1T s T T s where: a a - T a = L a /R a arature tie constant, - T = JR a /K electroechanic tie constant, - K otor constant. The following relations are also applied: n 1 1, T T a When experiental ethods are used, otor with following characteristics is taken into consideration: - P n = 750 W, - i u = 0,3 A, - U an = 90 V, - I an = 10,7 A, - n n = 1750 in -1. Measuring the speed change due to arature voltage step fro U a1 = 46 V to U a = 56 V. DC tachogenerator is used for speed easureent. When stepping the voltage fro U a1 to U a, speed increases fro n 1 = 100 in -1 to n = 1480 in -1. Tie response of speed change is observed with RIGOL DS105D oscilloscope and is shown in Fig. 16. T T a (6) Fig. 16 shows second order speed response with strong daping. When calculating in SIT, it is iportant to select correct odel process, one that suits this type of response. Otherwise, incorrect results will appear. Data ust be set to be processed fro the first oent when voltage step takes place, until steady state value of speed response is given (setting the preprocess). There is also a high frequency noise fro DC tacho-generator, so it is necessary to filter input data, and with caution that the shape of voltage step reains authentic. After analyzing input data, the obtained paraeters are shown in Fig. 17. Fig. 17 Paraeters of a DC otor with load Transfer function (6) paraeters resulting in SIT calculation are as follows: 1 Tw K 0,34983 0,35 Vs ; T Tw 0,104 s; Ta 0,068s K T p This result is consistent with data results fro conventional ethods (T a fro the response to the step voltage with locked rotor, T deterining the oent of inertia fro stopping procedure, K static equations). Fig. 16 Speed response due to arature voltage step Fig. 18 Tie response of speed gained by SIT calculation and input data of observed DC otor When observing Model output window, it is clear that SIT calculation is consistent with the real syste MIPRO 013/CE 701
results with sall deviation the accuracy rate is 96.45%. Since it is ipossible to filter high frequency noises copletely, so ore accurate results cannot be obtained (Fig. 18). IV. CONCLUSION This article describes the approach in paraeter identification of linear processes with single input and single output (SISO) by using Syste Identification Toolbox fro Matlab software package. In order to identify the odel correctly, it is necessary to record results in digital for accurately and precisely. Measured data can be saved as text or in CSV forat. Quantization noise of A/D conversion and the noise fro easuring equipent also need to be taken into account. After loading data into Matlab package, it has to be liited to nuber of saples needed for tie response observation, and high frequency noises need to be filtered afterwards. Sapling frequency has to be high enough, but it ust not exceed its liits. This eans that two consequent saples have to be different enough by quant. Otherwise, a proble with paraeter identification occurs. The whole algorith of identification can be iproved by using DAQ cards, because they have the option of signal filtering, thus giving ore accuracy. Bounds need to be taken into account in Process odels. It could happen that SIT calculates coefficients that are on a boundary, thus eaning that incorrect odel is chosen or bounds need to be expanded. Coparing with conventional ethods, this identification process is faster and ore accurate. For identification with SIT package, correct type of transfer function needs to be chosen according to the response. Accuracy of chosen transfer function calculation needs to be copared with input data given to Matlab. Also, on the basis of transfer function, Matlab can give graphic results in the for of output response, ipulse response and Bode diagras. Process Models gives the opportunity to choose 44 different types of transfer functions. BIBLIOGRAPHY [1] L. Ljung; Syste identification toolbox, Mathworks 1997. [] http://www.athworks.co/help/toolbox/ident/, 10. 6. 01. [3] N. Perić, I. Petrović; Identifikacija procesa, predavanja, FER, Zagreb, 005. 70 MIPRO 013/CE