Design of ammonia leakage online monitoring system based on tunable diode laser absorption spectroscopy

A real-time online ammonia volume fraction monitoring system based on tunable diode laser absorption spectroscopy (TDLAS) is designed to meet the demand for ammonia gas leakage monitoring in ammonia-fueled ships. The system uses a 1, 512 nm distributed-feedback (DFB) laser as the light source and a 5 m high-temperature Boss-Gas-Cell as the absorption cell. By applying a 4 Hz scan signal and a 31.4 kHz modulation signal to the laser current, the effective absorption signal of the gas is transferred to the high-frequency band, then the second harmonic (2f) signal about gas volume fraction is extracted by a digital lock-in amplifier from the gas absorption signal, and ammonia volume fraction can be calculated from the amplitude of 2f signal. The test results show that the ammonia detection accuracy in the range of 0-500 ppm can reach ±1% FS, the response time is less than 30 s, and the system measurement repeatability is less than 1%, which meets the needs of ammonia leakage monitoring in ammonia-fueled vessels.


Introduction
As a zero-carbon energy carrier, ammonia, with the advantages of high energy density, and convenience in manufacturing, storage, and transportation, can be used in fuel cells with the development of existing technologies.To reduce the climate impact of shipping, ammonia fuel has recently received a lot of attention [1] .However, ammonia is a kind of flammable, explosive, and toxic gas, and ammonia leakage will bring about safety problems such as poisoning and explosion.Therefore, designing a fast, safe, and effective ammonia leakage monitoring system is of great significance for the promotion and application of ammonia fuel.
Existing ammonia gas detection methods mainly include electrochemistry, non-dispersive infrared (NDIR), and tunable laser diode absorption spectroscopy (TDLAS), etc.Compared with the optical class of detection methods, the traditional electrochemical sensors of ammonia have poor immunity to interference, poor stability, and a short life span [2] .As one of the optical detection methods, the NDIR sensor has a simple structure and low cost, but the detection accuracy and detection limit are relatively poor, due to its broadband light source, and it only has good detection performance for specific gases, such as CO2 and CH4.TDLAS utilizes the narrow-band absorption characteristics of gases and offers good specificity and sensitivity necessary to investigate the concentration of gas, with a single-wavelength laser as the light source.Therefore, this paper designs an ammonia leakage monitoring system based on the TDLAS principle according to the requirements of China Classification Society's "Guidelines for the Application of Ammonia Fuel in Ships", which is characterized by high accuracy, fast response, and good repeatability and meets the ammonia leakage monitoring needs of ammonia-fueled vessels.

Principle
The basic principle of tunable laser absorption spectroscopy is Lambert-Beer law, which states that gas molecules have absorption properties for light of a specific wavelength.When a laser light with an intensity of ‫ܫ‬ and wavelength of ߣ is absorbed by the gas, its intensity becomes ‫ܫ‬ .The mathematical relationship between them is as follows: where C is the gas volume fraction, ߙ(ߣ) is the gas absorption coefficient, and L is the optical path length.The gas absorption coefficient can be expressed as: where S is the line intensity of the gas absorption spectrum and ߮(ߣ) is the normalized line shape function.For a given absorption line of a gas molecule, the absorption line strength S is only related to the gas temperature.The normalized line shape function ߮(ߣ) describes the broadening form of absorption spectral lines, which can be divided into natural broadening, collision broadening, and Doppler broadening, according to the reason of the formation of broadening.The collision broadening of molecules dominates at room temperature and normal pressure, and the line shapes are determined by the Lorentzian line shapes [3][4][5][6] .Therefore, after selecting the absorption spectral lines of the gas molecules, the gas volume fraction can be inverted according to Formula (1), by measuring the light intensity change before and after the absorption by gas and the optical length of the gas absorption.

