Introduction
This brief essay describes the software to monitor the 3.5 meter
polishing cell. This software reads load cells, which define the
array of supporting forces, and thermocouples, which monitor temperatures
in and around the cell.
An entirely distinct set of hardware and software actually controls
the LOG and the the lap which polishes the mirror.
Hardware
The hardware for this project consists of the usual VME rack and
power supply and a handful of cards.
First and foremost we have a trusty mvme147 cpu board (with 4M of ram).
In addition to this we have a BB906 analog input board with a digital
IO daughter board. At one time this would have been sufficient, but
the 906 board is only a 12-bit board, and the temperature system
demanded extra precision, so an Acromag 9330 16-bit ADC board was added.
In addition to the collection of boards inside the VME rack, we have a
locally designed and built multiplexor board that funnels 192 input
channels into 8 channels. At one time all 8 channels were on the 906
board, but later the last 2 were moved to the 9330. In any case, each
of the 8 input channels can have one of 24 different inputs selected
via this multiplexor at any one time. The multiplexor itself is
controlled via the digital IO duaghter board on the 906.
The multiplexor has a certain settling time after it changes settings.
Also, low-pass filters are used on the inputs to the 9330.
Both of these necessitate some care in the software to wait a sufficient
time to obtain an acceptable reading after the mux is addressed.
Reading voltages
So lets dive right into how the software works. The main loop is
concerned with cycling the mux thru its various values, allowing the
right amount of settling time, and reading the voltages. It keeps a
matrix of 8 by 24 values (stored as 16-bit integers, just raw out of
the ADC's). There are actually 2 of these matrices, the one being
filled, and the one already filled. Only the one completely filled is
available in any way to the rest of the world.
A clock interrupt happens at 100 Hz (every 10 milliseconds),
and this drives the main loop.
The mux is set, then ticks are counted for a settling interval (presently
10 ticks for a 100 millisecond settling time). After this, on each tick
the ADC is read out and the value is accumulated. After some number of
ticks (presently 90), the average value is calculated and recorded in
the matrix. The upshot of all this is that a new row gets added to the
matrix every second and the values in the row are the average of 90 readings
from the ADC.
Every 24 seconds the entire matrix is filled up and we
have a new complete set of data to process.
The full matrix is handed to the data conversion task, and the
data collection task continues along filling a new matrix.
The two matrices are swapped back and forth every 24 seconds in this
fashion. The full matrix is immediately converted to voltages
(in the range -10. to +10. volts), and the voltage matrix is handed
first to the load cell conversion routine, and then the temperature
conversion routine.
Load Cell values
The first 6 columns of the voltage matrix contain load cell values,
among other things. The other things are reference voltages, power
supply monitors, and such like. In each column 4 of the 24 voltages
are these sort of housekeeping things (which do not get involved in
the load cell calculations, by the way). So we could have 120 load
cells, but not all of these are hooked up. The software keeps a data
structure with the following items for each actual load cell:
- An status flag (on for all "real" load cells).
- A numerical ID number for the load cell.
- The ADC channel for that load cell (column in matrix).
- The mux setting for that load cell (row in matrix).
- Volts per pound at the ADC.
- The latest reading in pounds.
A word of explanation is in order regarding the volts per pound
value. The load cells we use produce a nominal 30 microvolts
per pound. We run these thru an amplifier board before the ADC sees
the signal which has a nominal gain of 598. Hence the ADC sees
a nominal 0.018 volts per pound. The load cell database keeps
the raw load cell calibration (typically 31-32 microvolts per pound)
and the amplifier gain (always 598.0) in case we want to independently
characterize
Temperature values
The last 2 columns of the voltage matrix are a single IJB (isothermal
junction block) for the thermal system. Again, 4 items in each column
are housekeeping values, the other 80 could be thermocouples, except
that one of them is the AD590 that reads the junction temperature, so
we could accomodate 79 thermocouples if we should so desire. However
not all of these are wired up at this time.
Here are the steps along the way to developing temperatures from the
block of voltages for an IJB:
- Validate the reference voltage (it must be between 4.9 volts and
5.05 volts). If it is valid, normalize it to 5.0 volts and all the
other voltages on the same ADC channel in the same fashion. If it is
not valid, flag a reference error.
- Calculate the ijb temperature from the AD590 value. Validate this
by checking that it is between -40 and +50 degrees centigrade. Add an
optional offset (zero in this software) to the temperature.
No error is flagged if it is invalid, but it and all the thermocouple
temperatures will be marked bad if so.
- Calculate a voltage for a type E thermocouple based on the ijb
temperature. For a type E this is done using the Seebeck coefficient
of 0.0000605 volts per degree centigrade.
- Calculate a thermocouple voltage by dividing the raw ADC voltage
by 1000 (We amplify the voltage by this amount before we send it to the
ADC), and adding the ijb voltage.
- Calculate a raw thermocouple temperature by running the voltage
thru the polynomial for a type E thermocouple, and adding an optional
offset in degrees (these offsets are always zero in this system).
To the end of the list of thermcouple temperatues, we append two
"Phantom thermocouples" so they can be processed along with the real
thermocouples. These are the raw and offset-adjusted IJB temperatures
(AD590 readings). Since we have a zero offset in this system, both
values are identical. All thermocouple temperatures are then subjected
to the following battery of tests. If they fail any test, the temperature
is marked as BAD (a value of 999.0 is entered), and an error is flagged.
- If the thermocouple is marked as "down" the temperature is marked
bad, but no error is issued. In general thermcouples would be marked
down when they are open or shorted, and we don't want the error file
filled with messages about them.
- If the temperature is less than -40 degrees centigrade, it is
marked bad and a COLD error is issued.
- If the temperature is more than 50 degrees centigrade, it is
marked bad and a HOT error is issued.
- If the temperature varies more than 10 degrees from the last
good reading, it is marked bad and a OPEN error is issued.
- Notice that we do not have an explicit shorted test, the COLD
case should catch this.
And that is how you get the raw temperatures for all the thermocouples.
The offsets for each thermocouple and the IJB are provided to allow
individual calibrations to be done for each sensor in the system.
The software keeps the last 5 temperatures for each thermocouple,
whenever a new temperature is calculated, the oldest is discarded.
It is possible to request the most recent (raw) temperatures, or the
median of the 5 temperatures.
How do I get the data?