CN116659557A - Method and device for monitoring pulse times and direction signals and electronic equipment - Google Patents
Method and device for monitoring pulse times and direction signals and electronic equipment Download PDFInfo
- Publication number
- CN116659557A CN116659557A CN202310637038.9A CN202310637038A CN116659557A CN 116659557 A CN116659557 A CN 116659557A CN 202310637038 A CN202310637038 A CN 202310637038A CN 116659557 A CN116659557 A CN 116659557A
- Authority
- CN
- China
- Prior art keywords
- signal
- potential
- path
- way
- signals
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Manipulation Of Pulses (AREA)
Abstract
The application provides a method, a device and electronic equipment for monitoring pulse times and direction signals, wherein the method comprises the following steps: acquiring first potential change information and second potential change information output by a decoder; determining a plurality of two-way potential states according to the first potential change information and the second potential change information; the signal types of the A-path signal and the B-path signal are the same, and the A-path signal and the B-path signal are respectively one of the following: in the case of the quadrature pulse signal, the binary pulse signal, and the PLC pulse signal, the number of pulses and the plurality of direction signals of the encoder are determined based on all the two-way potential states. For different types of signal orthogonal pulse signals, binary pulse signals and PLC pulse signals, a mode of considering potential change information of two paths of signals is adopted as a judgment basis, so that the problem that the existing scheme can only monitor pulse times and direction signals for a single form of signal output by an encoder is solved.
Description
Technical Field
The present application relates to the technical field of encoders and decoders, and in particular, to a method and apparatus for monitoring pulse number and direction signals, a computer readable storage medium, and an electronic device.
Background
The common photoelectric encoding mainly takes three forms, including absolute encoding, semi-absolute encoding and incremental encoding, and the difference between encoder types is the information contained on the code wheel and how the external decoder and control system parse the signals input by the encoder. The decoding circuit in the prior art scheme is mainly oriented to a single incremental encoder, cannot be compatible with other types of encoders, and particularly is difficult to process the output of a PLC (programmable logic controller) commonly used in industrial automation motion control. In addition, devices such as monostable flip-flops, capacitive resistors, RS flip-flops and the like are required to be used in the circuit in the prior art, which is not beneficial to the design and realization of a pure digital ASIC chip.
It can be seen that the existing scheme can only monitor pulse times and direction signals for a single form of signal output by the encoder, i.e. has poor compatibility.
Disclosure of Invention
The application aims to provide a method, a device, a computer readable storage medium and an electronic device for monitoring pulse times and direction signals, which are used for at least solving the problem that the existing scheme can only monitor the pulse times and the direction signals for a single form of signals output by an encoder.
In order to achieve the above object, according to one aspect of the present application, there is provided a method of monitoring a pulse number and direction signal, the method comprising: acquiring first potential change information and second potential change information output by a decoder, wherein the decoder generates the potential change information of an A path signal and the potential change information of a B path signal according to the A path signal and the B path signal after receiving the A path signal and the B path signal output by an encoder, takes the potential change information of the A path signal as the first potential change information and takes the potential change information of the B path signal as the second potential change information; determining a plurality of two-way potential states according to the first potential change information and the second potential change information, wherein the two-way potential states are used for representing potential states of the A-way signal and the B-way signal at the same moment; and the signal types of the A-path signal and the B-path signal are the same, and the A-path signal and the B-path signal are respectively one of the following: under the conditions of orthogonal pulse signals, binary pulse signals and PLC pulse signals, the pulse times and a plurality of direction signals of the encoder are determined according to all the two-path potential states, the direction signals are signals representing the rotation direction of a rotating shaft of the encoder, and the rotation direction of the rotating shaft of the encoder is forward rotation or reverse rotation.
Optionally, when the a-path signal and the B-path signal are the orthogonal pulse signals, determining a plurality of direction signals according to all the two-path potential states includes: under the condition that the change rule of the two paths of potential states in a preset time period meets a first change rule, determining that the direction signal is a forward rotation signal, wherein the first change rule is a change rule conforming to a first cyclic sequence, the first cyclic sequence is { CD, CC, DC, DD, CD, … }, C is used for representing a high level, D is used for representing a low level, and each number in the first cyclic sequence is respectively used for representing the two paths of potential states corresponding to one moment in the preset time period; and under the condition that the change rule of the two-way potential state in the preset time period meets a second change rule, determining that the direction signal is an inversion signal, wherein the second change rule is a change rule following a second cyclic sequence, the second cyclic sequence is { CC, CD, DD, DC, CC, … }, and each number of the second cyclic sequence is used for representing the two-way potential state corresponding to one moment in the preset time period.
Optionally, when the a-path signal and the B-path signal are the binary pulse signals, determining a plurality of direction signals according to all the two-path potential states includes: determining that the direction signal is a forward rotation signal under the condition that the change rule of the two-way potential state in a preset time period meets a third change rule, wherein the third change rule is a change rule following a third cyclic sequence, the third cyclic sequence is { DC, CD, CC, DD, DC, … }, each number in the third cyclic sequence is used for representing the two-way potential state corresponding to one moment in the preset time period, C is used for representing a high level, and D is used for representing a low level; and under the condition that the change rule of the two-way potential state in the preset time period meets a fourth change rule, determining that the direction signal is an inversion signal, wherein the fourth change rule is a change rule following a fourth cycle number sequence, the fourth cycle number sequence is { CD, DC, DD, CC, CD, … }, and each number of the fourth cycle number sequence is used for representing the two-way potential state corresponding to one moment in the preset time period.
Optionally, when the a-path signal and the B-path signal are the PLC pulse signals, determining a plurality of direction signals according to all the two-path potential states includes: when the potential state of the B-path signal is high level and the change process of the two paths of potential states at adjacent moments within a preset time period is from DC to CC or from CC to DC, determining the direction signal as a forward signal, wherein C is used for representing high level, and D is used for representing low level; and determining that the direction signal is an inversion signal when the potential state of the B-path signal is at a high level and the change process of the two-path potential state at adjacent moments in the preset time period is from CD to CC or from CC to CD.
Optionally, when the a-path signal and the B-path signal are the PLC pulse signals, determining a plurality of direction signals according to all the two-path potential states includes: when the potential state of the A-path signal is high level and the change process of the two paths of potential states at adjacent moments in a preset time period is from DD to CD or from CD to DD, determining the direction signal as a forward signal, wherein C is used for representing high level and D is used for representing low level; and determining that the direction signal is an inversion signal when the potential state of the A-path signal is at a high level and the change process of the two-path potential state at adjacent time points within the preset time period is from DD to DC or from DC to DD.
Optionally, the method further comprises: when the signal types of the A-path signal and the B-path signal are different, the A-path signal is the pulse frequency, and the B-path signal is the multiple direction signals, doubling the pulse frequency, and determining the final pulse frequency; outputting the final pulse number and the plurality of direction signals.
Optionally, determining the pulse number according to all the two-way potential states includes: and under the condition that the number of the two paths of potential states is N, determining that the pulse times are N-1, wherein N is a positive integer.
According to another aspect of the present application, there is provided a monitoring apparatus of pulse number and direction signal, the apparatus including an acquisition unit, a first determination unit, and a second determination unit; the acquisition unit is used for acquiring first potential change information and second potential change information output by the decoder, wherein the decoder generates the potential change information of the A-path signal and the potential change information of the B-path signal according to the A-path signal and the B-path signal after receiving the A-path signal and the B-path signal output by the encoder, takes the potential change information of the A-path signal as the first potential change information and the potential change information of the B-path signal as the second potential change information; the first determining unit is used for determining a plurality of two-way potential states according to the first potential change information and the second potential change information, and the two-way potential states are used for representing potential states of the A-way signal and the B-way signal at the same time; the second determining unit is configured to determine that the signal types of the signal of the path a and the signal of the path B are the same, and the signal of the path a and the signal of the path B are one of the following: under the conditions of orthogonal pulse signals, binary pulse signals and PLC pulse signals, the pulse times and a plurality of direction signals of the encoder are determined according to all the two-path potential states, the direction signals are signals representing the rotation direction of a rotating shaft of the encoder, and the rotation direction of the rotating shaft of the encoder is forward rotation or reverse rotation.
According to another aspect of the present application, there is provided a computer readable storage medium, the computer readable storage medium including a stored program, wherein the program when run controls a device in which the computer readable storage medium is located to perform any one of the methods for monitoring pulse number and direction signals.
According to another aspect of the present application, there is provided an electronic apparatus characterized by comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a monitoring method for performing any one of the pulse number and direction signals.
By applying the technical scheme of the application, for different types of signal orthogonal pulse signals, binary pulse signals and PLC pulse signals, a mode of considering potential change information of two paths of signals is adopted as a judgment basis, so that pulse times and direction signals are further known, and the problem that the existing scheme can only monitor the pulse times and direction signals for a single form of signal output by an encoder is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
fig. 1 is a block diagram showing a hardware configuration of a mobile terminal performing a method of monitoring a pulse number and a direction signal according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for monitoring pulse count and direction signals according to an embodiment of the present application;
fig. 3 shows a schematic diagram of first potential change information and second potential change information in the case where the a-way signal and the B-way signal are orthogonal pulse signals;
FIG. 4 shows a schematic diagram of the determination of the direction signal in the case where the A-way signal and the B-way signal are binary pulse signals;
fig. 5 shows a schematic diagram of first potential change information and second potential change information in the case where the a-way signal and the B-way signal are binary pulse signals;
FIG. 6 shows a schematic diagram of the determination of the direction signal in the case where the A-way signal and the B-way signal are binary pulse signals;
fig. 7 shows a schematic diagram of first potential change information and second potential change information in the case where the a-way signal and the B-way signal are the PLC pulse signals;
Fig. 8 shows a schematic diagram of determining a direction signal in the case where the a-path signal and the B-path signal are the PLC pulse signals;
fig. 9 is a schematic diagram showing first potential change information and second potential change information in the case where the signal types of the a-way signal and the B-way signal are different, and the a-way signal is the pulse number, and the B-way signal is a plurality of direction signals;
fig. 10 is a block diagram showing the structure of a device for monitoring pulse number and direction signals according to an embodiment of the present application.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the application herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As described in the background art, the existing scheme can only monitor the pulse number and the direction signal for the single-form signal output by the encoder, that is, has poor compatibility, and in order to solve the problem that the existing scheme can only monitor the pulse number and the direction signal for the single-form signal output by the encoder, the embodiment of the application provides a method, a device, a computer readable storage medium and an electronic device for monitoring the pulse number and the direction signal.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal according to a method for monitoring pulse number and direction signals according to an embodiment of the present application. As shown in fig. 1, a mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for monitoring pulse number and direction signals in an embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the above-mentioned method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for monitoring the number of pulses and direction signals running on a mobile terminal, a computer terminal or similar computing device is provided, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system such as a set of computer executable instructions, and although a logical sequence is shown in the flowchart, in some cases the steps shown or described may be performed in a different order than here.
Fig. 2 is a flow chart of a method for monitoring pulse number and direction signals according to an embodiment of the present application. As shown in fig. 2, the method comprises the steps of:
step S201, obtaining first potential change information and second potential change information output by a decoder, wherein the decoder generates potential change information of an A-path signal and potential change information of a B-path signal according to the A-path signal and the B-path signal after receiving the A-path signal and the B-path signal output by an encoder, and takes the potential change information of the A-path signal as the first potential change information and the potential change information of the B-path signal as the second potential change information;
Specifically, the first potential change information and the second potential change information may be displayed in the form of a potential change map.
Step S202, determining a plurality of two-way potential states according to the first potential change information and the second potential change information, wherein the two-way potential states are used for representing potential states of the A-way signal and the B-way signal at the same time;
specifically, for example, when the two-way potential state is 01, the potential state of the a-way signal is low, the potential state of the B-way signal is high, and for example, when the two-way potential state is 10, the potential state of the a-way signal is high, and the potential state of the B-way signal is low.
Step S203, wherein the signal types of the a-path signal and the B-path signal are the same, and the a-path signal and the B-path signal are one of the following signals: in the case of the quadrature pulse signal, the binary pulse signal, and the PLC pulse signal, the number of pulses of the encoder and a plurality of direction signals representing a rotation direction of a rotation shaft of the encoder are determined based on all of the two-way potential states, and the rotation direction of the rotation shaft of the encoder is either normal rotation or reverse rotation.
In one embodiment of the present application, when the a-path signal and the B-path signal are the orthogonal pulse signals, determining a plurality of direction signals based on all of the two-path potential states includes:
under the condition that the change rule of the two-way potential state in the preset time period meets a first change rule, determining the direction signal as a forward rotation signal, wherein the first change rule is a change rule conforming to a first cycle sequence, the first cycle sequence is { CD, CC, DC, DD, CD, … }, each number of the first cycle sequence is used for representing the two-way potential state corresponding to one moment in the preset time period, C is used for representing high level, and D is used for representing low level;
specifically, C is high, D is low, C can be represented by 1, D can be represented by 0, as shown in fig. 3 and 4, fig. 3 (the first half of the a-way signal leads the B-way signal by 90 ° corresponding to the process of the positive rotation of the mechanical shaft of the encoder; the second half of the B-way signal leads the a-way signal by 90 ° corresponding to the process of the negative rotation of the mechanical shaft) shows first potential change information and second potential change information in the case where the change law of the two-way potential state in the predetermined period satisfies the first change law, fig. 4 shows first cycle number columns {10, 11, 01, 00, 10, … }, the direction signal is determined to be a forward signal, and +1 in fig. 4 shows a forward signal, -1 shows a reverse signal;
And determining that the direction signal is an inversion signal when the change rule of the two-way potential state in the predetermined time period satisfies a second change rule, wherein the second change rule is a change rule following a second cyclic sequence, the second cyclic sequence is { CC, CD, DD, DC, CC, … }, and each number of the second cyclic sequence is used for representing the two-way potential state corresponding to one moment in the predetermined time period.
Specifically, fig. 4 shows that in the case where the second cyclic number sequence is {11, 10, 00, 01, 11, … }, the above-described direction signal is determined to be an inversion signal.
In one embodiment of the present application, when the a-path signal and the B-path signal are the binary pulse signals, determining a plurality of direction signals according to all of the two-path potential states includes:
determining the direction signal as a forward rotation signal when the change rule of the two-way potential state in the preset time period meets a third change rule, wherein the third change rule is a change rule conforming to a third cyclic sequence, the third cyclic sequence is { DC, CD, CC, DD, DC, … }, each number in the third cyclic sequence is used for representing the two-way potential state corresponding to one moment in the preset time period, C is used for representing a high level, and D is used for representing a low level;
Specifically, as shown in fig. 5 and 6, fig. 5 shows the first potential change information and the second potential change information in the case where the change rule of the two-way potential state in the predetermined period satisfies the third change rule, fig. 6 shows the determination of the direction signal as the forward signal in the case where the third cyclic number sequence is {01, 10, 11, 00, 01, … }, and fig. 6 and 4 are not repeated herein in the same manner.
And determining that the direction signal is an inversion signal when the change rule of the two-way potential state in the predetermined period satisfies a fourth change rule, wherein the fourth change rule is a change rule following a fourth cycle sequence, the fourth cycle sequence is { CD, DC, DD, CC, CD, … }, and each number of the fourth cycle sequence is used for representing the two-way potential state corresponding to one moment in the predetermined period.
Specifically, as shown in fig. 6, in the case where the fourth cyclic sequence is {10, 01, 00, 11, 10, … }, the direction signal is determined to be an inversion signal.
In one embodiment of the present application, when the a-path signal and the B-path signal are the PLC pulse signals, determining a plurality of direction signals according to all of the two-path potential states includes: when the potential state of the B-path signal is at a high level and the change process of the two paths of potential states at adjacent moments within a preset time period is from DC to CC or from CC to DC, determining that the direction signal is a forward signal, wherein C is used for representing a high level, and D is used for representing a low level; when the potential state of the B-path signal is at a high level and the change of the two-path potential state at adjacent time points within the predetermined period is from CD to CC or from CC to CD, the direction signal is determined to be an inversion signal.
Specifically, the serial communication is usually performed with the sensor and the monitor by using the PLC, and the common interface protocols mainly include three interface protocols of SSI, biSS-C and endat2.2, as shown in fig. 7 and 8, fig. 7 (1) shows the first potential change information and the second potential change information when the a-path signal and the B-path signal are the PLC pulse signals, and the potential state of the default B-path signal is always at the high level;
fig. 8 (1) shows that in the case where the change in the two-way potential state at the adjacent timing within the predetermined period is from 01 to 11 or from 11 to 01, the direction signal is determined to be a forward rotation signal;
fig. 8 (1) also shows that the direction signal is determined to be an inversion signal in the case where the change in the two-way potential state at the adjacent timing within the predetermined period is from 10 to 11 or from 11 to 10.
In one embodiment of the present application, when the a-path signal and the B-path signal are the PLC pulse signals, determining a plurality of direction signals according to all of the two-path potential states includes: when the potential state of the a-path signal is at a high level and the adjacent time of the two-path potential state within a predetermined period is from DD to CD or from CD to DD, determining that the direction signal is a forward signal, wherein C is used for representing a high level and D is used for representing a low level; when the potential state of the a-way signal is at a high level and the change in the two-way potential state at adjacent times within the predetermined period is from DD to DC or from DC to DD, the direction signal is determined to be an inversion signal.
Specifically, fig. 7 (2) shows the first potential change information and the second potential change information in the case where the a-path signal and the B-path signal are the PLC pulse signals, and the potential state of the default a-path signal is always at the high level;
fig. 8 (2) shows that in the case where the change of the two-way potential state at the adjacent timing within the predetermined period is from 00 to 10 or from 10 to 00, the direction signal is determined to be a forward rotation signal;
fig. 8 (2) also shows that the direction signal is determined to be an inversion signal in the case where the change process of the adjacent time points of the two-way potential state in the predetermined period is from 00 to 01 or from 01 to 00.
In one embodiment of the present application, the method further includes: when the signal types of the signal of the A path and the signal of the B path are different, the signal of the A path is the pulse number, and the signal of the B path is the multiple direction signals, the final pulse number and the multiple direction signals are directly output; or the pulse number is doubled to determine the final pulse number (for example, if the pulse number is 10, the final pulse number is 20 after the pulse number is doubled to 10), and the final pulse number and the plurality of direction signals are output.
Specifically, fig. 9 (1) shows that in the partial encoder, when the a-way signal is the pulse number and the B-way signal is the plurality of direction signals, the decoding circuit of the PDU directly outputs the two-way potential states as the final pulse number and the plurality of direction signals, respectively; as shown in fig. 9 (2), when the doubling process is not performed, only the positive transition edge of the a-path signal is sampled to output a count pulse, and no signal is generated in the middle of the two signal pulses; when the rotating shaft moves at a low speed, the determining unit cannot receive counting pulses for a long time, and measurement accuracy is inaccurate. In order to improve the accuracy of the speed measurement, as shown in fig. 9 (3), the decoding circuit of the PDU supports frequency multiplication of the input a-path signal, the positive and negative jump edges of the sampling signal output the counting pulse of the PDU, the direction signal is fixed to be high (to perform accumulated count) or low (to perform down count), and the value of the accumulated count is used for real-time speed measurement in the rotation process or average speed measurement in a short time in the speed change rotation process.
In one embodiment of the present application, determining the pulse number according to all the two-way potential states includes: when the number of the two-way potential states is N, the pulse number is determined to be N-1, and N is a positive integer.
Through the embodiment, for different types of signal orthogonal pulse signals, binary pulse signals and PLC pulse signals, a mode of considering potential change information of two paths of signals is adopted as a judgment basis, so that pulse times and direction signals are further known, and the problem that the existing scheme can only monitor the pulse times and direction signals for a single form of signal output by an encoder is solved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a device for monitoring the pulse times and the direction signals, and the device for monitoring the pulse times and the direction signals can be used for executing the method for monitoring the pulse times and the direction signals. The device is used for realizing the above embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The following describes a device for monitoring pulse number and direction signals provided by the embodiment of the application.
Fig. 10 is a block diagram of a device for monitoring pulse number and direction signals according to an embodiment of the present application. As shown in fig. 10, the apparatus includes an acquisition unit 1001, a first determination unit 1002, and a second determination unit 1003; the obtaining unit 1001 is configured to obtain first potential change information and second potential change information output by a decoder, where the decoder generates, after receiving an a-way signal and a B-way signal output by an encoder, potential change information of the a-way signal and potential change information of the B-way signal according to the a-way signal and the B-way signal, and uses the potential change information of the a-way signal as the first potential change information and the potential change information of the B-way signal as the second potential change information; the first determining unit 1002 is configured to determine a plurality of two-way potential states according to the first potential change information and the second potential change information, where the two-way potential states are used to represent potential states of the a-way signal and the B-way signal at the same time; the second determining unit 1003 is configured to make the signal types of the a-path signal and the B-path signal identical, where the a-path signal and the B-path signal are each one of the following: in the case of the quadrature pulse signal, the binary pulse signal, and the PLC pulse signal, the number of pulses of the encoder and a plurality of direction signals representing a rotation direction of a rotation shaft of the encoder are determined based on all of the two-way potential states, and the rotation direction of the rotation shaft of the encoder is either normal rotation or reverse rotation.
In the device, for different types of signal orthogonal pulse signals, binary pulse signals and PLC pulse signals, a mode of considering potential change information of two paths of signals is adopted as a judgment basis, so that pulse times and direction signals are further known, and the problem that the existing scheme can only monitor the pulse times and direction signals for a single type of signal output by an encoder is solved.
In one embodiment of the present application, in a case where the a-path signal and the B-path signal are the orthogonal pulse signals, the second determining unit includes a first determining module and a second determining module, where the first determining module is configured to determine that the direction signal is a forward rotation signal in a case where a change rule of the two-path potential states in a predetermined period satisfies a first change rule, where the first change rule is a change rule following a first cyclic sequence, the first cyclic sequence is { CD, CC, DC, DD, CD, … }, each of the first cyclic sequences is used to characterize the two-path potential states corresponding to one time in the predetermined period, C is used to characterize a high level, and D is used to characterize a low level; the second determining module is configured to determine that the direction signal is an inversion signal when the change rule of the two-way potential state in the predetermined period satisfies a second change rule, where the second change rule is a change rule following a second cyclic sequence of numbers { CC, CD, DD, DC, CC, … }, and each number of the second cyclic sequence of numbers is used to characterize the two-way potential state corresponding to one time in the predetermined period.
In one embodiment of the present application, in the case where the a-path signal and the B-path signal are the binary pulse signals, the second determining unit includes a third determining module and a fourth determining module, where the third determining module is configured to determine that the direction signal is a forward rotation signal when a change rule of the two-path potential states in a predetermined period satisfies a third change rule, where the third change rule is a change rule following a third cyclic sequence, the third cyclic sequence is { DC, CD, CC, DD, DC, … }, each of the third cyclic sequences is used to represent the two-path potential states corresponding to one time in the predetermined period, C is used to represent a high level, and D is used to represent a low level; the fourth determining module is configured to determine that the direction signal is an inversion signal when the change rule of the two-way potential state in the predetermined period satisfies a fourth change rule, where the fourth change rule is a change rule following a fourth cycle sequence, the fourth cycle sequence is { CD, DC, DD, CC, CD, … }, and each of the fourth cycle sequences is used to characterize the two-way potential state corresponding to one time in the predetermined period.
In one embodiment of the present application, when the a-path signal and the B-path signal are the PLC pulse signals, the second determining unit includes a fifth determining module and a sixth determining module, where the fifth determining module is configured to determine that the potential state of the B-path signal is a high level, and that the change process of adjacent time points of the two-path potential state within a predetermined period is a change from DC to CC, or from CC to DC, and that the direction signal is a forward signal, C is configured to represent a high level, and D is configured to represent a low level; the sixth determining module is configured to determine that the direction signal is an inversion signal when the potential state of the B-path signal is at a high level and the change process of the two-path potential state at adjacent time points within the predetermined period is from CD to CC or from CC to CD.
In one embodiment of the present application, in the case where the a-path signal and the B-path signal are the PLC pulse signals, the second determining unit includes a seventh determining module and an eighth determining module, where the seventh determining module is configured to determine that the direction signal is a forward signal, where C is used to represent a high level, and D is used to represent a low level, where a change process of adjacent time points of the a-path signal in a predetermined period is a change from DD to CD or a change from CD to DD; the eighth determining module is configured to determine that the direction signal is an inversion signal when the potential state of the a-way signal is at a high level and the change process of the two-way potential state at adjacent time points within the predetermined period is from DD to DC or from DC to DD.
In one embodiment of the present application, the apparatus further includes a third determining unit and a processing unit, where the third determining unit is configured to double the pulse number to determine a final pulse number when the signal types of the a-path signal and the B-path signal are different, the a-path signal is the pulse number, and the B-path signal is the plurality of direction signals; the processing unit is used for outputting the final pulse times and the plurality of direction signals.
In one embodiment of the present application, the second determining unit includes a ninth determining module for determining that the number of pulses is N-1 and N is a positive integer in the case where the number of the two-way potential states is N.
The monitoring device for pulse times and direction signals comprises a processor and a memory, wherein the acquisition unit, the first determination unit, the second determination unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions. The modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the problem that the existing scheme can only monitor pulse times and direction signals aiming at a single form of signal output by the encoder is solved by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a computer readable storage medium, which comprises a stored program, wherein the program is used for controlling equipment where the computer readable storage medium is positioned to execute the pulse frequency and direction signal monitoring method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program runs to execute the pulse frequency and direction signal monitoring method.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the processor realizes at least the following steps when executing the program: acquiring first potential change information and second potential change information output by a decoder, wherein the decoder generates potential change information of an A-path signal and potential change information of a B-path signal according to the A-path signal and the B-path signal after receiving the A-path signal and the B-path signal output by an encoder, and takes the potential change information of the A-path signal as the first potential change information and the potential change information of the B-path signal as the second potential change information; determining a plurality of two-way potential states according to the first potential change information and the second potential change information, wherein the two-way potential states are used for representing potential states of the A-way signal and the B-way signal at the same time; the signal types of the A-path signal and the B-path signal are the same, and the A-path signal and the B-path signal are respectively one of the following: in the case of the quadrature pulse signal, the binary pulse signal, and the PLC pulse signal, the number of pulses of the encoder and a plurality of direction signals representing a rotation direction of a rotation shaft of the encoder are determined based on all of the two-way potential states, and the rotation direction of the rotation shaft of the encoder is either normal rotation or reverse rotation. The device herein may be a server, PC, PAD, cell phone, etc.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with at least the following method steps: acquiring first potential change information and second potential change information output by a decoder, wherein the decoder generates potential change information of an A-path signal and potential change information of a B-path signal according to the A-path signal and the B-path signal after receiving the A-path signal and the B-path signal output by an encoder, and takes the potential change information of the A-path signal as the first potential change information and the potential change information of the B-path signal as the second potential change information; determining a plurality of two-way potential states according to the first potential change information and the second potential change information, wherein the two-way potential states are used for representing potential states of the A-way signal and the B-way signal at the same time; the signal types of the A-path signal and the B-path signal are the same, and the A-path signal and the B-path signal are respectively one of the following: in the case of the quadrature pulse signal, the binary pulse signal, and the PLC pulse signal, the number of pulses of the encoder and a plurality of direction signals representing a rotation direction of a rotation shaft of the encoder are determined based on all of the two-way potential states, and the rotation direction of the rotation shaft of the encoder is either normal rotation or reverse rotation.
The application also provides an electronic device, which is characterized by comprising: the system comprises one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a monitoring method for performing any one of the pulse number and direction signals. For different types of signal orthogonal pulse signals, binary pulse signals and PLC pulse signals, a mode of considering potential change information of two paths of signals is adopted as a judgment basis, so that pulse times and direction signals are further known, and the problem that the existing scheme can only monitor the pulse times and direction signals for a single form of signal output by an encoder is solved.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
1) The method for monitoring the pulse times and the direction signals of the application adopts a mode of considering the potential change information of the two paths of signals as a judgment basis for different types of signal orthogonal pulse signals, binary pulse signals and PLC pulse signals, and further knows the pulse times and the direction signals, thereby solving the problem that the existing scheme can only monitor the pulse times and the direction signals for a single type of signal output by an encoder.
2) The pulse number and direction signal monitoring device disclosed by the application takes the mode of considering the potential change information of the two paths of signals as a judgment basis for different types of signal orthogonal pulse signals, binary pulse signals and PLC pulse signals, so that the pulse number and direction signals are further known, and the problem that the pulse number and direction signals can only be monitored for a single form of signal output by an encoder in the conventional scheme is solved.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (10)
1. A method for monitoring a pulse count and direction signal, comprising:
acquiring first potential change information and second potential change information output by a decoder, wherein the decoder generates the potential change information of an A path signal and the potential change information of a B path signal according to the A path signal and the B path signal after receiving the A path signal and the B path signal output by an encoder, takes the potential change information of the A path signal as the first potential change information and takes the potential change information of the B path signal as the second potential change information;
determining a plurality of two-way potential states according to the first potential change information and the second potential change information, wherein the two-way potential states are used for representing potential states of the A-way signal and the B-way signal at the same moment;
and the signal types of the A-path signal and the B-path signal are the same, and the A-path signal and the B-path signal are respectively one of the following: under the conditions of orthogonal pulse signals, binary pulse signals and PLC pulse signals, the pulse times and a plurality of direction signals of the encoder are determined according to all the two-path potential states, the direction signals are signals representing the rotation direction of a rotating shaft of the encoder, and the rotation direction of the rotating shaft of the encoder is forward rotation or reverse rotation.
2. The method according to claim 1, wherein, in the case where the a-way signal and the B-way signal are the orthogonal pulse signals, determining a plurality of direction signals from all of the two-way potential states includes:
under the condition that the change rule of the two-way potential state in a preset time period meets a first change rule, determining the direction signal as a forward rotation signal, wherein the first change rule is a change rule conforming to a first cyclic sequence, the first cyclic sequence is { CD, CC, DC, DD, CD, … }, each number in the first cyclic sequence is used for representing the two-way potential state corresponding to one moment in the preset time period, C is used for representing high level, and D is used for representing low level;
and under the condition that the change rule of the two-way potential state in the preset time period meets a second change rule, determining that the direction signal is an inversion signal, wherein the second change rule is a change rule following a second cyclic sequence, the second cyclic sequence is { CC, CD, DD, DC, CC, … }, and each number of the second cyclic sequence is used for representing the two-way potential state corresponding to one moment in the preset time period.
3. The method of claim 1, wherein determining a plurality of direction signals from all of the two-way potential states in the case where the a-way signal and the B-way signal are the binary pulse signals, comprises:
determining that the direction signal is a forward rotation signal under the condition that the change rule of the two-way potential state in a preset time period meets a third change rule, wherein the third change rule is a change rule following a third cyclic sequence, the third cyclic sequence is { DC, CD, CC, DD, DC, … }, each number in the third cyclic sequence is used for representing the two-way potential state corresponding to one moment in the preset time period, C is used for representing a high level, and D is used for representing a low level;
and under the condition that the change rule of the two-way potential state in the preset time period meets a fourth change rule, determining that the direction signal is an inversion signal, wherein the fourth change rule is a change rule following a fourth cycle number sequence, the fourth cycle number sequence is { CD, DC, DD, CC, CD, … }, and each number of the fourth cycle number sequence is used for representing the two-way potential state corresponding to one moment in the preset time period.
4. The method according to claim 1, wherein, in the case where the a-way signal and the B-way signal are the PLC pulse signals, determining a plurality of direction signals according to all of the two-way potential states includes:
when the potential state of the B-path signal is high level and the change process of the two paths of potential states at adjacent moments within a preset time period is from DC to CC or from CC to DC, determining the direction signal as a forward signal, wherein C is used for representing high level, and D is used for representing low level;
and determining that the direction signal is an inversion signal when the potential state of the B-path signal is at a high level and the change process of the two-path potential state at adjacent moments in the preset time period is from CD to CC or from CC to CD.
5. The method according to claim 1, wherein, in the case where the a-way signal and the B-way signal are the PLC pulse signals, determining a plurality of direction signals according to all of the two-way potential states includes:
when the potential state of the A-path signal is high level and the change process of the two paths of potential states at adjacent moments in a preset time period is from DD to CD or from CD to DD, determining the direction signal as a forward signal, wherein C is used for representing high level and D is used for representing low level;
And determining that the direction signal is an inversion signal when the potential state of the A-path signal is at a high level and the change process of the two-path potential state at adjacent time points within the preset time period is from DD to DC or from DC to DD.
6. The method according to claim 1, wherein the method further comprises:
when the signal types of the A-path signal and the B-path signal are different, the A-path signal is the pulse frequency, and the B-path signal is the multiple direction signals, doubling the pulse frequency, and determining the final pulse frequency;
outputting the final pulse number and the plurality of direction signals.
7. The method according to any one of claims 1 to 6, wherein determining the number of pulses from all of the two-way potential states comprises:
and under the condition that the number of the two paths of potential states is N, determining that the pulse times are N-1, wherein N is a positive integer.
8. A device for monitoring a pulse count and direction signal, comprising:
an obtaining unit, configured to obtain first potential change information and second potential change information output by a decoder, where after the decoder receives an a-path signal and a B-path signal output by an encoder, the decoder generates potential change information of the a-path signal and potential change information of the B-path signal according to the a-path signal and the B-path signal, uses the potential change information of the a-path signal as the first potential change information, and uses the potential change information of the B-path signal as the second potential change information;
The first determining unit is used for determining a plurality of two-way potential states according to the first potential change information and the second potential change information, wherein the two-way potential states are used for representing potential states of the A-way signal and the B-way signal at the same time;
the second determining unit is configured to determine that the signal types of the signal of the path a and the signal of the path B are the same, and the signal of the path a and the signal of the path B are one of the following: under the conditions of orthogonal pulse signals, binary pulse signals and PLC pulse signals, the pulse times and a plurality of direction signals of the encoder are determined according to all the two-path potential states, the direction signals are signals representing the rotation direction of a rotating shaft of the encoder, and the rotation direction of the rotating shaft of the encoder is forward rotation or reverse rotation.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run controls a device in which the computer readable storage medium is located to perform the method of monitoring the pulse number and direction signal according to any one of claims 1 to 7.
10. An electronic device, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising a method for performing the monitoring of the pulse count and direction signals of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310637038.9A CN116659557A (en) | 2023-05-31 | 2023-05-31 | Method and device for monitoring pulse times and direction signals and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310637038.9A CN116659557A (en) | 2023-05-31 | 2023-05-31 | Method and device for monitoring pulse times and direction signals and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116659557A true CN116659557A (en) | 2023-08-29 |
Family
ID=87716656
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310637038.9A Pending CN116659557A (en) | 2023-05-31 | 2023-05-31 | Method and device for monitoring pulse times and direction signals and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116659557A (en) |
-
2023
- 2023-05-31 CN CN202310637038.9A patent/CN116659557A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109947073B (en) | Sensor for short pulse width modulation code/one-sided nibble transmission with improved data rate and automatic protocol detection | |
US11177827B2 (en) | Encoder signal sampling method and device | |
CN105008934A (en) | Velocity measurement device and velocity measurement method | |
CN102843118A (en) | Quadrupling and sensing method and device for quadrature encoder | |
CN102893132A (en) | A device and a method for processing signals which represent an angular position of a motor shaft | |
CN116659557A (en) | Method and device for monitoring pulse times and direction signals and electronic equipment | |
CN102879017B (en) | Novel double-speed coarse and fine combination system for resolver-to-digital converter | |
TWI684840B (en) | Electronic machine device and data sending method | |
CN116183954A (en) | Motor speed measuring method, system, device, electronic equipment and storage medium | |
CN109782013B (en) | Motor speed measuring method and device, readable storage medium and electric equipment | |
CN117200755A (en) | IRIG-B direct current clock code decoding method and device | |
CN103973297A (en) | Method And Evaluation Device For A Plausibility Check Of An Incremental Meter | |
CN103561008A (en) | Method and device for decoding transport protocol and transport protocol decoding chip | |
CN116481433A (en) | Method and device for determining motor position and nonvolatile storage medium | |
CN108555906B (en) | Robot control method and device and robot | |
CN111289015A (en) | Multi-resolution absolute position measuring device | |
JP5925485B2 (en) | Encoder device and signal generation method for encoder device | |
CN111328038A (en) | Data transmission method and device under NB (NB) network | |
CN102829808B (en) | Multi-circle code converter based on mechanical gear set circle count | |
CN117792598A (en) | Data transmission method, data transmission device, and computer-readable storage medium | |
CN108871385B (en) | Encoder, motor, encoder data processing method, and storage medium | |
CN107563253B (en) | Signal anti-interference processing method based on mutual sampling | |
CN116165423A (en) | Voltage processing method and voltage processing device | |
CN203645707U (en) | Transmission protocol decoding device and transmission protocol decoding chip | |
JP3067729B2 (en) | Encoder signal processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |