Search

CN-121979372-A - System and method for processing abnormal reset of servo software and recovering state

CN121979372ACN 121979372 ACN121979372 ACN 121979372ACN-121979372-A

Abstract

A system and method for processing abnormal reset of servo software and recovering state includes control center module, interrupt processing module, return telemetry data module and watchdog register. The reset mode comprises power-on reset and watchdog reset, initializing a watchdog, initializing a servo system and an external clock, initializing an underflow interrupt period, initializing an SRAM area address of a variable to be stored to 0 when the generated reset is the power-on reset, loading an SRAM variable when the generated reset is the watchdog reset, and loading the SRAM variable into a global variable of the servo system and initializing the watchdog. The invention can ensure that the servo system software is executed in a state before reset after hot reset.

Inventors

  • ZHAO XIU
  • HAO TINGTING
  • HAO JIAOPING
  • Su Zhenye
  • ZHANG CHENGHAO
  • JIAO ZHEN
  • LIU HAISHAN
  • DING HUAILONG
  • WU FEI
  • LI DONGDONG
  • ZHU FENGQING
  • ZHAO QING

Assignees

  • 北京精密机电控制设备研究所

Dates

Publication Date
20260505
Application Date
20251219

Claims (9)

  1. 1. The system for the abnormal resetting processing and state recovery of the servo software is characterized by comprising a control center module, an interrupt processing module, a return telemetry data module and a watchdog register; The control center module is used for executing local SRAM variable storage work once in each underflow interrupt period, loading or initializing the local SRAM variable according to a reset mode when reset occurs, wherein the reset mode comprises power-on reset and watchdog reset, initializing a watchdog, initializing a servo system and an external clock, initializing the underflow interrupt period and initializing an SRAM area address of a variable to be stored to 0 when the generated reset is power-on reset, loading the SRAM variable when the generated reset is watchdog reset, and loading the SRAM variable into a global variable of the servo system and initializing the watchdog; the interrupt processing module is used for completing the feeding operation of the watchdog register according to the underflow interrupt period, carrying out data acquisition on the servo system, and completing closed-loop operation control on the servo actuator according to the data acquisition; and returning to the telemetry data module, namely monitoring the overflow state of the watchdog register, and feeding back the watchdog to the control center module when the overflow of the watchdog register is monitored.
  2. 2. The system for abnormal reset processing and state recovery of servo software according to claim 1, wherein the local SRAM variable save work performed by the control center module is specifically: And storing the local system time, the servo system start control state, the action angle instruction signal, the overcurrent fault times, the watchdog reset times and the current zero drift data in the global variable into a local SRAM, so that the watchdog reset is loaded into the global variable.
  3. 3. The system for abnormal reset processing and state recovery of servo software according to claim 2, wherein the control center module sets the watchdog overflow time to 17ms each time a power-on reset occurs, enables the watchdog after all the initialization is completed, and resets the watchdog overflow time to 4.3ms.
  4. 4. A system for servo software exception reset processing and state restoration according to claim 2 or 3 wherein the interrupt handling module performs a watchdog feeding operation every 10 underflow interrupt periods to zero the watchdog register count.
  5. 5. The system for abnormal reset processing and state recovery of servo software according to claim 4, wherein the data acquisition of the interrupt processing module comprises analog acquisition, I/O port data acquisition, rotational data acquisition and control instructions issued by the upper control system, and the data acquisition is performed once in each underflow interrupt period.
  6. 6. The system for abnormal resetting and state recovering of servo software according to claim 5, wherein the closed loop operation control performed by the interrupt processing module comprises three closed loop control of a position closed loop, a speed closed loop and a current closed loop, wherein the position closed loop and the speed closed loop are executed once every 10 underflow interrupt periods, and the current closed loop is executed once every underflow interrupt period.
  7. 7. A method for performing abnormal reset processing and state recovery on servo software, which is implemented by using the system for performing abnormal reset processing and state recovery on servo software according to claim 6, and is characterized by comprising the following steps: step 1), initializing a peripheral clock after the servo system is powered on to reset or the watchdog is reset, and initializing the watchdog; Step 2), judging whether the reset is power-on reset or watchdog reset according to the reset mark, if the reset is power-on reset, executing the step 3), and if the reset is watchdog reset, executing the step 4); initializing a servo system, initializing an ePWM1_INT underflow interrupt period, initializing an SRAM area address to 0, and executing the step 5); Step 4), loading the local system time, the system start-up control state, the action angle instruction signal, the overcurrent fault times, the watchdog reset times and the current zero drift data before resetting from a local SRAM area to a global variable, and executing the step 5 after completing the state recovery work of the servo system; And 5) opening ePWM1_INT underflow interruption, continuously monitoring a watchdog counter, if the watchdog counter does not overflow, enabling a servo system to work normally, periodically executing SRAM variable saving, data acquisition and closed loop operation control according to the underflow interruption, executing a dog feeding operation according to every 10 underflow interruption periods, enabling the count of the watchdog register to be cleared, and if the watchdog counter overflows, generating watchdog reset and jumping to the step 1).
  8. 8. The method for abnormal reset processing and state recovery of servo software according to claim 7, wherein the operation of saving the SRAM variable in step 5) is specifically: and storing the local system time, the servo system start-up state, the action angle instruction signal, the overcurrent fault times, the watchdog reset times and the current zero drift data in the global variable into a local SRAM.
  9. 9. The method for processing abnormal reset and recovering state of servo software according to claim 7, wherein the data acquisition in the step 5) comprises analog acquisition, I/O port data acquisition, rotational data acquisition and control instructions issued by a superior control system; The closed loop operation control in the step 5) comprises position closed loop, speed closed loop and current closed loop control.

