data is stored on a 4-track Braemar cassette tape deck with 15-M-bit capacity. ..... corrections are multiplied by some factor to speed the recovery of the average ...
Bulletinofthe SeismologicalSocietyofAmerica,Vol.70,No.6, pp. 2275-2290,December1980
E A R T H Q U A K E SIGNAL PROCESSING AND LOGGING W I T H A BATTERY-POWERED MICROCOMPUTER BY WILLIAM A. PROTHERO, JR. ABSTRACT A low power microprocessor controlled event-triggered seismic data logging system has been designed and implemented in the ocean bottom seismic capsule. Three channels of seismic data are digitized, formated, and stored under control of an Intersil IM6100 microprocessor chip. The processor also controls event triggering, acoustic diagnostics, battery voltage monitoring, and self-diagnostic functions. A watchdog system restarts it in the rare case of a failure of proper program sequencing. The entire system consumes less than 0.15 watts in the idle mode. The event triggering algorithm consists of first measuring the ratio of the short-term signal average to the long-term signal average, with amplifier offset removed (STA/LTA ratio). When an S T A / L T A trigger occurs, the number of slope reversals in the signal begin to be counted. After a preset time following the first S T A / L T A trigger, if the number of subsequent S T A / L T A triggers meet preset criteria, a system trigger is declared and data is stored on a 4-track Braemar cassette tape deck with 15-M-bit capacity. Various system diagnostics, unit and experiment identification, and battery voltages are recorded at the beginning of each new event record. Digital filters for the long- and short-term averages, and antialiasing have been efficiently implemented by dividing or multiplying by factors of 2, exclusively. This amounts to a shift right or left of a binary number. The recording system has been tested in numerous field experiments. Circuit cards from the ocean bottom capsule implementation are being assembled and used for land stations and could be applied to a wide variety of data acquisition tasks.
INTRODUCTION Low power microprocessors allow vastly improved capabilities for field data logging equipment. Preprocessing of signals, flexibility in data acquisition and recording, and extensive self-diagnostics are all possible with a minimum of hardware. The instrument complexity is shifted from hardware which is relatively difficult to modify and reproduce, to software which is relatively easy to modify and trivial to reproduce, allowing the upgrading of existing instruments quite economically. This paper describes the implementation of an Intersil IM6100-based microcomputer in a seismic data acquisition system for an ocean bottom seismometer capsule (Prothero, 1979). The signal processing algorithms and system control functions are applicable to many data logging applications. Other signal processing algorithms with possible application to event triggering are discussed in the last part of this paper. DESCRIPTION OF THE MICROCOMPUTER The microprocessor is an Intersil IM6100, which has a 12-bit organization and executes the instruction set of the PDP-8E. The details of its operation are available through Intersil and Harris (Semiconductor Corporation) in numerous technical brochures and from the Digital Equipment Corporation (1975). One manufacturer (PCM Corporation) produces a PDP-8E equivalent microcomputer that will execute all PDP-SE software including F O R T R A N and BASIC. The CPU and numerous 2275
2276
WILLIAM A. PROTttERO, JR.
peripheral chips are available in low power CMOS so that a complete computer with up to 32 K of memory can be made which consumes less than 0.25 watts (at a 2-MHz clock rate). The ocean bottom seismometer (OBS) hardware is described in Prothero (1979). Table I is a general set of specifications for the instrument. Figure 1 is a block diagram of the OBS electronics showing all of its functional components. Outputs from three seismometers pass through preamplifiers and antialiasing filters. The preamplifier gains are settable by the computer. The signals then pass through a series of three gain of eight amplifiers. If the highest gain output should exceed 0.75 of full scale, the overscale logic automatically switches the multiplexer to the next lowest gain output. The need for precise sample times made a hardware implementation of this feature preferable to a software implementation. The overscale circuit remains in the lower gain state until a reset is received from the computer. Thus, gain changes can be avoided as the signal passes through zero, if desired. The status of the overscale circuit can be read into the computer and is recorded on tape with the data. The multipl'exer, which chooses the analog voltage to be sampled, has auxiliary channels for battery voltage and temperature measurements. The signal from the MUX is passed through a sample and hold circuit and is digitized to 12-bit accuracy by an Analog Devices ADC 1121, low power A-D. The A-D output is then sampled by the microcomputer for processing and recording. The microcomputer, as configured for the OBS, consists of a CPU, memory to 16 K, watchdog auto-restart logic, programmable read only memory (PROM) with program loading and auto-restart software, and interfaces. The interfaces consist of: (a) A-D and MUX; (b) serial interface to a terminal; (c) digital cassette recorder interface; (d) acoustic system interface; and (e) memory extension interface. The system time base is derived from a 2.097152-MHz crystal oscillator. It also provides the CPU clock, which is switchable by software to 524 KHz for lower power operation when the system is idling. This clock output is divided to 1 Hz and input to a 24-bit binary counter, which can be read by the computer to obtain an absolute time base reference. The counter is set to zero on the minute with a precise station clock. A separate counter (set to zero at the same time as the 24-bit counter) divides the 1-Hz signal by 60 to provide minute marks for ease of checking the clock rate against external minute-oriented clocks. The zero time is entered into the computer memory at setup time. The operating software then adds it to times derived from the binary counter in the system, providing an absolute time base. The data and program memory is random access memory (RAM) with both read and write capability. Program memory can be write protected so that once the program is loaded, it cannot modify itself. The watchdog restart circuit consists of two counters, each of which must be reset by the computer every 8 sec. If not reset, they force a control panel interrupt (a feature of the IM6100) which vectors the program to the control panel PROM. In this system, the restart program reinitializes all interfaces and critical memory locations and restarts the system at an address wired into the serial interface card. The watchdog system is a safety feature which increases the reliability of the microcomputer by preventing it from getting lost or hung up due to an electronic transient or some random sequencing error. In practice, it is extremely rare for the watchdog system to be activated on a properly functioning unit. The serial interface card provides communication between the microcomputer and a terminal. The software operating system uses this facility for setup and diagnostics. This communication function could be implemented with 7-segment displays and a key pad for other applications, but for the OBS, a terminal was preferable.
TABLE 1 UCSB OBS SPECIFICATIONS Mechanical: weight: 136 kg (approx.) descent rate: 1 m/sec (approx.) ascent rate: 0.5 m/sec (approx.) Pressure case: tube: inner diameter: 15.2 cm outer diameter: 18.3 cm endcap thickness: 3.2 cm material: 7075-T6 aluminum coating: hard anodize with dichromate seal and epoxy paint Release system: Dual explosive bolts actuated by acoustic recall or two independent timers Sensors: three-component mark products L-25 4.5-Hz geophones gimbal leveled with solenoid-actuated locking mechanism Recording system: mode: 12-bit digital with auto gain ranging in 4 steps of 8 tape recorder: Braemar cassette with 4-track head data capacity: 1.5 × 107 bits or (81 rain for three channels at 64 Hz) trigger system: microprocessor controlled short term versus long term average data memory: 4096 samples sample rate: maximum of 128 samples/sec (all three channels) with triggering Timing: crystal oscillator with internal thermistor for temperature correction in situ time corrections possible using acoustic system Power requirements: 0.15 watts (continuous) power source: Gates Rechargeable "Energy Cells" Maximum design deployment time: rechargeable battery pack--2 months lithium battery pack--6 months Acoustic system: ranging: transponder accuracy 3 m (approximate) commands: release and diagnostics diagnostics: command received, voltages, noise level, number of events recorded, tape runtime (programmable), program restarts, batteries OK diagnostic code: one ping = "0", two pings = "1", after diagnostics are transmitted, system pings once per minute synchronized to OBS clock Special features and improvements over the previous SIO OBS 1. All checkout, andi data playback can be performed without opening the capsule a t sea. 2. The instrument tube is small enough to fit through a narrow ship's door, and the complete OBS can be launched from smaller boats. 3. Assembly time for new units is minimal because of printed circuit card construction. The mechanical systems are also considerably simplified. 4. No external leads are exposed to sea water. 5. Microproce'ssor control allows vastly improved flexibility in signal processing and capsule control functions. 2277
2278
WILLIAM A. PROTHERO, JR.
The cassette interface consists of a sequencer that turns on the cassette and requests data when needed. Thus, to write data, the computer must only give a "go" command, then wait for data requests from the interface. The cassette is a readwrite unit, so interface circuitry is also provided to perform "rewind," "backspace," and "read" functions. Thus, it is possible for the microcomputer to read data and test for recording errors. Operating programs could also be read in from the cassette. However, in the OBS, program loading is done through the serial interface and data is read externally by the test box computer, so this capability is not used. This ANALOG ELECTRONICS-1 PER SEISMOMETER SEISMOMETERS 3 COMPONENT
F'LTRSt preomp
gQin control
[ I ACOUSTIC[ [ . ACOUSTIC ~ RELEASE L.-J PmO on J TRANS- ~.~ AND ~,=-~-cr°mm°na
to explosive bolts
MUX AND OVERSCALE LOGIC
battery ~>tovoltooes
] POWER [ CURRENT
to external connectors
external time load and test
Fro. 1. Block diagram of OBS electronics. Each seismometer signal is amplified by a computer settable preamplifier, triter, and gain-ranging circuit. The multiplexer (MUX) is also capable of sampling the main clock temperature and battery voltages. Data are recorded on a 4-track cassette. The electronics is controlled by an Intersil IM6100 CMOS mmroprocessor. Checkout, data playback, and battery charging may be accomplished without opening the capsule.
enables recorder testing to be performed without opening the OBS pressure vessel. A Braemer cassette modified with a 4-track head is used, with MaxceU C90 tapes. It records at 314.96 bits/cm (800 bits/in), so 1.5 × 107 bits can be recorded on a single cassette. The unit writes in both directions on a single track at a time, which minimizes skew problems. Power for the system is provided by Gates Energy Cells, which are rechargeable lead acid cells that can be purchased in various sizes and amp-hour ratings. The microprocessor logic system draws 8 mA on slow clock and 23 mA on fast clock from its 6.6-V power supply.
2279
EARTHQUAKE SIGNAL PROCESSING AND LOGGING
Mechanically, the electronics are on circular double-sided printed circuit cards with plated through holes mounted perpendicular to the axis of a cylindrical tube of 15.26 cm (6 in) inside diameter. A printed circuit backplane containing 44-pin-edge
f
YES YES f 3 ~ /
~
~hr
' NO
3 . 5 to 5.0
0
ms.
N( ~rder
Service
.,W
MAIN
o~Oh~~up-YES
IDLELOOP
~
iNTERRUPT
YES
ROUTINE
FIG. 2. OBS software flow chart. The main idle loop services slow capsule functions while the interrupt routine takes data, updates the triggering algorithm, and checks for timed functions.
connectors busses the cards together. It is a simple mechanical configuration and works extremely well in practice. SOFTWARE OPERATING SYSTEM
The operating software consists of several subprograms. An idle program (Figure 2) monitors various housekeeping functions such as diagnostics requests from the
2280
WILLIAM A. PROTHERO, JR.
terminal, acoustics diagnostics, startup sequencing, and the 4-hr system check. At the end of the loop, the CPU clock is switched to its slow rate. At regular intervals, a clock pulse causes a system interrupt which vectors the program to the data sampling routine. The data sampling program (Figure 2) switches to the fast CPU clock rate, takes data from three channels and reads the overscale gain. Once per second, time is read and stored in place of the x and y data. Then the time is tested for automatic housekeeping functions and preprogrammed run times. The OBS system is programmed to wait for some settable number of hours from time zero before it activates gimbal leveling and preamp gain adjust software, which is actuated approximately every 6 min for 1 hr. Every 4 hr thereafter, the preamp gain is readjusted and 8 sec of data is recorded. This exercises the instrument and provides a test in case no events are recorded. The system then performs the desired filtering and trigger testing operations on the data and stores it in the data memory. Software has also been implemented to run the recording system according to an arbitrary time schedule for refraction experiments where triggering would be unreliable. When an event has been triggered, the system waits until data memory is nearly filled, then turns on the tape recorder. The recorder must be serviced every 3 msec, so the service routine is called from both the monitor loop and the data acquisition routine. The slow CPU clock function is inhibited during data recording to insure that the recorder is serviced often enough. Recorded data is blocked into 4 K records for ease of processing. The first record of a given event includes battery voltages, long-term average ground noise, experiment identification, OBS identification, program version number, time zero, and date. Data are played from the OBS tape recorder into a PCM-12 computer which is a PDP-8 equivalent and is the heart of the test system. The test computer copies the data to its system cassette or through a high speed RS-232 interface to a larger computer. It can also plot data on a Tektronix graphics terminal, an oscilloscope, or a strip chart recorder through a digital to analog converter. Interactive data editing software on the Tektronix graphic display terminal will be expanded at a later date. Diagnostics. Diagnostics for checkout prior to and during deployment have been programmed into the OBS operating system. During checkout, single keystroke commands from the terminal allow printing of various memory locations, computation and printing of the checksum of the write-protected memory, cassette recorder rewind, backspace, and playback, and initiation of the acoustic diagnostic sequence. The triggering can be tested by a program patch that samples an external signal from an oscillator rather than the Z data channel. This way a known signal can be applied to see if it has the expected effect. These functions, in addition to battery voltage and current consumption measurements, are performed with the electronics inside the pressure tube, nearly ready for launch. When deployed, diagnostics are transmitted to the surface through an acoustic transponder when an acoustic command is received. They are transmitted at 1 bit per 4 sec where a "0" is a single ping and, "1" is a double ping (Prothero, 1977). Information transmitted includes: (a) squib fire command received; (b) preamp gains; (c) cassette tape used; (d) number of restarts; (e) number of events triggered; and (f) any low battery voltages. After the diagnostic sequence is completed, it sends a ping once per minute exactly 4.5 sec after the 60-sec minute mark. By ranging to the OBS with the transponder to determine the acoustic propagation delay, the capsule clock can be compared to a surface clock to within a few milliseconds. The short-term average is formed by first subtracting the signal offset (determined by taking a true long-term average of the signal) from each data point, taking the
E A R T H Q U A K E SIGNAL PROCESSING AND LOGGING
2281
absolute value, and adding it to a running sum of all terms in that particular time segment. The negative and positive values are kept separate so they may be used later to compute the true signal average to get the amplifier offset. When the number of terms chosen for the short-term average has been sampled, the contents of the sums registers are transferred and the sums registers are set to zero. For the purpose of the discussion of the long-term average, we assume that the short-term average approximately follows the signal envelope. The long-term average is formed using a first order filter of the form Y(i) =
IX(i) + Y ( i - 1 ) ( N - 1)] N
(1)
where N is the number of terms in the average, Y ( i ) is the filter output, X ( i ) is the current sample, and Y ( i - 1) is the last filter output. The transfer function of this filter (Otnes and Enochsen, 1978) is given by H(f) =
1 N-
(N-
(2)
1)exp(-j27rft)
where t is the sample interval in seconds. Since floating point multiply and divide operations are extremely time consuming when done in software, they must be avoided whenever possible. Filter generation will be limited to dividing by powers of 2, which simply involves shifting the binary number one or more places right. With this restriction, averaging filters can be implemented quite quickly. Other considerations involve overflow and roundoff errors. In order to avoid this, the numerator of the difference equation is saved separately, and operations are performed on it. A filter commonly used in the OBS trigger program uses N = 2048 and t = 0.25 sec. The gain of this filter is 1
H(f) = N 1+
- 2
(3) cos 2~rft
\1/2
It is plotted in Figure 3 for N = 2, 32, 256, and 2048. If a step increase in signal is applied, it reaches 0.7 of its maximum value in approximately 10 min. However, if a signal 100 times ground noise is received, for 10 sec, the long-term average will rise 2.7 times its original value. If the S T A / L T A trigger criterion is 8 times the longterm average, it will then take 22 times the original ground noise to trigger a smaller event immediately following. It will then take 15 to 20 min to return to its original level. Increasing the averaging time is of little help because, even though the rise through an event is slower, the fall time after an event is also slower. This problem has been solved in two ways. The first is to program the LTA routine to rise slowly but fall quickly. If the difference equation is rearranged as follows Y ( i ) = Y ( i - 1) + IX(i) - Y ( i - 1)]/N.
(4)
The term IX(i) - Y ( i - I ) ] / N can be considered as a correction term to be added to the last value of the long-term average to form the new value. Then negative corrections are multiplied by some factor to speed the recovery of the average after an event. An example of this algorithm will be discussed later.
WILLIAMA. PROTHERO,JR.
2282
It is also important for the triggering system to be able to extend the recording time for longer events. In the present system, the LTA is used, but a more controllable solution could be achieved by comparing short-term averages to a slowly increasing ramp that is initialized at the LTA at the beginning of the trigger. This causes the trigger criterion to increase so that triggering will cease if the noise level should rise abruptly. As a precaution, if the LTA should fall below the ramp, the ramp would be reinitialized to the LTA. The transfer function (Figure 3) is similar to that of a single stage RC filter (for f