DYNAMICS OF SENSORS DYNAMIC RESPONSE OF A TEMPERATURE SENSOR The conversion from sensing element temperature to thermal expansion, electrical resistance is essentially instantaneous. The dynamic characteristics of the temperature sensor are related to the heat -transfer and –storage parameters that cause the sensing element temperature to lag that of measurement medium. Conversion of energy gives: UA(Tact − Tind )dt = MCdTind (1) where U – overall heat transfer coefficient, depending on the surrounding fluid and its velocity; A – heat transfer area; Tact – actual temperature of surrounding fluid; Tind –temperature indicated by sensor; M –mass of sensing element; C – specific heat of sensing element; Tind ( s) 1 = (2) Tact ( s) sτ + 1 MC where τ = UA 1/16 U, A Tind Tact Figure 1 Measurement with simple thermal sensor Response degradation may be Present in a new sensor – wrong installation Developed over time as results of • Cracking of insulation cement • Relocation of including powders used in probe construction Actual installed response is critical to process safety and/or performance say nuclear power plant. Only in situ test can provide desired confidence. 2/16 DYNAMICS OF SENSORS Temperature sensor enclosed in a thermo-well or sheath TW, MW, UWF, AW, CW TF TS, MS, USW, AS, CS Figure 2 Measurement with thermal sensor including sheath Ignoring the thermal capacity of the space between sensor and well the heat balance equation are Sensor: Well: dTS = U SW AS (TW − TS ) dt dT M W CW W = −U SW AS (TW − TS ) + U WF AW (TF − TW ) dt M S CS (3) (4) 3/16 With substitution τS = M S CS U SW AS τW = M W CW U WF AW δ= U SW AS U WF AW (1 + τ S s)TS ( s) = TW ( s) (5) (1 + δ + τ W s )TW ( s) = TF ( s) + δTS ( s) (6) TS ( s ) k = 2 TF ( s) τ Sτ W s + (τ S + τ W + δτ S ) s + 1 (7) M S CS If coupling term between the well and the sensor δτ S = U A << τ W + τ S then WF W TS ( s ) k = 2 TF ( s ) τ Sτ W s + (τ S + τ W ) s + 1 (8) 4/16 DYNAMICS OF SENSORS When we use the substitutions 1 τ Sτ W = ω n2 and τ S + τ W = 2 ξ then ωn TS ( s) k = 2 TF ( s) ⎛ s ⎞ ξ ⎜⎜ ⎟⎟ + 2 s + 1 ωn ⎝ ωn ⎠ (9) When greater accuracy is need in utilizing the results of an experimental test to determine sensor dynamics, a model using three time constant and a dead time may be applied: TS ( s ) e −τ dt s = TF ( s ) (τ W s + 1)(τ S s + 1)(τ sh s + 1) (10) 5/16 IDENTIFICATION OF THE DYNAMICS OF AN ELEMENT IN TIME DOMAIN Impulse response of first order elements G ( s) = k 1 + τs Response of the element when the input has a form of pulse (see Figure 3) up to time T is − kA ⎜⎛ y (t ) = 1− e τ T ⎜⎝ t ⎞ ⎟ ⎟ ⎠ (11) for t>T − T t kA 1 − e τ −τ y (t ) = e T − T τ e (12) When T→0 then y (t ) = kA τ e − t τ A/T Time T Figure 3 Real impulse 6/16 DYNAMICS OF SENSORS Impulse response of second order elements The solution are found to be for over dumped elements y (t ) = kAω n ⎛⎜ e (−ξ + 2 ξ −1 ⎝ 1 ) ξ 2 −1 ω n t 2 − e (−ξ − ) ξ 2 −1 ω n t ⎞⎟ ⎠ (13) for critically dumped elements y (t ) = kAω n2te −ωnt (14) and for under dumped elements 1 y (t ) = kAω n 1−ξ 2 ( e −ξω nt sin 1 − ξ 2 ω n t ) (15) 7/16 Experimental determination of measurement system parameters Experimental determination of measurement system parameters is a calibration task. For first-order instruments the static sensitivity k is found by static calibration. There is only one parameter pertinent to dynamic response, the time constant τ. One common method applies a step input and measure τ at the time to achieve 63.2 percent of the final value. This method is influenced by inaccuracies in the determination of the t = 0 point and also gives no check as to whether the instrument is really first-order. A preferred method uses the data from a stepfunction test re-plotted semi-logarithmically to get a better estimate of τ and to check conformity to true first order response. This method goes as follow t ⎛ − τ ⎜ y (t ) = kA 1 − e ⎜ ⎝ ⎞ ⎟ ⎟ ⎠ (16) t − y (t ) 1− =e τ kA (17) Now we define y (t ) ⎞ t ⎛ Z = log e ⎜1 − ⎟=− kA τ ⎝ ⎠ − Δt =τ ΔZ (18) (19) 8/16 DYNAMICS OF SENSORS Thus if we plot Z versus t we get a straight line. Figure 4 illustrates a procedure. The method gives a more accurate value of τ since the best line through all the data points is used rather than just two points as in 63.2 percent method. If the data deviate considerably from a straight line we know the instrument is not truly first order and a τ obtained by 63.2% method would be quiet misleading. Figure 4 Step function test of first order system 9/16 Stronger verification of first order dynamic characteristics is available from frequency response testing, although at considerable cost of time and money if the system I not completely electrical. Amplitude ratio and phase angle are plotted on the logarithmic scale. If the system is truly first order the amplitude ratio follows the typical low- and high-frequency asymptotes (slopes 0 and –20 dB/decade) and the phase angle approaches –90 deg asymptotically. Deviations from the above amplitude and/or phase characteristics indicate non first order behaviour, see Figure 5. Figure 5 Frequency response test of first order system 10/16 DYNAMICS OF SENSORS Figure 6 Step and pulse test for second order system 11/16 For second order system k is found from static calibration and ξ and ωn can be obtained in a number of ways from step or frequency response tests. Figure 6 shows a typical step function response for an underdamped second order system. The values of ξ and ωn may be found from the relations 1 ξ= 2 ⎡ ⎤ ⎢ π ⎥ +1 ⎢ a⎥ ⎢ log e ⎥ ⎣ A⎦ ωn = 2π T 1−ξ 2 (20) (21) When the system is lightly damped any fast transient input will produce a response similar to figure. Then ξ can be approximated by ξ= x1 xn 2πn log e (22) This approximation assumes 1 − ξ 2 ≈ 1 which is quiet accurate when ξ < 0.1 and again ωn can be found from equation 21. In applying 21 if several cycles of oscillation appear in the record it is more accurate to determine the period T as the average of as many distinct cycles as 12/16 DYNAMICS OF SENSORS are available rather than from the single cycle. If the system is strictly linear and second order the value of n in 22 is immaterial. The same value of ξ will be found for any number of cycles. Thus if ξ is calculated for, say, n=1, 2, and 6 and different numerical values of ξ are obtain, we know the system is not following the postulated mathematical model. For over dumped system (ξ>1.0), no oscillations exist, and the determination of ξ and ωn becomes more difficult. Usually it is easier to express the system response in terms of two time constants τ1 and τ2 rather than ξ and ωn. From 13 we can write t t − τ1 τ 2 −τ 2 y (t ) = e τ1 − e +1 τ 2 − τ1 kA τ 2 − τ 1 (23) where τ1 = τ2 = (ξ − (ξ + 1 ) (24) ξ 2 − 1 ωn 1 (25) ) ξ − 1 ωn 2 13/16 To find τ1 and τ2 from the step response we may precede as follows, see Figure 7. 1. Define the percent incomplete response Rpi as y (t ) ⎞ ⎛ R pi = ⎜1 − ⎟100% kA ⎠ ⎝ (26) 2. Plot Rpi on a logarithmic scale versus time t on a linear scale. This curve will approach a straight line for a large t if the system is second order. Extend this line back to t=0 and note the value P1 where this line intersects the Rpi axis. P1 should be τ1 τ 2 − τ1 100 Now τ1 is the time at which the straight-line asymptote has the value 0.368P1. 3. Now plot on the same graph a new curve, which is the difference between the straight-line asymptote and Rpi. If this new curve is not a straight line the system is not second order. If it is straight line the time at which this line has the value 0.368(P1-100) is numerically equal to τ2. P2 should be τ2 100 τ1 − τ 2 14/16 DYNAMICS OF SENSORS Rpi P1 0.368P1 160 80 P2 40 20 0.368(P1-100) 10 6 Time 1 τ2 τ1 4 7 Figure 7 Step test for overdamped second order systems Frequency response method can be used to find ξ and ωn or τ1 and τ2. Figure 8 shows the application of these techniques. The methods shows use the amplitude curve only. If the phase curve is available it constitute a valuable check on conformance to the postulated model. 15/16 Figure 8 Frequency response test of second order system 16/16 Introducction to dSpace Make the model of an office chair in figure 1. Change the constants value to 0. Figure 1 Create a new m-file with the parameters in figure 2. Don’t forget to save your files. Start the new m-file in the Matlab command window. JW 2001-11-13 rev. 2 2/7 Figure 2 Click on Simulation, Configuration Parameters and chose Solver. Set the Start time to 0, Stop time to inf and the Fixed step size to 0.001 like in figure 3. Figure 3 3/7 Choose Real-Time Workshop. Control that your configuration is the same as in Figure 4. Figure 4 Click the button Build. 4/7 Open ControlDesk via Start, Program, dSpace Tools. Figure 5 • • Choose Platform in the Navigator window. Find your *.ppc file in File Selector and put it in ds1104 (under Hardware), close File Selector. • • Click on the new fold with your files name as show in Figure 6. Mark Model Root. 5/7 Figure 6 • • Figure 4 Choose File, New, Layout. Choose Data Acquisition ---PlotterArray, Virtual Instruments--PushButton and NumericInput from the Instrument Selection Bar and put in the Layout window, see Figure 4. 6/7 In order to connect these to suitable parameters, click on a parameter in Variable and drag it to its place in Layout, see Figure 5. Out1: Signal out. P: Signal in. Figure 5 Connect the pulse signal (B) and the out signal (the position of the chair) to Plotter, the signal in (P) that belongs to the pulse to PushButton and the value b (the attenuation of the chair) to Numeric Input, see Figure 1. Make necessary configurations by double-click on the instruments in Layout: • PushButtom o Choose PuschButtons. o Mark PuchButtons_00. o Change the name of the button to some suitable name, put Value to 0. o Mark PuchButtons_01. o Change the name and set the Value to 750 ( M ⋅ g ≈ 750 ), see Figure 6. • Numeric Input o Put its max-value to some suitable value. 7/7 Figure 6 Now is it time to save all your windows in one experiment. This is done by clicking on the icon New Experiment in the tool window, see Figure 7. Figure 7 Give a name to your experiment. Select Experiment in the Navigator window and click with the right mouse button on the experiment icon in the window. Choose thereafter Add All Open Files. Open Capture Settings by clicking with the right button in the tool field, choose Settings and thereafter the fold Capture, and put Length to 10. Now is it finally time to simulate the model. Click on the icon Animation Mode in the tool field, see Figure 11. Figure 81 Click on Start in Capture Settings. See figure 12 8/7 Do four different simulations by changing the b-values in Numeric Input. Use the buttons (PushButton) to create an Impulse response. If you would like to save the values in ControlDesk (the curve in Layout) and, for example, plot the curves in Matlab. Then click on the button Settings… in the Capture Settings Window. In the fold Capture click the button Save Capture… Save your data (for example in b2). The data will now be saved in a matrix. To plot the figure in Matlab, see the example in Figure 13. Figure 9