Description

System and method for processing abnormal reset of servo software and recovering state Technical Field The invention relates to the field of fault processing and recovery of a servo system, in particular to a system and a method for processing and recovering abnormal reset of servo control driving software. Background The servo system is widely applied to the fields of industrial automation (such as robot joint control), aerospace (aircraft steering engine system) and the like by virtue of high-precision control, quick response, multifunction and high reliability. The application characteristics of the servo system require that the servo software running on the servo system has strong real-time performance and high reliability, and especially after abnormal reset of the software caused by failure, the servo system needs to be quickly restored to a normal state before reset. In the prior art, the cost is increased and the hardware complexity is improved due to the addition of an external circuit, so that the application requirements of a servo system for small space and low power consumption cannot be met, or the real-time requirements of the servo system on state continuity after reset cannot be met due to the fact that the watchdog reset frequency threshold value is used for hardware fault diagnosis. Disclosure of Invention The technical solution of the invention is as follows: the system and the method for processing abnormal reset of the servo software and recovering the state are provided, the running state parameters of the servo system are stored in advance, the running state of the software is monitored by using an on-chip watchdog, and after the reset and initialization operation are finished, the state variables stored before the reset are read, so that the normal running state of the servo system is recovered. According to the invention, a peripheral chip and an external circuit are not added, so that the servo system software can be executed in a state before reset after hot reset. The technical scheme of the invention is as follows: In a first aspect of the present invention, The system for performing abnormal reset processing and state recovery on the servo software comprises a control center module, an interrupt processing module, a return telemetry data module and a watchdog register; The control center module is used for executing local SRAM variable storage work once in each underflow interrupt period, loading or initializing the local SRAM variable according to a reset mode when reset occurs, wherein the reset mode comprises power-on reset and watchdog reset, initializing a watchdog, initializing a servo system and an external clock, initializing the underflow interrupt period and initializing an SRAM area address of a variable to be stored to 0 when the generated reset is power-on reset, loading the SRAM variable when the generated reset is watchdog reset, and loading the SRAM variable into a global variable of the servo system and initializing the watchdog; the interrupt processing module is used for completing the feeding operation of the watchdog register according to the underflow interrupt period, carrying out data acquisition on the servo system, and completing closed-loop operation control on the servo actuator according to the data acquisition; and returning to the telemetry data module, namely monitoring the overflow state of the watchdog register, and feeding back the watchdog to the control center module when the overflow of the watchdog register is monitored. Preferably, the local SRAM variable save work performed by the control center module is specifically: And storing the local system time, the servo system start control state, the action angle instruction signal, the overcurrent fault times, the watchdog reset times and the current zero drift data in the global variable into a local SRAM, so that the watchdog reset is loaded into the global variable. Preferably, the control center module sets the watchdog overflow time to 17ms each time power-on reset occurs, enables the watchdog after all initialization is completed, and resets the watchdog overflow time to 4.3ms. Preferably, the interrupt handling module performs a watchdog operation every 10 underflow interrupt periods, clearing the watchdog register count. Preferably, the data acquisition of the interrupt processing module comprises analog quantity acquisition, I/O port data acquisition, rotary data acquisition and control instructions issued by an upper control system, wherein the data acquisition is carried out once in each underflow interrupt period. Preferably, the closed loop operation control finished by the interrupt processing module comprises three closed loop control of a position closed loop, a speed closed loop and a current closed loop, wherein the position closed loop and the speed closed loop are executed once every 10 underflow interrupt periods, and the current closed loop is executed once every underf