An online fault detection and security protection method, device and storage medium

CN122908075APending Publication Date: 2026-10-13贵州航天控制技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611408900.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-11
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]检测手段单一,故障识别能力不足:仅依靠位置行程、有无反馈数据两项指标判断故障,未统计位置变化速度、周期数据更新频次,无法识别传感器性能衰减、隐性失效等潜在风险;仅检测当前瞬时传感器状态,不存储传感器全生命周期故障记录,偶发瞬时故障极易漏检,无法提前预判传感器老化失效趋势

Benefits of technology

[0029]故障检测覆盖范围全面,故障识别能力显著提升:摒弃现有仅行程、有无数据两项简单判断标准,新增位置变化速率、周期数据更新频次校验,可同时识别超行程、通讯丢帧、数据错帧、传感器性能退化多类故障,提前捕捉传感器老化失效潜在风险,大幅降低故障漏检概率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122908075A_ABST
    Figure CN122908075A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of online fault detection and safety protection method, device and storage medium, belong to the technical field of fault safety control.Through the construction of multidimensional fault detection logic, combined with position range, position change speed, periodic data update frequency realizes fault identification, synchronously records and solidifies the various fault data of position sensor full life cycle;When fault reaches threshold, synchronous execution of stall protection, integrator zero operation, eliminate the system jitter caused by integral residual;Design hierarchical stall recovery mechanism, according to the real-time stroke position of equipment Adaptive release protection or drive load back-off.The present application can widen fault detection coverage, greatly improve the fault tolerance of servo system and long-term operation reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fail-safe control technology, and in particular to an online fault detection and safety protection method, device and storage medium. Background Technology

[0002] Online fault detection and safety protection devices (servo systems) are widely used in industrial production lines, robotics, aerospace equipment, and other fields. They rely on high precision and rapid response to achieve accurate equipment positioning and stable operation. Position sensors are the core components of the servo system's closed-loop control. Their primary function is to collect real-time equipment motion position data and upload it to the servo controller. The controller combines position commands from the host computer with position deviation feedback from the sensor to complete closed-loop calculations and outputs PWM signals to control the driver and motor for precise positioning.

[0003] Servo systems operate under harsh conditions such as high and low temperatures, continuous impact, and prolonged continuous operation. Position sensors are prone to malfunctions such as internal component aging, hardware damage, and communication frame loss. After a fault, the sensor's position data feedback stops or becomes abnormal. The controller continues to output drive signals, causing motor stall and overcurrent, which can severely burn out the motor and driver components. Existing servo system position sensor fault detection and safety protection schemes include three basic implementation methods: travel limit detection, which only compares the sensor's feedback position with the device's maximum mechanical travel; if the feedback position exceeds the travel limit, the sensor is considered faulty; data existence detection, which only checks if valid feedback data is received within a fixed period; if valid data is present, the sensor is considered fault-free; and single stall protection, which triggers stall protection only when the position exceeds the mechanical travel, directly resetting the closed-loop control value. The above-mentioned existing technologies have several inherent defects:

[0004] The detection methods are limited and the fault identification capabilities are insufficient: faults are judged based on only two indicators: position travel and whether there is feedback data. The speed of position change and the frequency of periodic data updates are not statistically analyzed, making it impossible to identify potential risks such as sensor performance degradation and latent failures. The sensor only detects the current instantaneous sensor status and does not store fault records for the entire sensor life cycle. Occasional instantaneous faults are very easy to miss, and it is impossible to predict the aging and failure trend of the sensor in advance.

[0005] The safety protection logic is incomplete, resulting in poor system stability: the existing stall protection simply clears the control quantity without designing a matching stall protection release and recovery logic, so the equipment cannot autonomously resume normal control after moving to its travel limit; when a sensor fault triggers stall protection, the integrator is not simultaneously shut down and cleared, causing the integral circuit to continuously accumulate deviations. After the sensor recovers, the residual integral deviation will cause the system position to jump drastically, impacting the equipment structure; the fault protection does not match the protection and recovery timing with the actual overcurrent conditions of the motor and driver, resulting in weak fault tolerance.

[0006] It is evident that existing servo systems lack multi-dimensional comprehensive fault detection methods, full lifecycle fault tracing capabilities, and complete stall protection and recovery logic. Furthermore, they lack fault integral suppression mechanisms. Consequently, the reliability and safety of servo systems cannot meet the long-term stable operation requirements of high-end industrial and aerospace equipment. Summary of the Invention

[0007] To address the aforementioned technical problems, embodiments of the present invention provide an online fault detection and safety protection method, apparatus, and storage medium, applicable to online fault detection of position sensors and stall safety protection control in servo systems used in industrial production lines, robots, and aerospace equipment. The technical solution adopted by the present invention is as follows:

[0008] An online fault detection and safety protection method, comprising the following steps:

[0009] The servo controller receives position data periodically uploaded by the position sensor and performs parsing and conversion, verifies the validity of the data from multiple dimensions, and counts and records the cumulative number of various faults.

[0010] The sensor fault level is determined based on the multi-dimensional verification results. When the fault reaches the preset threshold, the stall protection mechanism is activated, the control quantity and integrator are cleared simultaneously, and the continuous drive output is cut off.

[0011] Continuously monitor the status of the position sensor feedback data to determine whether the sensor fault has been eliminated. If the fault has not been eliminated, the stall protection state will be maintained continuously.

[0012] After the sensor fault is cleared, the stall recovery process is executed to verify the current travel position of the equipment. Normal drive output is restored or the load is limited and retracted according to the scenario. If multiple retractions are ineffective, the recovery process is terminated.

[0013] Optionally, when the fault reaches a preset threshold, the stall protection mechanism is activated, which includes: if the number of consecutive abnormal frames reaches the protection threshold, the closed-loop control computation is immediately cleared, and the continuous output of the PWM drive signal is stopped; the integral operation is simultaneously shut down and the accumulated deviation value inside the integrator is cleared, eliminating the interference of integral residue on subsequent system control, maintaining the stall protection state, and jumping to the fault status monitoring process.

