A magnetic encoder can include a magnetic target and a sensor configured to detect and output position information (e.g., absolute angular position) of the target based on changes of the target's magnetic field. In some cases, the target may be a gear having a plurality of magnetic (e.g., ferromagnetic) teeth. The distance between identical points on two adjacent gear teeth is referred as the target's “pitch.” Magnetic encoders are used in electric motor control systems to synchronize the excitation signals, among other applications.
Some magnetic field sensors, such as used in magnetic encoders, include multiple magnetic field sensing elements (e.g., Hall elements) and corresponding front-end circuitry arranged in multiple channels. Each channel may produce a signal and the multiple signals can be processed together to detect and output the target position information.
A two-channel magnetic encoder may require—in terms of achieving a desired accuracy, sensitivity, or other performance characteristic—the processing of two signals both having a 50% duty cycle and with 90° phase shift (sometimes referred to as “phase separation” or “phase offset”) between the signals. That is, the signals being processed should be in quadrature or orthogonal. If these requirements are not met, the encoder may output inaccurate target position information.
With conventional magnetic encoders, the actual phase shift between the signals being processed may depend in significant part on the design of the target (e.g., target pitch), position of magnetic field sensing elements with respect to each other (e.g., spacing between elements) and with respect to the target (e.g., air gap). Thus, the accuracy of conventional encoders may depend in significant part on tolerances during manufacture and assembly.
Disclosed herein are systems and methods to achieve desirable phase shift between two or more magnetic field signals independent of the target design and sensing element spacing.
According to one aspect of the disclosure, a method includes: receiving, by a magnetic field sensor, first and second magnetic field signals responsive to motion of a target; generating first and second digital pulse signals responsive to the first and second magnetic field signals, respectively; calculating a first time between a pulse edge of the first digital pulse signal and a next pulse edge of the second digital pulse signal; calculating a second time between two different pulse edges of the first digital pulse signal or two different pulse edges of the second digital pulse signal; calculating, using the calculated first and second times, a phase shift between the first and second magnetic field signals; and generating, using the calculated phase shift, a third magnetic field signal having a predetermined phase shift from the first magnetic field signal or from the first magnetic field signal.
In some embodiments, the calculating of the first time can include calculating a time between a rising pulse edge of the first digital pulse signal and a next rising pulse edge of the second digital pulse signal. In some embodiments, the calculating of the second time can include calculating a time between consecutive rising pulse edges of the first digital pulse signal or consecutive rising pulse edges of the second digital pulse signal. In some embodiments, the calculating of the phase shift can include dividing the first time by the second time.
In some embodiments, the method can further include generating a third digital pulse signal responsive to the third magnetic field signal. In some embodiments, the method may further include: providing the first digital pulse signal on a first output of the sensor; and selectively providing either the second or third digital pulse signal on a second output of the sensor.
In some embodiments, the method can further include detecting the motion of the target to be a constant motion, wherein the calculating of the phase shift is performed in response to the detecting of the constant motion. In some embodiments, the method can further include: storing, during a first period of operation, the calculated phase shift to a memory of the magnetic field sensor; retrieving, during a second period of operation, the stored phase shift from the memory; and using the retrieved phase shift to generate the third magnetic field signal.
In some embodiments, the predetermined phase shift may be ninety degrees. In some embodiments, the first magnetic field signal can be generated by at least one or more magnetic field sensing elements of the magnetic field sensor and the second magnetic field signal is generated by at least one or more other magnetic field sensing elements of the magnetic field sensor. In some embodiments, the first and second magnetic field sensing elements may comprise Hall effect elements.
In some embodiments, the method may further include: generating, using calculated phase shift, one or more other magnetic field signals having respective other predetermine phase shifts from first magnetic field signal. In some embodiments, the target can comprise a multiple-ring absolute encoder.
According to another aspect of the disclosure, a magnetic field sensor includes: a plurality of magnetic field sensing elements configured to generate first and second magnetic field signals responsive to motion of a target and circuitry configured to perform any embodiments of the method just described.
It should be appreciated that individual elements of different embodiments described herein may be combined to form other embodiments not specifically set forth above. Various elements, which are described in the context of a single embodiment, may also be provided separately or in any suitable sub-combination. It should also be appreciated that other embodiments not specifically described herein are also within the scope of the following claims.
The manner of making and using the disclosed subject matter may be appreciated by reference to the detailed description in connection with the drawings, in which like reference numerals identify like elements.
The drawings are not necessarily to scale, or inclusive of all elements of a system, emphasis instead generally being placed upon illustrating the concepts, structures, and techniques sought to be protected herein.
As used herein, the term “magnetic field sensing element” is used to describe a variety of electronic elements that can sense a magnetic field. The magnetic field sensing element can be, but is not limited to, a Hall Effect element, a magnetoresistance element, or a magnetotransistor. As is known, there are different types of Hall Effect elements, for example, a planar Hall element, a vertical Hall element, and a Circular Vertical Hall (CVH) element. As is also known, there are different types of magnetoresistance elements, for example, a semiconductor magnetoresistance element such as Indium Antimonide (InSb), a giant magnetoresistance (GMR) element, an anisotropic magnetoresistance element (AMR), a tunneling magnetoresistance (TMR) element, and a magnetic tunnel junction (MTJ). The magnetic field sensing element may be a single element or, alternatively, may include two or more magnetic field sensing elements arranged in various configurations, e.g., a half bridge or full (Wheatstone) bridge. Depending on the device type and other application requirements, the magnetic field sensing element may be a device made of a type IV semiconductor material such as Silicon (Si) or Germanium (Ge), or a type III-V semiconductor material like Gallium-Arsenide (GaAs) or an Indium compound, e.g., Indium-Antimonide (InSb).
As is known, some of the above-described magnetic field sensing elements tend to have an axis of maximum sensitivity parallel to a substrate that supports the magnetic field sensing element, and others of the above-described magnetic field sensing elements tend to have an axis of maximum sensitivity perpendicular to a substrate that supports the magnetic field sensing element. In particular, planar Hall elements tend to have axes of sensitivity perpendicular to a substrate, while metal based or metallic magnetoresistance elements (e.g., GMR, TMR, AMR) and vertical Hall elements tend to have axes of sensitivity parallel to a substrate.
As used herein, the term “magnetic field sensor” is used to describe a circuit that uses a magnetic field sensing element, generally in combination with other circuits. Magnetic field sensors are used in a variety of applications, including, but not limited to, an angle sensor that senses an angle of a direction of a magnetic field, a current sensor that senses a magnetic field generated by a current carried by a current-carrying conductor, a magnetic switch that senses the proximity of a ferromagnetic object, a rotation detector that senses passing ferromagnetic articles, for example, magnetic domains of a ring magnet or a ferromagnetic target (e.g., gear teeth) where the magnetic field sensor is used in combination with a back-biased or other magnet, and a magnetic field sensor that senses a magnetic field density of a magnetic field.
As used herein, the terms “target” and “magnetic target” are used to describe an object to be sensed or detected by a magnetic field sensor or magnetic field sensing element.
Turning to
Magnetic field sensor 102 may comprise a plurality of magnetic field sensing elements to generate one or more signals (“magnetic field signals”) responsive to the target 104 (e.g., responsive to its rotation) and circuitry configured to process the magnetic field signals to detect and output information about the target's position. In some embodiments, sensor 102 may output two or more pulse signals encoding target position information.
As shown, target 104 may rotate around an axis 110 (Z axis) and sensor 102 may be positioned alongside the target 104 with surface (or “face”) 112 lying substantially in the Y-Z plane and intersecting the X axis. In this arraignment, the magnetic field sensing elements (e.g., planar Hall elements) may be arranged to have axes of sensitivity perpendicular to sensor surface 112, allowing the approach of gear teeth 106 to be sensed.
In some cases, two or more magnetic field sensing elements within sensor 102 can be spaced apart (e.g., along the Y axis in
In some embodiments, the magnetic field sensing elements and/or the sensor circuitry may be provided on one or more integrated circuits (ICs). As shown, magnetic field sensor 102 may be provided as a 4-pin system in a package (SIP), with at least one of the pins 114 providing an output signal encoding the position information of target 104.
Magnetic encoder 100 can be employed in various types of applications. For example, used in an electric motor control system, target 104 may be coupled to the rotor and the output of magnetic field sensor 102 may be used to synchronize a motor excitation signal.
Sensor 200 can include a plurality of terminals/pins for connections to external circuits, devices, and/or systems. As shown, sensor 200 can include a voltage supply input terminal 240 coupled to supply regulation circuitry 210 for receiving a voltage from an external voltage supply, output terminals 242a, 242b coupled to output driver circuitry 208 for providing two or more digital outputs, and a ground terminal 244 for grounding the sensor. Supply regulation circuitry 210 can convert a supply voltage on input terminal 240 to one or more analog and/or digital supply voltages/currents to power various analog and digital elements of sensor 200. Likewise, ground terminal 224 may be connected to various sensor circuit elements. Various such connections are omitted from the figure for clarity.
Elements of sensor 202 can be provided as analog and/or digital circuit elements arranged and configured to perform the functions described in conjunction therewith. Moreover, the particular elements shown in
Responsive to a magnetic field, magnetic field sensing elements 202 can generate two magnetic field signals 230a. 230b with phase shift therebetween. In the case where the magnetic field is produced by a rotating ferrous gear, magnetic field signals 230a, 230b may be sinusoids. In some cases, both magnetic field signals 230a, 230b may correspond to differential signals, meaning they represent a difference (e.g., an amplified difference) between outputs of two different sensing elements 202. In one example, outputs of a first sensing element 202a and a second sensing element 202b may be subtracted or otherwise used (e.g., via a differential amplifier) to provide first differential magnetic field signals 230a and outputs of the second sensing element 202b and a third sensing element 202c may be subtracted or otherwise used to provide second differential magnetic field signals 230b.
Sensing elements 202 may be spaced apart or otherwise arranged such that the magnetic field signals 230a, 230b have a predetermined, desired phase shift. For example, within a magnetic encoder, it may be desirable for magnetic field signals 230a, 230b to have 90° phase shift (thus, signals 230a and 230b may be sometimes referred to as sine and cosine signals, respectively). The actual phase shift may be greater than or less than the desired phase shift due to, for example, misalignment of the sensing elements 202.
Magnetic field signals 230a and 230b may be processed by the first and second channels of front-end circuitry 204 to generate respective first and second digital channel signals 232a and 232b (sometimes referred to as “left” and “right” channel signals). In more detail, magnetic field signals can undergo gain adjustment via amplifiers 220a, 220b, filtering via filters 222a, 222b, and analog-to-digital conversion via ADCs 224a, 224b. Said processing can result in channel signals 232a, 232b that are also responsive to the magnetic field detections and phase-shifted (e.g., desirably by) 90°. In some cases, channel signals 232a, 232b may be digital versions/representations of sinusoids.
Phase shift calculator 226 can receive channel signals 232a, 232b and calculate their phase shift. The calculated phase shift can be provided to virtual channel signal generator 227 to correct for undesirable phase shift between channel signals 232a, 232b, as discussed below.
In some embodiments, phase shift can be calculated by converting sinusoidal channel signals 232a, 232b into (digital) pulse signals each having a rising edge and a falling edge for each period of the corresponding sinusoidal signal. In some cases, a threshold-based technique can be used to generate these pulse signals. For example, when sinusoidal channel signal 232a has an amplitude above a first threshold, the corresponding pulse signal may have a first state (“high”) and when it has an amplitude below a second threshold, the corresponding pulse signal may have a second state (“low”), with raising/falling pulse edges occurring between these state transitions. Such thresholds can be calculated, for example, based on a percentage of peak-to-peak signal amplitude (e.g., 50% of the peak-to-peak amplitude). Likewise for sinusoidal signal 232b.
In some embodiments, sensor 200 may provide pulse signals as output (via output signal generator 228 discussed below) and phase shift calculator 226 may use these sensor-output pulse signals to calculate phase shift between the two channels. In other embodiments, phase shift calculator 226 may directly calculate the pulse signals from channel signals 232a, 232b. In any case, phase shift calculator 226 can calculate phase shift from the two pulse signals.
In some embodiments, phase shift calculator 226 can calculate: (i) a time between a rising/falling edge of one pulse signal and a next rising/falling edge of the other pulse signal (i.e., the rising/falling edge of the other pulse signal that follows closest in time), herein denoted Td; (ii) a time between two consecutive rising/falling edges of either the first or second pulse signal, herein denoted Tp and effectively representing the target speed; and (iii) the channel phase shift, ϕcalc, as:
In some cases, phase shift calculator 226 may calculate the channel phase shift, ϕcalc, from averages of Td and Tp taken over multiple signal periods:
In some cases, phase shift calculator 226 may calculate the averages of Td and Tp over periods when the target is rotating or otherwise moving at a constant or near constant speed. For example, it can detect constant target speed when Tp is equal or nearly equal for multiple consecutive periods of either or both pulse signals. To account for jitter and target tolerances, phase shift calculator 226 may consider Tp to be equal for consecutive periods if it differs by less than a threshold amount across those periods.
As previously discussed, actual phase shift between channel signals 232a, 232b may depend in significant part on spacing between sensing elements 202, target pitch, and air gap between the sensor and target. Thus, for a given system in which sensor 200 is deployed, the actual phase shift between channels may remain substantially constant over time. In some embodiments, the channel phase shift can be calculated during an initial period of system operation (i.e., during a calibration phase) and saved to EEPROM 212 for use during subsequent periods of operation without having to be re-calculated.
In some embodiments, phase shift calculator 226 can calculate Td and/or Tp using a clock signal (e.g., a signal having a fixed, known frequency) that is generated by oscillator 218 and provided to digital controller 206.
Virtual channel signal generator 227 can receive the calculated channel phase shift (e.g., from EEPROM 212) along with channel signals 232a, 232b and generate one or more virtual channel signals that have a predetermined, desired phase shift with respect to at least one of the channel signals 232a, 232b. For example, if channel signals 232a, 232b have an actual phase shift of 85°, virtual channel signal generator 227 may generate a virtual channel signal that has a desired phase shift of 90° with respect to either the first or second channel signal 232a, 232b. A virtual channel signal may be generated as a digital representation of a sinusoidal signal having the same frequency as either or both of the channel signals 232a, 232b.
In some embodiments, given a desired phase shift, ϕdesired, virtual channel signal generator 227 can replace second channel signal 232b with a virtual channel signal, v2, generated as follows:
In some embodiments, the predetermined, desired phase shift, ϕdesired, may be a setting programmed within EEPROM 212. In other embodiments, the desired phase shift may be hardcoded or hardwired within sensor 200.
In some embodiments virtual channel signal generator 227 can use the technique described above to generate multiple virtual channel signals each having a different desired phase shift. That is, multiple different desired phase shifts ϕdesired
Output signal generator 228 can receive channel signals 232a, 232b along with one or more virtual channel signals generated by virtual channel signal generator 227 and use some combination of these sinusoidal signals to generate digital output signals 234a, 234b. The digital output signals 234a, 234b may be provided at output terminals 242a and 242b, respectively, by way of output driver circuitry 208. In some cases, digital output signals 234a, 234b may be pulse signals each having a rising and falling edge for each period of a corresponding sinusoidal signal. Output signal generator 228 can generate the pulse signals using a threshold-based technique based on peak-to-peak signal amplitude, such as described above.
In the example of
Digital output signals 234a, 234b can be provided to additional circuitry (not shown) to calculate, for example, an angle of rotation of a target (e.g., a ferrous gear). In more detail, given two pulse signals with 90° phase shift, target angle can be determined using an ARCTAN calculation, such as implemented by a CORDIC. In some cases, such angle calculation may be implemented directly by digital controller 206 of sensor 200.
In some embodiments, a magnetic field sensor may have N>2 more outputs, which may be useful for high-resolution applications (e.g., a high-resolution magnetic encoder utilizing three or more digital signals). In this case, output signal generator 228 can generate a first digital output signal based on first channel signal 232a and can generate N−1 other output signals based on N−1 different virtual channel signals generated by virtual channel signal generator 227, each having a different desired phase shift relative to first channel signal 232a.
While embodiments of the present disclosure are described in the context of magnetic field sensors, the structures and techniques sought to be protected herein are not limited to use in magnetic field sensors. For example, disclosed phase correction structures and techniques can be applied in various types of systems and devices where it is desirable to have two or more signals with particular phase shift therebetween (e.g., orthogonal signals).
Structure and techniques disclosed herein can also be used for sensors in crank applications, where the mechanical switching location of the output is important. The switching location can be adjusted by calculating a virtual channel signal using the method above and switching on this shifted channel to adjust the switching location.
Turning to
In contrast,
Referring to
Referring to
A graph 600, having horizontal axis 602x representing time and vertical axis 602y representing amplitude, includes waveforms 604a and 604b corresponding to a first and second (or “left” and “right”) sinusoidal channel signals received by a two-channel sensor. Using the calculated phase shift, ϕcalc, and a given desired phase shift, ϕdesired, a virtual channel signal can be generated using equation (3), resulting in waveform 604c. In this example, the virtual channel signal is orthogonal to the first channel signal represented by waveform 604a (i.e., ϕdesired=90°).
As shown in graph 620, having horizontal axis 622x representing time and vertical axis 622y representing amplitude, the first channel waveform 604a and the (generated) virtual channel waveform 604c be converted to waveforms 624a and 624c, respectively, corresponding to digital outputs of a two-channel sensor. Thus, desirable magnetic field sensor outputs can be achieved independent of target design, magnetic field sensing element spacing, etc.
Graph 700, having horizontal axis 702x representing time and vertical axis 702y representing amplitude, includes waveforms 704a, 704b corresponding to sinusoidal channel signals received in a two-channel magnetic field sensor. Having calculated the phase shift between the two channels, ϕcalc, three virtual channels 704c, 704d, and 704e can be generated using equation (3) with respective desired phase shifts of 45°, 90°, and 135°.
Graph 720, having horizontal axis 722x representing time and vertical axis 722y representing amplitude, includes waveforms 724a, 724c, 724d, and 724d corresponding to sensor digital outputs (pulse signals) generated from waveforms 704a, 704c, 704d, and 704c, respectively.
Thus is it shown how embodiments of the present disclosure can provide for N-channel (N>2) sensor outputs using a conventional two-channel arrangement of magnetic field sensing elements to enable high-resolution applications.
Graph 740 illustrates how two or more sensor digital outputs can be combined (XOR). XOR'ing two outputs can be used to provide one output with twice the resolution (edges/time). It is useful in applications that require resolving smaller angles with higher resolution. In this example, where horizontal axis 742x represents time and vertical axis 742y represents amplitude, a first waveform 744f may correspond to the XOR or waveforms 724c and 724c and a second waveform 744g may correspond to the XOR or waveforms 724a and 724d. These particular combinations of signals are merely illustrative and various other combinations could be formed, including combinations of three or more signals.
Turning to
A magnetic field sensor with phase correction, such as sensor 200 of
At block 902, first and second magnetic field signals can be received. The signals may be responsive to motion of a target (e.g., rotation of a ferrous gear). In some embodiments, the magnetic field signals (or “channel signals”) may be digital versions/representations of sinusoids.
At block 904, first and second pulse signals can be generated responsive to the first and second magnetic field signals. In some embodiments, the pulse signals can be generated using a threshold-based technique such as described above.
At block 906, a time (Td) can be calculated between a rising/falling edge of one pulse signal and a next rising/falling edge of the other pulse signal.
At block 908, a time (Tp) can be calculated between two consecutive rising/falling edges of either the first or second pulse signal.
At block 910, a phase shift (ϕcalc) can be calculated between the first and second magnetic field signals using the times calculated at blocks 906 and 906. In some cases, the phase shift may be calculated based on averages of Td and Tp taken over periods when the target is rotating or otherwise moving at a constant or near constant speed. For example, constant target speed can be detected when Tp is equal or nearly equal for multiple consecutive periods of either or both pulse signals. In some embodiments, the phase shift can be can then be calculated using equation (1) or (2) from above.
At block 912, the calculated phase shift may be used to generate one or more virtual magnetic field signals (or “channel signals”) having predetermined phase shifts (desired) from the first or second magnetic field signal. In some embodiments, equation (3) from above may be used to generate the virtual magnetic field signal(s). In some embodiments, the virtual magnetic field signals can be converted to pulse signals and provided on outputs of the sensor.
In some embodiments, the calculated phase shift may be stored to a memory of the sensor (e.g., an EEPROM) during a first period of operation and subsequently retrieved for use in generating the virtual magnetic field signals during subsequent periods of operation. In some embodiments, the predetermined phase shifts may also be stored in memory and used for generating the virtual magnetic field signals.
As used herein, the terms “processor” and “controller” are used to describe electronic circuitry that performs a function, an operation, or a sequence of operations. The function, operation, or sequence of operations can be hard coded into the electronic circuit or soft coded by way of instructions held in a memory device. The function, operation, or sequence of operations can be performed using digital values or using analog signals. In some embodiments, the processor or controller can be embodied in an application specific integrated circuit (ASIC), which can be an analog ASIC or a digital ASIC, in a microprocessor with associated program memory and/or in a discrete electronic circuit, which can be analog or digital. A processor or controller can contain internal processors or modules that perform portions of the function, operation, or sequence of operations. Similarly, a module can contain internal processors or internal modules that perform portions of the function, operation, or sequence of operations of the module.
As used herein, the term “predetermined,” when referring to a value or signal, is used to refer to a value or signal that is set, or fixed, in the factory at the time of manufacture, or by external means, e.g., programming, thereafter. As used herein, the term “determined,” when referring to a value or signal, is used to refer to a value or signal that is identified by a circuit during operation, after manufacture.
While electronic circuits shown in figures herein may be shown in the form of analog blocks or digital blocks, it will be understood that the analog blocks can be replaced by digital blocks that perform the same or similar functions and the digital blocks can be replaced by analog blocks that perform the same or similar functions. Analog-to-digital or digital-to-analog conversions may not be explicitly shown in the figures but should be understood.
In the foregoing detailed description, various features are grouped together in one or more individual embodiments for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that each claim requires more features than are expressly recited therein. Rather, inventive aspects may lie in less than all features of each disclosed embodiment.
References in the disclosure to “one embodiment,” “an embodiment,” “some embodiments,” or variants of such phrases indicate that the embodiment(s) described can include a particular feature, structure, or characteristic, but every embodiment can include the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment(s). Further, when a particular feature, structure, or characteristic is described in connection knowledge of one skilled in the art to affect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
The disclosed subject matter is not limited in its application to the details of construction and to the arrangements of the components set forth in the following description or illustrated in the drawings. The disclosed subject matter is capable of other embodiments and of being practiced and carried out in various ways. As such, those skilled in the art will appreciate that the conception, upon which this disclosure is based, may readily be utilized as a basis for the designing of other structures, methods, and systems for carrying out the several purposes of the disclosed subject matter. Therefore, the claims should be regarded as including such equivalent constructions insofar as they do not depart from the spirit and scope of the disclosed subject matter.
Although the disclosed subject matter has been described and illustrated in the foregoing exemplary embodiments, it is understood that the present disclosure has been made only by way of example, and that numerous changes in the details of implementation of the disclosed subject matter may be made without departing from the spirit and scope of the disclosed subject matter.
All publications and references cited herein are expressly incorporated herein by reference in their entirety.