Harmonic detection
The methods of detecting gas volume fraction using laser absorption spectroscopy can be categorized into direct absorption spectroscopy (DAS) method and harmonic detection method.The DAS method measures the attenuation of the laser light intensity before and after absorption by the gas by superimposing a low-frequency scanning signal on the laser driver current and obtaining the absorption peak signal of the gas.This method can directly obtain the gas concentration through the calculation of known parameters, without calibration, but it is very sensitive to system noise and has low detection sensitivity.The harmonic detection method modulates the wavelength of the laser by superimposing a high-frequency modulation signal and a low-frequency scan signal on the laser driver current.This method shifts the gas absorption signal to the high-frequency band for processing, extracts the harmonic signal which contains the gas concentration information through phase-locked amplification technology, and removes system low-frequency noise to improve the detection sensitivity of the system [7][8][9][10][11][12] .

System design
The ammonia leakage online monitoring system is mainly composed of the light source, absorption cell, sampling pump, control board, and serial port screen, and the system structure block diagram is shown in Figure 1.The control board generates the laser drive signal and modulates the laser wavelength, and the modulated laser is reflected several times in the absorption cell and absorbed by the target gas.The outgoing light is converted into the photo-current signal by the photoelectric detector and sent to the control board for processing, which extracts the harmonic signal, inverts the gas volume fraction, and is displayed on the serial port screen.The pump is used to extract the target gas to ensure the flow of gas in the absorption cell.

Laser
Cell Detector

Light source selection
The absorption peaks of ammonia in the entire infrared band can be found in the HITRAN database [13] .Among them, the absorption spectral line intensity of ammonia in the mid-infrared band is the largest, but the lasers in the mid-infrared band are expensive and bulky.The lasers in the near-infrared band have been commercialized on a large scale, which is cheap and easy to use.Although the absorption intensity is reduced, high-precision gas detection can also be achieved by increasing the optical path.Therefore, a 1, 512 nm DFB laser is selected as the light source for the ammonia leakage monitoring system.

Absorption cell selection
According to the system's detection range of 0-500 ppm and accuracy of ± 2% FS, as well as the absorption line strength of ammonia at 1, 512.2 nm, the minimum optical path of the gas absorption is approximately 1 meter.In addition, considering the strong adsorption of ammonia, to ensure the response time of the system, the absorption cell needs to be heated, so the 5-meter high-temperature Boss-Gas-Cell from Xuhai optoelectronics is selected as the absorption cell of the system.The optical path of this absorption cell is 5 meters.It is small in size, integrates the laser interface and photoelectric detector, and does not require light, which is also easy to use.

Design of the control board
The control board of the ammonia leakage online monitoring system includes generating a laser driver signal, controlling the temperature stability of the laser, collecting the photo-current signal from the detector, extracting the harmonic signal, inverting the gas concentration, and driving the serial screen.
The TDLAS control board from Weirui Technology is used to output the laser driver signal, collect the detector signal, and extract the second harmonic signal.The laser modulation parameters are debugged by its supporting software.The frequency of the saw-tooth scanning signal is set to 4 Hz, and the frequency of the sinusoidal modulation signal is set to 31.4 kHz.The drive circuit of the laser TEC module is designed based on the microcontroller of GD32F103xx and the MAX8521 chip to realize the setting and stability of the laser temperature.The second harmonic signal output by the TDLAS control board is collected by the ADC module inside the microcontroller.To ensure the stability of the sampling, a 100 Hz analog low-pass filter is added in front of the ADC input port, which effectively reduces the noise in the harmonic signal and improves the sampling accuracy.The circuit block diagram of the control board is shown in Figure 2.

