CN-121979175-A - Abnormality detection method and system for servo driver, and medium
Abstract
The application relates to an abnormality detection method and system for a servo driver, the servo driver and a medium. The method is applied to a servo driver and comprises the steps of clearing a count value of a target timer through a target kernel every time a target interrupt period arrives, wherein the target timer is used for counting an overflow event when the count value of the target timer reaches the count period of the target timer, the count period of the target timer is not smaller than the target interrupt period, and reporting an abnormal overtime of the target kernel to a controller and stopping outputting a pulse width modulation signal under the condition that the count overflow event occurs in the target timer. By adopting the method, the overtime abnormality of the target kernel can be timely detected and the pulse width modulation signal is blocked, so that the safety of servo control is ensured.
Inventors
- Request for anonymity
- Request for anonymity
- Request for anonymity
- Request for anonymity
- Request for anonymity
- Request for anonymity
- Request for anonymity
Assignees
- 深圳数马电子技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260115
Claims (10)
- 1. An abnormality detection method of a servo driver is characterized by being applied to the servo driver; The method comprises the following steps: When the target interrupt period comes, the count value of the target timer is cleared through the target kernel, wherein the target timer is used for counting overflow events when the count value of the target timer reaches the count period of the target timer; and under the condition that the target timer generates the counting overflow event, reporting the overtime abnormality of the target kernel to a controller, and stopping outputting a pulse width modulation signal.
- 2. The method of claim 1, wherein the target core comprises at least one of a first core or a second core, wherein the target interrupt period comprises at least one of a first interrupt period or a second interrupt period, wherein the target timer comprises at least one of a first timer or a second timer, wherein the count period of the first timer is not less than the first interrupt period, wherein the count period of the second timer is not less than the second interrupt period, wherein the clearing, by the target core, of the count value of the target timer each time the target interrupt period arrives comprises: when the first interrupt period comes, the count value of the first timer is cleared through the first inner core, and whether the count overflow event occurs in the second timer is detected; and when the second interrupt period comes, resetting the count value of the second timer through the second inner core, and detecting whether the count overflow event occurs in the first timer.
- 3. The method of claim 2, wherein reporting a timeout exception for the target kernel to a controller if the count overflow event occurs for the target timer comprises: Reporting, by the first kernel, a timeout exception for the second kernel to a controller when the count overflow event occurs at the second timer; And under the condition that the second kernel detects that the first timer generates the counting overflow event, the second kernel interacts with the first kernel, so that the first kernel reports the abnormal overtime of the first kernel to the controller.
- 4. The method according to claim 2, wherein the method further comprises: The counting period of the first timer is configured according to a preset weighting parameter and the first interrupt period through the first kernel or the second kernel, the counting period of the second timer is configured according to the weighting parameter and the second interrupt period, and after the configuration is completed, the first timer and the first timer are triggered to start counting.
- 5. The method of claim 1, wherein the target timer is configured to set an overflow flag bit of a status register of the target timer to be valid when a count value of the target timer reaches a count period of the target timer, to indicate occurrence of the count overflow event of the target timer, and wherein reporting a timeout exception of the target core to a controller when the count overflow event of the target timer occurs, comprises: And reporting the overtime exception of the target kernel to a controller under the condition that the overflow flag bit of the state register of the target timer is valid.
- 6. The method of claim 1, wherein the ceasing to output the pulse width modulated signal comprises: and routing the count overflow event to a fault input of a pulse width modulation module to trigger the pulse width modulation module to stop outputting a pulse width modulation signal.
- 7. The method of any of claims 1 to 6, wherein the target interrupt period is an interrupt period of a highest priority interrupt of the target core.
- 8. An abnormality detection system of a servo driver, characterized in that the system comprises a target kernel, a target timer and a pulse width modulation module; The target kernel is used for resetting the count value of the target timer every time the target interrupt period arrives; The target timer is used for counting overflow events when the self count value reaches the self count period, and the count period of the target timer is not less than the target interrupt period; the target kernel is further configured to report, to a controller, that the timeout of the target kernel is abnormal, when the target timer has the count overflow event; The pulse width modulation module is used for stopping outputting pulse width modulation signals under the condition that the counting overflow event occurs in the target timer.
- 9. A servo drive comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 7 when the computer program is executed.
- 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
Description
Abnormality detection method and system for servo driver, and medium Technical Field The present application relates to the field of servo control technologies, and in particular, to a method and a system for detecting an abnormality of a servo driver, and a medium. Background In the servo control system, the servo driver is a key pivot between the upper-level controller and the servo motor, and can convert a control signal from the upper-level controller into a pulse width modulation signal executable by the servo motor so as to drive the servo motor to complete the required mechanical movement. In the conventional art, a controller at an upper stage periodically detects whether the state of the servo driver is abnormal. However, this method is limited, so that it is difficult to capture the abnormal core timeout inside the servo driver in time, and the safety of the servo control cannot be ensured. Disclosure of Invention In view of the foregoing, it is desirable to provide an abnormality detection method, system, servo driver, and medium for a servo driver capable of ensuring the safety of servo control. In a first aspect, the present application provides an anomaly detection method for a servo driver, which is applied to the servo driver, and the method includes: When the target interrupt period comes, the count value of the target timer is cleared through the target kernel, wherein the target timer is used for counting overflow events when the count value of the target timer reaches the count period of the target timer; and under the condition that the target timer generates the counting overflow event, reporting the overtime abnormality of the target kernel to a controller, and stopping outputting a pulse width modulation signal. In a second aspect, the present application also provides an abnormality detection system for a servo driver, including: The system comprises a target kernel, a target timer and a pulse width modulation module; The target kernel is used for resetting the count value of the target timer every time the target interrupt period arrives; The target timer is used for counting overflow events when the self count value reaches the self count period, and the count period of the target timer is not less than the target interrupt period; the target kernel is further configured to report, to a controller, that the timeout of the target kernel is abnormal, when the target timer has the count overflow event; The pulse width modulation module is used for stopping outputting pulse width modulation signals under the condition that the counting overflow event occurs in the target timer. In a third aspect, the present application also provides a servo drive comprising a memory storing a computer program and a processor implementing the steps of the method described above when executing the computer program. In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method described above. According to the abnormality detection method, the abnormality detection system, the servo driver and the medium of the servo driver, when the target interrupt period arrives, the count value of the target timer is cleared through the target kernel, wherein the target timer is used for counting overflow events when the count value of the target timer reaches the self count period, the count period of the target timer is not smaller than the target interrupt period, the count value of the target timer can be cleared timely under the condition that the target kernel runs normally by setting the target timer with the count value cleared by the target kernel, the counting overflow events can not occur, and correspondingly, under the condition that the overtime abnormality occurs in the target kernel, the count value of the target timer can not be cleared timely, so that the counting overflow events of the target timer can reflect the overtime abnormality of the target kernel. Furthermore, under the condition that the target timer counts an overflow event, the overtime abnormality of the target kernel is reported to the controller, and the output of the pulse width modulation signal is stopped, so that the overtime abnormality of the target kernel can be timely reported, the pulse width modulation signal is blocked, the problem of abnormal motor movement caused by inaccurate pulse width modulation signals is avoided, and the safety of servo control is ensured. Drawings In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are needed in the description of the embodiments of the present application or the related technologies will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other related dr