• No results found

Software Design of Measurement and Control System 121

CZD C D

Chapter 5 Software Design of Measurement and Control System 121

£

3

<

_ J

0.

o

00

o

00

o

N

I

c

f

o

CO CO CL

<

u

LU

u

<

CL CO

<

o

•<J-T o

u oo

d->

£ w

Q.

tf>

•a o

o o o o

0)

_Q

physic z ramma START. nnel. ion.

ax and min d the prog then push ie next cha nd calibrat

st the m signal ar e board, EXT fort EXIT to e T§ "5 c .c w w

M - o «j <£

® ° c <2

« 8 «° .

= -i /

> i

DL, N 3 o

X) N

Chapter 5 Software Design of M e a s u r e m e n t and Control S y s t e m 1 2 2 W h e n channel 0,1,4 and 5 are calibrated, the system reads the A / D values of a specific channel and displays the points on the screen of the computer. T h e operator adjusts the sensor from the beginning to the end in the measurement range, and inputs the physical value of the sensor to the edit zone on the keyboard of the computer. Thus, a series of data pairs of physical values and the readings of A / D values can be obtained. T h e calibration data pairs can be seen on the screen. Because the calibration process can be controlled accurately, cubic spline interpolation is conducted for the four channel signals. T h e interpolation curve is displayed based on the end condition case 1 cited before. If the curve is not satisfied, the interpolation for end condition of case 2, 3 or 4 will be conducted. W h e n the calibration curve is satisfied, the calibration data table will be written into the calibration file.

When channel 2 and 3 are calibrated, the system works in the process of running of the test rig. T h e system acquires the A / D value of displacement as well as velocity and

acceleration at the same time. T h e physical values of velocity and acceleration can be obtained by deriving the displacement physical value, which is calibrated by the above method. Therefore, the calibration points for velocity and acceleration can be obtained and are displayed on the screen. This process can be s h o w n in Figure 5.18. Because of the long chain of the calibration, the calibration data pairs m a y not be very accurate. So software low pass filter is employed and "noisy-data" are eliminated and polynomial interpolation is conducted for the velocity and acceleration calibration. T h e fitting curve is displayed on the screen and the order of the polynomial can be changed if the fitting curves are not satisfied. A s the other channels, the calibration data table will be written in the calibration file if the calibration curve is satisfied. Because it is difficult to ensure the calibrating points to cover the entire range which the measurement and control system will operate, both interpolation and extrapolation are applied in the program.

Chapter 5 Software Design of M e a s u r e m e n t and Control System 123

sensor and instrument

measurement value

'

previous calibration

»» calibratii

filter and

<

lg puiui ^™

interpolation

velocity calibrating table

•**" CdilDIdUng yyjikn.

filter and

i

interpolation

-acceleration calibrating table

physical value

digital derivation

digital

<

derivation

Figure 5.18 Block diagram of calibration of velocity and acceleration

Since the measurement range of 12-bit A/D converter on the board is set to -10V—

+10V and its output is two's complement code, the digital range of the A/D is from -2048—+2047. Therefore, each calibration file has 4096 data, the position of each

datum in the file specifies the physical value of this channel. For example, the first datum in the file specifies the physical value corresponding to the digital input value of -2048 (-10V input), and the 4096th datum in the file specifies the physical value

corresponding to the digital input value of 2047 (+10V input).

A s an example, some screen copies of the calibration procedure of load cell are shown in the following pages.

Chapter 5 Software Design of M e a s u r e m e n t and Control System 1 2 4 Figure 5.19 shows the start of the calibration of load cell. T h e operator can change the m a x i m u m and m i n i m u m calibrating values, A / D converter on-board programmable gain, calibrating file n a m e and current physical value. The system can automatically change the horizontal coordinate of the figure to fit the whole figure display zone. Push S T A R T button to start calibration, push N E X T button to change to the next channel calibration, or push E X I T button to exit calibration process.

w System 10 40

Test Rig Calibration

ADO: FRICTION F0RCE(L0AD CELL)

Max physical value: |200 | Min physical value: |0 | Calibration file: |force.cal1 |

Pragrammable gain: |10 1 Current value: |0 j A/D C O N V E R T E R

V A L U E

0000

Please adjust the m a x and nrdn physical values of the signal and the programmable

gain on the board, then push START.

rXtsIn NEXT for the next channel.

Rjsh EXIT to end calibration.

START f NEHT 1 f EHIT 1

