Encoder reading acquisition method, device, servo system and storage medium

By sending a preset protocol to identify the frame and reading the target protocol in the target reply frame, the problem of slow acquisition of encoder position readings is solved, and a more efficient reading acquisition process is achieved.

CN113791734BActive Publication Date: 2025-03-25SUZHOU INOVANCE CONTROL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111059111.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-09
Publication Date
2025-03-25
Estimated Expiration
2041-09-09

AI Technical Summary

Technical Problem

Existing encoder reading acquisition methods lead to slow encoder position reading acquisition speed and low reading efficiency.

Method used

By sending a preset protocol identification frame to the target encoder, receiving and reading the target protocol in the target reply frame, the target protocol is used to obtain the position reading of the encoder when the target protocol matches the preset protocol.

Benefits of technology

The number of sending operations is reduced, the acquisition speed of the target protocol is improved, and the reading speed and efficiency of the encoder position reading is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113791734B_ABST
    Figure CN113791734B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for obtaining encoder readings, and the method includes the following steps: sending a preset protocol identification frame to a target encoder, so that the target encoder obtains a target reply frame based on the received preset protocol identification frame; if a target reply frame sent by the target encoder is received, the target protocol of the target encoder is read in the target reply frame; when the target protocol matches the preset protocol, the position reading in the target encoder is obtained using the target protocol. The present invention also discloses an encoder reading acquisition device, a private service system, and a computer-readable storage medium. By using the method of the present invention, only one sending operation of the preset protocol identification frame is required to read the target protocol of the target encoder in the received target reply frame, which greatly reduces the number of sending operations, thereby improving the speed of obtaining the target protocol, improving the speed of reading the position reading of the encoder, and achieving the technical effect of improving the reading efficiency of the encoder position reading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of servo system control, and in particular to an encoder reading acquisition method, device, servo system and computer-readable storage medium. Background Art

[0002] With the continuous advancement of servo technology, its application areas have been continuously expanded. In different application fields and application scenarios, there are different requirements for the performance of the servo system. Therefore, with the changes in application scenarios, the type of encoder used by the servo system also has a variety of options.

[0003] In the related art, a method for obtaining encoder readings is disclosed. First, the encoders that may be applied and the protocols of the encoders are written into the reading software. Then, when reading data from the target encoder, the reading software uses an enumeration or polling method to send one protocol to the target encoder at a time in a preset order until a correct return frame from the target encoder is received. Based on the correct return frame, the target encoder and the target protocol of the target encoder are determined, and the position reading is read from the target encoder using the determined target protocol.

[0004] However, with the existing encoder reading acquisition method, the encoder position reading acquisition speed is slow and the encoder position reading reading efficiency is low. Summary of the invention

[0005] The main purpose of the present invention is to provide an encoder reading acquisition method, device, servo system and computer-readable storage medium, aiming to solve the technical problems of slow encoder position reading acquisition speed and low encoder position reading efficiency in the existing encoder reading acquisition method.

[0006] To achieve the above object, the present invention provides a method for obtaining encoder readings, the method comprising the following steps:

[0007] Sending a preset protocol identification frame to a target encoder so that the target encoder obtains a target reply frame based on the received preset protocol identification frame;

[0008] If the target reply frame sent by the target encoder is received, reading the target protocol of the target encoder in the target reply frame;

[0009] When the target protocol matches the preset protocol, the position reading in the target encoder is obtained using the target protocol.

[0010] Optionally, after the step of sending the preset protocol identification frame to the target encoder, the method further includes:

[0011] If the target reply frame sent by the target encoder is not received, obtaining first prompt information;

[0012] Outputting the first prompt information;

[0013] When a first determination operation for the first prompt information of the output state is received, based on the first determination operation, the step of sending the preset protocol identification frame to the target encoder is returned to be executed.

[0014] Optionally, the step of obtaining a position reading in the target encoder using the target protocol comprises:

[0015] Based on the target protocol, obtaining a protocol confirmation frame;