[0014] Optionally, if the cumulative number of consecutive abnormal frames reaches or exceeds the preset protection trigger threshold, and it is determined that the position sensor has a continuous failure fault, and there is a risk of motor stalling and overcurrent burnout due to prolonged operation, the controller immediately sends a zeroing command to the basic closed-loop calculation unit to clear all control outputs generated by the closed-loop calculation, stop the servo controller from outputting PWM drive signals, and cut off the continuous power supply of the driver to the motor, thereby blocking the risk of motor stalling, overheating, and overcurrent damage from the power source.

[0015] Optionally, within the same calculation cycle of the zeroing control quantity, the integral calculation channel in the closed-loop control link is simultaneously shut down, directly clearing the long-term accumulated position deviation integral value inside the integrator, eliminating the residual integral deviation that has been continuously accumulated during the fault, locking the stall protection operation status, and continuously collecting position sensor feedback data in a loop.

[0016] Optionally, a stall recovery procedure is executed, which specifically includes:

[0017] Continuously count the number of consecutive valid feedback frames from the sensor under stall protection status, and determine whether the number of consecutive valid frames has reached the recovery trigger threshold.

[0018] If the recovery threshold is not reached, the stall protection continues to be maintained, and the sensor feedback data is continuously monitored.

[0019] After the number of consecutive valid frames reaches the target, the current real-time position of the device is read to determine whether the position is within the mechanical travel limit; if the current position exceeds the mechanical travel limit, the minimum limit control quantity is output to drive the load to slowly retreat to the valid travel range, and the number of limit retreat executions is recorded.

[0020] Determine if the limit switch retraction execution count has reached the preset limit. If it has not reached the limit, continue executing the limit switch retraction. If the load still has not returned to the effective stroke after reaching the limit, determine that there is a hardware fault in the driver or motor, terminate the stall recovery process, and continuously lock the stall protection status.

[0021] Optionally, if the number of consecutive valid feedback frames does not reach the recovery trigger threshold, it is determined that the sensor fault has not been completely repaired and the feedback data is not stable enough. The stall protection lockout state is maintained continuously, the sensor feedback messages are monitored in a loop, and no recovery action is performed.

[0022] Optionally, when the number of consecutive valid feedback frames reaches the recovery threshold, the controller reads the current actual position data of the load in real time, compares the real-time position with the upper and lower limits of the equipment's mechanical travel, and determines whether the load is within the legal and valid travel range.

[0023] Optionally, the number of limit retraction executions is compared with the preset upper limit of retraction count. If the number of retractions does not reach the upper limit threshold, the limit control quantity is continuously output in a loop to drive the load to continuously retract. If the load position still does not return to the effective mechanical travel range after the number of retractions reaches the preset upper limit, it is determined that the root cause of the fault is not the position sensor, but irreversible damage to the underlying hardware. The controller directly terminates all stall recovery processes, permanently locks the stall protection state, and continuously cuts off the drive output.

[0024] An online fault detection and safety protection device is provided to implement the above-mentioned online fault detection and safety protection method. The device includes a servo controller and a servo mechanism.

[0025] A servo mechanism is used to acquire motion position and execute power drive, and consists of three types of hardware components: position sensor, driver, and motor.

[0026] The servo controller is used for data parsing, fault diagnosis, closed-loop calculation and safety protection control. It consists of a position information acquisition and processing module and a closed-loop control module. Position sensor data first flows into the position information acquisition and processing module to complete the parsing and fault diagnosis. The processed valid position data and fault judgment signal are synchronously transmitted to the closed-loop control module to perform closed-loop calculation and safety protection control.

[0027] A storage medium, which is a computer-readable storage medium, has computer-readable program instructions stored thereon for performing the above-described online fault detection and security protection method.

[0028] This invention provides an online fault detection and safety protection method, apparatus, and storage medium. The technical solutions provided by the embodiments of this invention bring at least the following beneficial effects:

[0029] The fault detection coverage is comprehensive and the fault identification capability is significantly improved: the existing two simple judgment criteria of only travel and whether there is data have been abandoned, and the position change rate and periodic data update frequency verification have been added. It can simultaneously identify multiple types of faults such as overtravel, communication frame loss, data frame error, and sensor performance degradation, and capture the potential risk of sensor aging and failure in advance, greatly reducing the probability of missed fault detection.

[0030] It has the capability of full life cycle fault tracing and early warning: it permanently stores the cumulative fault data of the sensor throughout the entire life cycle, and the host computer can retrieve historical fault records at any time. Maintenance personnel can predict the lifespan of the sensor based on the frequency of faults, replace potential sensors in advance, and avoid sudden equipment shutdown and damage.

[0031] The safety protection closed loop is complete, and the system's operational stability and fault tolerance are greatly optimized: a complete set of matching stall protection and stall recovery logic is set up, and the integrator is shut down instantly in case of failure to eliminate residual integration, solving the problem of severe system jitter after sensor recovery; the protection and recovery trigger conditions are matched with the actual working conditions of the motor and driver, and the load is automatically and slowly withdrawn in the overtravel state. If multiple withdrawals fail, other hardware faults are automatically identified, taking into account both equipment safety and autonomous recovery capability, and significantly improving the long-term operational reliability of the servo system.

[0032] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a schematic diagram illustrating the composition and working principle of an online fault detection and safety protection device.

[0035] Figure 2 A schematic diagram of the design architecture for an online fault detection and safety protection device;

[0036] Figure 3 This is a flowchart illustrating the sensor fault detection and handling process.

[0037] Figure 4 A flowchart illustrating the blocking protection mechanism;

[0038] Figure 5 A flowchart illustrating the block-to-turn recovery mechanism;

[0039] Figure 6 This is a flowchart illustrating an online fault detection and safety protection method. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0041] Before describing the technical solution of the present invention in detail, the technical background and technical terms involved in the technical solution will be explained first:

[0042] Stall protection is a set of proactive safety cut-off control logic executed by the servo system to prevent the motor from being continuously stalled and burning out due to overcurrent. It is the core protective action of the entire online fault safety protection system. The key improvement of this invention compared to traditional stall protection is that during sensor failure, the closed-loop integral stage continuously accumulates position deviation. If only the drive is cut off and the accumulated integral value is retained, the huge integral deviation will cause drastic changes in motor position and impact the equipment after the sensor recovers. This invention simultaneously shuts down the integral calculation and clears the accumulated deviation inside the integrator at the moment stall protection is triggered, completely eliminating the interference of residual integral value on the subsequent operation of the system and ensuring stable operation after equipment recovery. This invention is based on a comprehensive judgment of multiple indicators, including position range, position change rate, and periodic data update rate, providing a more comprehensive triggering condition and ensuring that the stall risk caused by latent sensor failure is not overlooked.