2048

0

2048

Min FRICTION FORCE (N) Max

F i g u r e 5.19 S c r e e n c o p y w h e n start the calibration process

W h e n push S T A R T button, the point corresponding to the current physical value and A / D value is displayed on the figure zone as a blinking square as shown in Figure 5.20.

W e need to adjust the load for the sensor, and enter the physical value of the load in the edit zone, then push C O N T . button to get this data pair as a calibrating point and display this point as a small hollow square, and continue the above procedure. The R E S T A R T button is pushed to conceal the previous calibration of this channel and

Chapter 5 Software Design of M e a s u r e m e n t and Control S y s t e m 1 2 5

restart a calibration procedure. When the operator gets enough data pairs and the data pairs cover the majority of the measurement range, push FINISH to finalise this

calibration.

w System IQfll 11:26

Test Rig Calibration

ADO: FRICTION F O R C E ( L O A D CELL) Max physical value:

Min physical value:

Calibration file:

Pragrammable gain:

Current value:

A/D CONVERTER VALUE

200

ijforce.calT 1100.5

-658

Change the input value and write the value in the edit field, then push the C O N T . for

the folowing point.

ftjsh R E S T A R T to renew calibration.

FVish FINISH to finish the calibration.

CONT. RESTART FINISH

2048

1 0

2048

>n a

D D

a

1 1

FRICTION FORCE (N) 200

Figure 5.20 Screen copy of calibrating point

Cubic spline interpolation is employed to get the calibrating table explained before in

the full measurement range. Natural spline fit (case 1) is the default method to get the interpolating data. The interpolating curve is displayed in the figure zone. If the

interpolation is not satisfied, push METHOD to select the other end conditions and the interpolation curve is displayed again, as shown in Figure 5.21. The four kinds of end conditions described in Section 3.4.2 are employed in turn for the operator to check.

When the operator is satisfied with an interpolation curve, push SAVE to save the

curve as the calibrating table in the calibration file to finalise the calibration of the channel, as shown in Figure 5.22.

Chapter 5 Software D e s i g n of M e a s u r e m e n t a n d Control S y s t e m 1 2 6

ij System 11:38

Test Rig Calibration

ADO: FRICTION FORCECLOAD CELL)

Max physical value:

Min physical value:

Calibration file:

Programmable gain:

Current value:

A/D CONVERTER VALUE

|200 force.call

H

I^QX

-1336

Finish. End concttion: 2ed deriv. equal to adjacent points.

Push SAVE to write calibration file.

ftjsh RESTART to renew calibration.

Push M E T H O D for a n e w end condition of cubic spline interpolation method.

f S R U E ] RESTART M E T H O D

2048

<

0

-2048

to

FRICTION FORCE (N) 200

Figure 5.21 Screen copy of interpolating curve of the calibrating points

w System 11:47

Test Rig Calibration

ADO: FRICTION FORCE(LOAD CELL)

Max physical value:

Min physical value:

Calibration file:

Pragrammable gain:

Current value:

A/D CONVERTER V A L U E

200 [force. calT

H

[I96.3|

The calibrating data is written to the calibration file.

Please be patient.

Wish NEXT to stop to next channel.

Push RESTART for renew calibration.

[ NEHT 1 RESTRRT EHIT

2046

0

-2048

\

FRICTION FORCE (N) 200

Figure 5.22 Selecting interpolating m e t h o d a n d saving calibration table

Chapter 5 Software Design of M e a s u r e m e n t and Control System 127

The default calibration file names for each channel is shown in Table 5.2.

Table 5.2 Calibration file n a m e s

No.

1 2 3 4 5 6

A / D channel/signal friction force

displacement from capacitance sensor R M S of acoustic emission

thermocouple

velocity from capacitance sensor acceleration from capacitance sensor

calibration file n a m e force.cali dsplsmt.cali

AErms.cali trnprtcali

vlctxali aclitcali

W h e n the calibrations of all the channels are finished, this module automatically switches to experimental process.

5.4 Pre-adjustment process

The temperature of disk and velocity of spindle should be adjusted to the required values before the actual experiments. This module is used for the pre-adjustment and check of some devices of the test rig. T h e control signals for motor and heating device can also be checked. It is also useful for the check of almost all the input channels and output channels, including A / D converter, amplifiers, sensors, instruments, switching input devices and switching control output devices.

The general flowchart of the process is shown as Figure 5.23.