[0016] Sending the protocol confirmation frame to the target encoder, so that the target encoder obtains a reply confirmation frame based on the received protocol confirmation frame;

[0017] If the reply confirmation frame sent by the target encoder is received, the position reading in the target encoder is obtained using the target protocol.

[0018] Optionally, after the step of reading the target protocol of the target encoder in the target reply frame, the method further includes:

[0019] When the target protocol does not match the preset protocol, obtaining second prompt information;

[0020] outputting the second prompt information;

[0021] When a second determination operation for the second prompt information is received, based on the second determination operation, the step of sending the preset protocol identification frame to the target encoder is returned to be executed.

[0022] Optionally, the step of obtaining a position reading in the target encoder using the target protocol comprises:

[0023] Based on the target protocol, obtaining an acquisition instruction;

[0024] Sending the acquisition instruction and the preset clock signal to the target encoder, so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal;

[0025] The position reading sent by the target encoder is received.

[0026] Optionally, before the step of sending the acquisition instruction and the preset clock signal to the target encoder so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal, the method further includes:

[0027] Performing level adjustment on the acquisition instruction and the preset clock signal to obtain an adjusted acquisition instruction and an adjusted clock signal;

[0028] The step of sending the acquisition instruction and the preset clock signal to the target encoder so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal comprises:

[0029] The adjusted acquisition instruction and the adjusted clock signal are sent to the target encoder, so that the target encoder sends the position reading based on the adjusted acquisition instruction and the adjusted clock signal.

[0030] Optionally, the preset protocols include ENDAT protocol, BISS protocol and SSI protocol.

[0031] In addition, to achieve the above-mentioned purpose, the present invention also proposes an encoder reading acquisition device, the device comprising:

[0032] A sending module, used for sending a preset protocol identification frame to a target encoder, so that the target encoder obtains a target reply frame based on the received preset protocol identification frame;

[0033] A receiving module, configured to read the target protocol of the target encoder from the target reply frame if the target reply frame sent by the target encoder is received;

[0034] The acquisition module is used to acquire the position reading in the target encoder by using the target protocol when the target protocol matches the preset protocol.

[0035] In addition, to achieve the above-mentioned purpose, the present invention also proposes a servo system, which includes: a memory, a processor, and an encoder reading acquisition program stored in the memory and running on the processor, and when the encoder reading acquisition program is executed by the processor, the steps of the encoder reading acquisition method described in any one of the above items are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which an encoder reading acquisition program is stored, and when the encoder reading acquisition program is executed by a processor, the steps of the encoder reading acquisition method described in any one of the above items are implemented.

[0037] The technical solution of the present invention proposes a method for obtaining encoder readings, which includes the following steps: sending a preset protocol identification frame to a target encoder so that the target encoder obtains a target reply frame based on the received preset protocol identification frame; if the target reply frame sent by the target encoder is received, reading the target protocol of the target encoder in the target reply frame; when the target protocol matches the preset protocol, using the target protocol to obtain the position reading in the target encoder.

[0038] In the existing encoder data reading method, the reading software adopts the enumeration or polling method, and sends one protocol to the target encoder each time in a preset order until the correct reply frame of the target encoder is received, and then the target encoder and the target protocol of the target encoder can be determined based on the correct reply frame. The reading software needs to perform multiple sending operations to determine the target protocol among many protocols, which makes the encoder's position reading speed slow and the encoder's position reading efficiency low. In the present invention, only one sending operation of the preset protocol identification frame is required to read the target protocol of the target encoder in the received target reply frame, thereby greatly reducing the number of sending operations, thereby improving the speed of obtaining the target protocol, further improving the encoder's position reading speed, and achieving the technical effect of improving the encoder's position reading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0040] Figure 1 A schematic diagram of the servo system structure of the hardware operating environment involved in the embodiment of the present invention;

[0041] Figure 2 It is a flow chart of a first embodiment of a method for obtaining encoder readings of the present invention;

[0042] Figure 3 It is a schematic diagram of the position reading transmission path of the present invention;

[0043] Figure 4 This is a structural block diagram of the first embodiment of the encoder reading acquisition device of the present invention.