[0043] On the one hand, this invention provides an online fault detection and safety protection device. This device constructs a multi-dimensional comprehensive sensor fault detection logic, integrating three types of detection indicators: travel range, position change rate, and periodic data update frequency, to achieve simultaneous identification of explicit faults and latent faults caused by sensor performance degradation. It can realize the storage of fault records throughout the entire life cycle of the position sensor, solidify all abnormal fault counts, support upper computer reading and tracing, and provide early warning of sensor aging and failure. It establishes a complete closed-loop safety protection system, including graded stall protection trigger logic, stall protection autonomous recovery logic, and fault synchronous shutdown of the integrator to eliminate residual integral deviation, thereby improving the fault tolerance and operational stability of the servo system.

[0044] The composition principle of the above-mentioned online fault detection and safety protection device is as follows: Figure 1 As shown, the device is a servo control system, completely divided into two independent but cooperating hardware units: a servo controller and a servo mechanism. These two units establish a signal interaction link through dedicated digital communication lines and drive control lines. The servo mechanism is responsible for acquiring motion position data and executing power drive, while the servo controller is responsible for data parsing, fault diagnosis, closed-loop calculation, and safety protection control. All modules work together to complete the entire process of servo system position closed-loop control, multi-dimensional online fault detection of position sensors, fault stall safety protection, and autonomous recovery after fault elimination. These will be described in detail below:

[0045] I. Servo Mechanism

[0046] The servo mechanism is the execution and feedback hardware unit of the servo system. It consists of three types of hardware components: position sensor, driver, and motor. These three types of components are connected by fixed electrical and mechanical relationships. The detailed functions of each component are as follows:

[0047] 1. Position sensor

[0048] Electrical connection: The data output port of the position sensor is connected to the data input channel of the servo controller one by one through a differential communication harness to realize bidirectional digital signal transmission.

[0049] Hardware Function: Real-time acquisition of the actual physical position of the servo load, conversion of analog displacement into standardized digital position messages, and periodic uploading of position feedback data to the servo controller according to a fixed and equal communication cycle, providing a unique position feedback data source for servo closed-loop control.

[0050] The position sensor continuously outputs periodic position frame data, which is used by the servo controller to perform triple fault verification of position range, position change rate, and periodic update frequency. The various abnormal data generated serve as the basis for fault detection and stall protection logic.

[0051] 2. Driver

[0052] Electrical connection: The driver control signal input terminal is connected to the power output port of the servo controller through the PWM drive signal line, and the driver power output terminal is directly electrically connected to the motor power supply winding.

[0053] Hardware functions: Receives PWM pulse width modulation signals from the servo controller, converts the low-voltage control signals into high-power drive current adapted to the rated operating conditions of the motor, adjusts the output current magnitude and direction, and drives the motor to complete forward and reverse motion; at the same time, it collects the motor operating current and temperature conditions in real time, providing operating condition references for stall protection and recovery logic.

[0054] During the stall protection triggering phase, the driver receives the control signal after being cleared and cuts off the high-power output to prevent the motor from stalling and experiencing overcurrent for an extended period. During the stall recovery phase, the driver receives limit control signals or normal closed-loop control signals and drives the load to slowly return to the effective mechanical travel range.

[0055] 3. Motor

[0056] Mechanical connection: The motor output shaft is rigidly mechanically connected to the servo load, and the motor power supply end is connected to the driver power output end.

[0057] Hardware function: Receives the drive current output from the driver, converts electrical energy into mechanical energy, and drives the load to complete precise positioning movement according to the position command issued by the host computer.

[0058] When the position sensor malfunctions and continuously receives drive signals, it will enter a stall state. The stall protection mechanism of this invention can cut off the drive output in time to avoid the motor stalling and overheating, and the windings burning out. If the motor still cannot return to the effective stroke after multiple limit retractions, it can help determine the hardware failure of the motor body and terminate the stall recovery process.

[0059] II. Servo Controller

[0060] The servo controller is the core computing and decision-making unit of the entire device. Its hardware includes a high-speed processor, non-volatile flash memory, multiple digital communication interfaces, and a PWM drive output interface. The flash memory permanently stores fault records throughout the sensor's lifecycle, while the processor handles all data conversion, fault detection, closed-loop calculations, and safety protection logic. The controller internally incorporates two deeply integrated, data-interoperable software core modules: a position information acquisition and processing module and a closed-loop control module. The data flow between these two modules is as follows: position sensor data first flows into the position information acquisition and processing module for analysis and fault identification; the processed valid position data and fault determination signals are then synchronously transmitted to the closed-loop control module for closed-loop calculations and safety protection control.

[0061] (a) Location Information Acquisition and Processing Module

[0062] This module is a dedicated fault detection processing unit. Its input interface connects to the position sensor communication channel. Internally, it is divided into two sub-units: a position data conversion unit and a sensor anomaly detection and processing unit. The complete functions of each sub-unit are as follows:

[0063] 1. Location data conversion unit

[0064] The location data conversion unit continuously receives raw digital messages periodically uploaded by the location sensor in real time. It decodes, verifies, and converts the messages into units, converting the raw digital quantities into real-time location information in the system's standard units. It continuously updates the latest frame of location data in the local cache area and retains the previous frame of historical location data for speed calculation. It filters out invalid garbled messages caused by communication noise and only outputs valid standardized location data to the next-level subunit.

[0065] 2. Sensor anomaly detection and processing unit

[0066] The sensor anomaly detection and processing unit receives the standardized location data after conversion and realizes three core functions: multi-dimensional fault identification, fault counting, and full lifecycle data storage.

[0067] (1) Multi-dimensional fault identification function: Three independent verifications are completed in sequence. The first verification is whether the real-time position exceeds the maximum mechanical travel limit of the equipment and identify the overtravel limit fault. The second verification is to calculate the position change rate based on the position data of two adjacent frames and compare it with the system's preset maximum allowable speed to identify abnormal jump frame faults. The third verification is to count the total number of valid feedback frames uploaded by the sensor within a single fixed communication cycle. If there are no valid frames, the communication frame loss fault is determined. If the number of valid frames is lower than the minimum frame number threshold under normal sensor operation, the sensor performance degradation hidden fault is determined.

[0068] (2) Fault count accumulation and statistics function: Each time any type of abnormal fault is identified, the corresponding fault type count variable is automatically incremented by 1, and the count of four types of abnormal faults, namely, amplitude limiting fault, frame error fault, frame loss fault, and performance degradation fault, is counted independently.

[0069] (3) Full life cycle solid storage function: The cumulative number of four types of faults is written to the designated independent storage area of ​​the servo controller flash memory. The data will not be lost when the power is off, and all abnormal records of the sensor throughout its entire life cycle after it is installed and put into use are completely retained; at the same time, the data reading interface is opened to the host computer, which supports the host computer to retrieve fault statistics data for the purpose of assessing the potential risks of sensor aging and failure.

[0070] (4) Fault signal output function: The cumulative number of four types of faults and the number of consecutive abnormal frames are combined to generate a unified fault judgment signal, which is transmitted to the closed-loop control module as the trigger input condition for the stall protection mechanism.

[0071] (ii) Closed-loop control module

[0072] This module is the core unit for motion control and safety protection of the servo system. Its input receives standard position data and fault judgment signals from the position information acquisition and processing module, and its output connects to the driver's PWM drive channel. In addition to the closed-loop calculation unit, the module includes an independent safety protection unit. This safety protection unit integrates a stall protection mechanism subunit and a stall recovery mechanism subunit. The complete functions of each unit are as follows:

[0073] 1. Closed-loop solution unit

[0074] The closed-loop calculation unit receives the target position command sent by the host computer, compares it with the real-time position information fed back by the sensor, calculates the position deviation, generates the basic closed-loop control quantity through proportional-integral closed-loop calculation, and converts the control quantity into a PWM signal to output to the driver when there is no sensor failure, so as to realize the precise position following control of the load.

[0075] When the stall protection is triggered, the closed-loop calculation unit receives the instruction from the safety protection unit, directly clears the control quantity generated by the closed-loop calculation, and stops the PWM drive signal output.

[0076] 2. Safety Protection Unit

[0077] The safety protection unit coordinates the entire process of fault protection and fault clearance recovery, and includes two linked sub-units:

[0078] (1) Block protection mechanism subunit

[0079] The system receives the fault judgment signal output by the sensor anomaly detection and processing unit, and counts the number of consecutive abnormal feedback frames in real time. When the cumulative value of consecutive abnormal frames reaches the preset protection threshold, it simultaneously executes two core protection actions: First, it sends an instruction to the closed-loop calculation unit to clear the closed-loop control quantity, cuts off the continuous PWM drive output, and prevents the motor from continuously stalling due to overcurrent; Second, it directly shuts down the integral calculation channel, clears the long-term accumulated position deviation integral value inside the integrator, eliminates the residual integral deviation from the root, and avoids the system from experiencing drastic position jumps after the sensor fault is recovered. After the protection action is executed, the stall protection state is continuously locked, and the sensor feedback data is monitored cyclically. After the fault is cleared, the process jumps to the stall recovery mechanism subunit.

[0080] (2) Blocking recovery mechanism subunit

[0081] The system continuously monitors sensor feedback data under stall protection conditions, counts the number of consecutive valid normal feedback frames, and initiates a recovery process when the number of consecutive valid frames reaches the recovery threshold: It reads the current real-time position of the equipment and performs differentiated control under two operating conditions; if the current position is within the mechanical travel limit, the stall protection is directly released, and the closed-loop control output is restored to normal; if the current position exceeds the mechanical travel limit, a low-amplitude limit control quantity is output to drive the load to slowly return to the effective travel range, and the number of return executions is recorded; it continuously checks whether the number of return executions reaches the preset upper limit. If the upper limit is not reached, the limit return continues; if the load still does not return to the effective travel range after reaching the upper limit, it is determined that there is an irreversible hardware fault in the motor or driver, and the stall recovery process is terminated directly, permanently maintaining the stall protection state.

[0082] Figure 2 This is a schematic diagram of the design architecture of an online fault detection and safety protection device. Based on software functional logic, it is divided into two sequentially executed functional layers from top to bottom: the upper layer is the sensor fault detection and processing functional layer, and the lower layer is the safety protection functional layer. The two functional layers have a clear data input-output dependency relationship. The fault statistics and fault judgment signals output by the upper layer serve as the sole triggering basis for the lower layer's safety protection logic, forming a linear processing logic of "fault detection and judgment first, then safety protection and control." Each layer integrates multiple independent sub-functions, each with a clear division of labor and data interoperability, fully covering all technical functions of the position sensor throughout its entire lifecycle: fault identification, fault data storage, fault stall protection, and autonomous recovery after fault elimination. These are described in detail below:

[0083] I. Upper Layer: Sensor Fault Detection and Processing Functional Layer

[0084] This layer is the core layer for device fault perception and data recording. It is the data front-end processing unit of the entire safety protection logic. It has three independent sub-functional modules set in parallel horizontally: location range judgment sub-function, fixed period sensor frame count statistics sub-function, and abnormal state record storage sub-function. Among them, the location range judgment sub-function and the fixed period sensor frame count statistics sub-function are parallel synchronous operation units. They independently complete the data verification of two dimensions. During the verification process, the various fault counts identified are synchronously transmitted to the abnormal state record storage sub-function for unified summary and processing.

[0085] 1. Location range determination sub-function

[0086] Based on the preset upper and lower limit thresholds of the servo mechanism's mechanical travel hardware parameters, the system continuously receives real-time position data parsed by the position information acquisition and processing module, comparing the feedback position value with the mechanical travel limit frame by frame. Once the position data is detected to exceed the limit, the system automatically increments the amplitude limiting fault count and synchronously outputs this amplitude limiting anomaly event to the abnormal state record storage sub-function. This sub-function is used to identify explicit faults where the sensor output exceeds the range, overcoming the limitation of relying solely on the number of communication frames to determine faults.

[0087] 2. Fixed-period sensor frame count statistics sub-function

