| The rotary steerable system is one of the essential tools for unconventional oil and gas field exploration and development in China.The system requires its main controller to achieve communication,control,measurement,and recording functions during drilling processes.Traditional main controllers do not use operating systems and often rely on interrupt service routines for multitasking scheduling.However,many interrupts can consume significant CPU processing time,potentially leading to unpredictable task scheduling and a high load on the main controller to avoid these issues in the design of the main controller of the rotary steerable system.Therefore,this study proposes to use the FreeRTOS operating system for software design.Firstly,technical specifications were formulated based on the analysis of system functional requirements,and the TMS320F28335 digital signal processor(DSP)was determined as the main controller.Next,an overall software scheme based on FreeRTOS was designed.Secondly,modular design was applied to all system subsystems according to the system requirements and overall design.The real-time operating system FreeRTOS was further ported to the main controller,and the software design of the main controller was completed through system porting and configuration.The functionality of load rate calculation was designed for each task.Finally,functional,performance and load rate tests were carried out on the main controller in standard and high-temperature environments.The test results show that in terms of performance,the task preemption time and task switching time were less than 20μs,and all tasks could respond within the set time.In terms of functionality,all specified tasks were completed during the comprehensive functional testing.In terms of load rate,the idle load rate of the system was around 83% in both standard and high-temperature environments.This study has completed the design of the main controller for a rotary steerable system based on FreeRTOS through requirement analysis,metric analysis,solution formulation,task design,system porting,and testing validation.The innovative application of the main controller for intelligent drilling equipment has effectively reduced the load rate of the main controller while ensuring the predictability of system task scheduling.Furthermore,the design of the main controller for the rotary steerable system provides insights into the programming of main controllers for underground intelligent equipment in China.Also,it contributes to ongoing experimentation with the application and design of real-time operating systems. |