[0044] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the servo system structure of the hardware operating environment involved in the embodiment of the present invention.

[0047] Typically, the servo system comprises: at least one processor 301, a memory 302, and an encoder reading acquisition program stored in the memory and executable on the processor, wherein the encoder reading acquisition program is configured to implement the steps of the encoder reading acquisition method as described above.

[0048] The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. The processor 301 may also include an AI (Artificial Intelligence) processor, which is used to process operations related to the encoder reading acquisition method, so that the encoder reading acquisition method model can be trained and learned autonomously to improve efficiency and accuracy.

[0049] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement the encoder reading acquisition method provided in the method embodiment of the present application.

[0050] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the communication interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305 and a power supply 306.

[0051] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0052] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 304 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 304 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 304 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0053] The display screen 305 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 305 is a touch display screen, the display screen 305 also has the ability to collect touch signals on the surface or above the surface of the display screen 305. The touch signal can be input to the processor 301 as a control signal for processing. At this time, the display screen 305 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 305 can be one, the front panel of the electronic device; in other embodiments, the display screen 305 can be at least two, respectively arranged on different surfaces of the electronic device or in a folding design; in some further embodiments, the display screen 305 can be a flexible display screen, arranged on a curved surface or a folding surface of the electronic device. Even, the display screen 305 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 305 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0054] The power supply 306 is used to power various components in the electronic device. The power supply 306 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 306 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0055] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the servo system, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0056] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which an encoder reading acquisition program is stored, and when the encoder reading acquisition program is executed by a processor, the steps of the encoder reading acquisition method described above are implemented. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed to be executed on a servo system, or on multiple servo systems located at one location, or on multiple servo systems distributed at multiple locations and interconnected by a communication network.

[0057] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0058] Based on the above hardware structure, an embodiment of the encoder reading acquisition method of the present invention is proposed.

[0059] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a method for obtaining encoder readings of the present invention, which is applied to a private server system. The method comprises the following steps:

[0060] Step S11: sending a preset protocol identification frame to a target encoder, so that the target encoder obtains a target reply frame based on the received preset protocol identification frame.

[0061] Step S12: If the target reply frame sent by the target encoder is received, the target protocol of the target encoder is read from the target reply frame.

[0062] It should be noted that the executor of the present invention is a servo system. The structure of the servo system is described above and will not be repeated here. The servo system is installed with an encoder reading acquisition program. When the servo system executes the encoder reading acquisition program, the steps of the encoder reading acquisition method of the present invention are implemented.

[0063] At present, in the existing methods, different protocol parsing methods are used to realize the reading of position quantity according to the type of encoder used and the type of encoder protocol. However, if the encoder is replaced, the corresponding servo system also needs to be replaced, which increases the use cost of the servo system, and a type of servo system can only use its corresponding encoder, resulting in low compatibility of the servo system.

[0064] In addition, there is another method, that is, all the encoders and encoder protocols that may be applied are written into the reading software, and then when reading the data of the target encoder, the reading software uses the enumeration or polling method, and sends one protocol to the target encoder each time in a preset order until the correct return frame of the target encoder is received, and the target encoder and the target protocol of the target encoder are determined based on the return frame, and the position data is read from the target encoder using the determined target protocol. However, the polling (enumeration) efficiency is affected by the number of encoders polled (enumerated). When there are many compatible encoder types, the polling (enumeration) time will increase, and when using this method, there is a problem of incorrect recognition of the SSI protocol and the BISS protocol.

[0065] It should be noted that the preset protocol identification frame can be a specific protocol identification frame set by the user based on demand, and the preset protocol identification frame will not change with the protocol conversion of the encoder. In addition, the target encoder is the sending object of the preset protocol identification frame, and the position reading in the target encoder needs to be obtained. The method of the present invention aims to obtain the position reading in the target encoder. The target encoder can be any form of encoder. The target encoder is usually used for reading the position reading of the private service system. After the target encoder reads the position reading, the private service system needs to obtain the position reading from the target encoder. The protocol of the target encoder can be the ENDAT protocol, the BISS protocol or the SSI protocol.