[0088] The built-in periodic timing logic uses a fixed communication period as a statistical window to collect all valid feedback frames uploaded by the position sensor in real time within the window. On the one hand, it counts whether there are valid data frames within the period to identify frame loss faults caused by complete communication interruption. On the other hand, it counts the total number of valid frames within the period and compares it with the minimum frame count threshold under normal operating conditions to identify latent faults such as sensor communication attenuation and performance degradation. At the same time, it calculates the position change rate based on the position data of two adjacent frames to identify frame error faults caused by abrupt changes in value. The counts of frame loss, frame error, and performance degradation are pushed to the abnormal state record storage sub-function in real time.

[0089] 3. Abnormal Status Record Storage Sub-function

[0090] This unit serves as the core for data aggregation and persistent storage at this layer. It uniformly receives four types of cumulative fault counts from two sub-functions: position range judgment and fixed-period sensor frame count. These counts include amplitude limiting fault counts, frame error fault counts, frame loss fault counts, and sensor performance degradation fault counts. All cumulative fault values ​​are written to a designated storage partition of the servo controller's non-volatile flash memory, ensuring permanent storage even after power failure and completely preserving all abnormal records throughout the entire lifecycle of the position sensor from installation to commissioning. Simultaneously, it outputs a comprehensive fault judgment signal containing information such as fault type, cumulative number of consecutive abnormal frames, and fault severity level. This signal is transmitted unidirectionally to the lower-level safety protection function layer as the basis for determining whether stall protection is triggered.

[0091] II. Lower layer: Safety protection functional layer

[0092] This layer is the core layer for emergency protection and fault recovery control of the device. It relies entirely on the fault judgment signal issued by the upper sensor fault detection and processing function layer to activate the corresponding logic. It has two serially linked sub-function modules set horizontally: the stall protection mechanism sub-function and the stall recovery output control sub-function. When there is no sensor fault in the system, this layer remains in standby mode. When the fault signal output by the upper layer reaches the protection threshold, the stall protection mechanism sub-function is activated first to perform a safety cut-off action. In the stall protection locked state, the sensor feedback data is continuously monitored. After the fault is completely eliminated, it automatically jumps to the stall recovery output control sub-function to perform protection release and system reset logic.

[0093] 1. Sub-functions of the stall protection mechanism

[0094] The system receives fault judgment signals from the upper layer, counts the cumulative number of consecutive abnormal feedback frames in real time, and compares them with the preset protection trigger threshold to complete the branch judgment: if the number of consecutive abnormal frames does not reach the threshold, it is judged as a minor instantaneous and intermittent fault, and protection is not triggered. The system returns to the upper-level sensor fault detection and processing function layer for continuous cyclic monitoring; if the cumulative number of consecutive abnormal frames reaches the protection threshold, dual protection operations are performed simultaneously: first, an instruction is sent to the closed-loop calculation unit to clear the closed-loop control quantity, stop the PWM drive signal output, and cut off the continuous power supply to the motor to avoid motor stall overcurrent burnout; second, the integral calculation channel is closed simultaneously, and the accumulated deviation inside the integrator is cleared to eliminate the interference of integral residue on subsequent system control; after completing the protection action, the system continuously locks the stall protection state and continuously collects sensor feedback data. Once the sensor fault is detected to be eliminated, it automatically jumps to the stall recovery output control sub-function.

[0095] 2. Stall recovery output control sub-function

[0096] The system is responsible for adaptive reset control after fault clearance. It continuously monitors sensor feedback frames while under stall protection, counts the number of consecutive valid normal feedback frames, and performs tiered processing based on the recovery trigger threshold: if the recovery threshold is not reached, it maintains the stall protection lockout state and continuously monitors sensor data; once the consecutive valid frames reach the threshold, it reads the current real-time position of the equipment and executes differentiated recovery logic under two conditions: if the current position is within the mechanical travel limit range, it directly releases the stall protection, restores the normal output of the closed-loop control, and the servo system returns to the normal following operation mode; if the current position exceeds the mechanical travel limit, it outputs a low-amplitude limit control quantity to drive the load to slowly retreat to the effective travel range, and continuously records the number of limit retreat executions; it simultaneously judges whether the number of retreats has reached the preset upper limit, and if not, it continuously executes the limit retreat operation in a loop; if the number of retreats reaches the upper limit and the load still has not returned to the effective mechanical travel, it determines that there is an irreversible hardware fault in the motor or driver, directly terminates the stall recovery process, permanently locks the stall protection state, and prevents secondary damage to the equipment.

[0097] The overall architecture of the online fault detection and safety protection device of this invention follows a complete closed-loop control logic of "detection first, protection later, fault elimination and recovery". The upper fault detection layer realizes multi-dimensional fault identification and full life cycle fault data retention, solving the defects of existing technologies such as single detection methods, missed detection of hidden faults, and lack of historical fault tracing. The lower safety protection layer is equipped with complete fault shutdown protection and adaptive recovery logic. It eliminates the risk of system jitter through the integrator synchronous zeroing mechanism and distinguishes recovery strategies based on the actual working conditions of the equipment, realizing triple safety capabilities of fault safe shutdown, fault elimination autonomous reset, and accurate identification of hardware faults. The two layers of functions work together to form an integrated servo safety control architecture covering the entire process of fault prediction, fault protection, and fault recovery.

[0098] On the other hand, the present invention provides an online fault detection and safety protection method, the process of which is as follows: Figure 6 As shown. This method operates within the servo controller's internal computing unit, relying on the coordinated scheduling of the position information acquisition and processing module and the closed-loop control module. The entire process follows a sequential, closed-loop execution logic. The fault count and continuous abnormal frame information output from the preceding fault detection process serve as the judgment input for the stall protection process. After the stall protection enters the locked state, it continuously monitors the sensor feedback data, and enters the graded adaptive stall recovery process after the fault is eliminated. The entire process fully covers six core functions: multi-dimensional fault identification of position sensors, persistent storage of fault data throughout the entire lifecycle, safe disconnection of motor stall under fault conditions, zeroing of integral deviation to suppress jitter, autonomous recovery according to different scenarios after fault elimination, and identification and interception of underlying hardware faults. It is divided into four steps, as detailed below.

[0099] Step S101: The servo controller receives the position data periodically uploaded by the position sensor and completes the parsing and conversion, verifies the validity of the data from multiple dimensions, and counts and solidifies the cumulative number of various faults.

