Robot main controller system based on STM32 microcontroller platform

By utilizing the multi-threaded task scheduling architecture and adaptive dynamic threshold interrupt triggering mechanism of the STM32 microcontroller platform, the problems of insufficient response delay and anti-interference capability of the main controller system of the live-line maintenance robot are solved, and the efficient and stable operation capability under high-voltage environment is achieved.

CN121541516APending Publication Date: 2026-02-17FUJIAN ELECTRIC POWER CO LTD XIAMEN ELECTRIC POWER SUPPLY CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511526354.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing main controller systems for live-line maintenance robots suffer from problems such as response delay, low resource utilization, and insufficient anti-interference capability in multi-task processing, real-time communication, and status monitoring, making it difficult to meet the real-time and safety requirements in high-voltage electromagnetic environments.

Method used

It adopts a multi-threaded task scheduling architecture based on the STM32 microcontroller platform, integrates a high-precision status monitoring module and an adaptive dynamic threshold interrupt triggering mechanism, and combines an embedded real-time operating system and a multi-threaded scheduling mechanism to optimize multi-task scheduling, improve communication efficiency, and enhance anti-interference capabilities.

Benefits of technology

It significantly improves the robot's operational reliability and real-time control performance in environments with strong electromagnetic interference, enhances the system's anti-interference capabilities and operational safety, and ensures efficient and stable operation under high-pressure environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121541516A_ABST
    Figure CN121541516A_ABST
Patent Text Reader

Abstract

The invention provides a robot main controller system based on an STM32 microcontroller platform, and the system comprises a state monitoring module which is configured to collect the electromagnetic interference intensity value of an environment, the force feedback data of the system, and the battery voltage, current, capacity, joint angle and torque data of a robot in real time; the processing module is configured to dynamically calculate an adaptive factor based on the historical interference data; dynamically adjusting a preset basic abnormal threshold value by using the adaptive factor and an electromagnetic interference intensity value acquired in real time to obtain a dynamic threshold value; comparing an electromagnetic interference intensity value acquired in real time with the dynamic threshold value, and judging whether the force feedback data exceeds a preset force feedback threshold value or not; when the electromagnetic interference intensity value collected in real time is larger than a dynamic threshold value or the force feedback data exceeds a preset force feedback threshold value, abnormal processing is triggered, and the abnormal processing comprises the steps of adjusting the priority of system threads in a grading mode, pausing non-key threads and switching to a preset safety mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of robot control technology, specifically relating to a robot main controller system based on the STM32 microcontroller platform. Background Technology

[0002] Live-line maintenance of high-voltage transmission lines is a crucial aspect of power system maintenance. To reduce the risks of manual operations and improve efficiency, live-line maintenance robots have become key equipment. The main controller system, as the core of the robot, is responsible for coordinating the movement of the multi-degree-of-freedom robotic arm, real-time acquisition and feedback of sensor data, and communication with the host computer. Existing live-line maintenance robot main controller systems are typically built on microcontrollers or embedded processors, employing a single task scheduling mechanism to handle tasks such as walking, securing, and monitoring.

[0003] However, existing main controller systems suffer from significant response latency issues in multitasking. Due to the lack of an effective multi-threaded scheduling mechanism, when the robot simultaneously performs tasks such as bolt positioning, force feedback adjustment, and posture stabilization, frequent task switching leads to CPU resource contention and excessively long response times. This fails to meet the stringent real-time requirements of high-voltage electromagnetic environments, consequently affecting the accuracy and safety of the robotic arm's end effector. Specifically, most existing systems employ bare-metal programs or simple foreground / background loop architectures, lacking priority differentiation and resource isolation mechanisms between tasks. When the robot performs delicate operations requiring multi-axis coordination, such as bolt tightening, simultaneous processing of sensor data acquisition or communication command parsing often results in task blocking, causing fluctuations in the motion control cycle and making it difficult to guarantee the stability and accuracy of the robotic arm's end effector trajectory.

[0004] Furthermore, in terms of real-time communication, existing systems suffer from low resource utilization. Communication modules largely rely on polling to process host computer commands and video stream data, which easily leads to data packet loss or delays. This is especially problematic when the wireless transmission link is unstable, resulting in inefficient parsing and distribution of control commands, consuming excessive processor cycles, and further exacerbating multitasking conflicts. Existing communication protocols often fail to adequately consider the impact of electromagnetic interference on data transmission stability under high-voltage environments, lacking dynamic bandwidth allocation and retransmission mechanisms. When video stream data and control commands share the same channel, effective quality of service (QoS) grading is not implemented, causing delays in critical control information and affecting the timeliness of system response.

[0005] Meanwhile, in terms of condition monitoring, existing systems lack sufficient anti-interference capabilities. Sensor data acquisition is susceptible to strong electromagnetic fields, and the lack of closed-loop filtering and abnormal interruption mechanisms results in high noise levels in monitoring data, untimely feedback, and an inability to effectively warn of center of gravity shifts or abnormal preload, increasing the risk of robot tipping over or operational failure. Existing solutions often use simple comparison methods with fixed thresholds to trigger protection, which is difficult to adapt to the complex and variable electromagnetic environment around high-voltage lines. In terms of sensor selection and signal conditioning circuit design, the ability to suppress common-mode interference and transient pulses is generally insufficient, affecting the measurement accuracy of key parameters such as current and torque, thereby reducing the control precision and reliability of the system.

[0006] These shortcomings limit the overall performance of existing live-line maintenance robot main controller systems, making it difficult to achieve efficient and stable on-line inspection and bolt tightening operations. There is an urgent need for a robot main controller system and method that optimizes multi-task scheduling, improves communication efficiency, and enhances anti-interference capabilities. Summary of the Invention

[0007] To address the shortcomings and deficiencies of existing technologies, this invention provides a robot main controller system and method, particularly suitable for live-line maintenance operations on high-voltage transmission lines. The system effectively solves the resource contention and response latency issues during concurrent multi-task execution by constructing a multi-threaded task scheduling architecture based on an embedded real-time operating system. The system integrates a high-precision status monitoring module to collect real-time data on environmental electromagnetic interference intensity, force feedback, and robot posture. It innovatively employs an adaptive dynamic threshold interrupt triggering mechanism: by analyzing historical interference data, it dynamically calculates adjustment factors and accordingly corrects preset base thresholds in real time, forming a dynamic threshold that adaptively adjusts with changes in the electromagnetic environment. When real-time interference exceeds this threshold or force feedback data is abnormal, the system immediately triggers a tiered interrupt, dynamically adjusts thread priorities, and switches to a safe mode. The system also includes a modularly designed upper and lower computer interaction interface, supporting real-time display of multiple high-definition video streams and precise control of the robotic arm. This invention significantly improves the robot's operational reliability, control real-time performance, and system anti-interference capability in environments with strong electromagnetic interference.

[0008] In a further preferred design, the system is based on an STM32 microcontroller with an ARM Cortex-M4 core, supporting floating-point arithmetic units and digital signal processor instruction sets. It is paired with the μC / OS embedded real-time operating system and uses a multi-threaded scheduling mechanism to create communication threads, status monitoring threads, and motion control threads. Thread synchronization is achieved using semaphores and mutexes, ensuring the motion control thread response time is less than 10ms, effectively optimizing multi-task processing efficiency. Its status monitoring module integrates Hall effect sensors, inertial measurement sensors, position detection sensors, and a Hall coulomb meter, enabling real-time acquisition of environmental electromagnetic interference intensity values, system force feedback data, and robot battery voltage, current, capacity, joint angle, and torque data, providing multi-source data support for subsequent processing. Regarding anomaly handling, the system calculates an adaptive factor based on historical electromagnetic interference data and dynamically adjusts a preset basic anomaly threshold based on real-time acquired electromagnetic interference intensity values ​​to obtain a dynamic threshold adapted to the current environment. Simultaneously, it checks whether the force feedback data exceeds the preset threshold; if any condition is met, anomaly handling is triggered, including tiered adjustment of thread priorities, pausing non-critical threads, and switching to a preset safety mode, significantly enhancing anti-interference capabilities and operational safety. In addition, the system supports serial port, Ethernet, and wireless communication protocols, enabling bidirectional data transmission between the main controller, the host computer, and external devices. The transmitted content includes real-time status information, control commands, and video stream data. The accompanying host computer interaction system, developed in C++ under the QT Creator environment, supports three-channel high-definition stream display and scaling functions. It features a main interface with real-time power display and motion control functions, and a settings interface with device IP address and port number settings, further enhancing the convenience of human-machine interaction and operational controllability. Corresponding anomaly handling methods are adapted to the system architecture. Through data acquisition, factor calculation, threshold adjustment, dual judgment, and anomaly response steps, the system ensures efficient and stable robot operation under high-pressure environments. Simultaneously, anomaly logs are recorded via non-volatile memory, providing a basis for subsequent system parameter optimization.

[0009] The present invention specifically employs the following technical means:

[0010] A robot main controller system, comprising:

[0011] The status monitoring module is configured to collect the electromagnetic interference intensity value of the environment, the force feedback data of the system, and the battery voltage, current, capacity, joint angle, and torque data of the robot in real time.

[0012] The processing module is configured as follows:

[0013] An adaptive factor is dynamically calculated based on historical interference data.

[0014] Using the adaptive factor and the real-time collected electromagnetic interference intensity value, a preset basic anomaly threshold is dynamically adjusted to obtain a dynamic threshold.

[0015] The real-time collected electromagnetic interference intensity value is compared with the dynamic threshold, and it is determined whether the force feedback data exceeds the preset force feedback threshold.

[0016] When the real-time collected electromagnetic interference intensity value is greater than the dynamic threshold, or the force feedback data exceeds the preset force feedback threshold, anomaly handling is triggered. The anomaly handling includes adjusting the system thread priority in stages, pausing non-critical threads, and switching to a preset safety mode.

[0017] Furthermore, the processing module includes a microcontroller and an embedded real-time operating system running thereon.

[0018] Furthermore, the microcontroller is an STM32 microcontroller based on the ARM Cortex-M4 core.

[0019] Furthermore, the embedded real-time operating system is μC / OS, and the system also includes a host computer interaction system; the host computer interaction system is developed in the QT Creator environment based on the C++ language, supports three-channel high-definition bitstream display and scaling functions, includes a main interface with real-time power display and motion control functions, and a settings interface with IP address and port number settings for the camera, control board, and robotic arm.

[0020] And, an anomaly handling method for a robot control system, comprising:

[0021] Real-time acquisition of environmental electromagnetic interference intensity values ​​and system force feedback data;

[0022] An adaptive factor is dynamically calculated based on historical interference data.

[0023] Using the adaptive factor and the real-time collected electromagnetic interference intensity value, a preset basic anomaly threshold is dynamically adjusted to obtain a dynamic threshold.