[0066] Typically, when the target encoder receives the preset protocol identification frame, a target reply frame is generated based on the preset protocol identification frame, and the target reply frame carries the specific protocol content of the target encoder (which protocol is the target encoder's protocol). When the target reply frame sent by the target encoder is received, the target protocol of the target encoder is read in the target reply frame. The target protocol is the protocol of the target encoder.

[0067] At the same time, if the target reply frame sent by the target encoder is not received, a first prompt message is obtained; the first prompt message is output; when a first determination operation for the first prompt message of the output status is received, based on the first determination operation, the step of sending a preset protocol identification frame to the target encoder is returned to be executed.

[0068] When the target reply frame sent by the target encoder is not received, it may be that the target encoder is not connected, the target encoder is damaged, or the protocol content of the target encoder is not currently supported. In this case, it is necessary to output a first prompt message to prompt the user to replace the encoder. After the user replaces the new target encoder according to the output first prompt message, the user sends a first confirmation operation, indicating that the replacement of the new target encoder is completed. At this time, steps S11 to S13 are repeated to obtain the position reading of the new target encoder.

[0069] Step S13: When the target protocol matches the preset protocol, the position reading in the target encoder is obtained using the target protocol.

[0070] The preset protocol may include an ENDAT protocol, a BISS protocol, and an SSI protocol. When the target protocol matches the preset protocol, the position reading in the target encoder may be obtained. Then, the target protocol is used to obtain the position reading in the target encoder.

[0071] When the target protocol does not match the preset protocol, obtain second prompt information; output the second prompt information; when receiving a second determination operation for the second prompt information, based on the second determination operation, return to execute the step of sending a preset protocol identification frame to the target encoder.

[0072] It should be noted that when the target protocol does not match the preset protocol, a second prompt message is obtained to prompt the user to replace the encoder. After the user replaces the new target encoder in response to the output second prompt message, the user sends a second confirmation operation, indicating that the replacement of the new target encoder is complete. At this time, steps S11 to S13 are performed again to obtain the position reading of the new target encoder.

[0073] Specifically, the step of using the target protocol to obtain the position reading in the target encoder includes: obtaining a protocol confirmation frame based on the target protocol; sending the protocol confirmation frame to the target encoder so that the target encoder obtains a reply confirmation frame based on the received protocol confirmation frame; if the reply confirmation frame sent by the target encoder is received, using the target protocol to obtain the position reading in the target encoder.

[0074] It should be noted that when the target protocol matches the preset protocol, a protocol confirmation frame is obtained based on the target protocol, and the protocol confirmation frame includes the target protocol, so as to use the protocol confirmation frame to determine whether the target protocol of the target encoder is accurate. That is, the target encoder obtains a reply confirmation frame based on the received protocol confirmation frame, and the reply confirmation frame is used to express that the target protocol of the target encoder is accurate. If the reply confirmation frame is received, it indicates that the target protocol is accurate. At this time, the position reading in the target encoder can be obtained. If the reply confirmation frame is not received, it indicates that the target protocol is inaccurate and the position reading in the target encoder cannot be obtained. At this time, a prompt message can be output to prompt the user to replace a new target encoder and repeat steps S11 to S13.

[0075] Specifically, the step of using the target protocol to obtain the position reading in the target encoder includes: obtaining an acquisition instruction based on the target protocol; sending the acquisition instruction and a preset clock signal to the target encoder, so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal; and receiving the position reading sent by the target encoder.

[0076] The preset clock signal is the clock signal of the servo system; when the target protocol matches the preset protocol and the reply confirmation frame sent by the target encoder is received, the position reading can be obtained from the target encoder. At this time, an acquisition instruction is obtained based on the target protocol; the position reading is obtained from the target encoder by using the acquisition instruction and the preset clock signal.

[0077] Among them, before the step of sending the acquisition instruction and the preset clock signal to the target encoder so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal, the method also includes: level adjusting the acquisition instruction and the preset clock signal to obtain an adjusted acquisition instruction and an adjusted clock signal; the step of sending the acquisition instruction and the preset clock signal to the target encoder so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal includes: sending the adjusted acquisition instruction and the adjusted clock signal to the target encoder so that the target encoder sends the position reading based on the adjusted acquisition instruction and the adjusted clock signal.

[0078] It should be noted that the preset clock signal and acquisition instruction cannot be directly recognized by the target encoder. At this time, it is necessary to adjust the level of the preset clock signal and the acquisition instruction to obtain the adjusted acquisition instruction and the adjusted clock signal. The adjusted acquisition instruction and the adjusted clock signal can be recognized by the target encoder, and the target encoder can send the position reading based on the adjusted acquisition instruction and the adjusted clock signal.

[0079] Reference Figure 3 , Figure 3 The target encoder reads the position signal of the motor to obtain the position reading.

[0080] When the target protocol matches the preset protocol and the reply confirmation frame sent by the target encoder is received, the processor of the servo system obtains an acquisition instruction and sends the acquisition instruction and the preset clock signal to the level conversion circuit; the level conversion circuit adjusts the level of the acquisition instruction and the preset clock signal to obtain the adjusted acquisition instruction and the adjusted clock signal; the level conversion circuit sends the adjusted acquisition instruction and the adjusted clock signal to the target encoder, and the target encoder sends the position reading to the level conversion circuit based on the adjusted acquisition instruction and the adjusted clock signal, the level conversion circuit adjusts the level of the position reading to obtain the adjusted position reading recognizable by the processor, and the processor receives the adjusted position reading sent by the level conversion circuit.

[0081] The technical solution of the present invention proposes a method for obtaining encoder readings, which includes the following steps: sending a preset protocol identification frame to a target encoder so that the target encoder obtains a target reply frame based on the received preset protocol identification frame; if the target reply frame sent by the target encoder is received, reading the target protocol of the target encoder in the target reply frame; when the target protocol matches the preset protocol, using the target protocol to obtain the position reading in the target encoder.

[0082] In the existing encoder data reading method, the reading software adopts the enumeration or polling method, and sends one protocol to the target encoder each time in a preset order until the correct reply frame of the target encoder is received, and then the target encoder and the target protocol of the target encoder can be determined based on the correct reply frame. The reading software needs to perform multiple sending operations to determine the target protocol among many protocols, which makes the encoder's position reading speed slow and the encoder's position reading efficiency low. In the present invention, only one sending operation of the preset protocol identification frame is required to read the target protocol of the target encoder in the received target reply frame, thereby greatly reducing the number of sending operations, thereby improving the speed of obtaining the target protocol, further improving the encoder's position reading speed, and achieving the technical effect of improving the encoder's position reading efficiency.

[0083] Reference Figure 4 , Figure 4 This is a structural block diagram of a first embodiment of an encoder reading acquisition device of the present invention, the device is used in a servo system, based on the same inventive concept as the above-mentioned embodiment, the device comprises:

[0084] The sending module 10 is used to send a preset protocol identification frame to a target encoder, so that the target encoder obtains a target reply frame based on the received preset protocol identification frame;

[0085] The receiving module 20 is configured to read the target protocol of the target encoder from the target reply frame if the target reply frame sent by the target encoder is received;

[0086] The acquisition module 30 is used to acquire the position reading in the target encoder using the target protocol when the target protocol matches the preset protocol.

[0087] It should be noted that, since the steps executed by the device of this embodiment are the same as the steps of the aforementioned method embodiment, its specific implementation method and the technical effects that can be achieved can refer to the aforementioned embodiment and will not be repeated here.

[0088] The above descriptions are only optional embodiments of the present invention, and are not intended to limit the patent scope of the present invention. All equivalent structural changes made using the contents of the present invention's specification and drawings, or directly / indirectly applied in other related technical fields, are included in the patent protection scope of the present invention.

Claims

1. A method for obtaining encoder readings, characterized in that: The method comprises the following steps: Sending a preset protocol identification frame to a target encoder so that the target encoder obtains a target reply frame based on the received preset protocol identification frame; the preset protocol identification frame is a specific protocol identification frame set by a user based on demand and does not change with the protocol conversion of the encoder; If the target reply frame sent by the target encoder is received, reading the target protocol of the target encoder in the target reply frame; When the target protocol matches the preset protocol, obtaining a position reading in the target encoder using the target protocol; If the target reply frame sent by the target encoder is not received, first prompt information is obtained, where the first prompt information is information prompting the user to change the target encoder; Outputting the first prompt information; When a first determination operation for the first prompt information of the output state is received, based on the first determination operation, the step of sending the preset protocol identification frame to the target encoder is returned to be executed.

2. The method according to claim 1, characterized in that The step of obtaining a position reading in the target encoder using the target protocol comprises: Based on the target protocol, obtaining a protocol confirmation frame; Sending the protocol confirmation frame to the target encoder, so that the target encoder obtains a reply confirmation frame based on the received protocol confirmation frame; If the reply confirmation frame sent by the target encoder is received, the position reading in the target encoder is obtained using the target protocol.

3. The method according to claim 1, characterized in that After the step of reading the target protocol of the target encoder in the target reply frame, the method further comprises: When the target protocol does not match the preset protocol, obtaining second prompt information, wherein the second prompt information is information for prompting the user to replace the target encoder; outputting the second prompt information; When a second determination operation for the second prompt information is received, based on the second determination operation, the step of sending the preset protocol identification frame to the target encoder is returned to be executed.

4. The method according to claim 1, characterized in that The step of obtaining a position reading in the target encoder using the target protocol comprises: Based on the target protocol, obtaining an acquisition instruction; Sending the acquisition instruction and the preset clock signal to the target encoder, so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal; The position reading sent by the target encoder is received.

5. The method according to claim 4, characterized in that Before the step of sending the acquisition instruction and the preset clock signal to the target encoder so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal, the method further includes: Performing level adjustment on the acquisition instruction and the preset clock signal to obtain an adjusted acquisition instruction and an adjusted clock signal; The step of sending the acquisition instruction and the preset clock signal to the target encoder so that the target encoder sends the position reading based on the acquisition instruction and the preset clock signal comprises: The adjusted acquisition instruction and the adjusted clock signal are sent to the target encoder, so that the target encoder sends the position reading based on the adjusted acquisition instruction and the adjusted clock signal.

6. The method according to any one of claims 1 to 5, characterized in that: The preset protocols include ENDAT protocol, BISS protocol and SSI protocol.

7. An encoder reading acquisition device, characterized in that: The device comprises: A sending module, used for sending a preset protocol identification frame to a target encoder, so that the target encoder obtains a target reply frame based on the received preset protocol identification frame; the preset protocol identification frame is a specific protocol identification frame set by a user based on demand and does not change with the protocol conversion of the encoder; A receiving module, configured to read the target protocol of the target encoder from the target reply frame if the target reply frame sent by the target encoder is received; an acquisition module, configured to acquire a position reading in the target encoder using the target protocol when the target protocol matches a preset protocol; The acquisition module is further configured to, if the target reply frame sent by the target encoder is not received, obtain first prompt information, the first prompt information being information prompting the user to change the target encoder; and output the first prompt information; The receiving module is further configured to, upon receiving a first determination operation for the first prompt information of the output state, return to execute the sending module based on the first determination operation to send a preset protocol identification frame to the target encoder.

8. A servo system, characterized in that: The servo system comprises: a memory, a processor and an encoder reading acquisition program stored in the memory and running on the processor, wherein the encoder reading acquisition program implements the steps of the encoder reading acquisition method according to any one of claims 1 to 6 when executed by the processor.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an encoder reading acquisition program, and when the encoder reading acquisition program is executed by a processor, the steps of the encoder reading acquisition method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Communication method and device compatible with multiple protocols, and electronic equipment

    CN110351242A

  • Electric motor drive device

    JP2013110904A