Cracking Open and Controlling a 747 Gas Gauge

A video of my {hardware} and software program controlling the pointer and counter on a 747 gas amount indicator.
On this publish, I disassemble a 747 gas amount indicator and reverse engineer the electromechanical components of the indicator. I then apply {hardware} and software program methods used on earlier initiatives to construct a PID controller for a management loop consisting of the AC servo motor and suggestions potentiometer within the indicator. This management loop is used to place the dial and counter on the face of the instrument to values entered right into a serial terminal.
Outward Appearances

The entrance of a number of 747 gas amount indicators I’ve. This one maxes out at 95,000 lbs of gas.
Pictured above is a 747 gas amount indicator. It has a dial and pointer that point out the gas amount from 0 to 95,000 kilos. As well as, there’s a mechanical drum counter that signifies the gas amount with a decision of 100 kilos from 0.0 to 95.0 hundreds of kilos.
This gauge is most certainly from a 747-200 the place a 3rd crewmember, the flight engineer, managed the gas consumption of the plane. In later plane, just like the 747-400, gas administration was computerized and the flight engineer’s place was eradicated in favor of a two crewmember flight deck. On these plane, the gas amount indicators are built-in into the glass cockpit shows of the pilot and first officer.

747 gas tanks from The 747 Gas System by E.D. Ayson, R.R. Dhanani, and G.A. Parker of The Boeing Firm for the Society of Automotive Engineers, April 1970.
The illustration above is from an article on the 747 fuel system (PDF) from 1970. The 747-100 pictured has seven gas tanks. Later variations of the plane added an non-obligatory eighth tank within the tail. Since jet gas weighs about 6.7 to six.8 kilos per gallon relying on formulation and temperature, this gauge is probably going from the middle tank (12,890 gallons or 87,000 kilos) or one of many two inboard wing tanks (12,240 gallons or 82,620 kilos). The gauge I later modify and management is probably going from one of many two outboard wing tanks because it solely goes to 35,000 kilos.
Barney Britton has some glorious flight deck pictures from the primary Boeing 747 plane on Tumbler. The final photograph in this set exhibits the flight engineer’s console. The gas administration system is within the backside middle of the console with yellow knobs on both aspect of it. In that photograph, you may see that the inboard and middle tanks have gauges that go to 95,000 kilos, the outboard tank gauges solely go to 35,000, and the reserve tanks solely go to three,500 kilos.

The rear view of a 747 gas amount indicator. The middle contact is a shielded coaxial connection to the gas degree sensor. Behind the F/E panel are small potentiometers for calibrating the indicator.
The rear of the gas amount indicator is proven within the photograph above. It has a canopy marked with an F and an E and a big connector. Behind the quilt are just a few small potentiometers for calibrating the gas amount indicator. The connector has a middle coaxial contact surrounded by 10 pin contacts. The middle coaxial contact connects to the gas degree sensor which is known as a tank unit as described in The 747 Gas System:
Tank models, which sense gas amount, and compensator models in every tank present enter alerts to the corresponding gas amount indicators. … The tank models are variable capacitors, their capacitance various with the extent of gas within the tank. The compensator models … present a correction for variation in dieletric fixed with the gas density.
A big metallic band across the very finish of the gas amount indicator seals the tip plate and gauge internals inside the primary physique. The metallic band is probably going welded in place then coated with gobs of grey paint.
Inside Pictures

Inside photograph of a 747 gas amount indicator. The massive black cylinder is the suggestions potentiometer for the management loop. The small cylinder beneath it’s the AC servo motor that strikes the pointer and counter.
One of many indicators I’ve got here with the tip seal already eliminated. These inner pictures are from that indicator. Within the photograph above, 1 of two electronics boards is seen on the left finish of the gauge. To the fitting of that may be a massive black cylinder. The black cylinder is the suggestions potentiometer for the management loop that manages the pointer place and counter worth.
Under that may be a smaller, silver cylinder. The silver cylinder is the AC servo motor used to rotate the pointer and counter. To the fitting of these are a bunch of gears that couple the servo motor, suggestions potentiometer, pointer, and counter collectively in numerous ratios. Lastly 1 of two massive yellow capacitors for the motor is seen.

The opposite aspect of the insides of the 747 gas amount indicator. A small transformer and the underside of the mechanical drum counter are seen from this angle.
Flipping the indicator over as proven above reveals the second of the 2 circuit boards within the indicator. The facility provide transformer and backside of the mechanical drum counter are seen from this angle.
The photograph above is a closeup of the suggestions potentiometer. The resistance is 1 kΩ ±3%. The linearity spec is ±0.06% which probably locations this half on the stratospheric finish of pricy.

