This video provides a comprehensive teardown, testing, and in-depth reverse engineering of a Nasa Marine Fluxgate Compass used for private boats. The analysis delves into both hardware and software aspects, starting with the closed-ring fluxgate sensor, which is excited by a 1kHz square wave and uses orthogonal coils to generate second harmonic signals. These signals are then converted to DC voltages via a phase detector. The video meticulously reverse-engineers the sensor's analog electronic board and the main CPU board, which features a Motorola 6802 processor and an 8-bit ADC to compute the heading. A significant portion is dedicated to the disassembly and reverse engineering of the 16KB PROM's machine code, revealing the heading computation algorithm that employs an arctangent function and a sector-based lookup table for accuracy. The presenter notes the device's use of low-cost, hobbyist-like components, contrasting with the sophisticated underlying principles.
Detailed Analysis of the Nasa Marine Fluxgate Compass
0:00 Introduction to the Device: The video introduces a Nasa Marine boat heading indicator from 1992, comprising an LCD display unit with a keypad and a separate fluxgate sensor. Initial observations include brass screws on the sensor to prevent magnetization, and the overall low-cost, hobbyist-like construction.
0:58 Fluxgate Sensor Mechanism: The core of the compass is a closed-ring fluxgate sensor. It features an excitation coil, a high-permeability core that saturates symmetrically without an external magnetic field. In the presence of an external magnetic field (Earth's magnetic field), the saturation becomes asymmetric, generating a second harmonic signal. This signal is then detected by two orthogonally placed pickup coils (X and Y axes). A pendulum mechanism ensures the sensor remains horizontal.
2:44 Sensor Electronic Board Components: The sensor board contains medium-power transistors for the excitation coil's push-pull output, a 4520 dual 4-bit counter, MC1455 timer, 4053 analog switches, and Op-amps (CA3140, 741, 7611). These components are configured to generate the excitation signal, and use the analog switches for phase detection to measure the second harmonic signals from the pickup coils.
5:25 Display and Keyboard Unit Internals: The main indicator unit houses a Motorola 6802 microprocessor, an ADC0803 8-bit Analog-to-Digital Converter, a TMS 27PC138 16KB PROM (used for 4KB code), and MC14543 LCD drivers. The keypad is described as low-cost, and evidence of hand-soldering is noted.
7:36 Practical Testing and Calibration: The compass is tested outdoors, demonstrating its accuracy in indicating magnetic north (359 degrees), west (270 degrees), south (180 degrees), and east (86 degrees). The unit also allows for alarm limit adjustments and damping (averaging) settings from 1 to 9.
10:05 Sensor Board Reverse Engineering (Schematic): The detailed schematic reveals a multivibrator generating a ~15kHz clock. This clock is divided to produce a ~950Hz square wave for the excitation coil. A 2F reference signal (twice the excitation frequency) is generated for the phase detector. An analog multiplexer selects between the two sense coils, followed by a bandpass filter and a phase detector (an amplifier with switchable gain) to convert the AC signal to a DC voltage proportional to the magnetic field component. A second-order low-pass filter smooths this DC signal before it's sent to the CPU board's ADC. A trimmer allows for phase adjustment.
12:17 CPU Board Reverse Engineering (Schematic): The CPU (EF6802) interacts with the OTP PROM (only 4KB of its 16KB capacity used), a keypad buffer, and the ADC. Address decoding is handled by a 74LS138, selecting various components like the LCD display, ADC, keypad, and buzzer. Specific outputs from the address decoder are used to select X or Y channels on the ADC for measurement. Swapped data lines on the LCD driver are identified as an optimization for routing. A basic 5V and crude 10V power supply regulation is also detailed.
14:35 Heading Algorithm (Software Reverse Engineering): The video explains the algorithm for computing the heading from the X and Y measurements. It uses an arctangent function, which is optimized by dividing the 360-degree circle into eight 45-degree sectors. For angles above 45 degrees, X and Y values are swapped, utilizing a trigonometric identity. The algorithm determines a "basic angle" within 0-45 degrees, then applies an offset and sign (add/subtract) based on the determined sector using a lookup table to calculate the final heading.
17:43 Code Disassembly and Implementation: The arctangent function itself is implemented using a lookup table in the PROM. The final heading is calculated by calling specific functions (pointers in the lookup table) to either add or subtract the basic angle from a sector-dependent offset.