[0024] The real-time collected electromagnetic interference intensity value is compared with the dynamic threshold, and it is determined whether the force feedback data exceeds the preset force feedback threshold.

[0025] When the real-time collected electromagnetic interference intensity value is greater than the dynamic threshold, or the force feedback data exceeds the preset force feedback threshold, anomaly handling is triggered. The anomaly handling includes adjusting the system thread priority in stages, pausing non-critical threads, and switching to a preset safety mode.

[0026] Furthermore, the adaptive factor is calculated by subtracting the ratio of the most recent average disturbance value to the upper limit of the system design from 1, and the value range is between 0 and 1.

[0027] Furthermore, the basic anomaly threshold is an initial interruption threshold preset based on engineering experience, denoted as T0; combining the adaptive factor α, the basic anomaly threshold T0, and the real-time collected electromagnetic interference intensity value E, the dynamic threshold is equal to T0×[1+α×(E-T0) / T0].

[0028] Furthermore, when an exception is triggered, the method also includes: recording an exception log to a non-volatile memory. The exception log includes real-time electromagnetic interference intensity values, force feedback data, and thread priority adjustment records, which are used for subsequent iterative optimization of system parameters.

[0029] Furthermore, the method operates in a multi-threaded environment of an embedded real-time operating system, the multi-threaded environment including at least:

[0030] A status monitoring thread responsible for collecting electromagnetic interference intensity values, force feedback data, and battery voltage, current, and capacity data;

[0031] Action control threads that are subject to priority adjustment and have a response time of less than 10ms;

[0032] A communication thread used for transmitting data and instructions.

[0033] And a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method described above.

[0034] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0035] Compared to existing technologies, this invention and its preferred solution effectively solve the response latency problem in multi-task processing of existing systems by adopting a multi-threaded architecture combining a high-performance microcontroller platform and an embedded real-time operating system. This achieves priority scheduling and resource isolation for critical tasks, thereby improving the robot's operational stability and real-time performance in high-voltage electromagnetic environments. The status monitoring module integrates multi-source sensors to collect electromagnetic interference, force feedback, and robot posture data in real time. Combined with an adaptive dynamic threshold interrupt triggering mechanism, it can intelligently adjust the anomaly judgment criteria based on historical interference data, significantly enhancing the system's adaptability and anti-interference capability to complex electromagnetic environments and avoiding false triggering or sluggish response caused by fixed thresholds. The communication module supports bidirectional data transmission of multiple protocols, optimizing the efficiency of instruction parsing and video stream processing, and reducing data packet loss and latency. Simultaneously, the modular design of upper and lower computer collaboration simplifies the operation interface and improves the visualization and controllability of operations. Overall, this invention improves automation and efficiency while ensuring the safety of live-line maintenance operations.

[0036] In further optimized design, a combined architecture of a high-performance STM32F407IGT6 microcontroller and UCOS embedded real-time operating system was adopted to achieve efficient scheduling and priority management of multi-threaded tasks. This allows for priority response to critical control tasks, effectively improving the system's real-time performance and stability under complex working conditions. The communication module supports bidirectional data transmission via serial port, Ethernet, and wireless communication protocols. Combined with a thread synchronization mechanism using semaphores and mutexes, data transmission conflicts are reduced, enhancing the reliability of interaction with the host computer and external devices. The status monitoring module integrates multiple sensor interfaces, comprehensively collecting data such as battery status, joint angles, torque, and posture, providing rich real-time information support for system control and anomaly diagnosis. The motion control module communicates with the CAN bus via PWM signal output, achieving precise control of the robot's multi-degree-of-freedom motion, meeting the motion execution requirements in complex work scenarios. The anomaly handling mechanism introduces an adaptive threshold adjustment strategy based on historical data, combined with force feedback anomaly monitoring, which can dynamically trigger graded response measures, improving the system's anti-interference capability and operational safety in environments with strong electromagnetic interference. The host computer interaction system is based on QT. The Creator environment development, through modular design and multi-interface functional division, provides intuitive real-time status display, equipment parameter configuration and robotic arm control functions, reducing the complexity of manual operation and providing an efficient human-machine collaboration platform for remote robot operation. Attached Figure Description

[0037] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0038] Figure 1 This is a flowchart of the main controller program in an embodiment of the present invention.

[0039] Figure 2 This is a diagram of the main interface of the host computer system according to an embodiment of the present invention.

[0040] Figure 3 This is a diagram of the host computer system settings interface according to an embodiment of the present invention.

[0041] Figure 4 This is a diagram of the robotic arm control interface of the host computer system in an embodiment of the present invention.

[0042] Figure 5 This is a system architecture diagram of an embodiment of the present invention. Detailed Implementation

[0043] In the following, specific embodiments of this application will be described in detail with reference to the accompanying drawings. Based on these detailed descriptions, those skilled in the art will be able to clearly understand and implement this application. Without departing from the principles of this application, features from various embodiments can be combined to obtain new implementations, or certain features from some embodiments can be substituted to obtain other preferred implementations.

