VXi VT1529A/B 사용자 설명서

다운로드
페이지 529
Generating User Defined Functions   487
Appendix F
Generating User Defined Functions
Introduction
The VT1422A has a limited set of mathematical operations such as add, 
subtract, multiply, and divide. Many control applications require functions 
such as square root for calculating flow rate or a trigonometric function to 
correctly transition motion of moving object from a start to ending position. 
In order to represent a sine wave or other transcendental functions, one could 
use a power series expansion to approximate the function using a finite 
number of algebraic expressions. Since the above mentioned operations can 
take from 1.5 µs to 4 µs for each floating point calculation, a complex 
waveform such as sine(x) could take more than 100 µs to get the desired 
result. A faster solution is desirable and available.
The VT1422A provides a solution to approximating such complex 
waveforms by using a piece-wise linearization of virtually any complex 
waveform. The technique is simple. The VXIplug&play Drivers & Product 
Manuals CD-ROM supplied with the VT1422A contains a 'C' program 
which calculates 128 Mx+B segments over a specified range of values for 
the desired function. The user supplies the function; the program generates 
the segments in a table. The resulting table can be downloaded into the 
VT1422A's RAM with the ALG:FUNC:DEF command where any desired 
name of the function (i.e., sin(x), tan(x), etc.) can be selected. Up to 32 
functions can be created for use in algorithms. At runtime, where the 
function is passed an 'x' value, the time to calculate the Mx+B segmented 
linear approximation is approximately 18 µs.
The VT1422A actually uses this technique to convert volts to temperature, 
strain, etc. The accuracy of the approximation is really based upon how 
well the range is selected over which the table will be built. For 
thermocouple temperature conversion, the VT1422A fixes the range to the 
lowest A/D range (±64 mV) so that small microvolt measurements yield the 
proper resolution of the actual temperature for a non-linear transducer. In 
addition, the VT1422A permits the creation of Custom Engineering Unit 
conversion for a transducer so that when the voltage measurement is actually 
made, the EU conversion takes place (see SENS:FUNC:CUST). Algorithms 
deal with the resulting floating point numbers generated during the 
measurement phase and may require further complex mathematical 
operations to achieve the desired result.
With some complex waveforms, it may be necessary to break up the 
waveform into several functions in order to get the desired accuracy. For 
example, suppose the generation a square root function is required for both 
voltage and strain calculations. The voltages are only going to range from 0 
to ±16 volts, worst case. The strain measurements return numbers in 
microstrain which range in the 1000's. Trying to represent the square root 
function over the entire range would severely impact the accuracy of the