Abnormal time determination method and device, electronic equipment and storage medium
Through the communication between the servo drive and the controller, the problem that the servo drive cannot record time under abnormal circumstances is solved, a method of obtaining time information under abnormal circumstances is realized, and the analysis convenience for operation and maintenance personnel is improved.
Patent Information
- Application Number
- CN202410800050.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-22
AI Technical Summary
The servo drive cannot record the specific time under abnormal circumstances, which makes it inconvenient for operation and maintenance personnel to analyze the abnormality.
Through the communication between the servo driver and the controller, the exception code is determined when the running status is abnormal through polling, and it is written into the cache area. Then it is checked whether the time information is written in the cache area, and the time information is read and stored to ensure that the servo The driver can obtain the time information written by the controller based on the exception code.
Even if the servo drive does not have an operating system, it can determine the specific time information when an exception occurs, avoiding the inconvenience caused to operation and maintenance personnel due to the inability to determine the time information.
Smart Images

Figure CN118809585A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method for determining abnormal time, a device for determining abnormal time, an electronic device and a computer-readable storage medium. Background Art
[0002] The servo drive has the function of recording historical anomalies, so it is a relatively important device in industrial applications. Generally, the servo drive is installed in the electric control cabinet, connected to the motion controller and controls the operation of the drive robot. However, during the automatic operation, the servo drive may have an abnormality. When the servo drive has an abnormality, most of the current servo drives do not have an operating system and cannot record time such as year, month, and day. Therefore, it is impossible to record the specific time when the servo drive is abnormal, which causes inconvenience to the operation and maintenance personnel when analyzing the abnormality. Summary of the invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a method for determining abnormal time, an apparatus for determining abnormal time, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
[0004] In order to solve the above problem, an embodiment of the present invention discloses a method for determining abnormal time, which is applied to a servo drive, and the servo drive is communicatively connected with a controller; the method comprises:
[0005] When polling checks that the running state of the servo driver is abnormal, determining a corresponding abnormal code, and writing the abnormal code into a buffer area of the servo driver;
[0006] Polling to check whether there is time information written by the controller after reading the abnormal code in the buffer area;
[0007] When it is detected that time information is written into the buffer area, the time information is read, and the time information and the abnormal code are stored correspondingly.
[0008] Optionally, the communication mode between the servo driver and the controller is mailbox communication; the step of writing the abnormal code into the buffer area of the servo driver includes:
[0009] Writing the abnormal code into the cache area of the mailbox communication of the servo drive;
[0010] The polling checks whether there is time information in the buffer area written by the controller after reading the exception code, including:
[0011] Polling is performed to check whether the time information written by the controller after reading the abnormal code is written in the buffer area of the mailbox communication.
[0012] Optionally, the method further comprises:
[0013] When the exception code is written into the buffer area, the buffer area is locked in a read-only state until the exception code is read.
[0014] Optionally, the servo driver is communicatively connected to a terminal device; and the method further comprises:
[0015] The abnormal code and the time information are sent to the terminal device, so that the terminal device displays the abnormal code and the time information.
[0016] The embodiment of the present invention further discloses a method for determining abnormal time, the method being applied to a controller, the controller being communicatively connected with a servo driver; the method comprising:
[0017] Polling to check whether there is an abnormal code written by the servo driver in the buffer area of the servo driver;
[0018] When polling checks that an abnormal code is written into the buffer area, the current time information is obtained and the time information is written into the buffer area, so that the servo driver reads the time information from the buffer area and stores the time information and the abnormal code in correspondence.
[0019] Optionally, the communication mode between the servo driver and the controller is mailbox communication; the polling to check whether there is an abnormal code written in the buffer area of the servo driver includes:
[0020] Polling to check whether there is an abnormal code written in the buffer area of the mailbox communication of the servo drive;
[0021] The step of writing the time information into the buffer area comprises:
[0022] The time information is written into a buffer area of the mailbox communication.
[0023] Optionally, the method further comprises:
[0024] When the time information is written into the buffer area, the buffer area is locked in a read-only state until the time information is read.
[0025] Optionally, a control system is deployed in the controller; when polling checks that an abnormal code is written into the buffer area, obtaining current time information and writing the time information into the buffer area includes:
[0026] When polling checks that an abnormal code is written into the buffer area, the current time information of the control system is acquired, and the current time information of the control system is written into the buffer area.
[0027] The embodiment of the present invention discloses a system for determining abnormal time, the system comprising a servo driver and a controller, the servo driver and the controller being in communication connection;
[0028] The servo driver is used to determine a corresponding abnormal code when polling checks that an abnormality occurs in the running state of the servo driver, and write the abnormal code into a buffer area of the servo driver, and poll to check whether there is time information written in the buffer area after the controller reads the abnormal code; when checking that time information is written in the buffer area, read the time information, and store the time information and the abnormal code in correspondence;
[0029] The controller is used for polling and checking whether there is an abnormal code written by the servo driver in the buffer area of the servo driver. When polling and checking finds that there is an abnormal code written in the buffer area, the controller obtains the current time information and writes the time information into the buffer area.
[0030] Optionally, the communication mode between the servo driver and the controller is mailbox communication;
[0031] The servo driver is used to write the exception code into the cache area of the mailbox communication of the servo driver, and poll to check whether there is time information written by the controller after reading the exception code in the cache area of the mailbox communication.
[0032] Optionally, the servo driver is further configured to lock the cache area into a read-only state when writing the exception code into the cache area until the exception code is read.
[0033] Optionally, the system further comprises a terminal device, and the servo drive is communicatively connected to the terminal device;
[0034] The servo driver is further used to send the abnormal code and the time information to the terminal device;
[0035] The terminal device is used to display the abnormal code and the time information.
[0036] Optionally, the controller is used to poll and check whether an abnormal code is written into the buffer area of the mailbox communication of the servo drive, and poll and check whether an abnormal code is written into the buffer area of the mailbox communication of the servo drive.
[0037] Optionally, the controller is further configured to lock the cache area into a read-only state when writing the time information into the cache area until the time information is read.
[0038] Optionally, a control system is deployed in the controller;
[0039] The controller is used for acquiring the current time information of the control system and writing the current time information of the control system into the cache area when polling detects that an abnormal code is written into the cache area.
[0040] The embodiment of the present invention discloses a device for determining abnormal time, the device is applied to a servo drive, the servo drive is communicatively connected with a controller; the device comprises:
[0041] A first writing module is used to determine a corresponding abnormal code when polling checks that the running state of the servo driver is abnormal, and write the abnormal code into a buffer area of the servo driver;
[0042] A first checking module, used for polling and checking whether there is time information written by the controller after reading the abnormal code in the buffer area;
[0043] The first reading module is used to read the time information when it is detected that the time information is written into the buffer area, and store the time information and the abnormal code in correspondence.
[0044] Optionally, the communication mode between the servo driver and the controller is mailbox communication; the first writing module includes:
[0045] A first writing submodule, used for writing the abnormal code into the cache area of the mailbox communication of the servo drive;
[0046] The first inspection module comprises:
[0047] The first checking submodule is used for polling and checking whether there is time information written after the controller reads the abnormal code in the buffer area of the mailbox communication.
[0048] Optionally, the device further comprises:
[0049] The first locking module is used to lock the cache area into a read-only state when the exception code is written into the cache area until the exception code is read.
[0050] Optionally, the servo driver is communicatively connected to a terminal device; and the device further comprises:
[0051] The sending module is used to send the abnormal code and the time information to the terminal device, so that the terminal device displays the abnormal code and the time information.
[0052] The embodiment of the present invention discloses a device for determining abnormal time, the device is applied to a controller, the controller is communicatively connected with a servo driver; the device comprises:
[0053] A second checking module is used for polling and checking whether there is an abnormal code written by the servo driver in the buffer area of the servo driver;
[0054] The second writing module is used to obtain the current time information and write the time information into the buffer area when polling checks that an abnormal code is written into the buffer area, so that the servo driver reads the time information from the buffer area and stores the time information and the abnormal code correspondingly.
[0055] Optionally, the communication mode between the servo driver and the controller is mailbox communication; the second inspection module includes:
[0056] A second checking submodule is used for polling and checking whether there is an abnormal code written in the buffer area of the mailbox communication of the servo drive;
[0057] The second writing module includes:
[0058] The second writing submodule is used to write the time information into the cache area of the mailbox communication.
[0059] Optionally, the device further comprises:
[0060] The second locking module is used to lock the cache area into a read-only state when writing the time information into the cache area until the time information is read.
[0061] Optionally, a control system is deployed in the controller; the second writing module includes:
[0062] The third writing submodule is used to obtain the current time information of the control system and write the current time information of the control system into the cache area when polling detects that an abnormal code is written into the cache area.
[0063] The present invention also discloses an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for determining abnormal time when executing the computer program.
[0064] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for determining abnormal time as described above are implemented.
[0065] The embodiments of the present invention include the following advantages:
[0066] In an embodiment of the present invention, when the servo driver detects through polling that an abnormality occurs in the operating status of the servo driver, the corresponding abnormality code is determined and the abnormality code is written into the cache area of the servo driver. Then, the cache area is polled to check whether there is time information written by the controller after the abnormality code is read. When it is detected that there is time information written in the cache area, the time information is read, and the time information and the abnormality code are stored correspondingly, so that the servo driver can read the time information written by the controller according to the abnormality code. Furthermore, even if the servo driver does not have an operating system, the corresponding time information can be determined when an abnormality occurs, thereby avoiding inconvenience caused to the operation and maintenance personnel during abnormality analysis due to the inability to determine the time information. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 is a flowchart of a method for determining abnormal time provided by an embodiment of the present invention;
[0068] Figure 2 is a structural block diagram of a device connection provided by an embodiment of the present invention;
[0069] Figure 3 is a flowchart of steps for determining abnormal time of a servo driver provided by an embodiment of the present invention;
[0070] Figure 4 is a flowchart of another method for determining abnormal time provided by an embodiment of the present invention;
[0071] Figure 5 is a flowchart of steps of a controller for determining abnormal time provided by an embodiment of the present invention;
[0072] Figure 6 is a structural block diagram of another device connection provided by an embodiment of the present invention;
[0073] Figure 7 is a structural block diagram of a system for determining abnormal time provided by an embodiment of the present invention;
[0074] Figure 8 is a structural block diagram of a device for determining abnormal time provided by an embodiment of the present invention;
[0075] Fig. 9 It is a structural block diagram of another device for determining abnormal time provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0076] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0077] In the related art, the servo drive does not have an operating system and cannot record time such as year, month, and day, so it is impossible to record the specific time when the servo drive is abnormal, causing inconvenience to the operation and maintenance personnel when analyzing the abnormality. In order to solve the above technical problems, the present invention provides a method for determining the abnormal time. When the servo drive polls and checks that the operating state of the servo drive is abnormal, the servo drive determines the corresponding abnormal code and writes the abnormal code into the buffer area of the servo drive. Then, the buffer area is polled to check whether there is time information written by the controller after reading the abnormal code. When it is checked that the buffer area has time information written, the time information is read, and the time information and the abnormal code are stored correspondingly, so that the servo drive can read the time information written by the controller according to the abnormal code. Even if the servo drive does not have an operating system, the corresponding time information can be determined when an abnormality occurs, avoiding inconvenience to the operation and maintenance personnel when analyzing the abnormality due to the inability to determine the time information.
[0078] Reference Figure 1 , shows a flowchart of a method for determining abnormal time provided by an embodiment of the present invention, the method is applied to a servo drive, the servo drive is connected to a control communication, and the method may specifically include the following steps:
[0079] Step 101, when polling checks that the running state of the servo driver is abnormal, determine the corresponding abnormal code, and write the abnormal code into the buffer area of the servo driver.
[0080] In the embodiment of the present invention, the servo driver and the controller are generally arranged in an electric control cabinet, the servo driver and the controller are connected in communication, and the servo driver can be connected to the robot body through a motor cable, so that the servo driver can control the operation of the robot body. Figure 2 As shown, a structural block diagram of a device connection provided by an embodiment of the present invention is shown.
[0081] It should be noted that the servo driver of the present invention may be provided with an MCU (Microcontroller Unit), and the method for determining the abnormal time applied to the servo driver may be applied to the MCU in the servo driver.
[0082] In the embodiment of the present invention, when the servo driver and the controller are powered on, communication initialization can be performed. After the initialization is completed, the servo driver can start polling to check the running state of the servo driver and determine whether the running state of the servo driver is abnormal. When the servo driver detects that the running state of the servo driver is abnormal, the servo driver can first determine the abnormal code corresponding to the abnormality, and then write the abnormal code into the buffer area of the servo driver. When the servo driver detects that the running state of the servo driver is not abnormal, the servo driver can continue to poll to check whether the running state of the servo driver is abnormal.
[0083] It should be noted that after the servo driver in the present invention is powered on, it can start polling to check the operating status of the servo driver. When the operating status of the servo driver is abnormal, the corresponding abnormal code is written into the cache area of the servo driver. That is, the abnormal operating status of the servo driver in the present invention can be regarded as a trigger condition for the method for determining the abnormal time of the present invention.
[0084] In an embodiment of the present invention, when the servo driver writes the exception code into the buffer area, the buffer area may be locked into a read-only state until the exception code is read. Specifically, after the servo driver writes the exception code into the buffer area, the buffer area may be locked into a read-only state to prevent the servo driver from writing the exception code multiple times during a complete data communication process, resulting in the inability to determine the time information corresponding to the exception code. After the controller reads the exception code, the buffer area may be unlocked to change the state of the buffer area to a non-read-only state.
[0085] It should be noted that a complete data communication process in the present invention means that when the servo drive is abnormal, the exception code is written into the cache area, the controller reads the exception code in the cache area, and then the current time information is written into the cache area, and the servo drive reads the time information from the cache area. This process is a complete data communication process.
[0086] Step 102 , polling and checking whether there is time information written by the controller after reading the abnormal code in the buffer area.
[0087] In an embodiment of the present invention, after the controller performs communication initialization, it can poll to check whether there is any abnormal code written in the cache area of the servo driver. If the controller detects that there is an abnormal code written in the cache area of the servo driver, it can obtain the current time information and write the current time information into the cache area of the servo driver. The servo driver can poll to check whether there is time information in the cache area written by the controller reading the abnormal code.
[0088] In one embodiment, a control system may be deployed in the controller. When the controller detects through polling that an abnormal code is written into the cache area of the servo drive, the controller may obtain the current time information of the control system and write the current time information into the cache area of the servo drive.
[0089] In an embodiment of the present invention, the communication method between the servo drive and the controller can be mailbox communication; writing the exception code into the cache area of the servo drive may include: writing the exception code into the cache area of the servo drive's mailbox communication; polling to check whether there is time information written by the controller after reading the exception code in the cache area, may include: polling to check whether there is time information written by the controller after reading the exception code in the cache area of the mailbox communication.
[0090] In the present invention, the mailbox communication may be EtherCAT (Ethernet for Control Automation Technology) mailbox communication, and the buffer area of the servo drive may be the buffer area of the EtherCAT mailbox communication of the servo drive. The mailbox communication uses a handshake mechanism rather than a data exchange mechanism. An ESC (EtherCAT Slave Controller) may be provided in the servo drive of the present invention, and a buffer area is provided in the ESC. The servo drive and the controller cannot access the buffer area at the same time. After the sender writes data into the buffer area, the buffer area may be locked to a read-only state until the receiver reads the buffer area data. In the present invention, when the servo drive is the sender, the controller is the receiver, and when the controller is the sender, the servo drive is the receiver.
[0091] EtherCAT is a high-performance industrial Ethernet technology that allows real-time Ethernet communication, particularly suitable for automation and control systems. EtherCAT mailbox communication is a communication mechanism in an EtherCAT network that allows the exchange of data between a master (usually a controller) and slaves (such as drives, sensors, etc.).
[0092] Step 103, when it is detected that time information is written into the buffer area, the time information is read, and the time information and the abnormal code are stored correspondingly.
[0093] In an embodiment of the present invention, the servo driver polls to check whether there is time information written in the cache area by the controller after reading the exception code. When the servo driver does not detect that there is time information written in the cache area, it can continue to poll to check whether there is time information written in the cache area by the controller after reading the exception code. When the servo driver detects that there is time information written in the cache area, it can read the time information in the cache area and store the time information and the exception code accordingly.
[0094] In the present invention, a powered erasable programmable read-only memory may be provided in the servo drive, and the servo drive may store time information and exception codes correspondingly in the powered erasable programmable read-only memory, so that operation and maintenance personnel may read the exception codes and corresponding time information in the powered erasable programmable read-only memory through a terminal device.
[0095] In an embodiment of the present invention, the servo drive can also be communicatively connected with the terminal device, and the servo drive can send the exception code and time information to the terminal device, so that the terminal device displays the exception code and time information, so that the operation and maintenance personnel can clearly know the exception code and the corresponding time information through the terminal device during the exception analysis, and further enable the operation and maintenance personnel to perform exception analysis and maintenance of the servo drive more conveniently.
[0096] In order to better illustrate the present invention, Figure 3 The present invention shows a flowchart of the steps of determining the abnormal time of a servo drive provided by an example of the present invention. After the servo drive is powered on, the EtherCAT mailbox communication can be initialized, and then the servo drive polls to check whether the servo drive is abnormal. If the servo drive is not abnormal, the servo drive continues to poll to check whether the servo drive is abnormal. If the servo drive is abnormal, the corresponding abnormal code is determined, and the abnormal code is written into the buffer area of the EtherCAT mailbox communication. Then the servo drive polls to check whether the buffer area of the EtherCAT mailbox communication has time information written, and the time information is the time information written by the controller after reading the abnormal code. If the buffer area of the EtherCAT mailbox communication has no time information written, the EtherCAT mailbox communication buffer area continues to be polled to check whether the EtherCAT mailbox communication buffer area has time information written. If the EtherCAT mailbox communication buffer area has time information written, the time information in the EtherCAT mailbox communication buffer area is read, and the time information is stored in the electrically erasable programmable read-only memory.
[0097] In an embodiment of the present invention, when polling checks that an abnormality occurs in the operating status of the servo drive, a corresponding abnormal code is determined and the abnormal code is written into a cache area of the servo drive; polling checks whether there is time information written in the cache area after the controller reads the abnormal code; when it is checked that time information is written in the cache area, the time information is read, and the time information and the abnormal code are stored correspondingly, so that the servo drive can read the time information written by the controller according to the abnormal code, and even if the servo drive does not have an operating system, the corresponding time information can be determined when an abnormality occurs, thereby avoiding inconvenience caused to operation and maintenance personnel during abnormality analysis due to the inability to determine the time information.
[0098] Reference Figure 4, shows a flowchart of another method for determining abnormal time provided by an embodiment of the present invention, the method is applied to a controller, the controller is communicatively connected with a servo drive area, and the method may specifically include the following steps:
[0099] Step 401 , polling and checking whether there is an abnormal code written by the servo driver in the buffer area of the servo driver.
[0100] In the embodiment of the present invention, when the servo driver and the controller are powered on, communication initialization can be performed. After the initialization is completed, the servo driver can start polling to check the running state of the servo driver and determine whether the running state of the servo driver is abnormal. When the servo driver detects that the running state of the servo driver is abnormal, the servo driver can first determine the abnormal code corresponding to the abnormality, and then write the abnormal code into the buffer area of the servo driver. When the servo driver detects that the running state of the servo driver is not abnormal, the servo driver can continue to poll to check whether the running state of the servo driver is abnormal.
[0101] After the controller is powered on and communication initialization is completed, the controller can poll to check whether there is an exception code written by the servo drive in the servo drive's buffer area. When the controller polls to check whether there is no exception code written by the servo drive in the servo drive's buffer area, it can continue to poll to check whether there is an exception code written by the servo drive in the servo drive's buffer area.
[0102] Step 402, when polling checks that an abnormal code is written into the buffer area, obtain current time information and write the time information into the buffer area, so that the servo driver reads the time information from the buffer area and stores the time information and the abnormal code correspondingly.
[0103] In an embodiment of the present invention, when the controller polls to check whether there is an exception code written by the servo drive in the servo drive buffer area, when the polling check finds that an exception code is written in the buffer area, the current time information can be obtained and the time information can be written into the buffer area. Therefore, the servo drive polls the buffer area to check whether there is time information written by the controller. When the servo drive detects that time information is written in the buffer area, the time information can be read and the time information and the exception code can be stored correspondingly.
[0104] In one embodiment, the communication method between the servo drive and the controller can be email communication; polling to check whether there is an abnormal code written in the cache area of the servo drive may include: polling to check whether there is an abnormal code written in the cache area of the servo drive's email communication; writing the time information into the cache area may include: writing the time information into the cache area of the email communication.
[0105] In the present invention, the mailbox communication can be EtherCAT mailbox communication, and the buffer area of the servo drive can be the buffer area of the EtherCAT mailbox communication of the servo drive. Mailbox communication uses a handshake mechanism rather than a data exchange mechanism. An ESC (EtherCAT Slave Controller) can be provided in the servo drive of the present invention, and a buffer area is provided in the ESC. The servo drive and the controller cannot access the buffer area at the same time. After the sender writes data into the buffer area, the buffer area can be locked to a read-only state until the receiver reads the buffer area data. In the present invention, when the servo drive is the sender, the controller is the receiver, and when the controller is the sender, the servo drive is the receiver.
[0106] In one embodiment, a control system is deployed in the controller; when polling checks that an abnormal code is written in the cache area, the current time information is obtained and the time information is written into the cache area, which may include: when polling checks that an abnormal code is written in the cache area, the current time information of the control system is obtained, and the current time information of the control system is written into the cache area.
[0107] In an embodiment of the present invention, when the controller writes the time information into the cache area, the cache area can be locked in a read-only state until the time information is read. Specifically, after the controller writes the time information into the cache area, the cache area can be locked in a read-only state to prevent the driver from writing the time information multiple times during a complete data communication process, resulting in the inability to determine the time information corresponding to the abnormal code. After the servo driver reads the time information, the cache area can be unlocked to change the state of the cache area to a non-read-only state.
[0108] It should be noted that a complete data communication process in the present invention means that when the servo drive is abnormal, the exception code is written into the cache area, the controller reads the exception code in the cache area, and then the current time information is written into the cache area, and the servo drive reads the time information from the cache area. This process is a complete data communication process.
[0109] In an embodiment of the present invention, the servo drive can also be communicatively connected with the terminal device, and the servo drive can send the exception code and time information to the terminal device, so that the terminal device displays the exception code and time information, so that the operation and maintenance personnel can clearly know the exception code and the corresponding time information through the terminal device during the exception analysis, and further enable the operation and maintenance personnel to perform exception analysis and maintenance of the servo drive more conveniently.
[0110] In order to better illustrate the present invention, Figure 5The invention shows a flowchart of the steps of a controller provided by an example of the present invention when determining the abnormal time. After the controller is powered on, the EtherCAT mailbox communication can be initialized, and then the controller polls to check whether there is an abnormal code written in the buffer area of the EtherCAT mailbox communication, wherein the buffer area of the EtherCAT mailbox communication is set in the servo drive, and the abnormal code is written into the buffer area of the EtherCAT mailbox communication by the servo drive when the servo drive is abnormal. If the controller polls to check whether there is no abnormal code written in the buffer area of the EtherCAT mailbox communication, then continue to poll to check whether there is an abnormal code written in the buffer area of the EtherCAT mailbox communication. If the controller polls to check whether there is an abnormal code written in the buffer area of the EtherCAT mailbox communication, then read the abnormal code in the buffer area of the EtherCAT mailbox communication, and then read the current time information of the control system, and write the current time information into the buffer area of the EtherCAT mailbox communication, so that the servo drive reads the time information from the buffer area of the EtherCAT mailbox communication, and stores the time information and the abnormal code correspondingly.
[0111] In an embodiment of the present invention, when polling checks that an abnormality occurs in the operating status of the servo drive, a corresponding abnormal code is determined and the abnormal code is written into a cache area of the servo drive; polling checks whether there is time information written in the cache area after the controller reads the abnormal code; when it is checked that time information is written in the cache area, the time information is read, and the time information and the abnormal code are stored correspondingly, so that the servo drive can read the time information written by the controller according to the abnormal code, and even if the servo drive does not have an operating system, the corresponding time information can be determined when an abnormality occurs, thereby avoiding inconvenience caused to operation and maintenance personnel during abnormality analysis due to the inability to determine the time information.
[0112] like Figure 6As shown, a block diagram of another device connection provided by an embodiment of the present invention is shown, wherein an MCU, an EEPROM (electrically erasable programmable read-only memory), an ESC and two RJ45 interfaces are provided in the servo driver, wherein the MCU is simultaneously connected to the EEPROM, the ESC and one of the RJ45 interfaces, the interface is connected to the RJ45 interface in the terminal device via a network cable, the RJ45 interface in the servo driver and the RJ45 interface in the terminal device can communicate using an Ethernet network port, and the terminal device includes a display device for displaying an abnormal code and time information, and the display device is connected to the RJ45 interface in the terminal device. While the ESC in the servo driver is connected to the MCU, it is also connected to another RJ45 interface in the servo driver, the RJ45 interface is connected to the RJ45 interface in the controller via a network cable, the RJ45 interface in the servo driver and the RJ45 interface in the controller can communicate using an EtherCAT bus, and the RJ45 interface in the controller is also connected to the MCU in the controller. Wherein, the MCU in the servo driver executes a method for determining the abnormal time applied to the servo driver, and the MCU in the controller executes a method for determining the abnormal time applied to the controller.
[0113] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0114] Reference Figure 7 , shows a structural block diagram of a system for determining abnormal time provided by an embodiment of the present invention, wherein the system 70 for determining abnormal time includes a servo driver 701 and a controller 702, and the servo driver 701 and the controller 702 are in communication connection.
[0115] The servo driver 701 is used to determine a corresponding exception code when polling checks that an abnormality occurs in the running state of the servo driver 701, and write the exception code into a buffer area of the servo driver 701, and polling checks whether there is time information written in the buffer area after the controller 702 reads the exception code; when checking that time information is written in the buffer area, read the time information, and store the time information and the exception code in correspondence;
[0116] The controller 702 is used for polling and checking whether there is an abnormal code written by the servo driver 701 in the buffer area of the servo driver 701. When polling and checking that there is an abnormal code written in the buffer area, the controller 702 obtains the current time information and writes the time information into the buffer area.
[0117] In one embodiment, the communication mode between the servo driver 701 and the controller 702 is mailbox communication;
[0118] The servo driver 701 is used to write the exception code into the cache area of the mailbox communication of the servo driver 701, and poll to check whether there is time information written after the controller 602 reads the exception code in the cache area of the mailbox communication.
[0119] In one embodiment, the servo driver 701 is further configured to lock the cache area into a read-only state when writing the exception code into the cache area until the exception code is read.
[0120] In one embodiment, the system further includes a terminal device, and the servo driver 701 is communicatively connected to the terminal device;
[0121] The servo driver 701 is further used to send the abnormal code and the time information to the terminal device;
[0122] The terminal device is used to display the abnormal code and the time information.
[0123] In one embodiment, the controller 702 is used to poll and check whether an abnormal code is written into the cache area of the mailbox communication of the servo driver 701, and poll and check whether an abnormal code is written into the cache area of the mailbox communication of the servo driver 701.
[0124] In one embodiment, the controller 702 is further configured to lock the cache area into a read-only state when writing the time information into the cache area until the time information is read.
[0125] In one embodiment, a control system is deployed in the controller 702;
[0126] The controller 702 is used to obtain the current time information of the control system and write the current time information of the control system into the cache area when polling checks that an abnormal code is written into the cache area.
[0127] In an embodiment of the present invention, the servo driver is used to determine the corresponding abnormal code when polling checks that the running state of the servo driver is abnormal, and write the abnormal code into the buffer area of the servo driver, and poll to check whether there is time information written by the controller after reading the abnormal code in the buffer area; when it is checked that there is time information written in the buffer area, read the time information, and store the time information and the abnormal code in correspondence; the controller is used to poll to check whether there is an abnormal code written by the servo driver in the buffer area of the servo driver, and when polling checks that there is an abnormal code written in the buffer area, obtain the current time information, and write the time information into the buffer area. Thus, the servo driver can read the time information written by the controller according to the abnormal code, and then even if the servo driver does not have an operating system, when an abnormality occurs, the corresponding time information can be determined, avoiding inconvenience caused to the operation and maintenance personnel during abnormal analysis due to the inability to determine the time information.
[0128] Reference Figure 8 , shows a structural block diagram of a device for determining abnormal time provided by an embodiment of the present invention, the device is applied to a servo drive, the servo drive is communicatively connected with a controller; the device may specifically include the following modules:
[0129] The first writing module 801 is used to determine a corresponding abnormal code when polling checks that the running state of the servo driver is abnormal, and write the abnormal code into the buffer area of the servo driver;
[0130] A first checking module 802 is used to poll and check whether there is time information written by the controller after reading the abnormal code in the buffer area;
[0131] The first reading module 803 is used to read the time information when it is detected that the time information is written into the buffer area, and store the time information and the abnormal code in correspondence.
[0132] In one embodiment, the communication mode between the servo driver and the controller is mailbox communication; the first writing module 801 includes:
[0133] A first writing submodule, used for writing the abnormal code into the cache area of the mailbox communication of the servo drive;
[0134] The first inspection module 802 includes:
[0135] The first checking submodule is used for polling and checking whether there is time information written after the controller reads the abnormal code in the buffer area of the mailbox communication.
[0136] In one embodiment, the device further comprises:
[0137] The first locking module is used to lock the cache area into a read-only state when the exception code is written into the cache area until the exception code is read.
[0138] In one embodiment, the servo driver is communicatively connected to a terminal device; the device further comprises:
[0139] The sending module is used to send the abnormal code and the time information to the terminal device, so that the terminal device displays the abnormal code and the time information.
[0140] Reference Fig. 9 , shows a structural block diagram of another device for determining abnormal time provided by an embodiment of the present invention, wherein the device is applied to a controller, and the controller is communicatively connected with a servo driver; the device may specifically include the following modules:
[0141] A second checking module 901 is used for polling and checking whether there is an abnormal code written by the servo driver in the buffer area of the servo driver;
[0142] The second writing module 902 is used to obtain the current time information and write the time information into the cache area when polling checks that an abnormal code is written into the cache area, so that the servo driver reads the time information from the cache area and stores the time information and the abnormal code correspondingly.
[0143] In one embodiment, the communication mode between the servo driver and the controller is mailbox communication; the second checking module 901 includes:
[0144] A second checking submodule is used for polling and checking whether there is an abnormal code written in the buffer area of the mailbox communication of the servo drive;
[0145] The second writing module 902 includes:
[0146] The second writing submodule is used to write the time information into the cache area of the mailbox communication.
[0147] In one embodiment, the device further comprises:
[0148] The second locking module is used to lock the cache area into a read-only state when writing the time information into the cache area until the time information is read.
[0149] In one embodiment, a control system is deployed in the controller; the second writing module 902 includes:
[0150] The third writing submodule is used to obtain the current time information of the control system and write the current time information of the control system into the cache area when polling detects that an abnormal code is written into the cache area.
[0151] In an embodiment of the present invention, the first writing module is used to determine the corresponding abnormal code when polling checks that the running state of the servo driver is abnormal, and write the abnormal code into the buffer area of the servo driver; the first checking module is used to poll and check whether there is time information written by the controller after reading the abnormal code in the buffer area; the first reading module is used to read the time information when checking that there is time information written in the buffer area, and store the time information and the abnormal code in correspondence. Thus, the servo driver can read the time information written by the controller according to the abnormal code, and then even if the servo driver does not have an operating system, the corresponding time information can be determined when an abnormality occurs, avoiding inconvenience caused to the operation and maintenance personnel during abnormal analysis due to the inability to determine the time information.
[0152] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0153] An embodiment of the present invention further provides an electronic device, including:
[0154] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned abnormal time determination method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0155] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned abnormal time determination method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0156] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0157] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0158] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0159] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0160] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0161] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0162] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0163] The above describes in detail a method for determining an abnormal time, a device for determining an abnormal time, an electronic device and a computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for a person skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for determining abnormal time, characterized in that: The method is applied to a servo drive, and the servo drive is communicatively connected with a controller; the method comprises: When polling checks that the running state of the servo driver is abnormal, determining a corresponding abnormal code, and writing the abnormal code into a buffer area of the servo driver; Polling to check whether there is time information written by the controller after reading the abnormal code in the buffer area; When it is detected that time information is written into the buffer area, the time information is read, and the time information and the abnormal code are stored correspondingly.
2. The method for determining abnormal time according to claim 1, characterized in that: The communication mode between the servo driver and the controller is mailbox communication; Writing the abnormal code into the buffer area of the servo drive comprises: Writing the abnormal code into the cache area of the mailbox communication of the servo drive; The polling checks whether there is time information in the buffer area written by the controller after reading the exception code, including: Polling is performed to check whether the time information written by the controller after reading the abnormal code is written in the buffer area of the mailbox communication.
3. The method for determining abnormal time according to claim 1, characterized in that: The method further comprises: When the exception code is written into the buffer area, the buffer area is locked in a read-only state until the exception code is read.
4. The method for determining abnormal time according to claim 1, characterized in that: The servo drive is communicatively connected with the terminal device; the method further comprises: The abnormal code and the time information are sent to the terminal device, so that the terminal device displays the abnormal code and the time information.
5. A method for determining abnormal time, characterized in that: The method is applied to a controller, and the controller is communicatively connected with a servo drive; the method comprises: Polling to check whether there is an abnormal code written by the servo driver in the buffer area of the servo driver; When polling checks that an abnormal code is written into the buffer area, the current time information is obtained and the time information is written into the buffer area, so that the servo driver reads the time information from the buffer area and stores the time information and the abnormal code in correspondence.
6. The method for determining abnormal time according to claim 5, characterized in that: The communication mode between the servo driver and the controller is mailbox communication; the polling checks whether there is an abnormal code written in the buffer area of the servo driver, including: Polling to check whether there is an abnormal code written in the buffer area of the mailbox communication of the servo drive; The step of writing the time information into the buffer area comprises: The time information is written into a buffer area of the mailbox communication.
7. The method for determining abnormal time according to claim 5, characterized in that: The method further comprises: When the time information is written into the buffer area, the buffer area is locked in a read-only state until the time information is read.
8. The method for determining abnormal time according to claim 5, characterized in that: A control system is deployed in the controller; When polling checks that an abnormal code is written into the buffer area, obtaining current time information and writing the time information into the buffer area includes: When polling checks that an abnormal code is written into the buffer area, the current time information of the control system is acquired, and the current time information of the control system is written into the buffer area.
9. A system for determining abnormal time, characterized in that: The system comprises a servo drive and a controller, wherein the servo drive and the controller are communicatively connected; The servo driver is used to determine a corresponding abnormal code when polling checks that an abnormality occurs in the running state of the servo driver, and write the abnormal code into a buffer area of the servo driver, and poll to check whether there is time information written in the buffer area after the controller reads the abnormal code; when checking that time information is written in the buffer area, read the time information, and store the time information and the abnormal code in correspondence; The controller is used for polling and checking whether there is an abnormal code written by the servo driver in the buffer area of the servo driver. When polling and checking finds that there is an abnormal code written in the buffer area, the controller obtains the current time information and writes the time information into the buffer area.
10. A device for determining abnormal time, characterized in that: The device is applied to a servo drive, and the servo drive is communicatively connected with a controller; the device comprises: A first writing module is used to determine a corresponding abnormal code when polling checks that the running state of the servo driver is abnormal, and write the abnormal code into a buffer area of the servo driver; A first checking module, used for polling and checking whether there is time information written by the controller after reading the abnormal code in the buffer area; The first reading module is used to read the time information when it is detected that the time information is written into the buffer area, and store the time information and the abnormal code in correspondence.
11. A device for determining abnormal time, characterized in that: The device is applied to a controller, and the controller is communicatively connected with a servo driver; the device comprises: A second checking module is used for polling and checking whether there is an abnormal code written by the servo driver in the buffer area of the servo driver; The second writing module is used to obtain the current time information and write the time information into the buffer area when polling checks that an abnormal code is written into the buffer area, so that the servo driver reads the time information from the buffer area and stores the time information and the abnormal code correspondingly.
12. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the method for determining the abnormal time as described in any one of claims 1-4 or 5-8 are implemented.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for determining the abnormal time according to any one of claims 1-4 or 5-8 are implemented.
Citation Information
Patent Citations
Fault monitoring method and apparatus of servo driver, processor and electronic device
CN110515352A
Failure logging device and this failure logging has device for car
CN206133298U
Motion controller and its control method
JP2006221558A