[0044] In view of the problems of response delay, low resource utilization, and insufficient anti-interference capability of existing main controller systems for live-line maintenance robots in terms of multi-task processing, real-time communication, and status monitoring, this invention is proposed. Its implementation scheme includes a main controller module, a communication module, a status monitoring module, a motion control module, and a UCOS embedded real-time operating system. The main controller module uses an STM32F407IGT6 microcontroller as the core processor, supporting floating-point arithmetic and DSP instruction sets. The communication module supports serial port, Ethernet, and wireless protocols. The status monitoring module integrates Hall sensors and gyroscopes to collect real-time data on battery status, joint angles, and attitude. The motion control module controls the movement of the walking rollers, lifting slide, electric wrench, and six-degree-of-freedom robotic arm via PWM and CAN bus. It also includes a host computer interaction system that supports multi-channel high-definition stream display and modular interface operation. This invention improves system stability and response speed, and enhances the safety and efficiency of live-line maintenance operations through multi-threaded priority preemption, PID adjustment, and semaphore synchronization.

[0045] The solution provided by this invention specifically includes:

[0046] In a first aspect, the present invention provides a robot main controller system based on the STM32 microcontroller platform, comprising: a main controller module, a communication module, a status monitoring module, a motion control module, and an embedded real-time operating system;

[0047] The main controller module uses the STM32F407IGT6 microcontroller as the core processor, which has a high-performance ARM Cortex-M4 core and supports floating-point arithmetic units and digital signal processor instruction sets to process robot multi-degree-of-freedom motion, force feedback signals and visual auxiliary data.

[0048] The embedded real-time operating system is the UCOS micro real-time operating system, which is responsible for task scheduling, thread management and resource allocation. It supports multi-threaded concurrent execution and enables priority response of critical tasks by setting thread priorities.

[0049] The communication module is used to realize bidirectional data transmission between the main controller and the host computer and external devices. It supports serial port, Ethernet and wireless communication protocols. The data transmission content includes real-time status information, control commands and video stream data.

[0050] The status monitoring module integrates sensor interfaces for Hall current and voltage sensors, gyroscopes, accelerometers, and encoders to collect battery voltage, current, capacity, joint angle, torque, and attitude data in real time, and feeds them back to the main controller in the form of array packages.

[0051] The motion control module connects the motor driver and servo actuator, supports PWM signal output and CAN bus communication, and controls the movement of the robot's walking rollers, lifting slide, electric wrench and six-degree-of-freedom robotic arm, involving multiple relative motion actions.

[0052] The relative motion actions include: the forward, backward, and stop movement of the traveling rollers; the rise, fall, and stop movement of the slide; and the forward, reverse, and stop movement of the electric wrench.

[0053] As a preferred embodiment of the present invention, it further includes: a host computer interaction system, which is developed and written in C++ under the QT Creator environment, and has a human-machine interface designed for bolt tightening operations; the host computer interaction system adopts three high-definition streams and supports zooming in and out functions; the main interface includes real-time power display, motion control functions for the trolley motor and lifting slide; the settings interface includes settings for changing the IP address, username, password, and port number information of the three cameras, setting the connection IP address and port number of the control board, setting the IP address and port number of the robotic arm, and setting the minimum motion adjustment angle of each joint of the robotic arm; the robotic arm motion control interface can switch between the three camera images and can simultaneously display two high-definition images, including resetting the robotic arm, executing preset actions, fine-tuning the six robotic arm joints, controlling the up, down, left, right, forward, and backward movements of the robotic arm's end joints, starting and emergency stop control of the electric wrench of the end tool, and the coordinates of the robotic arm's end can be displayed in real time in the lower right corner.

[0054] As a preferred embodiment of the present invention, the host computer interaction system adopts a modular approach, and the software system is composed of a communication module, a user data module, an image display module, and a motion control module.

[0055] The communication module sends control commands to the main controller through functions in the SDK library via the serial communication protocol, which is used to control the operation of each motor and complete the bolt tightening task.

[0056] The user data module is responsible for displaying the robot's real-time status information on the host computer interface, including: the robot's robotic arm pose, joint angles, power battery voltage and capacity display. The UI design uses a label module to display the collected data values ​​in real time and continuously update them.

[0057] The image display module mainly collects and displays the image information from three cameras. By displaying it on the host computer, it is convenient for operators to control the robot's robotic arm movements. First, the SDK is initialized, binding the camera's IP address, port number, username, user password, and device information, and setting the channel signal and communication method information.

[0058] The motion control module mainly controls the robot's walking motor, lifting slide, robotic arm, and electric wrench. Button modules with corresponding text are used on the UI interface. A program written in C++ connects the button modules to the internal program, enabling them to perform corresponding actions.

[0059] In a preferred embodiment of the present invention, the motion control module adjusts the motor output torque through a PID controller when performing the bolt tightening task, thereby achieving closed-loop control and abnormal handling.

[0060] In a preferred embodiment of the present invention, the status monitoring module obtains the real-time status of the lithium battery by connecting to a Hall coulomb meter, packages the collected data into an array, and uploads it to the host computer through the communication module.

[0061] In a preferred embodiment of the present invention, the embedded real-time operating system achieves thread synchronization through semaphores and mutexes to avoid data conflicts; the system adopts a polling scheduling algorithm combined with a priority preemption mechanism to ensure that the response time of the action control thread is less than 10ms.

[0062] Secondly, to further address the problems existing in robot control, this invention provides a method for using the above-mentioned control system, including:

[0063] Step S1: System initialization, which is used by the main controller module to load the kernel through the UCOS operating system, configure the clock frequency, and initialize each module after the robot is powered on and started; at the same time, memory stack space is allocated to reserve resources for subsequent threads.

[0064] Step S2: Thread creation and scheduling, used to create three sub-threads, including a communication thread, a status monitoring thread, and an action control thread;

