Disclosure of Invention
The invention aims to provide a switching interface, a recognition method and a device for recognizing a coder by a servo driver, which can enable the servo driver to effectively recognize different types of external coders and improve the universality of the coder.
In order to achieve the purpose, the following technical scheme is adopted in the application:
an embodiment of the present invention provides an adapter for a servo driver identification encoder, including: a plurality of identification circuits for identifying a plurality of types of encoders are supported, and the plurality of identification circuits share a signal input port for indiscriminately connecting the encoders of the respective types.
The embodiment of the present invention further provides a method for identifying an encoder by a servo driver, which is applied to the adaptor for identifying an encoder by a servo driver according to the first embodiment, and includes:
an ARM in the servo driver sequentially utilizes an identification circuit which supports identification of different types of encoders in the adapter interface to execute an initialization process on an external encoder;
and when the initialization process of any type of encoder is successfully completed, stopping the initialization process of the subsequent encoder type, and determining the encoder type successfully initialized currently as the type of the current external encoder.
The embodiment of the present invention further provides an apparatus for identifying an encoder by a servo driver, which is suitable for the adapter interface for identifying an encoder by a servo driver according to the first embodiment, and includes:
the initialization module is used for controlling an ARM in the servo driver to sequentially utilize an identification circuit which supports identification of different types of encoders in the adapter interface to execute an initialization process on an external encoder;
and the identification module is used for stopping the initialization process of the subsequent encoder type after the initialization process of any type of encoder is successfully completed, and determining the type of the encoder which is successfully initialized currently as the type of the current external encoder.
An embodiment of the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method for servo drive identification encoder as described above.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method for a servo drive to recognize an encoder as described above.
Compared with the prior art, the embodiment of the invention connects different types of encoders to the servo driver externally through a switching interface for identifying the encoders by the servo driver; the adapter port supports a plurality of identification circuits for identifying various types of encoders, and the identification circuits share one signal input port for indiscriminately connecting the encoders of corresponding types, so that the encoders of different types can be externally connected to the servo driver through the adapter port and identification can be completed.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
A first embodiment of the invention relates to an adapter for a servo drive identification encoder. The core of the embodiment is that the adapter port supports a plurality of identification circuits for identifying a plurality of types of encoders, and the plurality of identification circuits share one signal input port for indiscriminately connecting the encoders of corresponding types. The following describes implementation details of the adapter for the servo driver identification encoder of the present embodiment in detail, and the following description is only provided for the sake of understanding, and is not necessary to implement the present embodiment. As shown in fig. 1, the adapter for the servo driver identification encoder includes:
a plurality of identification circuits (not shown) for identifying a plurality of types of encoders are supported, and the plurality of identification circuits share a signal input port for indiscriminately connecting the respective types of encoders.
Specifically, the adapter interface for the identification encoder of the servo driver in the scheme can be welded in the servo driver, a plurality of identification circuits which can be used for supporting and identifying various types of encoders are integrated in the adapter interface, the circuit principle of each identification circuit and the specific circuit structure of the identification circuit are the same as or similar to those of the existing identification circuit supporting and identifying the encoder, for example, the adapter interface can be an identification circuit supporting and identifying a non-wire-saving ABZ encoder and an absolute value encoder. In the scheme, the existing single identification circuits are integrated into a switching interface, and the identification circuits share a signal input port so as to achieve the purpose of indiscriminately connecting the corresponding types of encoders. In other words, in actual operation, different types of encoders can be directly plugged into the signal input end in fig. 1, and the encoders are identified by corresponding identification circuits in the adapter interface so as to be in signal connection with the servo driver, without worrying about the problem that a single encoder interface provided on a similar servo driver does not match the current encoder.
In addition, in order to save the number of signal line ports of the signal input port, as shown in fig. 1, part of the input signal lines of the part identification circuit in the signal input port in the present scheme share the signal line ports. When the external encoder is identified through the identification circuit, the on-off state of each identification circuit can be controlled through the switching circuit, so that the input signals of the external encoder can be distinguished.
For example, the plurality of identification circuits may include at least: an identification circuit for identifying the non-wire-saving ABZ encoder and the absolute value encoder.
Accordingly, as shown in fig. 1, in the signal input port, the W +, W-, Z +, Z-input signal lines of the non-dotted ABZ encoder and the PS +, PS-, CLK +, CLK-input signal lines of the absolute value encoder correspond to share one signal line port, thereby reducing the number of signal line ports of the signal input port. In practical application scenarios, another purpose of the signal line sharing is to conform to the interface configuration of the encoder when different types of encoders are connected without difference.
In addition, the plurality of identification circuits can share one signal output port and are used for indiscriminately connecting the servo driver. The signal output port may include a signal line port for transmitting output signals of different encoders. Of course, in consideration of saving the number of signal line ports, some signal line ports may be commonly provided.
Compared with the prior art, the adapter for identifying the encoder by the servo driver provided by the embodiment can externally connect different types of encoders to the servo driver; the adapter port supports a plurality of identification circuits for identifying various types of encoders, and the identification circuits share one signal input port for indiscriminately connecting the encoders of corresponding types, so that the encoders of different types can be externally connected to the servo driver through the adapter port and identification can be completed.
In addition, because some signal lines in the input signal line ends of the plurality of identification circuits share the signal line port, the complexity of the interface circuit in the adapter port can be greatly reduced, and the design cost is reduced.
The second embodiment of the invention relates to a method for identifying an encoder by a servo driver, which is suitable for the adapter interface for identifying the encoder by the servo driver in any one of the first embodiment. As shown in fig. 2, the method includes:
step 201: and the ARM in the servo driver sequentially utilizes an identification circuit which supports identification of different types of encoders in the adapter interface to execute an initialization process on the external encoder.
Specifically, after the encoder is plugged into the signal input port of the adapter interface for the servo driver to identify the encoder shown in fig. 1, since the servo driver does not know the type of the external encoder, the external encoder needs to be identified and initialized by sequentially starting an initialization program (for different types of encoders) pre-built in an ARM (Advanced RISC Machines, Reduced Instruction Set (RISC) processor), and corresponding identification circuits are turned on and other types of identification circuits are turned off during the identification and initialization processes.
Step 202: and when the initialization process of any type of encoder is successfully completed, stopping the initialization process of the subsequent encoder type, and determining the encoder type successfully initialized currently as the type of the current external encoder.
When different types of initialization processes are sequentially adopted to initialize the encoders and the initialization process of any type of encoder is successfully completed, the execution of the initialization process of the subsequent encoder type can be stopped, and the type of the encoder which is successfully initialized currently is determined as the type of the current external encoder. Thereafter, after the encoder type is determined, data interaction between the encoder and the servo driver can be achieved.
In addition, when the initialization processes of all the preset encoder types are not successfully completed and the initialization times of polling are more than the preset times, the external encoder is stopped from executing the initialization processes, and an encoder disconnection alarm is sent.
Specifically, when different types of initialization processes are sequentially adopted to initialize the encoders, the initialization processes of any type of encoders are not successfully completed, and the initialization times of polling are greater than a predetermined number of times (for example, 3 times), it can be determined that the initialization external encoder cannot be identified through the adapter, at this time, the execution of the initialization processes can be stopped, and an encoder disconnection alarm is sent to remind a technician.
Compared with the prior art, the method for identifying the encoder by the servo driver in the embodiment can sequentially utilize the identification circuit supporting identification of different types of encoders in the adapter interface through the ARM in the servo driver to execute an initialization process on the externally connected encoder; and when the initialization process of any type of encoder is successfully completed, stopping the initialization process of the subsequent encoder type, and determining the type of the encoder which is successfully initialized currently as the type of the current external encoder so as to realize the identification of the external encoder by the servo driver.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the present invention relates to an apparatus for a servo driver identification encoder, which is applied to any one of the above-mentioned adapter ports for a servo driver identification encoder, and as shown in fig. 3, the apparatus includes:
the initialization module 310 is configured to control an ARM in the servo driver to sequentially utilize an identification circuit in the adapter to identify different types of encoders, and execute an initialization process on an external encoder;
the identifying module 320 is configured to stop the initialization process of the subsequent encoder type after the initialization process of any type of encoder is successfully completed, and determine the encoder type that is currently and successfully initialized as the type of the current external encoder.
Further, the identifying module 320 may be further configured to stop executing the initialization process on the external encoder and issue an encoder disconnection alarm when the initialization processes of all the preset encoder types are not successfully completed and the number of times of polling initialization is greater than a predetermined number of times.
A fourth embodiment of the invention is directed to an electronic device, as shown in FIG. 4, comprising at least one processor 402; and a memory 401 communicatively coupled to the at least one processor 402; wherein the memory 401 stores instructions executable by the at least one processor 402, the instructions being executable by the at least one processor 402 to enable the at least one processor 402 to perform the above-described method for servo drive identification encoder.
Where the memory 401 and the processor 402 are coupled by a bus, which may include any number of interconnected buses and bridges that couple one or more of the various circuits of the processor 402 and the memory 401 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 402 is transmitted over a wireless medium through an antenna, which further receives the data and transmits the data to the processor 402.
The processor 402 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 401 may be used to store data used by processor 402 in performing operations.
A fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes any of the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.