| Rotary Steerable System(RSS)is one of the essential tools for developing unconventional oil and gas resources in China.The system communicates with other drilling tools through a bus as an information transmission hub to realize the coordinated operation of the entire control system.However,the use of different bus protocols by drilling tools developed by different manufacturers or research institutions reduces the portability of the drilling tools.The Rotary Steerable System developed by our research group and the Measurement While Drilling(MWD)System designed by other manufacturers have the following problems in datacommunication:(1)heterogeneity between communication bus protocols.(2)lack of timestamps in data transmission.(3)high-reliability requirements for instruments and equipment in hightemperature and complex geological environments underground.In response to these issues,this research aims to design a protocol conversion module that meets the requirements of the system based on practical needs.The test-driven development technique is used for firmware code development of the protocol conversion module to avoid difficulties during traditional embedded software development.In this project,the functional requirements of the protocol conversion module between the two tools were proposed by studying the communication interaction process,bus heterogeneity,and traditional waterfall development between the RSS and MWD tools.The requirements were divided into transmission reliability,temperature and safety resistance,and software testability.Firstly,regarding transmission reliability,this paper studied the aspects such as transmission rate matching,command detection and diagnosis,and conversion mode selection.Then,a protocol conversion scheme was designed to meet the requirements of this project.Secondly,regarding temperature resistance and safety,this paper conducts hardware circuit design from the perspectives of chip selection and circuit protection.Thirdly,for software testability,the testdriven development method is used for software code development.The software is divided into the protocol conversion module and the real-time clock module,based on detailed software requirements analysis and modular design concept.Then,according to the test-driven development process,testing cases are written,coded,and refactored in a loop iteration to complete the development of functional code.Finally,by constructing a testing platform,we evaluated the software performance of the protocol conversion module by conducting unit testing and code coverage analysis.Then,the functionality of the protocol conversion module in normal and high-temperature environments was verified.The results indicate that the code test coverage of this study can reach 99%,and stable transmission is achieved in ambient and high-temperature environments,meeting the system’s functional requirements.This research project has achieved the protocol conversion function between the RSS and MWD tools.The innovation includes using the test-driven development method for software development,which effectively ensures the "low coupling,high cohesion" characteristics of the code while improving the testability and quality of the code. |