[0065] The communication thread is used to periodically scan the communication interface to determine the connection status. If it is normal, it updates the real-time data and sends the status information to the camera network module through the switch, and then uploads it to the host computer wirelessly. On the other hand, after the host computer updates the instructions, it sends instructions, which are received, parsed and notified to the control thread by the communication thread.

[0066] The status monitoring thread is used to collect battery voltage, current, battery capacity, motor speed and torque data through Hall sensors and encoders; it obtains the real-time status of the lithium battery by connecting to a Hall coulomb meter, packages this data in the form of an array, and uploads it to the host computer through the communication thread;

[0067] The motion control thread is used to judge the instructions issued by the host computer, analyze the type of instruction action; adjust the motor output torque through the PID controller, send new motion control instructions to the corresponding motor driver, execute the corresponding action, and realize closed-loop control; after execution, update the status and feed back to the communication sub-thread.

[0068] Step S3: Multi-threaded collaborative execution, used by each thread to achieve synchronization through semaphores and mutexes;

[0069] Step S4: Exception handling and optimization, used to monitor if the thread detects electromagnetic interference or force feedback anomalies, triggering an interrupt service routine, pausing non-critical threads and switching to safe mode; at the same time, logs are recorded to Flash memory for subsequent parameter iteration and optimization.

[0070] The anomaly handling employs a dynamic interrupt triggering mechanism based on a real-time adaptive threshold for electromagnetic interference intensity. Specifically, this includes: real-time acquisition of the environmental electromagnetic interference intensity value E using an electromagnetic field sensor integrated into the status monitoring module; pre-setting a basic anomaly threshold T0; and introducing an adaptive factor. (0< <1), this factor is dynamically calculated based on historical interference data, factor The expression is:

[0071] ;

[0072] in, This is the average value of the most recent interference. This represents the upper limit of the system design.

[0073] Dynamic threshold The expression is:

[0074] ;

[0075] When the real-time environmental electromagnetic interference intensity value E> When this occurs, an interrupt is triggered, and the thread priority is adjusted according to the magnitude of E.

[0076] Step S5: Interact with the host computer, where the main controller receives visual assistance instructions through the QT Creator host computer software, parses them, and distributes them to the motion control thread to realize flexible docking and fastening operations at the end of the robotic arm.

[0077] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the method of use as described in the second aspect of the present invention.

[0078] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the method of using the robot main controller system based on the STM32 microcontroller platform as described in the second aspect of the present invention.

[0079] The beneficial effects of the above design of the present invention include:

[0080] 1. This invention uses the STM32F407IGT6 microcontroller as the core processor and integrates the UCOS embedded real-time operating system, which supports multi-threaded concurrent execution and priority preemption mechanism. It can achieve priority response of critical tasks, ensure high stability and low latency response of the system in strong electromagnetic interference environment, and effectively solve the problem of system instability caused by untimely scheduling of real-time operating system in the prior art.

[0081] 2. This invention integrates a multi-source status monitoring module, including Hall sensors and encoders, to collect real-time data on battery voltage, current, capacity, joint angle, motor speed, and torque. This data is then fed back to the main controller in an array format. Combined with the PID controller of the motion control module, the motor output torque is adjusted to achieve closed-loop control and anomaly handling. This significantly improves the robot's real-time perception and precise adjustment of battery status and torque feedback, thereby enhancing the safety of live-line maintenance operations.

[0082] 3. The communication module in this invention supports serial port, Ethernet and wireless communication protocols, realizing bidirectional data transmission between the main controller and the host computer and external devices. The transmitted content includes real-time status information, control commands and video stream data. The communication between threads is achieved through message queues, semaphores and mutex locks, which solves the system incoordination problem caused by data transmission conflicts and interference in the prior art.

[0083] 4. This invention introduces a dynamic interruption triggering mechanism based on a real-time electromagnetic interference intensity adaptive threshold in the anomaly handling module. It uses a dedicated electromagnetic field sensor to collect the environmental interference intensity and combines historical data to dynamically calculate the adaptive factor and dynamic threshold, thereby realizing intelligent hierarchical adjustment of interruption triggering. This effectively avoids the problem of false triggering or slow response of fixed thresholds under varying electromagnetic fields, significantly reduces the incidence of abnormal events under high voltage environments, further enhances the anti-interference capability and operational safety of the robot system, and ensures stable operation in complex power maintenance scenarios.

[0084] 5. Through thread creation and scheduling, multi-thread collaboration, and interaction with the host computer, the system has achieved automated execution of 12 relative motion actions of the robot's walking rollers, lifting slide, electric wrench, and six-degree-of-freedom robotic arm, improving the automation level and work efficiency of live-line maintenance tasks on high-voltage power lines.

[0085] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0086] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0087] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0088] Example 1

[0089] like Figure 5 As shown, this is the first embodiment of the present invention, providing a robot main controller system based on the STM32 microcontroller platform, including a main controller module, a communication module, a status monitoring module, a motion control module, and an embedded real-time operating system; wherein:

[0090] The main controller module uses the STM32F407IGT6 microcontroller as the core processor, which has a high-performance ARM Cortex-M4 core and supports the instruction set of floating point unit (FPU) and digital signal processor (DSP). It can process multi-degree-of-freedom motion of the robot, force feedback signals and visual auxiliary data.

[0091] The embedded real-time operating system is the UCOS micro real-time operating system, which is responsible for task scheduling, thread management and resource allocation. It supports multi-threaded concurrent execution and enables priority response of critical tasks (such as action control) by setting thread priorities.

