The Context
Petroleum and natural gas are bought and sold based on the amount of energy they deliver. Gas Chromatography (GC) systems are widely used in hydrocarbon processing facilities when high quality standards are to be met, or when rigid custody transfer standards are needed for trading. Gas Chromatography systems provide a one-stop solution to calculate the amount of energy delivered by the natural gas by determining the gas composition and molecular properties of the constituents. A leader in online analytical instrumentation entrusted Tismo with the end to end development of a portable Gas Chromatography system.
The Problem
Tismo’s client boasted one of the most extensive product lines in the online analytical instrumentation niche. The requirement was to undertake the complete design and development of a portable Gas Chromatography system. This system was to comprise a rugged Gas Chromatography module for the determination of the energy content in natural gas, a fully integrated sample handling system and enhanced data processing and reporting capabilities. Sample handling, signal processing, data analysis and report generation were to be managed within the unit to ensure accurate and repeatable analysis. The system was to be designed to work either as a stand-alone analyzer or mounted onto a vehicle. It would also have to be validated against the following standards:
- ISO 6568, 6569, 6976
- ASTM D3588, D1945
- GPA 2261, 2172, 2145, 2177
The Solution
Tismo undertook the end-to-end design and development of a portable Gas Chromatography system including electronics, firmware, software and mechanical engineering disciplines.
To reduce analysis time, a backflushing technique was adopted. This involved connecting 2 columns in series with a 10-port gas sampling valve. The first column was very short and the second column was 20 times longer. The lighter components would pass quickly through the first column and onto the second column, while the heavier components would remain in the first column. After a predetermined time period, known as backflush time, the valve would be actuated to backflush the heavy components to the TCD.
The system itself was designed as a dual processor architecture. A Process Control Board was responsible for Process management, Oven temperature control through PID and Data acquisition from the Gas Chromatography module. A Main Controller Board, running Windows Embedded OS, controlled the Data Acquisition and was also responsible for Data Analysis using Heuristic Algorithms. The Controller board also hosted the Human Machine Interface (HMI).
Related Read: Web App Control for Spectrophotometer
ELECTRONICS
The Main Controller Board supported the user interface including the graphic display and keypad, communication (Ethernet and USB) and storage. The Process Control Board connected the Gas Chromatography module to the user interface, acquired data from the Gas Chromatography module and was responsible for process management. A separate power supply module was designed to drive the various voltages and currents required for the system.
Since the Main Controller Board was primarily responsible for some of the standard features, the client had recommended a Commercial Off-the-Shelf (COTS) module. However, the Tismo team knew that a custom design would be more adept to cater to the features and characteristics of the chromatography module. The Tismo team worked closely with the client’s engineering team to demonstrate the advantages of a custom design in accurately determining energy content. Tismo also implemented an LCD color display to give the instrument a modern look and feel. Operating temperature range and sunlight visibility were the design considerations while choosing the display.
The Process Control Board’s main responsibilities included data acquisition and control, including the two channels of temperature control. Easy availability in small quantities and availability of low-cost development tools were the main concerns for the client in this respect. A 32 bit PIC microcontroller from Microchip was selected to abate the concerns. Two Thermal Conductivity Detectors (TCD) in bridge configuration were implemented and provided extremely high sensitivity, even for low concentrations of components. The Gas Chromatography system’s TCD bridge was balanced automatically before each analysis to ensure peak performance and repeatability. A 24-bit ADC was used for the TCD measurements and moving averages of these ADC values were calculated to eliminate noise in the signal.
FIRMWARE
The firmware orchestrated the entire control and measurement process in the Gas Chromatography System. The process management was divided into multiple tasks. The tasks themselves were implemented as state machines. The firmware was developed in the C/C++ programming language. A command handler was implemented to parse and process the commands received from the host and the responses to be sent to the host, were stored in a common buffer. The responses from the buffers were designed to be sent to the host by the Host communication subsystem, so as to make use of the fast DMA transfers from the buffer to the UART.
Oven temperature control was a major function of the firmware. Since the instrument design required all measurements to be done at a standard temperature, oven temperature control was critical. Tismo’s design took about 30 minutes to stabilize the oven temperature within ± 0.1 C. A PID Control loop was implemented to provide fast oven heating without overshoots and tight control of the PWM controlled heater.
The firmware was designed to send real time updates to the main controller as the chromatogram was being captured, over a serial link. Tismo also implemented a feature to enable firmware updates in the field, through a USB port. Diagnostic support was also enabled, so that operators and technicians could perform low-level diagnostics on peripherals. Power on Self Tests (POSTs) were implemented to check the hardware, the integrity of the firmware etc.
SOFTWARE
The software was implemented on the Controller board, running Embedded Windows. It was responsible for the control of the integrated sample handling system, the Gas Chromatography module and the data processing/handling capabilities of the system. It also calculated the amount of energy per unit of natural gas in British Thermal Unit (BTU), relative density and compressibility using the AGA8 method. The system also analyzed the composition of the natural gas with exceptional accuracy. Oven temperature was precisely controlled, eliminating errors caused by ambient temperature fluctuations. The system supported a variety of functions including calibration, diagnostics, report generation, out-of-range alarms etc. The software enabled sample results, including real-time chromatograms, raw data information, analysis reports and calibration data to be easily viewed on the LCD display. System and analysis reports could be retrieved via a USB port, customized to meet user requirements.
Tismo designed a modular software using C# over .NET framework for Embedded Windows. The Test Run module was responsible for starting and stopping tests, and collecting the test run data from the process control board. The Results module identified peaks with the help of calibrated retention times for each gas. Peaks were detected by identifying the start, peak and end TCD values and checking the slopes at each point in the data set. The module detected the completion of test runs, computed the gas peak areas and performed complete analysis of the data, for the test run. The area under the peak was calculated after baseline correction. The Results module was also responsible for writing the results to a file, which could be read later by the User Interface(Report Screens) to display specific sets of information on different screens.
The Calibration module ran tests using the Test Run Subsystem classes and compared the Test results with calibration data. Depending on the settings, it would determine the Calibration Response Factor.
Also Read: Web HMI based Control Software for Industrial Gas Analyzer
MECHANICAL DESIGN
Tismo’s mechanical design team implemented a robust design for the Gas Chromatography system, rugged enough to be carried on trucks and vans. The designs met the stringent Finite Element Analysis (FEA) specifications. In the interest of managing costs, an IP67 compliant mechanical enclosure was sourced from a third-party manufacturer. As per the IP67 requirements, the unit was ‘dust-tight’ and could be dropped into a body of water up to a meter deep for half an hour, without compromising the enclosed equipment. The design was easy to maintain, in that some of the parts that required periodic servicing could be changed with ease. The production and assembly times were also reduced significantly by using consistently designed parts and sub-assemblies which also helped reduce the overall cost.
TESTING / VERIFICATION
An elaborate laboratory test setup, consisting of all the necessary gas lines and equipment with safety measures, was set up to test the completely assembled system. The system was tested using multiple samples. The measurement and computation were validated against the known values of reference samples. Tismo undertook repeatability testing for the Gas Chromatography system, so as to ensure that the process gave consistent results, without external intervention. A golden sample was used for this testing, along with a client provided Gas Chromatography instrument, for result comparison.
Summary
Tismo completed the end to end product engineering of a portable Gas Chromatography system. Five prototypes were produced, that combined an integrated sample handling system, gas chromatography module, and data processing/handling capabilities. The instrument determined the energy content, relative density, and compressibility of natural gas, based on industry-standard calculation methods. Sample handling, signal processing, data analysis and report generation were managed within the unit to ensure accurate, repeatable analysis. Results could be viewed on the LCD and reports could be retrieved via a USB port.
Tismo recently carried out an exploratory study to assess the viability of Machine Learning on Embedded Systems. The ML model was deployed on the Gas Chromatography system mentioned above. Machine Learning was found to enhance accuracy and make the study robust to process variations.