A closeup of the servo motor and 1 of two massive capacitors within the indicator. The motor is rated for 26 VAC on each phases.
The photograph above is a closeup the AC servo motor and among the gears it turns. The AC servo motor has two windings. Each windings are rated for 26 VAC 400 Hz.
Mechanical Operation
After inspecting the indicator and figuring out the varied elements, it was time to reverse engineer components of the gauge to see if I may get it working once more. The gauge is probably going powered from 115 VAC 400 Hz and would require a variable capacitance to regulate it. Neither of which was one thing I wished to attempt to implement. With some reservation, I made a decision the inventory electronics must go and I targeted my reverse engineering on the electromechanical components of the indicator.
The diagram above paperwork my reverse engineering efforts. Trying on the diagram, a two-phase AC servo motor turns some gears. The gears flip the dial pointer, the drum counter, and the suggestions potentiometer. The motor wires and potentiometer wires connect with the facility provide transformer and circuit boards. The 90° part shift required between the motor windings is offered by one of many two massive yellow capacitors within the indicator. My plan is to disconnect the seven wires proven on the diagram from the inventory electronics and join them to my very own electronics as an alternative.
Hacking the Gauge
Up to now, we’ve been taking a look at a pair of indicators that go from 0 to 95,000 kilos. Each of those indicators had been in too good of situation to hack up. I’ve a 3rd indicator, nevertheless, that was in rougher situation. It’s from one of many outboard tanks so it solely goes from 0 to 35,000 kilos. I made a decision to make this indicator the topic of my hacks.
Step one within the hack was to get the indicator open. My weapon of selection was a hacksaw. The indicator physique is aluminum so a hack noticed lower it open pretty simply and rapidly. I used to be cautious to not nick the circuit boards or inner wiring. If I ever had to do that once more, I’d most likely assault the band on the finish of the unit with a rotary software and pair of pliers.

The cracked open and separated indicator. I added the inexperienced connector to the meeting to make connecting to my electronics simpler.
I eliminated the indicator physique from its shell, unscrewed the screws holding the circuit boards in place, and thoroughly disconnected the seven wires linked to the motor and potentiometer in addition to the lamp energy and chassis floor wire. These wires had been all ridiculously quick so I soldered them onto a connector then soldered longer wires onto a mating connector to provide the wires extra attain.