[0092] The communication module is used to realize bidirectional data transmission between the main controller and the host computer and external devices (such as robotic arms and camera modules). It supports serial port (RS232), Ethernet and wireless communication protocols. The transmitted content includes real-time status information, control commands and video stream data.

[0093] The status monitoring module integrates sensor interfaces such as Hall current and voltage sensors, gyroscopes, accelerometers, and encoders to collect battery voltage, current, capacity, joint angle, torque, and attitude data in real time, and feeds them back to the main controller in the form of array packages.

[0094] The motion control module connects the motor driver and servo actuator, supports PWM signal output and CAN bus communication, and controls the movement of the robot's walking rollers, lifting slide, electric wrench and six-degree-of-freedom robotic arm, involving 12 relative motion actions, including the forward, backward and stop movement of the walking rollers; the rise, fall and stop movement of the slide; and the forward, reverse and stop movement of the electric wrench.

[0095] The system's workflow is as follows: After the main controller is powered on, it first initializes each module, and then creates three independent sub-threads: a communication thread, a status monitoring thread, and an action control thread. Each thread communicates with the others without interference through a message queue, with the priority order being the action control thread, the communication thread, and the status monitoring thread, to ensure system stability in a strong electromagnetic interference environment.

[0096] Example 2

[0097] In the second embodiment of the present invention, based on embodiment 1, a host computer interaction system is also provided. It is developed and written in C++ language in QT Creator environment, and a human-machine interface is designed for bolt tightening operation requirements. In order to reduce the difficulty of operation for workers, the entire host computer adopts three high-definition bitstreams and supports functions such as zooming in and zooming out.

[0098] like Figure 2 As shown, this interface is the main interface of the host computer interaction system, which includes functions such as real-time power display, motion control of the crane motor and lifting slide.

[0099] like Figure 3 As shown, this interface is the settings interface of the host computer interaction system, which includes settings for changing the IP address, username, password, and port number of the three cameras; setting the connection IP address and port number of the control board; setting the IP address and port number of the robotic arm; and setting the minimum motion adjustment angle of each joint of the robotic arm.

[0100] like Figure 4 As shown, this interface is the robot's robotic arm motion control interface in the host computer interaction system. It can switch between three camera feeds and simultaneously display two high-definition feeds. It includes functions such as resetting the robotic arm, executing preset actions, fine-tuning the six robotic arm joints, controlling the up, down, left, right, forward, and backward movements of the robotic arm's end effector joints, and starting and stopping the electric wrench of the end effector tool. The coordinates of the robotic arm's end effector are displayed in real time at the lower right corner.

[0101] The interface program uses a modular approach, and the software system consists of a communication module, a user data module, an image display module, and a motion control module. The communication module sends control commands to the main controller through functions in the SDK library via a serial communication protocol, thereby controlling the actions of each motor and completing the bolt tightening task.

[0102] The user data module is responsible for displaying the robot's real-time status information on the host computer interface, mainly including the robot's robotic arm pose, joint angles, and battery voltage and capacity. The UI design utilizes a label module to display the collected data values ​​in real time and continuously update them.

[0103] The image display module primarily collects and displays the images from three cameras, which are then displayed on the host computer to facilitate operator control of the robot's robotic arm movements. The SDK is first initialized by binding the camera's IP address, port number, username, password, and device information, and setting channel signals, communication methods, and other information.

[0104] The motion control module, which controls the robot's walking motor, lifting slide, robotic arm, and electric wrench, is the core of the robot's control system. The robot is designed with multiple actions, displayed as buttons with corresponding text on the UI. A C++ program connects the button modules to the internal program, enabling them to execute the corresponding actions.

[0105] In summary, the host computer interaction system, through its modular architecture and intuitive multi-interface design, achieves real-time monitoring of robot status, precise motion control, and visual assistance integration. This not only lowers the operational threshold for staff but also significantly improves the system's stability and response speed in complex electromagnetic environments, providing an efficient and reliable human-machine collaboration platform for the automated execution of live-line maintenance tasks.

[0106] Example 3

[0107] Reference Figure 1 This is the third embodiment of the present invention. Based on the above embodiments, a method for operating a robot main controller system based on the STM32 microcontroller platform is also provided, including the following steps:

[0108] Step S1: System Initialization: After the robot is powered on and started, the main controller module initiates the initialization process via UCOS.

[0109] The operating system loads the kernel, configures the clock frequency (e.g., 168MHz), and initializes various modules; at the same time, it allocates memory stack space and reserves resources for subsequent threads.

[0110] Step S2: Thread creation and scheduling;

[0111] Create three child threads, including:

[0112] A1: Communication Thread: Periodically scans the communication interface to determine the connection status; if normal, it updates real-time data, such as battery status and joint pose, and sends the status information to the camera network module through the switch, and uploads it to the host computer wirelessly; on the other hand, after the host computer updates the instructions, it sends instructions, which are received by the communication thread, parsed and notified to the control thread, thus entering the next process;

[0113] A2: Status monitoring thread: Collects battery voltage, current, battery capacity, motor speed and torque data through Hall sensors and encoders; obtains the real-time status of the lithium battery by connecting to a Hall coulomb meter, packages this data in the form of an array, and uploads it to the host computer through a communication thread;

[0114] A3: Motion Control Thread: Judges the instructions issued by the host computer, analyzes the type of instruction action, including robotic arm, lifting slide, traveling roller and electric wrench; adjusts the motor output torque through PID controller, sends new motion control instructions to the corresponding motor driver, executes the corresponding action, realizes closed-loop control; after execution, updates the status and feeds back to the communication sub-thread.