[0100] This step serves as the data pre-processing entry point for the entire safety control logic. The servo controller continuously receives raw position digital messages from the position sensors at fixed communication cycles. The position data conversion unit within the position information acquisition and processing module decodes the messages, performs unit conversion, and filters noise, outputting standardized real-time position data. Simultaneously, it caches the previous frame of position data for rate calculation. After data standardization and conversion, it automatically enters a multi-round fault verification sub-process arranged in a serial fashion, identifying different types of sensor anomalies one by one, and simultaneously accumulating fault counts and permanently storing them in local flash memory. This step includes the following sub-steps, illustrated in the flowchart below. Figure 3 As shown:

[0101] Sub-step 101-1: Read the real-time position data after conversion, compare the real-time position value with the maximum mechanical travel limit of the equipment, and if the position exceeds the travel limit, accumulate the amplitude limit fault count.

[0102] Read standardized real-time position data, retrieve the upper and lower limits of the maximum mechanical travel of the device pre-stored in the servo system, and compare the current feedback position with the travel limit frame by frame; if the real-time position value exceeds the upper limit or falls below the lower limit, determine that this feedback is a limiting abnormality, perform an auto-incrementing operation on the limiting fault independent counter, and record this overtravel fault event.

[0103] Sub-step 101-2: Read the current frame position and the historical position data of the previous frame, calculate the position change rate, compare the rate with the system's preset maximum allowable speed, if the rate exceeds the limit, the current frame is determined to be an erroneous frame, and the erroneous frame fault count is accumulated.

[0104] Retrieve the valid position data of the previous frame from the buffer, calculate the position change rate by dividing the position difference between the previous and next frames by the communication cycle duration, and compare the calculated actual speed with the system's preset maximum allowable speed threshold. If the actual speed exceeds the set threshold, the current frame is determined to be a sudden error frame, and an auto-incrementing operation is performed on the independent counter for the error frame fault to mark the current speed abnormal data.

[0105] Sub-step 101-3: Count the total number of valid feedback frames from the sensor within a fixed period. If there are no valid feedback frames within the period, determine that there is a communication frame loss fault and accumulate the frame loss fault count.

[0106] Using a preset fixed communication period as the data statistics window, the total number of all valid data frames uploaded by the position sensor within the statistics window period is counted. If no valid feedback message is collected within the entire statistics window, it is determined that the sensor communication channel is interrupted and frames are lost. An independent counter for frame loss faults is incremented to record the communication loss fault.

[0107] Sub-step 101-4: Compare the number of valid feedback frames in the cycle with the minimum frame count threshold under normal sensor operation. If the frame count is lower than the lower threshold, determine the sensor performance degradation fault and accumulate the degradation fault count.

[0108] The total number of valid feedback frames obtained within the same period is retrieved and compared with the minimum valid frame count threshold for normal operation calibrated at the factory. This threshold is the minimum frame count benchmark for full operation under the premise that the sensor has no aging and no communication attenuation. If the number of valid frames in a period is lower than this lower threshold, it is determined that the sensor has a hidden fault of performance degradation caused by hardware aging and communication attenuation. An independent counter for performance degradation faults is incremented to capture potential failure risks that cannot be identified by existing technology.

[0109] Sub-step 101-5: The cumulative number of four types of faults—amplitude limiting, frame errors, frame drops, and performance degradation—is uniformly written into the fixed storage area of ​​the servo controller's flash memory for permanent storage, so that the host computer can read and trace the fault records of the sensor throughout its entire life cycle, and at the same time output a comprehensive fault judgment signal to the safety protection logic.

[0110] The system aggregates the total number of counts from four independent counters for four types of faults: amplitude limiting faults, frame error faults, frame loss faults, and performance degradation faults. The four sets of count data are then written into a dedicated storage partition of the servo controller's non-volatile flash memory. The data will not be lost after the flash memory is powered off, and all abnormal fault records of the sensor throughout its entire lifecycle since its initial installation and commissioning are fully preserved. At the same time, the system integrates the counts of the four types of faults, the cumulative number of consecutive abnormal frames, and the fault severity level to generate a standardized comprehensive fault judgment signal. This signal is transmitted unidirectionally to the safety protection unit of the lower-level closed-loop control module and serves as the core judgment basis for subsequent stall protection triggering.

[0111] After completing all fault detection, counting, and storage sub-processes, the process automatically proceeds to the next step S102, where the stall protection threshold is determined based on the fault determination signal.

[0112] Step S102: Based on the multi-dimensional verification results, the sensor fault level is comprehensively determined. When the fault reaches the preset threshold, the stall protection mechanism is activated, the control quantity and integrator are cleared synchronously, and the continuous drive output is cut off.

[0113] This step is the core safety disconnection step under continuous sensor failure. It is executed by the stall protection mechanism subunit inside the closed-loop control module. It receives the comprehensive fault judgment signal output from step S101, counts the number of continuously occurring abnormal feedback frames in real time, and follows the... Figure 4 The branch judgment logic shown is processed in a hierarchical manner, taking into account both the filtering of minor transient faults and the safety protection against severe persistent faults. This step includes the following sub-steps, as illustrated in the flowchart below. Figure 4 As shown:

[0114] Sub-step S102-1: Receive the cumulative count of various faults output by the sensor fault detection process, and determine whether the number of consecutive abnormal frames has reached the protection trigger threshold.

[0115] The system extracts the statistical values ​​of continuous abnormal frames in the fault judgment signal in real time, retrieves the system's preset stall protection trigger threshold, and compares the current number of continuous abnormal frames with the protection threshold for judgment.

[0116] Sub-step S102-2: If the protection threshold is not reached, maintain the original closed-loop control logic to operate normally and continuously execute the sensor fault detection process.

[0117] If the cumulative number of consecutive abnormal frames does not reach the protection trigger threshold, it is determined that the current fault is only a single, occasional, instantaneous interference fault. No safety cut-off action is initiated, and the process directly flows back to step S101, continuously looping the multi-dimensional fault detection of the sensor without interrupting the normal closed-loop follow control of the servo system.

[0118] Sub-step S102-3: If the number of consecutive abnormal frames reaches the protection threshold, immediately clear the closed-loop control calculation and stop the continuous output of the PWM drive signal.

[0119] If the cumulative number of consecutive abnormal frames reaches or exceeds the preset protection trigger threshold, it is determined that the position sensor has a continuous failure fault, and there is a risk of motor stalling and overcurrent burnout due to prolonged operation. The controller immediately sends a zeroing command to the closed-loop calculation unit to clear all control outputs generated by the closed-loop calculation, stop the servo controller from outputting PWM drive signals, and cut off the continuous power supply of the driver to the motor, thus blocking the risk of motor stalling, overheating, and overcurrent damage from the power source.

