HP E1328A User Manual page 69

D/a converter module
Hide thumbs Also See for E1328A:
Table of Contents

Advertisement

Sample Program
/* This program demonstrates a weighted least-squares approach to determining DAC calibration
constants.
ym = (uncalibrated) negative full-scale output value
yp = positive full-scale output
y0 = uncalibrated zero
w = weighting factor for relative importance of zero
w = 3.65 is the recommended weighting factor
w = 1 yields conventional least-squares algorithm
The DAC characteristic is modeled as y = b1*x + b0.
The coefficients b1 and b0 are used to calculate the actual calibration constants, J and K. */
dac_line(yp, y0, ym, w, b1, b0)
double yp, y0, ym, w, *b1, *b0;
{
double u[2], M[2][2], N[2][2], d;
u[0] = ym + w * y0 + yp;
u[1] = w * 0x8000 * y0 + 0xFFFF * yp;
M[0][0] = w + 2;
M[0][1] = 0x8000 * w + 0xFFFF;
M[1][0] = M[0][1];
M[1][1] = w * (double)(0x8000) * 0x8000 + (double)(0xFFFF) * 0xFFFF;
d = M[0][0]*M[1][1] - M[0][1]*M[1][0];
N[0][0] = M[1][1] / d;
N[0][1] = - M[0][1] / d;
Appendix B
is as follows:
00110011
instructs channel 4 to accept the following data entries.
The seven parameters (register 0A
0B
is high 8 bits of calculated offset (J).
16
7C
is low 8 bits of calculated offset (J).
16
16
is high 8 bits of calculated gain (K).
16
F8
is second 8 bits of calculated gain (K).
16
F2
is third 8 bits of calculated gain (K).
16
1A
is low 8 bits of calculated gain (K).
16
5F
is calculated check sum.
16
10. Change the selected channel mode to CAL-ON.
11. If desired, check that the constants have been loaded correctly by
outputting 8000
16
hour accuracy for voltage or current (see Appendix A).
The following is a sample program written in C to calculate J, K, and
checksum. " ym, yo, and yp" (from steps 4-6 on page 67) are measured and
entered. Note, the program does not prompt for the value of w, the default
value of 3.65 is used.
HP E1328A Register-Based Programming
or
33
(register 08
b
16
) are entered as follows:
16
and verifying that the channel output is zero 24
)
16
69

Advertisement

Table of Contents
loading

Table of Contents