[0115] Step S3: Multi-threaded collaborative execution: Each thread achieves synchronization through semaphores and mutexes. For example, when the action control thread is performing the bolt tightening task, it locks the sensor access permissions of the status monitoring thread to avoid data conflicts; the system uses a round-robin scheduling algorithm combined with a priority preemption mechanism to ensure that the response time of the action control thread is less than 10ms.

[0116] Step S4: Anomaly Handling and Optimization: When the monitoring thread detects electromagnetic interference or force feedback anomalies, such as the preload exceeding the manually preset threshold, it triggers the Interrupt Service Routine (ISR), suspends non-critical threads and switches to safe mode, for example, stopping the motor output and sending an emergency stop signal; at the same time, it records the log to the Flash memory for subsequent parameter iteration and optimization.

[0117] Furthermore, the anomaly handling employs a dynamic interrupt triggering mechanism based on a real-time adaptive threshold for electromagnetic interference intensity. Specifically, this includes: real-time acquisition of the environmental electromagnetic interference intensity value E using a dedicated electromagnetic field sensor (e.g., a transient electromagnetic detector based on a Rogowski coil) integrated into the state monitoring module; a preset basic anomaly threshold T0 (e.g., set to 40V / m based on experience); and the introduction of an adaptive factor. (0< <1), this factor is dynamically calculated based on historical interference data (the average of the previous N interference peaks extracted from the Flash log). This can be reflected by the following formula:

[0118] ;

[0119] in This is the average value of the most recent interference. Set the upper limit for system design (e.g., 100V / m);

[0120] The dynamic threshold can then be expressed as:

[0121] ;

[0122] When the real-time environmental electromagnetic interference intensity value E> When this occurs, an interrupt is triggered, and the thread priority is adjusted according to the magnitude of E.

[0123] For example, when E is between 50-70V / m, only the communication thread is suspended; when E > 70V / m, all non-action control threads are suspended and the robotic arm is forced to retract to a safe posture. This mechanism ensures that the threshold adapts to environmental changes through dynamic calculation, avoiding false triggering or sluggish response under varying electromagnetic fields with a fixed threshold, and adapting to electromagnetic environments with large variations in interference intensity and high transient peak values.

[0124] Step S5: Interact with the host computer: The main controller receives visual assistance instructions through the QT Creator host computer software, parses them, and distributes them to the motion control thread to realize the flexible docking and fastening operation of the robotic arm end effector;

[0125] For example, in the interaction with the host computer, the visual assistance commands originate from a real-time visual processing module based on the publicly available YOLOv8 deep learning algorithm. This module is deployed on the host computer or a dedicated visual processing unit, and its specific application is as follows: Images are continuously captured by the end-effector camera of the robotic arm; the existing YOLOv8 algorithm model is used to identify the bolt target and calculate its image pixel coordinates; then, through hand-eye calibration conversion, the pixel coordinates are converted into three-dimensional spatial target coordinates in the robotic arm's base coordinate system; the motion control thread receives these target coordinates, forming a visual servo closed loop with the real-time coordinates of the robotic arm's end-effector; and the joint motors are dynamically adjusted through a PID controller to achieve precise and compliant positioning of the bolt by the robotic arm's end-effector, thereby effectively compensating for robot body positioning errors and external environmental disturbances.

[0126] For example, in the anomaly handling and optimization steps, the existing YOLOv8 algorithm model is used in conjunction with a vision-assisted system to perform real-time image recognition and monitoring of the nut's condition during the tightening process. When an abnormal condition such as stripped threads, damaged threads, or failure to rotate as expected is detected, an anomaly interruption is immediately triggered, notifying the motion control module to stop the electric wrench, and marking the operation as abnormal and recording it in the Flash memory, thereby achieving online intelligent evaluation of operation quality and safety protection.

[0127] In summary, this method achieves high stability and low latency response of the robot's main controller in environments with strong electromagnetic interference by utilizing the multi-threaded scheduling mechanism and priority preemption strategy of the embedded real-time operating system UCOS. At the same time, the integrated closed-loop feedback of state monitoring and motion control ensures the system's real-time perception and precise adjustment of battery status, joint pose, and force feedback, improving the safety and efficiency of live-line maintenance operations and making it suitable for complex scenarios involving high-voltage power lines.

[0128] Example 4

[0129] This is the fourth embodiment of the present invention. Unlike the embodiments described above, this embodiment performs statistical analysis on the results of each improvement module, integrates the basic model with different improvement modules, and finally selects the optimal system improvement scheme through experiments.

[0130] Experimental setup: Using the same robot hardware platform (STM32F407IGT6 microcontroller, motor driver, sensors, etc.), a high-voltage electromagnetic interference environment (intensity 50V / m) was simulated. The task was bolt tightening, including walking, lifting, robotic arm positioning, and tightening operations. Each configuration was repeated 10 times, and key metrics were recorded: response time (instruction-to-execution delay, ms), exception handling success rate (safe mode switching rate under electromagnetic interference, %), overall work efficiency (task completion time, s), and CPU utilization (%).

[0131] Basic system: Traditional single-threaded system without UCOS scheduling and PID control.

[0132] Ablation comparison experiments were conducted on different system configurations on a self-constructed high-voltage transmission line simulation dataset. The experimental results are shown in Table 1.

[0133] Table 1. Results of ablation comparison experiments

