PDA

View Full Version : Type-K thermocouple linearizer


jya
02-09-00, 04:12 PM
A little over a year ago, I had an article in Forth Dimensions describing my method for approximating arbitrary functions by using piecewise-quadratic interpolation. It included Forth code that runs in about 4 milliseconds on an NMIY0020. By taking advantage of the design decision to make all divisions a power of two, that is, writing assembly routines like 256/ and 256/MOD , the time goes down to about 3 ms. It is also useful for computing sines and exponentials to better than slide-rule accuracy.<p>I recently completed an assembler version. By taking advantage of such opportunities as one miltiplication always having one operand positive and the other never as large as 64, the execution time is now under 300 µs.<p>The code is adapted to work with an NMIS4004 running at a gain of 200. FFF corresponds to 50 (times 4095/4096) milivolts, or about 2250 degrees (F). Temperature is accurate to the nearest half degree, but reported to the nearest eighth to ensure glitch-free operation of a feedback controller.<p>Contact me for code (which I am happy to share) and discussion about how you might adapt the code to other uses.<p>Jerry<p>----------<br>Engineering is the art of making what you want from things you can get.<p>