After rigorously separating the electromechanical components from the digital components, I soldered a connector to the motor, lighting, and suggestions potentiometer wires.
The photograph above is a closeup of the connector I added to the indicator wiring and the mating connector that runs to my {hardware}.
My Pin | Unique Coloration | My Operate |
---|---|---|
A | BLU | fixed motor winding (+) |
B | VIO | fixed motor winding (-) |
C | YLW-ORN | variable motor winding (+) |
D | WHT-ORN | variable motor winding (-) |
E | GRN-ORN | chassis / lighting floor |
F | YLW-BRN | lighting (+) |
H | BRN-BLU | POT WIPER |
J | WHT-GRY | POT CCW (GND) |
Okay | BRN | POT CW (+3.3V) |
The desk above paperwork the wiring of the connector I added and every pin’s operate.
The Controller
The block diagram for my controller for the indicator is proven above. This controller combines a two channel model of the AC energy provide I used for my tachometer project and a PID controller. On this case, the AC energy provide frequency is mounted at 400 Hz.
The primary channel of the AC energy provide has a set magnitude and drives the blue / violet winding of the AC servo motor. A big collection capacitor on the blue / violet winding ensures the 2 motor windings are pushed 90° out of part as required by an AC induction motor.
The second channel of the AC energy provide has its signal and magnitude scaled by the output of the PID controller and drives the yellow / white winding of the AC servo motor. This winding controls the velocity and route of the AC servo motor in response to the output of the PID controller. (For extra particulars on AC servo motor operation, see the AC servo motor part of my altitude indicator project.)
The motor then drives the dial pointer, drum counter, and suggestions potentiometer via a collection of gears. The voltage throughout the potentiometer represents the present worth of the dial and counter. The voltage is digitized utilizing an analog-to-digital converter and used to compute the error between the specified pointer / counter worth and the present pointer / counter worth. The error is enter to the PID controller to shut the management loop.
The {Hardware}
The {hardware} for this venture is strictly the identical because the {hardware} for the tachometer project besides this venture makes use of one of many Raspberry Pi Pico’s analog-to-digital converter channels and solely requires 2 of the three DAC and amplifier channels to be stuffed. The suggestions potentiometer is linked to the ADC channel utilizing the 3-pin header on the Pico adapter board. The blue / violet motor winding is linked to the primary DAC channel and the yellow / white motor winding is linked to the second DAC channel.
The photograph above is one other view of the {hardware}. This photograph exhibits the face of the outboard wing tank gas amount indicator for the primary time.
The Software program
The software program for this venture consists of three principal duties:
- The primary activity is to immediate the person for the variety of hundreds of kilos to point on the dial and counter. This worth is remodeled right into a 12-bit set level. This activity runs as wanted to obtain an enter from the person utilizing a easy command line interface.
- The second activity is to learn the RP2040’s A/D converter to acquire the present place of the pointer and counter, calculate the error between the set level and the present place, and run the PID controller to calculate the subsequent acquire worth that’s used to regulate the magnitude of the AC servo motor’s management winding voltage. This activity runs at 100 Hz.
- The third and ultimate activity is to generate the 2 channels of sine waves to regulate the motor. This activity runs at 40 kHz to output a sine wave that has been sampled at 100 discrete factors. This ends in 400 Hz sine wave outputs.
Person Enter Activity
The code for the person enter activity is proven beneath:
// run get command state machine to get a line of enter (non-blocking) GetCommand (); // as soon as a line of enter is obtained, course of it if (cmd_state == 2) { int index = 0; char *buffptr = strtok (cmd_buffer, ","); whereas (buffptr != NULL) { change (index++) { case 0: goal = pwl_interp (atof (buffptr)); goal = (goal > 4095) ? 4095 : goal; goal = (goal < 0) ? 0 : goal; printf ("goal = %dn", goal); break; } buffptr = strtok (NULL, ","); } cmd_state = 0; }
This code sits in the primary loop and runs the command interpreter state machine as typically as it may. As soon as a return (0x0d) is encountered within the enter stream, the command line is processed.
The primary worth entered on the command line is transformed to a floating level quantity representing the variety of tens of thousand of kilos to point on the indicator. For instance, coming into 10.3 can be interpreted as needing to place the pointer simply clockwise of the ten mark whereas shifting the counter to point 10.3.
This worth is transformed to the anticipated analog-to-digital studying for this location on the dial and counter utilizing a piecewise linear interpolation scheme and a sparsely populated desk of recognized kilos to A/D readings. Within the case of 10,300 kilos, the anticipated A/D studying can be 1338. This worth, 1338, turns into the set level for the PID controller.
PID Controller Activity
The PID controller activity runs at 100 Hz. The code is proven beneath:
//---------------------------------------- // run pid loop //---------------------------------------- // get a number of adc readings sum = 0; for (i = 0; i < 512; i++) { sum += adc_read (); } place = spherical (sum / 512.0); // calculate error error = goal - place; // calculate P time period pTerm = KP * error; // calculate I time period sumError += error * Ts; if (sumError > Imax*Ts) sumError = Imax*Ts; if (sumError <= -Imax*Ts) sumError = -Imax*Ts; iTerm = KI * sumError; // calculate D time period deltaError = error - lastError; lastError = error; currentFilterEstimate = (alpha*previousFilterEstimate) + (1-alpha)*deltaError; previousFilterEstimate = currentFilterEstimate; dTerm = KD * currentFilterEstimate / Ts; // add phrases collectively float newScale = pTerm + iTerm + dTerm; // saturate end result if (newScale > 1.0) newScale = 1.0; if (newScale < -1.0) newScale = -1.0; // replace velocity and route for core 1 ISR critical_section_enter_blocking (&scale_critsec); scale = newScale; critical_section_exit (&scale_critsec);
Each 10 ms, this code will get an A/D studying, calculates the error between the set level and the A/D studying, calculates and sums the P, I, and D phrases of the controller, saturates the end result, then safely writes the saturated end result to the sine wave generator activity utilizing a essential part.
The A/D studying truly consists of 512 A/D readings taken in speedy succession and averaged collectively. This removes noise within the potentiometer and A/D converter that may wreak havoc with the spinoff time period of the PID controller. These results will likely be mentioned within the subsequent part of this publish.
The error, error, is just the distinction between the set level, goal, and the precise place, place. The subsequent few strains calculate the P, I, and D phrases of the PID controller. These calculations rely closely on a bunch of constants outlined earlier within the file. The values of those constants are the results of tuning the PID controller and can fluctuate from system to system. Lastly, the sum of the P, I, and D phrases is saturated to a price between -1.0 and +1.0 and handed to the interrupt service routine that generates the sine waves.
Sine Wave Generator Activity
The sine wave generator duties runs at 40 kHz and generates a pair of 400 Hz sine waves utilizing a desk of 100 samples of a single full sine wave:
bool repeating_timer_callback_40kHz (struct repeating_timer *t) { uint16_t a; a = 0xB000 | ((uint16_t)dac0B << 4); gpio_put (SPI_CS0n_PIN, 0); spi_write16_blocking (SPI_IF, &a, 1); gpio_put (SPI_CS0n_PIN, 1); a = 0xB000 | ((uint16_t)dac1B << 4); gpio_put (SPI_CS1n_PIN, 0); spi_write16_blocking (SPI_IF, &a, 1); gpio_put (SPI_CS1n_PIN, 1); if (++sin_phase >= 100) { sin_phase = 0; } critical_section_enter_blocking (&scale_critsec); dac0B = 128+sine[sin_phase]; dac1B = 128+scale*sine[sin_phase]; critical_section_exit (&scale_critsec); return true; }
This code outputs the present worth of the sine waves to the DACs utilizing one of many Pico’s two SPI peripherals. It then updates the sine waves’ part modulo 100 because the sine wave consists of 100 factors. As soon as the part is up to date, it calculates the subsequent worth of the fixed-magnitude sine wave used to energy the AC servo motor and the subsequent worth of variable-magnitude sine wave used to regulate the AC servo motor. The calculations are performed inside a essential part in order that the PID controller can not write a brand new worth of scale whereas the interrupt service routine is utilizing it.
Placing it All Collectively
Within the photograph above, the Raspberry Pi Pico, adapter board, analog op amp & buffer board, and gas amount indicator are linked collectively. The purple, yellow, and black wires go to a bench provide set for ±12 V with the present restrict set at 150 mA. The yellow and orange wires join the Pico’s serial port to a Raspberry Pi 400’s serial port. The purple, blue, and black wires join the Pico’s SWD connector to the identical Rasppberry Pi for programming and debugging. A micro USB cable provides +5V energy to the Pico.
Outcomes
A video of my {hardware} and software program controlling the pointer and counter on a 747 gas amount indicator.
With some fantastic tuning, the venture labored! Two points had been encountered whereas constructing the venture. These points are documented beneath.
By-product Points
The spinoff time period of a PID controller is extraordinarily delicate to noise within the A/D converter readings. Once I used solely a single A/D studying per 100 Hz PID replace cycle, the spinoff time period would trigger the management worth calculated within the PID loop to quickly leap backwards and forwards between -1.0 and 1.0 despite the fact that the pointer was very close to or on the set level.
This resulted in excessive present consumption and the AC servo motor quickly shifting backwards and forwards and altering route with out actually shifting the pointer or counter a lot. Despite the fact that the pointer and counter appeared like they weren’t shifting, this was inflicting put on and tear on the AC servo motor and drive gears which had been shifting.
Averaging 512 samples collectively as proven within the code above eradicated the noise and the problems with the spinoff time period of the PID controller. The AC servo motor now all however stops shifting when the set level is reached.
Points Round 22,500 Kilos
The second situation couldn’t be solved. The potentiometer has a loud or lifeless spot round 22,500 kilos. This ends in the pointer and counter being a bit off from the set level when the set level is within the neighborhood of twenty-two,500 kilos. The issue is worse when approaching this area from one route than the opposite. Though I consider the plane this indicator got here from was dismantled for components, it’s doable this indicator was eliminated for this situation earlier than the ultimate decommissioning of the plane.
Conclusion
I might have most well-liked to function the gauge intact and with out everlasting modifications however given the excessive AC provide voltage, the variable capacitor sensor, and the shortage of the gauge’s mating mixed-contact connector, I didn’t deem this possible with the components and tools I had accessible. As a substitute, I hacked the gauge to interchange the conventional electronics with my electronics. In a future revision of this venture, I’d prefer to miniaturize my electronics in order that they’d match within the present gauge enclosure.
Downloads
The board design recordsdata and software program for this venture can be found within the 747 Fuel Gauge listing of my avionics repository on Github.
References
Boeing Aircraft Fuel Management
Boeing 747 RA001 Flight Deck Photos
How Does the Derivative Term Affect PID Controller Performance?