Design of software
The flow chart of the control board driver designed based on GD32F103 is shown in Figure 3.After power-on, the peripheral modules of the microcontroller are initialized, and then the ADC is started to collect the voltage on the NTC resistor in the laser, calculate the current temperature of the laser, and compare it with the set value of temperature.The DAC output voltage is calculated by the PID algorithm to control the MAX8521 to adjust the working current of the TEC of the laser to stabilize its temperature at the set value.Timer 3 is used to update the serial screen data every second.If the serial port receives the command data from the serial screen, the instruction response program will be launched.The second harmonic signal is collected by ADC + Timer trigger + DMA.Channel 1 of Timer 1 outputs a 1 kHz PWM as the trigger source of ADC sampling, controlling ADC to collect 1, 000 samples of harmonic signal voltages every second and directly store them in the DMA buffer.
When the DMA transmission is completed and the interrupt is triggered, the sampling is completed.The maximum and minimum values of the sampling data are found and the harmonic peak value is calculated.According to the calibration coefficient, the gas volume fraction is calculated.The above program is executed recursively.

Initialize
The ADC acquires laser temperature

Test methods
A dynamic gas mixing device was built by using the flow meter from Sevenstar, which is used to prepare test gas for the ammonia online monitoring system.The test arrangement is shown in Figure 4. Dalian special gases produced 500 ppm ammonia standard gas and high-purity nitrogen as the gas source.Ammonia standard gas with 0 ppm, 100 ppm, 200 ppm, 300 ppm, 400 ppm, and 500 ppm were respectively prepared to calibrate the output of the ammonia online monitor.A triple-fitting curve was used to obtain the calculation relationship between the harmonic peak value and the gas concentration, as shown in Figure 5.Then, the calibration coefficient was set through the serial screen, and the calibration was completed.

Test results
After calibration, the ammonia sample gas used in calibration was prepared by the dynamic gas mixing device to test the detection indicators of the ammonia online monitoring system.The measured results of ammonia volume fraction within the range of 0-500 ppm are shown in Table 1.Among all the test concentration points, the maximum measurement error is 2.5 ppm, which is less than ± 1% FS (5 ppm) and meets the design requirements.The response time of the ammonia online monitoring system was tested by using 500 ppm standard gas, and the test results are shown in Figure 6.The system response time (T90) is 22 s.In a short period, 200 ppm standard gas was repeatedly measured 10 times, the average measured value was 201.6 ppm, and the measurement standard deviation was 0.56 ppm.The system measurement repeatability was calculated to be 0.28%.

Experimental conclusion
The above test results show that the measurement accuracy, response time, and measurement repeatability of the ammonia online monitoring system meet the design requirements and can realize real-time online monitoring of ammonia leakage on ammonia-fueled ships.

Conclusions
This paper aims to monitor demand for ammonia gas leakage in ammonia-fueled ships.Based on TDLAS technology, we designed an ammonia online monitoring system.It described the system composition and design ideas in detail, and proved through standard gas testing that the detection indicators of the system for ammonia gas meet the design requirements.However, in the test, the system calibration and testing only used 6 concentration points.If the system response is linear, the method will be correct.However, the response of the infrared absorption signal is nonlinear, especially in the low concentration range (below 10 ppm), limited by the detection sensitivity of the system, the measurement results have a large deviation, which can be improved by increasing the calibration data points.

Figure 1 .
Figure 1.Block diagram of system structure.

Figure 2 .
Figure 2. Block diagram of control board circuit.

Figure 3 .
Figure 3. Program flow chart of GD32 control unit system tests.

Figure 4 .
Figure 4. Experimental layout.Dalian special gases produced 500 ppm ammonia standard gas and high-purity nitrogen as the gas source.Ammonia standard gas with 0 ppm, 100 ppm, 200 ppm, 300 ppm, 400 ppm, and 500 ppm were respectively prepared to calibrate the output of the ammonia online monitor.A triple-fitting curve was used to obtain the calculation relationship between the harmonic peak value and the gas concentration, as shown in Figure5.Then, the calibration coefficient was set through the serial screen, and the calibration was completed.

Figure 5 .
Figure 5. Fitting curve of harmonic peak value and gas volume fraction.

Figure 6 .
Figure 6.Response time test.In a short period, 200 ppm standard gas was repeatedly measured 10 times, the average measured value was 201.6 ppm, and the measurement standard deviation was 0.56 ppm.The system measurement repeatability was calculated to be 0.28%.