[0134] experiment UCOS Multithreading PID control Response time (ms) Exception handling success rate (%) Overall work efficiency (s) CPU utilization (%) Experiment 1 18.5 72.1 85 92.3 Experiment 2 √ 9.8 85.4 62 78.6 Experiment 3 √ 14.2 88.7 68 85.1 Experiment 4 √ √ 6.7 95.2 48 68.4

[0135] Conclusion: As shown in Table 1, the ablation experiment results in Experiment 4, with the combined effect of UCOS multi-threading and PID control, show that the system achieves optimal performance in response time, anomaly handling success rate, and overall operation efficiency. The response time is reduced to 6.7ms, the anomaly handling success rate is increased to 95.2%, and the overall operation efficiency is reduced to 48s. At the same time, the CPU utilization rate is further optimized to 68.4%. This indicates that the improved strategy of combining UCOS multi-threading scheduling and PID closed-loop control proposed in this invention achieves efficient resource utilization while improving the robot's real-time performance and stability, and has good practicality and deployment feasibility.

[0136] Example 5

[0137] This is the fifth embodiment of the present invention. Unlike the embodiments described above, this embodiment provides a computer device applicable to a robot main controller system and method based on an STM32 microcontroller platform. The device includes a memory and a processor. The memory stores computer-executable instructions, and the processor executes the computer-executable instructions to implement the robot main controller system and method based on an STM32 microcontroller platform as described in the embodiments above.

[0138] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0139] This embodiment also provides a storage medium storing a computer program. When executed by a processor, the program implements a robot main controller system and method based on an STM32 microcontroller platform as described in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0140] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

[0141] This invention is not limited to the preferred embodiment described above. Anyone inspired by this invention can derive various other forms of robot main controller systems based on the STM32 microcontroller platform. All equivalent variations and modifications made within the scope of the claims of this invention shall fall within the scope of this invention.

Claims

1. A robot master controller system, characterized by, Comprise: A state monitoring module configured to collect electromagnetic interference intensity values of the environment, force feedback data of the system, and battery voltage, current, capacity, joint angle, and torque data of the robot in real time; A processing module configured to: Dynamically calculate an adaptive factor based on historical interference data; Use the adaptive factor and the real-time collected electromagnetic interference intensity values to dynamically adjust a preset basic abnormal threshold to obtain a dynamic threshold; Compare the real-time collected electromagnetic interference intensity values with the dynamic threshold, and simultaneously determine whether the force feedback data exceeds a preset force feedback threshold; When the real-time collected electromagnetic interference intensity values are greater than the dynamic threshold, or the force feedback data exceeds the preset force feedback threshold, trigger an abnormality processing, which includes hierarchical adjustment of system thread priority, suspension of non-critical threads, and switching to a preset safety mode.

2. The robotic master controller system of claim 1, wherein: The processing module comprises a microcontroller and an embedded real-time operating system running thereon.

3. The robotic master controller system of claim 2, wherein: The microcontroller is an STM32 microcontroller based on an ARM Cortex-M4 core.

4. The robotic master controller system of claim 2, wherein: The embedded real-time operating system is μC / OS, and the system further comprises an upper computer interaction system; the upper computer interaction system is developed based on C++ language in QT Creator environment, supports three-way high-definition code stream display and scaling function, includes a main interface with real-time power display and motion control function, and a setting interface with camera, control panel, and mechanical arm IP address and port number setting function.

5. An abnormality processing method of a robot control system, characterized by, Comprise: Collecting electromagnetic interference intensity values of the environment and force feedback data of the system in real time; Dynamically calculating an adaptive factor based on historical interference data; Using the adaptive factor and the real-time collected electromagnetic interference intensity values to dynamically adjust a preset basic abnormal threshold to obtain a dynamic threshold; Comparing the real-time collected electromagnetic interference intensity values with the dynamic threshold, and simultaneously determining whether the force feedback data exceeds a preset force feedback threshold; When the real-time collected electromagnetic interference intensity values are greater than the dynamic threshold, or the force feedback data exceeds the preset force feedback threshold, triggering an abnormality processing, which includes hierarchical adjustment of system thread priority, suspension of non-critical threads, and switching to a preset safety mode.

6. The abnormality processing method of a robot control system according to claim 5, characterized by: The calculation method of the adaptive factor is 1 minus the ratio of the latest interference average value to the system design upper limit, and the value range is between 0 and 1.

7. The abnormality processing method of a robot control system according to claim 6, characterized by: The basic abnormal threshold is an initial interruption threshold preset based on engineering experience, denoted as T0; combined with the adaptive factor α, the basic abnormal threshold T0, and the real-time collected electromagnetic interference intensity value E, the dynamic threshold is equal to T0×[1+α×(E-T0) / T0].

8. The abnormality processing method of a robot control system according to claim 5, characterized by: When triggering the abnormality processing, it also includes recording abnormality logs to a non-volatile memory, which includes real-time electromagnetic interference intensity values, force feedback data, and thread priority adjustment records, for subsequent system parameter iterative optimization.

9. The abnormality processing method of the robot control system according to claim 5, characterized in that: The method runs in a multi-thread environment of an embedded real-time operating system, and the multi-thread environment at least comprises: a state monitoring thread responsible for collecting electromagnetic interference intensity value, force feedback data, and battery voltage, current, capacity data; an action control thread with priority adjustment and response time less than 10 ms; a communication thread for transmitting data and instructions.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processor, implements the method of any one of claims 5-9.