Disclosure of Invention
The embodiment of the application provides a position determining method and a position determining device of a hybrid encoder, which are used for at least solving the technical problems of complex signal processing and low efficiency of the existing magneto-optical hybrid encoder in position determination.
According to an aspect of an embodiment of the present application, there is provided a position determining method of a hybrid encoder, including: determining a first absolute position of the hybrid encoder at the current moment at least according to a first electric signal output by at least one first magnetic induction chip in the hybrid encoder, wherein the first electric signal comprises: the first magnetic induction chip outputs at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for every circle, the sine and cosine signal group comprises sine signals with M periods and cosine signals with M periods, and M is a positive integer; determining the relative position of the hybrid encoder at the current moment according to a second electric signal output by at least one light sensing chip in the hybrid encoder; obtaining a circulant value of the hybrid encoder, wherein the circulant value includes at least one of: determining a first ring value according to a second magnetic induction chip in the hybrid encoder; a second lap value determined from a magnetic sensor in the hybrid encoder; a third cycle value determined according to a Z pulse signal in the second electric signal; acquiring a determined fourth turn value according to the first magnetic induction chip; and determining a second absolute position of the hybrid encoder at the current moment according to the first absolute position, the relative position and the circulant value.
Optionally, detecting a connection state of the hybrid encoder with an external power supply; when the hybrid encoder is detected to be disconnected from the external power supply, a main control chip of the hybrid encoder is controlled to operate in a low power consumption mode, wherein in the low power consumption mode, the first magnetic induction chip and the light induction chip do not work in a sleep state, and the turn number value of the hybrid encoder is obtained according to the second turn number value; when the hybrid encoder is detected to be connected with the external power supply, a main control chip of the hybrid encoder is controlled to operate in a full power consumption mode, wherein in the full power consumption mode, the first magnetic induction chip and the light induction chip are in a normal working state, and the circle value of the hybrid encoder is obtained according to the first circle value or the third circle value or the fourth circle value.
Optionally, in the low power consumption mode, whether a rotor of the hybrid encoder rotates is detected according to the magnetic sensor, where the magnetic sensor includes at least one of: at least two Hall elements, anisotropic magneto-resistance element, giant magneto-resistance element, tunnel magneto-resistance element; counting the number of turns of the hybrid encoder through the magnetic sensor and updating the second turn value when a rotor of the hybrid encoder rotates; and when the rotor of the hybrid encoder does not rotate, the magnetic sensor stops counting the number of turns of the hybrid encoder.
Optionally, detecting a connection state of the hybrid encoder and the external power supply within a preset time in a delayed manner; if the hybrid encoder and the external power supply are continuously disconnected within the preset time, controlling a main control chip of the hybrid encoder to operate in the low power consumption mode; and if the hybrid encoder and the external power supply are connected within the preset time, controlling a main control chip of the hybrid encoder to operate in the full power consumption mode.
Optionally, detecting whether the voltage amplitudes of the sine signal and the cosine signal in the sine and cosine signal group are within a preset range; when the voltage amplitudes of the sine signal and the cosine signal are within the preset range, determining a second absolute position of the hybrid encoder at the current moment according to the first absolute position, the relative position and the circled value; and when the voltage amplitudes of the sine signal and the cosine signal are not in the preset range, generating alarm information, wherein the alarm information is used for prompting that the first magnetic induction chip is abnormal.
Optionally, the second electrical signal includes at least one square wave signal group output by the photo sensing chip when the rotor of the hybrid encoder rotates for every cycle, the square wave signal groups are accumulated to obtain a relative position count value, and the relative position of the hybrid encoder at the current time is determined according to the relative position count value, where the square wave signal group includes K periods of first square wave signals and K periods of second square wave signals, where K is a positive integer, and a phase difference between the first square wave signal and the second square wave signal in the same period is 90 degrees.
Optionally, determining the first absolute position according to the sine and cosine absolute positions of the sine and cosine signal group; or, the first absolute position is determined according to the sine and cosine absolute positions of the sine and cosine signal group and the turn number value of the hybrid encoder.
According to another aspect of the embodiments of the present application, there is also provided a position determining apparatus of a hybrid encoder, including: the first determining module is configured to determine a first absolute position of the hybrid encoder at a current moment according to at least a first electrical signal output by at least one first magnetic induction chip in the hybrid encoder, where the first electrical signal includes: the first magnetic induction chip outputs at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for every circle, the sine and cosine signal group comprises sine signals with M periods and cosine signals with M periods, and M is a positive integer; the second determining module is used for determining the relative position of the hybrid encoder at the current moment according to a second electric signal output by at least one optical sensing chip in the hybrid encoder; an obtaining module, configured to obtain a circulant value of the hybrid encoder, where the circulant value includes at least one of: determining a first ring value according to a second magnetic induction chip in the hybrid encoder; a second lap value determined from a magnetic sensor in the hybrid encoder; a third cycle value determined according to a Z pulse signal in the second electric signal; acquiring a determined fourth turn value according to the first magnetic induction chip; and the third determining module is used for determining a second absolute position of the hybrid encoder at the current moment according to the first absolute position, the relative position and the circulant value.
Optionally, the apparatus further comprises: the first detection module is used for detecting the connection state of the hybrid encoder and an external power supply; wherein: when the hybrid encoder is detected to be disconnected from the external power supply, a main control chip of the hybrid encoder is controlled to operate in a low power consumption mode, wherein in the low power consumption mode, the first magnetic induction chip and the light induction chip do not work in a sleep state, and the turn number value of the hybrid encoder is obtained according to the second turn number value; when the hybrid encoder is detected to be connected with the external power supply, a main control chip of the hybrid encoder is controlled to operate in a full power consumption mode, wherein in the full power consumption mode, the first magnetic induction chip and the light induction chip are in a normal working state, and the circle value of the hybrid encoder is obtained according to the first circle value or the third circle value or the fourth circle value.
Optionally, the apparatus further comprises: the second detection module is used for detecting whether the voltage amplitudes of the sine signal and the cosine signal in the sine and cosine signal group are within a preset range or not; and generating alarm information when the voltage amplitudes of the sine signal and the cosine signal are not in the preset range, wherein the alarm information is used for prompting that the first magnetic induction chip is abnormal.
According to another aspect of the embodiments of the present application, there is also provided a hybrid encoder, wherein the hybrid encoder includes the position determination apparatus of the hybrid encoder described above.
According to another aspect of the embodiments of the present application, there is also provided a motor, wherein the hybrid encoder is included in the motor.
In the embodiment of the application, a first absolute position of the hybrid encoder at the current time is determined at least according to a first electrical signal output by at least one first magnetic induction chip in the hybrid encoder, a relative position of the hybrid encoder at the current time is determined according to a second electrical signal output by at least one light induction chip in the hybrid encoder, a turn number value of the hybrid encoder is obtained, and a second absolute position of the hybrid encoder at the current time is determined according to the first absolute position, the relative position and the turn number value. The first magnetic induction chip outputs at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for one circle, the sine and cosine signal group comprises sine signals with M periods and cosine signals with M periods (M is a positive integer), a first absolute position of the hybrid encoder at the current moment can be determined through the sine and cosine signal group, only one magnetic induction chip is needed in the process, and the technical problems that signal processing is complex and the efficiency is low when the position of the existing magneto-optical hybrid encoder is determined are solved; meanwhile, by detecting the connection state of the hybrid encoder and an external power supply, the main control chip of the hybrid encoder can be automatically controlled to operate in a full power consumption mode or a low power consumption mode, and the power consumption of the hybrid encoder is effectively reduced.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and any other variation 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.
Example 1
In accordance with an embodiment of the present application, there is provided an embodiment of a position determination method for a hybrid encoder, where it is noted that the steps illustrated in the flowchart of the drawings 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 flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a position determination method of a hybrid encoder according to an embodiment of the present application, as shown in fig. 1, the method including the steps of:
step S102, determining a first absolute position of the hybrid encoder at the current moment at least according to a first electric signal output by at least one first magnetic induction chip in the hybrid encoder.
And step S104, determining the relative position of the hybrid encoder at the current moment according to the second electric signal output by at least one optical sensing chip in the hybrid encoder.
Step S106, acquiring the circle value of the hybrid encoder. Wherein, the number of turns value includes at least one of the following: determining a first ring value according to a second magnetic induction chip in the hybrid encoder; a second lap value determined from a magnetic sensor in the hybrid encoder; a third cycle value determined according to the Z pulse signal in the second electric signal; and acquiring the determined fourth turn value according to the first magnetic induction chip.
And step S108, determining a second absolute position of the hybrid encoder at the current moment according to the first absolute position, the relative position and the turn number value.
In some optional embodiments of the present application, the first magnetic induction chip is preferably a TMR (tunneling Magneto Resistance) chip. The first electrical signal mainly includes: the first magnetic induction chip outputs at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for one cycle, wherein the sine and cosine signal group comprises sine signals with M periods and cosine signals with M periods, and M is a positive integer. Optionally, the first electrical signal may also be at least one period of digital signal output by the first magnetic induction chip, or at least one PWM signal that varies with the angular position period, or at least two periods of triangular wave signal, or at least four periods of trapezoidal wave signal.
Taking the output sine and cosine signal group as an example, assuming that the sine and cosine signal group includes a periodic sine signal and a periodic cosine signal, as shown in fig. 2, the phase difference between the sine signal and the cosine signal is 90 °, and as the rotor of the hybrid encoder rotates to any point, the values of the sine signal and the cosine signal output by the first magnetic induction chip are determined, and the first absolute position of the hybrid encoder at the current time can be determined directly according to the sine and cosine absolute position of the sine and cosine signal group. When the sine and cosine signal group includes sine signals and cosine signals of multiple periods, in addition to determining the values of the current sine signals and cosine signals, the number of periods of the current sine signals and cosine signals needs to be determined, so that the accurate sine and cosine absolute positions are determined. Optionally, after the number of turns of the hybrid encoder is obtained, the first absolute position of the hybrid encoder at the current time may be determined according to the sine and cosine absolute positions of the set of sine and cosine signals and the number of turns of the hybrid encoder.
The light sensing chip may employ a common light sensor, and the second electrical signal output by the light sensing chip generally includes: the optical sensing chip outputs at least one square wave signal group or at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for each circle, wherein the square wave signal group comprises K periodic first square wave signals and K periodic second square wave signals, K is a positive integer, the sine and cosine signal group comprises N periodic sine signals and N periodic cosine signals, and N is a positive integer.
Taking the output square wave signal group as an example, the frequencies of the first square wave signal and the second square wave signal in the square wave signal group are generally proportional to the rotation speed of the code wheel of the hybrid encoder, and it is assumed that the square wave signal group includes 2 periods of the first square wave signal and 2 periods of the second square wave signal, as shown in fig. 3, wherein the phase difference between the first square wave signal and the second square wave signal in the same period is 90 degrees. And obtaining a relative position count value by accumulating the first square wave signal and the second square wave signal in the square wave signal group, and then determining the relative position of the hybrid encoder at the current moment according to the relative position count value.
In the related art, when the external power supply of the hybrid encoder is disconnected and powered by a battery, the main control chip of the encoder still keeps normal operation, but in the process, the motor does not rotate in practice for most of the time, so that the main control chip keeps normal operation all the time and only increases the operation power consumption. In order to solve the problem, the application provides a scheme for determining the operation mode of the main control chip according to the connection state of the hybrid encoder and the external power supply so as to reduce the operation power consumption of the encoder.
Specifically, in the operation process of the hybrid encoder, the connection state of the hybrid encoder and an external power supply is detected constantly, and when the hybrid encoder is connected with the external power supply, the main control chip of the hybrid encoder is controlled to operate in a full power consumption mode, wherein in the full power consumption mode, the first magnetic induction chip and the optical induction chip are in a normal working state, and the circle value of the hybrid encoder is acquired according to the first circle value or the third circle value or the fourth circle value. Specifically, the first loop value may be determined according to a third electrical signal output by a second magnetic induction chip in the hybrid encoder, where the third electrical signal may be the above-mentioned sine and cosine signal group or square wave signal group, etc.; or determining a third turn value according to a Z pulse signal in a second electrical signal output by the photo-sensing chip, wherein the photo-sensing chip outputs a Z pulse signal every time a code wheel of the hybrid encoder rotates for one cycle, and as shown in fig. 4, the turn value of the hybrid encoder can be obtained by accumulating the Z pulse signal; the fourth turn value can also be determined directly according to the first electric signal output by the first magnetic induction chip.
When detecting hybrid encoder and external power source disconnection, can control hybrid encoder's main control chip and operate in low-power consumption mode, wherein, under low-power consumption mode, first magnetic induction chip and photoinduction chip are in the sleep state and do not work, acquire hybrid encoder's circle number value according to the second circle number value.
Specifically, in the low power consumption mode, whether the rotor of the hybrid encoder rotates or not may be detected according to a magnetic sensor, where the magnetic sensor includes at least one of: at least two Hall elements (Hall), Anisotropic magnetoresistive elements (AMR), Giant magnetoresistive elements (GMR), Tunnel magnetoresistive elements (TMR); when a rotor of the hybrid encoder rotates, counting the number of turns of the hybrid encoder through the magnetic sensor and updating a second turn value; when the rotor of the hybrid encoder is not rotating, the magnetic sensor stops counting the number of turns of the hybrid encoder.
Taking the hall elements as an example, the output of the hall elements is shown in fig. 5, the output of the first hall element is a first hall signal, the output of the second hall element is a second hall signal, and the single-turn value and the turn value of the hybrid encoder can be determined according to the first hall signal and the second hall signal. Two hall element can detect whether the rotor of hybrid encoder takes place to rotate, when the rotor takes place to rotate, arouses hybrid encoder's main control chip through hall element output signal, makes its reruns in full power consumption mode, need explain that, under this full power consumption mode, mainly through hall element update second circle numerical value in order to confirm hybrid encoder's circle numerical value.
Considering that in some special cases, the hybrid encoder may be disconnected from the external power source for a moment and then reconnected, in some alternative embodiments of the present application, when the hybrid encoder is detected to be disconnected from the external power source, the connection state of the hybrid encoder and the external power source may be detected with a delay within a preset time, and the preset time may be set by the user, for example, set to 5 s. If the hybrid encoder is continuously disconnected with the external power supply within the preset time, controlling a main control chip of the hybrid encoder to operate in a low power consumption mode; and if the hybrid encoder is connected with the external power supply within the preset time, controlling a main control chip of the hybrid encoder to operate in a full power consumption mode.
Fig. 6 shows a schematic flow chart for determining the operation mode of a hybrid encoder, in which: detecting the connection state of the hybrid encoder and an external power supply constantly, awakening a main control chip of the hybrid encoder when the external power supply is switched on, and enabling the main control chip to enter a full power consumption mode, wherein the Hall element normally updates the second circle value in the low power consumption mode, so that the multi-circle value can be synchronized through the second circle value, namely the first circle value, the third circle value and the fourth circle value are updated; when an external power supply is disconnected, the time is counted down for 5s, if the power supply in the 5s is continuously disconnected, the main control chip of the hybrid encoder enters a low power consumption mode, at the moment, the Hall element detects whether the motor rotates or not, if the motor does not rotate, the main control chip of the hybrid encoder keeps the low power consumption mode, if the motor rotates, the main control chip of the hybrid encoder is awakened to enter a full power consumption mode, and when the motor stops rotating, the main control chip of the hybrid encoder enters the low power consumption mode after the time is counted down for 5s again. In the process, when any link detects that the external power supply is switched on, the main control chip of the hybrid encoder is immediately awakened to enter a full power consumption mode.
Considering that the magnetic induction chip may have an abnormality during the operation of the hybrid encoder, in order to ensure the accuracy of the finally determined second absolute position of the hybrid encoder, the magnetic induction chip may be self-checked. Specifically, whether the voltage amplitudes of sine signals and cosine signals in a sine and cosine signal group in a first electric signal output by a first magnetic induction chip are in a preset range or not can be detected; when the voltage amplitudes of the sine signal and the cosine signal are within the preset range, the first electric signal output by the first magnetic induction chip is reliable, the determined first absolute position is reliable, and the second absolute position of the hybrid encoder at the current moment can be determined according to the first absolute position and the relative position; when the voltage amplitudes of the sine signal and the cosine signal are not in the preset range, it is indicated that the first electric signal output by the first magnetic induction chip is unreliable, and at this time, alarm information needs to be generated, wherein the alarm information is used for prompting that the first magnetic induction chip is abnormal.
Optionally, after the self-inspection of the magnetic induction chip is completed, the self-inspection of the optical induction chip can be performed. After determining that the first absolute position is reliable, a difference between the first absolute position and the relative position may be determined; when the difference is smaller than the preset threshold, it is indicated that the relative position determined according to the second electrical signal is also reliable, and at this time, a second absolute position of the hybrid encoder at the current moment can be determined according to the first absolute position and the relative position; when the difference is greater than the preset threshold, it indicates that the relative position determined according to the second electrical signal is unreliable, and at this time, an alarm message needs to be generated, where the alarm message is used to prompt that the optical sensing chip is abnormal, and in this case, the second absolute position of the hybrid encoder at the current moment can be directly determined according to the first absolute position. The preset threshold value can be set by a user according to the requirement on the position precision of the hybrid encoder.
As can be seen from fig. 4, the position of a single turn of the hybrid encoder corresponding to the Z pulse signal output by the photo sensing chip is fixed, and therefore, in some alternative embodiments of the present application, each time the rotor of the hybrid encoder rotates for one revolution, the absolute position of the single turn determined by the first electrical signal in the same rotating shaft region may be verified according to the relative position of the single turn determined by the Z pulse signal, so as to improve the accuracy of the absolute position.
Specifically, the target area where the rotating shaft is located when the Z pulse signal in the second electrical signal is obtained may be determined first, then the single-turn relative position of the rotating shaft in the target area may be determined according to the second electrical signal, the single-turn absolute position of the rotating shaft in the target area may be determined according to the first electrical signal, and then the single-turn absolute position may be verified according to the single-turn relative position, so that the accuracy of the obtained absolute position of the hybrid encoder is higher. In the embodiment of the application, a first absolute position of the hybrid encoder at the current time is determined at least according to a first electrical signal output by at least one first magnetic induction chip in the hybrid encoder, a relative position of the hybrid encoder at the current time is determined according to a second electrical signal output by at least one light induction chip in the hybrid encoder, a turn number value of the hybrid encoder is obtained, and a second absolute position of the hybrid encoder at the current time is determined according to the first absolute position, the relative position and the turn number value. The first magnetic induction chip outputs at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for one circle, the sine and cosine signal group comprises sine signals with M periods and cosine signals with M periods (M is a positive integer), a first absolute position of the hybrid encoder at the current moment can be determined through the sine and cosine signal group, only one magnetic induction chip is needed in the process, and the technical problems that signal processing is complex and the efficiency is low when the position of the existing magneto-optical hybrid encoder is determined are solved; meanwhile, by detecting the connection state of the hybrid encoder and an external power supply, the main control chip of the hybrid encoder can be automatically controlled to operate in a full power consumption mode or a low power consumption mode, and the power consumption of the hybrid encoder is effectively reduced.
Example 2
According to an embodiment of the present application, there is also provided a position determining apparatus of a hybrid encoder for implementing the position determining method of the hybrid encoder, as shown in fig. 7, the apparatus includes a first determining module 70, a second determining module 72, an obtaining module 74 and a third determining module 76, where:
the first determining module 70 is configured to determine a first absolute position of the hybrid encoder at a current moment according to at least a first electrical signal output by at least one first magnetic induction chip in the hybrid encoder, where the first electrical signal includes: the first magnetic induction chip outputs at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for every circle, the sine and cosine signal group comprises sine signals with M periods and cosine signals with M periods, and M is a positive integer.
Taking the output sine and cosine signal group as an example, assuming that the sine and cosine signal group includes a periodic sine signal and a periodic cosine signal, as shown in fig. 2, the phase difference between the sine signal and the cosine signal is 90 °, and as the rotor of the hybrid encoder rotates to any point, the values of the sine signal and the cosine signal output by the first magnetic induction chip are determined, and the first absolute position of the hybrid encoder at the current time can be determined directly according to the sine and cosine absolute position of the sine and cosine signal group. When the sine and cosine signal group includes sine signals and cosine signals of multiple periods, in addition to determining the values of the current sine signals and cosine signals, the number of periods of the current sine signals and cosine signals needs to be determined, so that the accurate sine and cosine absolute positions are determined. Optionally, after the number of turns of the hybrid encoder is obtained, the first absolute position of the hybrid encoder at the current time may be determined according to the sine and cosine absolute positions of the set of sine and cosine signals and the number of turns of the hybrid encoder.
And a second determining module 72, configured to determine a current relative position of the hybrid encoder according to a second electrical signal output by at least one photo-sensing chip in the hybrid encoder.
The light sensing chip may employ a common light sensor, and the second electrical signal output by the light sensing chip generally includes: the optical sensing chip outputs at least one square wave signal group or at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for each circle, wherein the square wave signal group comprises K periodic first square wave signals and K periodic second square wave signals, K is a positive integer, the sine and cosine signal group comprises N periodic sine signals and N periodic cosine signals, and N is a positive integer.
Taking the output square wave signal group as an example, the frequencies of the first square wave signal and the second square wave signal in the square wave signal group are generally proportional to the rotation speed of the code wheel of the hybrid encoder, and it is assumed that the square wave signal group includes 2 periods of the first square wave signal and 2 periods of the second square wave signal, as shown in fig. 3, wherein the phase difference between the first square wave signal and the second square wave signal in the same period is 90 degrees. And obtaining a relative position count value by accumulating the first square wave signal and the second square wave signal in the square wave signal group, and then determining the relative position of the hybrid encoder at the current moment according to the relative position count value.
An obtaining module 74, configured to obtain a turn number value of the hybrid encoder, where the turn number value includes at least one of: determining a first ring value according to a second magnetic induction chip in the hybrid encoder; a second lap value determined from a magnetic sensor in the hybrid encoder; a third cycle value determined according to the Z pulse signal in the second electric signal; and acquiring the determined fourth turn value according to the first magnetic induction chip.
A third determining module 76 is configured to determine a second absolute position of the hybrid encoder at the current time according to the first absolute position, the relative position, and the number of turns.
Optionally, the position determining apparatus of the hybrid encoder further includes a first detecting module, configured to detect a connection state of the hybrid encoder with an external power supply; wherein: when the hybrid encoder is detected to be disconnected from an external power supply, a main control chip of the hybrid encoder is controlled to operate in a low power consumption mode, wherein in the low power consumption mode, a first magnetic induction chip and a light induction chip do not work in a sleep state, and the turn number value of the hybrid encoder is obtained according to a second turn number value; when detecting that hybrid encoder is connected with external power source, the main control chip of control hybrid encoder operates in full power consumption mode, wherein, under full power consumption mode, first magnetic induction chip and photoinduction chip are in normal operating condition, acquire hybrid encoder's circle numerical value according to first circle numerical value or third circle numerical value or fourth circle numerical value.
In the operation process of the hybrid encoder, the connection state of the hybrid encoder and an external power supply is detected constantly, when the hybrid encoder is connected with the external power supply, the main control chip of the hybrid encoder is controlled to operate in a full power consumption mode, wherein in the full power consumption mode, the first magnetic induction chip and the light induction chip are in a normal working state, and the circle value of the hybrid encoder is acquired according to the first circle value or the third circle value or the fourth circle value. Specifically, the first loop value may be determined according to a third electrical signal output by a second magnetic induction chip in the hybrid encoder, where the third electrical signal may be the above-mentioned sine and cosine signal group or square wave signal group, etc.; or determining a third turn value according to a Z pulse signal in a second electrical signal output by the photo-sensing chip, wherein the photo-sensing chip outputs a Z pulse signal every time a code wheel of the hybrid encoder rotates for one cycle, and as shown in fig. 4, the turn value of the hybrid encoder can be obtained by accumulating the Z pulse signal; the fourth turn value can also be determined directly according to the first electric signal output by the first magnetic induction chip.
When detecting hybrid encoder and external power source disconnection, can control hybrid encoder's main control chip and operate in low-power consumption mode, wherein, under low-power consumption mode, first magnetic induction chip and photoinduction chip are in the sleep state and do not work, acquire hybrid encoder's circle number value according to the second circle number value.
Specifically, in the low power consumption mode, whether the rotor of the hybrid encoder rotates or not may be detected according to a magnetic sensor, where the magnetic sensor includes at least one of: at least two Hall elements (Hall), Anisotropic magnetoresistive elements (AMR), Giant magnetoresistive elements (GMR), Tunnel magnetoresistive elements (TMR); when a rotor of the hybrid encoder rotates, counting the number of turns of the hybrid encoder through the magnetic sensor and updating a second turn value; when the rotor of the hybrid encoder is not rotating, the magnetic sensor stops counting the number of turns of the hybrid encoder.
Considering that in some special cases, the hybrid encoder may be disconnected from the external power source for a moment and then reconnected, in some alternative embodiments of the present application, when the hybrid encoder is detected to be disconnected from the external power source, the connection state of the hybrid encoder and the external power source may be detected with a delay within a preset time, and the preset time may be set by the user, for example, set to 5 s. If the hybrid encoder is continuously disconnected with the external power supply within the preset time, controlling a main control chip of the hybrid encoder to operate in a low power consumption mode; and if the hybrid encoder is connected with the external power supply within the preset time, controlling a main control chip of the hybrid encoder to operate in a full power consumption mode.
Optionally, the position determining apparatus of the hybrid encoder further includes a second detecting module, configured to detect whether voltage amplitudes of the sine signal and the cosine signal in the sine and cosine signal group are within a preset range; when the voltage amplitudes of the sine signal and the cosine signal are not within the preset range, warning information is generated and used for prompting that the first magnetic induction chip is abnormal.
Considering that the magnetic induction chip may have an abnormality during the operation of the hybrid encoder, in order to ensure the accuracy of the finally determined second absolute position of the hybrid encoder, the magnetic induction chip may be self-checked. Specifically, whether the voltage amplitudes of sine signals and cosine signals in a sine and cosine signal group in a first electric signal output by a first magnetic induction chip are in a preset range or not can be detected; when the voltage amplitudes of the sine signal and the cosine signal are within the preset range, the first electric signal output by the first magnetic induction chip is reliable, the determined first absolute position is reliable, and the second absolute position of the hybrid encoder at the current moment can be determined according to the first absolute position and the relative position; when the voltage amplitudes of the sine signal and the cosine signal are not in the preset range, it is indicated that the first electric signal output by the first magnetic induction chip is unreliable, and at this time, alarm information needs to be generated, wherein the alarm information is used for prompting that the first magnetic induction chip is abnormal.
Optionally, after the self-inspection of the magnetic induction chip is completed, the self-inspection of the optical induction chip can be performed. After determining that the first absolute position is reliable, a difference between the first absolute position and the relative position may be determined; when the difference is smaller than the preset threshold, it is indicated that the relative position determined according to the second electrical signal is also reliable, and at this time, a second absolute position of the hybrid encoder at the current moment can be determined according to the first absolute position and the relative position; when the difference is greater than the preset threshold, it indicates that the relative position determined according to the second electrical signal is unreliable, and at this time, an alarm message needs to be generated, where the alarm message is used to prompt that the optical sensing chip is abnormal, and in this case, the second absolute position of the hybrid encoder at the current moment can be directly determined according to the first absolute position. The preset threshold value can be set by a user according to the requirement on the position precision of the hybrid encoder.
As can be seen from fig. 4, the position of a single turn of the hybrid encoder corresponding to the Z pulse signal output by the photo sensing chip is fixed, and therefore, in some alternative embodiments of the present application, each time the rotor of the hybrid encoder rotates for one revolution, the absolute position of the single turn determined by the first electrical signal in the same rotating shaft region may be verified according to the relative position of the single turn determined by the Z pulse signal, so as to improve the accuracy of the absolute position.
It should be noted that, in the embodiment of the present application, each module in the position determining device of the hybrid encoder corresponds to an implementation step of the position determining method of the hybrid encoder in embodiment 1 one to one, and since the detailed description has been already made in embodiment 1, details that are not partially embodied in this embodiment may refer to embodiment 1, and are not described herein again.
Example 3
According to an embodiment of the present application, there is also provided a nonvolatile storage medium including a stored program, wherein a device in which the nonvolatile storage medium is located is controlled to execute the position determination method of the hybrid encoder in embodiment 1 when the program is executed.
Specifically, the device in which the nonvolatile storage medium is controlled to execute the following steps when the program runs: determining a first absolute position of the hybrid encoder at the current moment at least according to a first electric signal output by at least one first magnetic induction chip in the hybrid encoder, wherein the first electric signal comprises: the first magnetic induction chip outputs at least one sine and cosine signal group when a rotor of the hybrid encoder rotates for one cycle, the sine and cosine signal group comprises sine signals with M periods and cosine signals with M periods, and M is a positive integer; determining the relative position of the hybrid encoder at the current moment according to a second electric signal output by at least one light sensing chip in the hybrid encoder; obtaining a turn number value of the hybrid encoder, wherein the turn number value at least comprises one of the following: determining a first ring value according to a second magnetic induction chip in the hybrid encoder; a second lap value determined from a magnetic sensor in the hybrid encoder; a third cycle value determined according to the Z pulse signal in the second electric signal; acquiring a determined fourth turn value according to the first magnetic induction chip; and determining a second absolute position of the hybrid encoder at the current moment according to the first absolute position, the relative position and the turn number value.
According to an embodiment of the present application, there is also provided a hybrid encoder, wherein the hybrid encoder includes the position determination apparatus of the hybrid encoder in embodiment 2.
According to the embodiment of the application, a motor is further provided, wherein the hybrid encoder is included in the motor.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit may be a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or may not be executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.