[0120] Sub-step S102-4: Simultaneously shut down the integral calculation stage and clear the accumulated deviation value inside the integrator to eliminate the interference of integral residue on subsequent system control, continuously maintain the stall protection state, and jump to the fault status monitoring process.

[0121] Within the same calculation cycle of the zeroing control quantity, the integral calculation channel in the closed-loop control link is simultaneously shut down, directly clearing the long-term accumulated position deviation integral value inside the integrator and eliminating the residual integral deviation that has been continuously accumulated during the fault. If only the drive is cut off while the accumulated integral value is retained, the huge integral deviation will cause a drastic change in motor position and impact the mechanical load after the sensor returns to normal. This step synchronously clears the integrator to avoid this problem at its source. After completing the dual protection action, the system permanently locks the stall protection operation state, continuously collects position sensor feedback data in a loop, and automatically jumps to step S103 to carry out continuous fault status monitoring.

[0122] Step S103: Continuously monitor the status of the position sensor feedback data to determine whether the sensor fault has been eliminated. If the fault has not been eliminated, continue to maintain the stall protection state.

[0123] This step serves as a transitional monitoring phase between fault protection and fault recovery. Throughout the process, the system operates under stall protection lockout. The servo controller continuously receives feedback messages from the position sensor and consistently counts the cumulative number of consecutive valid feedback frames without anomalies. If the number of consecutive valid frames does not reach the preset stall recovery trigger threshold, it is determined that the sensor fault has not been completely eliminated, and communication or hardware abnormalities persist. The system remains in stall protection lockout and repeats this monitoring step to collect and verify data. When the cumulative number of consecutive valid normal feedback frames reaches the recovery threshold, it is determined that the sensor hardware and communication faults have been completely eliminated, the feedback data has returned to stable and reliable status, and the process automatically proceeds to the next step to execute the tiered stall recovery control logic.

[0124] Step S104: After the sensor fault is cleared, execute the stall recovery process, check the current travel position of the equipment, restore normal drive output or limit back load according to the scenario, and terminate the recovery process if multiple back-offs are ineffective.

[0125] This step is responsible for the servo system reset control after fault elimination. It is executed by the stall recovery output control subunit within the closed-loop control module, balancing mechanical limit safety and autonomous recovery capabilities. Differentiated control strategies are designed for two operating conditions: "load within effective stroke" and "load exceeding mechanical stroke." Hardware fault identification logic is also added. This step includes the following sub-steps, illustrated in the flowchart below. Figure 5 As shown:

[0126] Sub-step S104-1: Continuously count the number of consecutive valid feedback frames from the sensor under the stall protection state, and determine whether the number of consecutive valid frames has reached the recovery trigger threshold.

[0127] Continuously count the total number of continuous, valid, and abnormal feedback frames output by the sensors during the stall protection lockout phase, retrieve the system's preset stall recovery trigger threshold, and determine whether the number of valid frames meets the standard.

[0128] Sub-step S104-2: If the recovery threshold is not reached, the stall protection is maintained continuously, and the sensor feedback data is monitored cyclically.

[0129] If the number of consecutive valid feedback frames does not reach the recovery trigger threshold, it is determined that the sensor fault has not been completely repaired and the feedback data is not stable enough. The stall protection lockout state is maintained continuously, the sensor feedback messages are monitored in a loop, and no recovery action is performed.

[0130] Sub-step S104-3: After the number of consecutive valid frames reaches the target, read the current real-time position of the device and determine whether the position is within the mechanical travel limit.

[0131] Once the number of consecutive valid feedback frames reaches the recovery threshold, the controller reads the actual position data of the current load in real time, compares the real-time position with the upper and lower limits of the equipment's mechanical travel, and determines whether the load is within the legal and valid travel range.

[0132] Sub-step S104-4: If the current position is within the travel limit, the stall protection is directly released, the closed-loop control output is restored to normal, and the system returns to the normal operating mode.

[0133] If the current load position falls within the mechanical travel limit range, the equipment has no risk of overtravel. The global stall protection lock state is directly released, the closed-loop calculation unit resumes normal operation and output, the controller re-outputs the PWM drive signal to the driver, the servo system returns to the normal position following operation mode, and the entire control process restarts from step S101.

[0134] Sub-step S104-5: If the current position exceeds the mechanical travel limit, output the minimum limit control quantity to drive the load to slowly retract to the effective travel range, and record the number of limit retraction executions.

[0135] If the current load position exceeds the upper or lower limit of the mechanical travel, directly releasing the stall protection will cause mechanical hard limit collision damage. Therefore, the controller outputs a low-amplitude limit control quantity to drive the motor to slowly retract the load into the effective mechanical travel range. At the same time, it independently records the number of limit retractions each time and continuously tracks the retraction progress.

[0136] Sub-step S104-6: Determine whether the number of limit retraction executions has reached the preset upper limit. If the upper limit has not been reached, continue to execute the limit retraction. If the load still has not returned to the effective stroke after reaching the upper limit, it is determined that there is a hardware fault in the driver or motor, the stall recovery process is terminated, and the stall protection state is continuously locked.

[0137] The system compares the number of limit retraction executions with the preset upper limit of retraction counts. If the retraction count does not reach the upper limit threshold, the limit control quantity is continuously output in a loop to drive the load to continuously retract. If the load position still does not return to the effective mechanical travel range after the retraction count reaches the preset upper limit, the system determines that the root cause of the fault is not the position sensor, but irreversible damage to the underlying hardware such as the motor windings and the driver power circuit. The controller directly terminates all stall recovery processes, permanently locks the stall protection state, and continuously cuts off the drive output to avoid secondary collisions and short circuit damage to the equipment.

[0138] This method forms a complete closed-loop control chain encompassing multi-dimensional fault detection and statistics, persistent fault stall safety protection, continuous online fault monitoring, and graded adaptive recovery for fault elimination. The sub-processes corresponding to the three attached figures each perform their respective functions, and data is interconnected between the preceding and following processes. Figure 3 The sensor fault detection process provides data support for all fault types, fault frequencies, and continuous abnormal frames for subsequent protection and recovery logic, enabling full lifecycle fault tracing and latent failure identification that are not available in existing technologies. Figure 4 The stall protection process differs from the traditional single control quantity zeroing method. It simultaneously achieves power cut-off and integral deviation zeroing, taking into account both motor hardware protection and system operation stability. Figure 5 The stall recovery process differentiates between equipment location and operating conditions, adding underlying hardware fault identification and interception logic, significantly improving the fault tolerance of the servo system. The four steps are executed strictly in sequence without logical jumps, completely resolving multiple shortcomings of existing technologies such as single detection dimensions, missed detection of occasional faults, lack of integral suppression, lack of stall recovery mechanisms, and inability to identify hardware faults. It is suitable for the safe operation requirements of servo systems under long-term, harsh operating conditions in industrial production lines, robots, aerospace equipment, and other applications.

[0139] Thirdly, the present invention provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described online fault detection and safety protection method.

[0140] Fourthly, the present invention provides a storage medium, which may be a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the above-described online fault detection and security protection method.

[0141] The computer-readable storage medium provided by this invention may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0142] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An online fault detection and safety protection method, characterized in that, The method includes the following steps: The servo controller receives position data periodically uploaded by the position sensor and performs parsing and conversion, verifies the validity of the data from multiple dimensions, and counts and records the cumulative number of various faults. The sensor fault level is determined based on the multi-dimensional verification results. When the fault reaches the preset threshold, the stall protection mechanism is activated, the control quantity and integrator are cleared simultaneously, and the continuous drive output is cut off. Continuously monitor the status of the position sensor feedback data to determine whether the sensor fault has been eliminated. If the fault has not been eliminated, the stall protection state will be maintained continuously. After the sensor fault is cleared, the stall recovery process is executed to verify the current travel position of the equipment. Normal drive output is restored or the load is limited and retracted according to the scenario. If multiple retractions are ineffective, the recovery process is terminated.

2. The online fault detection and safety protection method according to claim 1, characterized in that, When a fault reaches a preset threshold, the stall protection mechanism is activated, which includes: If the number of consecutive abnormal frames reaches the protection threshold, the closed-loop control computation is immediately cleared, the continuous output of the PWM drive signal is stopped, the integral operation is simultaneously shut down and the accumulated deviation value inside the integrator is cleared, the interference of integral residue on subsequent system control is eliminated, the stall protection state is continuously maintained, and the process jumps to the fault status monitoring process.

3. The online fault detection and safety protection method according to claim 2, characterized in that, If the cumulative number of consecutive abnormal frames reaches or exceeds the preset protection trigger threshold, it is determined that the position sensor has a continuous failure fault, and there is a risk of motor stalling and overcurrent burnout due to prolonged operation. The controller immediately sends a zeroing command to the basic closed-loop calculation unit to clear all control outputs generated by the closed-loop calculation, stops the servo controller from outputting PWM drive signals, and cuts off the continuous power supply of the driver to the motor, thus blocking the risk of motor stalling, overheating, and overcurrent damage from the power source.

4. The online fault detection and safety protection method according to claim 2, characterized in that, Within the same calculation cycle of the zeroing control quantity, the integral calculation channel in the closed-loop control link is closed synchronously, the long-term accumulated position deviation integral value inside the integrator is directly cleared, the residual integral deviation accumulated during the fault is eliminated, the stall protection operation status is locked, and the position sensor feedback data is continuously collected in a loop.

5. The online fault detection and safety protection method according to claim 1, characterized in that, The process of resuming operation after a stalled turn includes: Continuously count the number of consecutive valid feedback frames from the sensor under stall protection status, and determine whether the number of consecutive valid frames has reached the recovery trigger threshold. If the recovery threshold is not reached, the stall protection continues to be maintained, and the sensor feedback data is continuously monitored. After the number of consecutive valid frames reaches the target, the current real-time position of the device is read to determine whether the position is within the mechanical travel limit; if the current position exceeds the mechanical travel limit, the minimum limit control quantity is output to drive the load to slowly retreat to the valid travel range, and the number of limit retreat executions is recorded. Determine if the limit switch retraction execution count has reached the preset limit. If it has not reached the limit, continue executing the limit switch retraction. If the load still has not returned to the effective stroke after reaching the limit, determine that there is a hardware fault in the driver or motor, terminate the stall recovery process, and continuously lock the stall protection status.

6. The online fault detection and safety protection method according to claim 5, characterized in that, If the number of consecutive valid feedback frames does not reach the recovery trigger threshold, it is determined that the sensor fault has not been completely repaired and the feedback data is not stable enough. The stall protection lockout state is maintained continuously, the sensor feedback messages are monitored in a loop, and no recovery action is performed.

7. The online fault detection and safety protection method according to claim 5, characterized in that, Once the number of consecutive valid feedback frames reaches the recovery threshold, the controller reads the actual position data of the current load in real time, compares the real-time position with the upper and lower limits of the equipment's mechanical travel, and determines whether the load is within the legal and valid travel range.

8. The online fault detection and safety protection method according to claim 5, characterized in that, The number of limit back-off executions is compared with the preset back-off limit; if the number of back-offs has not reached the upper limit threshold, the limit control quantity is continuously output in a loop to drive the load to continuously back off. If the load position still fails to return to the effective mechanical travel range after the number of retractions reaches the preset limit, it is determined that the root cause of the fault is not the position sensor, but irreversible damage to the underlying hardware. The controller will then terminate all stall recovery processes, permanently lock the stall protection state, and continuously cut off the drive output.

9. An online fault detection and safety protection device, used to implement the method described in any one of claims 1 to 8, characterized in that, The device includes a servo controller and a servo mechanism; A servo mechanism is used to acquire motion position and execute power drive, and consists of three types of hardware components: position sensor, driver, and motor. The servo controller is used for data parsing, fault diagnosis, closed-loop calculation and safety protection control. It consists of a position information acquisition and processing module and a closed-loop control module. Position sensor data first flows into the position information acquisition and processing module to complete the parsing and fault diagnosis. The processed valid position data and fault judgment signal are synchronously transmitted to the closed-loop control module to perform closed-loop calculation and safety protection control.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium having computer-readable program instructions stored thereon, the computer-readable program instructions being used to execute the online fault detection and security protection method as described in any one of claims 1 to 8.