Abstract:
The invention concerns an angle sensor and a method of measuring an angle of a magnetic field. The angle sensor is configured to measure a direction of a magnetic field in a plane, comprising a first magnetic field sensor having a first sensitivity direction and delivering a first voltage, a second magnetic field sensor having a second sensitivity direction and delivering a second voltage, a first current source supplying a first biasing current to the first magnetic field sensor, a second current source supplying a second biasing current to the second magnetic field sensor ( 2 ), and electronic circuitry configured to adjust the first biasing current and the second biasing current in such a manner that a sum of the first voltage and the second voltage equals 0.

Description:
PRIORITY CLAIM 
       [0001]    Applicant hereby claims foreign priority under 35 U.S.C §119 from European Patent Application No. 16157316.7 filed on Feb. 25, 2016, the disclosure of which is herein incorporated by reference. 
       FIELD OF THE INVENTION 
       [0002]    The invention relates to an angle sensor configured to measure the direction of a magnetic field in a plane and to a method of measuring an angle which describes a direction of a magnetic field in a plane. 
       BACKGROUND OF THE INVENTION 
       [0003]    Angle sensors configured to measure the direction of the magnetic field are known for example from U.S. Pat. No. 6,545,462, U.S. Pat. No. 8,324,891 and U.S. Pat. No. 8,624,587. A magnetic field sensor comprising a horizontal Hall element capable of measuring a magnetic field pointing in a direction parallel to a surface of the Hall element is known for example from U.S. Pat. No. 5,942,895. 
       SUMMARY OF THE INVENTION 
       [0004]    The object of the invention is to develop a fast and reliable angle sensor. 
         [0005]    The basic concept of the sensors according to the invention consists in providing a magnetic field sensor having a variable sensitivity direction and to rotate the sensitivity direction until the scalar product of the sensitivity vector S of the magnetic field sensor and the magnetic field B is zero, i.e. S*B=0. 
         [0006]    An angle sensor configured to measure an angle α which describes a direction of a magnetic field in a plane, comprises
       a first magnetic field sensor having a first sensitivity direction,   a second magnetic field sensor having a second sensitivity direction,   each of the first and second magnetic field sensor having two current terminals and two voltage terminals,   a first current source supplying a first biasing current I 1  to the current terminals of the first magnetic field sensor,   a second current source supplying a second biasing current I 2  to the current terminals of the second magnetic field sensor, and   electronic circuitry forming a closed control loop configured to rotate a sensitivity direction of the angle sensor by changing the biasing currents I 1  and I 2  until a signal U equals 0 and to determine the angle α from the sensitivity direction of the angle sensor when the signal U equals 0,   wherein either the voltage terminals of the first and second magnetic field sensor are connected in series and the voltage appearing over the series connected voltage terminals is tapped and amplified to deliver the signal U, or the voltage terminals of the first and second magnetic field sensor are connected in parallel and the voltage appearing at the parallel connected voltage terminals is tapped and amplified to deliver the signal U, or wherein the angle sensor comprises a first amplifier coupled to the voltage terminals of the first magnetic field sensor, a second amplifier coupled to the voltage terminals of the second magnetic field sensor, and a summing junction coupled to the outputs of the first and second amplifier and having an output delivering the signal U.       
 
         [0014]    The first sensitivity direction and the second sensitivity direction include an angle δ. Preferably, the angle δ is 90°. The electronic circuitry is preferably configured to rotate the sensitivity direction of the angle sensor by providing the first biasing current I 1  as I 1 =I*sin δ* cos θ and the second biasing current as I 2 =I*(sin δ−cos δ)*sin δ*sin θ, the quantity I denoting a nominal current intensity and the quantity θ denoting an angle, and changing the angle θ, and the electronic circuitry is further configured to determine the angle α to α=θ−90° or α=θ+90°. 
         [0015]    According to the invention, a method of measuring an angle α which describes a direction of a magnetic field in a plane comprises
       providing a first magnetic field sensor having a first sensitivity direction and delivering a first voltage U 1 ,   providing a second magnetic field sensor having a second sensitivity direction and delivering a second voltage U 2 ,   supplying a first biasing current I 1  to the first magnetic field sensor,   supplying a second biasing current I 2  to the second magnetic field sensor,   forming a signal U that is proportional to a sum of the first voltage U 1  and the second voltage U 2 ,   adjusting the biasing currents I 1  and I 2  until the signal U equals 0, and   determining the angle α based on the adjusted values of the biasing currents I 1  and I 2  when the signal U equals 0.       
 
         [0023]    Preferably, the adjusting the biasing currents I 1  and I 2  until the signal U equals 0 occurs by providing the first biasing current I 1  as I 1 =I*sin δ* cos θ and the second biasing current as I 2 =I*(sin δ−cos δ)*sin δ*sin θ, the quantity I denoting a nominal current intensity, the quantity θ denoting an angle and the quantity δ denoting an angle which the first sensitivity direction and the second sensitivity direction include, and changing the angle θ until the signal U equals 0. The method then further comprises determining the angle α to α=θ−90° or α=θ+90°. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0024]    The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate one or more embodiments of the present invention and, together with the detailed description, serve to explain the principles and implementations of the invention. The figures are not to scale. In the drawings: 
           [0025]      FIG. 1  shows a schematic diagram of an angle sensor according to the invention, 
           [0026]      FIG. 2  shows a diagram illustrating the relationship between the sensitivity vector S of the angle sensor and the magnetic field B, 
           [0027]      FIG. 3  shows an embodiment of an angle sensor according to the invention, 
           [0028]      FIG. 4  shows several signal diagrams, 
           [0029]      FIG. 5  shows a further embodiment of an angle sensor according to the invention, and 
           [0030]      FIG. 6  shows an embodiment of an angle sensor according to the invention having Hall elements. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0031]    In the following, the same reference numerals are used to designate the same elements in the different embodiments. State-of-the-art CMOS technology may be used to make the sensors. 
         [0032]      FIG. 1  shows a schematic diagram of an angle sensor according to the invention. A Cartesian coordinate system with axes x and y oriented perpendicularly to each other is used to explain the invention. The sensor comprises a first magnetic field sensor  1 , a second magnetic field sensor  2  and electronic circuitry configured to operate the magnetic field sensors  1  and  2  and provide an output signal. Each of the magnetic field sensors  1 ,  2  has a predetermined sensitivity direction S A  or S B , respectively. The sensitivity direction S A  of the first magnetic field sensor  1  may be parallel to the x-axis, the sensitivity direction S B  of the second magnetic field sensor  2  may be parallel to the y-axis. Preferably, the sensitivity directions S A  and S B  of the two magnetic field sensors  1 ,  2  are oriented perpendicularly to each other. However, the magnetic field sensors  1  and  2  may have any other orientation and their sensitivity directions S A  and S B  may include an arbitrary angle δ. The two magnetic field sensors  1 ,  2  ideally have the same nominal sensitivity, denoted by S 0 . 
         [0033]    The first magnetic field sensor  1  and the second magnetic field sensor  2  may each be a vertical Hall element or a cluster composed of parallel aligned vertical Hall elements. Alternatively, the first magnetic field sensor  1  and the second magnetic field sensor  2  may each be composed of one or more horizontal Hall elements and one or more magnetic field concentrators in such a way that the first magnetic field sensor  1  is sensitive to a magnetic field pointing in the x-direction and the second magnetic field sensor  2  is sensitive to a magnetic field pointing in the y-direction, as disclosed for example in U.S. Pat. No. 5,942,895. Each Hall element comprises four electrical terminals, namely two current terminals serving to supply a biasing current and two voltage terminals serving to tap a Hall voltage. The magnetic field sensors  1 ,  2  may also be any other type of magnetic field sensor that is biased by a current and delivers a voltage, such as for example magnetoresistive (MR) sensors composed of four magnetoresistive resistors coupled to form a Wheatstone bridge. Therefore, each of the magnetic field sensors  1  and  2  comprises four electrical terminals, namely two current terminals configured to supply a biasing current and two voltage terminals configured to tap a voltage. 
         [0034]    The sensor further comprises a first current source  3  providing a first biasing current I 1  and a second current source  4  providing a second biasing current I 2 . The first current source  3  is coupled to the current terminals of the first magnetic field sensor  1 , the second current source  4  is coupled to the current terminals of the second magnetic field sensor  2 . 
         [0035]    The sensor further comprises a first circuit  5  configured to control the first current source  3  and the second current source  4  such that the first biasing current I 1  and the second biasing current I 2  are related to each other by the following equations: 
         [0000]        I   1   =I *sin δ*cos θ  (1)
 
         [0000]        I   2   =I *(sin δ−cos δ)*sin δ*sin θ  (2)
 
         [0000]    wherein the parameter I denotes a constant nominal current intensity and the parameter θ denotes an angle. 
         [0036]    If the angle δ is 90°, i.e. if the sensitivity directions S A  and S B  run orthogonally to each other, equations (1) and (2) reduce to 
         [0000]        I   1   =I* cos θ  (3)
 
         [0000]        I   2   =I *sin θ  (4)
 
         [0000]    In this case, the voltages U 1  and U 2  are given by the equations: 
         [0000]        U   1   =S   0   *I   1   *B   X    (5)
 
         [0000]        U   2   =S   0   *I   2   *B   Y    (6)
 
         [0000]    wherein S 0  denotes the magnitude of the sensitivity of the magnetic field sensors  1  and  2  and B X  and B Y  denote the components of the magnetic field along the x-axis or the y-axis. 
         [0037]    In the following embodiments, it is assumed, that the angle δ is 90°. 
         [0038]    In an embodiment, the sensor further comprises a first amplifier  6  configured to amplify the voltage U 1  of the first magnetic field sensor  1  and a second amplifier  7  configured to amplify the voltage U 2  of the second magnetic field sensor  2 . The amplifiers  6  and  7  ideally have the same gain k. The output voltages of the first amplifier  6  and the second amplifier  7  are fed to the inputs of a summing junction  8  and summed there. The output of the summing junction  8  delivers a voltage 
         [0000]        U=k *( U   1   +U   2 )= k*S   0   *I* ( B   X *cos+B Y *sin θ)   (7)
 
         [0039]    In the ideal case, the sensitivity of the magnetic field sensor, the nominal current intensity supplied to the magnetic field sensor and the gain of the amplifier are all the same for both magnetic field sensors. Therefore, ideally the magnetic field sensors have as described above a same sensitivity S 0 , are supplied with a same nominal current intensity I and the amplifiers have a same gain k. If there are deviations from the ideal case, then this might be corrected for in a calibration step, for example by adjusting different gains for the two amplifiers  6  and  7  or by adjusting different nominal current intensities, so that the equations given above apply. 
         [0040]    In another embodiment, the voltage terminals of the first magnetic field sensor  1  and the second magnetic field sensor  2  are connected in series or in parallel. The voltage U 1 +U 2  appearing over the series connected voltage terminals may be tapped and amplified to deliver the voltage U=k*(U 1 +U 2 ) or the voltage appearing at the parallel connected voltage terminals is tapped and amplified to deliver the voltage U=k*(U 1 +U 2 ), wherein the quantity k again denotes the gain. 
         [0041]    The sensor, composed of the first circuit  5 , the two current sources  3 ,  4 , the two magnetic field sensors  1 ,  2 , the amplifiers  6 ,  7  and the summing junction  8 , as well as the sensor with the structure and elements described in the preceding paragraph, is a sensor having two current inputs each receiving one of the biasing currents I 1  or I 2 , and a voltage output delivering the voltage U=k*(U 1 +U 2 ). The sensor can be used as magnetic field sensor having an adjustable direction of sensitivity S. The direction of sensitivity S in the xy-plane is given by the angle θ. Preferably, the sensitivity directions S A  and S B  run orthogonally to each other and the biasing currents I 1  and I 2  are set according to equations (3) and (4). The voltage U is proportional to the component of the magnetic field pointing in the direction of sensitivity S. The first circuit  5  has a first input configured to receive the angle θ. 
         [0042]    The angle sensor further comprises a second circuit  9  having an input configured to receive the voltage U and an output coupled to the first input of the first circuit  5 . In the following, the real angle of the magnetic field in the xy-plane is denoted as angle α B , the angle determined by the angle sensor is denoted as angle α. 
         [0043]    The first circuit  5  and the second circuit  9  form a closed control loop that is configured to change the biasing currents I 1  and I 2  until the voltage U equals zero. In this embodiment, this is done by supplying the magnetic field sensors  1  and  2  with biasing currents I 1  or I 2 , respectively, according to equations (1) and (2) and to vary the angle θ automatically by the closed loop formed by the circuits  5  and  9  until U=0, which in practice means until |U|≦U T  where U T  denotes a minimal detectable voltage. As U=k*(U 1 +U 2 ) this means that the sum of the voltages of the first magnetic field sensor  1  and the second magnetic field sensor  2  is regulated to zero, i.e. to 
         [0000]        U   1   +U   2 =0   (8)
 
         [0044]    The condition U=0 is fulfilled when the scalar product of the sensitivity vector S and the magnetic field vector B is zero, i.e. when S*B=0. This equation has two solutions which means that the angles θ and α are related to each other by one of the equations 
         [0000]      α=θ−90°  (9)
 
         [0000]      α=θ+90°  (10)
 
         [0045]      FIG. 2  illustrates the relation between the sensitivity vector S of the captioned magnetic field sensor and the magnetic field vector B and therefore the relation between the angles θ and α. S 1  is a vector denoting the magnitude and direction of the sensitivity of the first magnetic field sensor  1  and S 2  is a vector denoting the magnitude and direction of the sensitivity of the second magnetic field sensor  2 . 
         [0046]    The circuits  5  and  9  may be formed of digital and/or analog circuits. 
         [0047]    The concept of the angle sensor according to the invention consists in providing a magnetic field sensor with variable sensitivity direction and to rotate the sensitivity direction until the scalar product of the sensitivity vector S of the magnetic field sensor and the magnetic field B is zero, i.e. S*B=0, and of the finding that U 1 +U 2 =0 if S*B=0. So:
       a) The angle sensor comprises two magnetic field sensors  1  and  2  each having two current terminals and two voltage terminals.   b) The voltage terminals of the first magnetic field sensor  1  and the second magnetic field sensor  2  are coupled to deliver a voltage U=k*(U 1 +U 2 ), where k is a predetermined amplification factor.   c) The sensitivity direction is rotated by changing the biasing currents I 1  and I 2  until the voltage U=k*(U 1 +U 2 ) is 0.   d) The measured direction of the magnetic field in the plane spanned by the axes x and y is given by the angle α=θ−90° or the angle α=θ+90° because the sensitivity vector S runs perpendicularly to the magnetic field vector B if S*B=0.       
 
         [0052]      FIG. 3  shows an embodiment of an angle sensor according to the invention. The angle sensor comprises a clock signal generator  10  which controls the operation of the angle sensor. The first circuit  5  comprises a lookup table  11  and two D/A (Digital to Analog) converters  12  and  13 . The two current sources  3  and  4  are voltage controlled current sources. At each clock pulse CK 1  of the clock signal generator  10 , the first circuit  5  gets the value θ at its first input, reads the digital values sin θ and cos θ in the lookup table  11 , and feeds the digital value sin θ to the D/A converter  12  and the digital value cos θ to the D/A converter  13  and updates the value of the angle α. The analog output of the D/A converter  12  is fed to the first current source  3 , the analog output of the D/A converter  13  is fed to the second current source  4 . Therefore, the current supplied by the first current source  3  is proportional to I*sin θ and the current supplied by the second current source  4  is proportional to I*cos θ. The current sources  3  and  4  are adjusted to deliver the same nominal current I. 
         [0053]    The second circuit  9  comprises a polarity detector  14 , a signal detector  15 , an AND gate  16  and an UP/DOWN counter  17 . The output of the summing junction  8  is fed to an input of the polarity detector  14  and to an input of the signal detector  15 . The polarity detector  14  delivers a binary output signal which is 1 if the voltage U at its input is positive or zero and which is 0 if the voltage U at its input is negative. The output of the signal detector  15  and the clock signal CK 1  of the clock generator  10  are fed to two inputs of the AND gate  16 . The signal detector  15  delivers a binary output signal, based on the magnitude of the input voltage U. If the magnitude of the input voltage U is higher than a minimal detectable signal, i.e. greater than a predetermined threshold value U T , the output signal of the signal detector is 1. Otherwise, the output signal of the signal detector is 0. 
         [0054]    The output signal of the AND gate  16  is a binary signal, based on the AND logic of its inputs. Only if both input signals are 1, the output will be 1. Therefore, the AND gate will let pass the clock pulses CK1 if the output of the signal detector is 1 and will block the clock pulses if the output of the signal detector is 0. 
         [0055]    At each clock CK 1  of the clock signal generator  10 , the UP/DOWN counter  17  increments its value by 1 unit if the output signal of the polarity detector  14  is 1 and decrements its value by one unit if the output signal of the polarity detector  14  is 0. The value of the UP/DOWN counter  17  is fed to the first circuit  5 . The value of the UP/DOWN counter  17  remains constant, if the voltage U is zero, i.e. if U=0. If the voltage U is not zero, then the value of the UP/DOWN counter  17  is changing at each clock CK 1  until the voltage U has converged to zero. The value of the UP/DOWN counter  17  represents the angle θ of the sensitivity vector S. 
         [0056]    The UP/DOWN counter  17  provides at its output a limited number N of values, the lowest value corresponds to the angle θ=0°, the highest value corresponds to the angle θ=360°−360°/N. The number N may for example be 360 if the angle sensor provides an angle resolution of 1°, or N=3600 if the angle sensor provides an angle resolution of 0.1°. 
         [0057]    In this embodiment, the value of the UP/DOWN counter  17  is increased when the voltage U is positive and decreased when the voltage U is negative. As the voltage U is proportional to the scalar product S*B=|S|*|B|*cos (θ−α) this means that the sensitivity vector S is rotated in the counterclockwise direction if −90°&lt;θ−α&lt;90° and in the clockwise direction if 90°&lt;θ−α&lt;270° and has the consequence that the relationship between the angles θ and α is given by equation (9). The circuit  5  is therefore configured to read at each clock CK 1  the angle θ at its first input and determine the angle α using equation (9). 
         [0058]    At the start of the operation of the angle sensor (at switch on), a predetermined angle θ 0  is used as starting value for θ. θ 0  may be 0 or assume any other value. After a certain number of clocks CK 1 , the value of the angle θ has converged to that value that makes U=0. Whenever the condition U=0 is fulfilled, the outputted angle α correctly represents the angle α B  of the magnetic field B, whenever this condition is not fulfilled, the outputted angle α does not represent the angle α B . 
         [0059]      FIG. 4  shows an exemplary course of several signals in the course of the time t. The reference numerals denote:
       signal line  18 : the angle α B  representing the real direction of the magnetic field vector B,   signal line  19 : the angle α outputted by the angle sensor,   signal line  20 : the voltage U at the output of the summing junction  8 ,   signal line  21 : the binary output signal of the polarity detector  14 ,   signal line  22 : the binary output signal of the signal detector  15     signal line  23 : the basic clock signal CK 1 ,   signal line  24 : the binary output of the AND gate  16 , and   signal line  25 : the output of the UP/DOWN counter  17 .       
 
         [0068]    In  FIG. 4 , the direction of the magnetic field vector B is at first constant in time over a certain period and then changes to another constant value. After turning on the angle sensor, due to the regulation provided by the feedback circuit formed by the first circuit  5  and the second circuit  9 , the following occurs:
       The voltage U has a big value because the starting value θ 0  is far from fulfilling the condition θ 0 =α+90°. As time goes on, the voltage U converges step-by-step to zero.   The output signal of the polarity detector  14  is 1 and changes to  0  when the voltage U has converged to 0.   The output signal of the signal detector is 1 and changes to 0 when the voltage U has converged to 0.   The clocks of the clock generator  10  pass the AND gate  16  as long as the output signal of the signal detector is 1. The clocks of the clock generator  10  do not pass the AND gate  16  when the output signal of the signal detector is 0.   The UP/DOWN counter  17  increments its value by 1 unit with each pulse appearing at the output of the AND gate  16  as long as the output of the polarity detector  14  is 1, and decrements its value by 1 unit with each pulse appearing at the output of the AND gate  16  as long as the output of the polarity detector  14  is 0.       
 
         [0074]    At the moment t 1 , when the angle α B  decreases, the output voltage U becomes negative. When it becomes negative the binary output signal of the signal detector  15  changes from 0 to 1. Since the AND gate  16  lets then pass the clock pulses CK 1 , the UP/DOWN counter  17  decrements its value by 1 unit with each pulse, as long as the binary output signal of the signal detector  15  is 1. 
         [0075]    In a further embodiment, shown in  FIG. 5 , the angle sensor does not comprise the polarity detector  14  but comprises a polarity detector  26  that is coupled to the output of the first amplifier  6 . The polarity detector  26  delivers a binary output signal which is 1 if the voltage U 1  at its input is positive or zero and which is  0  if the voltage U 1  at its input is negative. The output signal of the polarity detector  26  therefore represents the sign of the voltage U 1  and is fed to a second input of the first circuit  5 . 
         [0076]    The angle θ defines the sensitivity direction. Therefore, the signs of the biasing currents I 1  and I 2  determine in which of the four quadrants the sensitivity vector S lies. The sign of the voltage U 1  determines whether the magnetic field vector B lies in one of the preceding quadrants (quadrants  2  and  3 ) or in one of the succeeding quadrants (quadrants  1  and  4 ). This information is then used to determine whether the relation between the angles θ and α is given by equation (9) or by equation (10), for example by use of the following lookup table containing the information, how the angle α is to be calculated: 
         [0000]    
       
         
               
               
               
               
               
             
           
               
                   
                   
               
               
                   
                 sign of I 1   
                 sign of I 2    
                 sign of U 1   
                 α = θ + value below 
               
               
                   
                   
               
             
             
               
                   
                 − 
                 + 
                 − 
                 −90° 
               
               
                   
                 + 
                 − 
                 + 
                 +90° 
               
               
                   
                 − 
                 + 
                 + 
                 +90° 
               
               
                   
                 + 
                 − 
                 − 
                 −90° 
               
               
                   
                 − 
                 − 
                 + 
                 −90° 
               
               
                   
                 + 
                 + 
                 + 
                 +90° 
               
               
                   
                 − 
                 − 
                 − 
                 +90° 
               
               
                   
                 + 
                 + 
                 − 
                 −90° 
               
               
                   
                   
               
             
          
         
       
     
         [0077]    In this embodiment, the value of the UP/DOWN counter  17  is always increased when the voltage U is different from zero. This means, that the sensitivity vector S is always rotated in the counterclockwise direction when U≠0. 
         [0078]      FIG. 6  shows an embodiment of an angle sensor according to the invention, wherein the magnetic field sensors  1  and  2  are Hall sensors which comprise Hall elements. In order to reduce or eliminate offset and 1/f noise problems of the Hall sensors, the well-known spinning current technique is used to operate the Hall sensors. The spinning current technique commutates the current and voltage terminals of each Hall sensor at a certain spinning clock CK 2 . Preferably, the four-phase spinning current technique is used, but also the two-phase spinning current technique could be used. The angle sensor comprises a first spinning current circuit  27  coupling the current terminals of the first magnetic field sensor  1  to the first current source  3  and the voltage terminals to the first amplifier  6  and a second spinning current circuit  28  coupling the current terminals of the second magnetic field sensor  2  to the second current source  4  and the voltage terminals to the second amplifier  7 . The clock signal generator  10  generates also the spinning clock CK 2  which is four times faster than the basic clock signal CK 1  if the four-phase spinning current technique is used or two times faster than the basic clock signal CK 1  if the two-phase spinning current technique is used. An integrator  29 , for example formed as a switched capacitor filter, is connected to the output of the summing junction  8  to make an integration of the Hall voltage U over the four or two spinning current phases. 
         [0079]    It would be apparent to those skilled in the art, that other analog and/or digital circuits, including microcontrollers and the like, may be used to realize the sensor of the invention. 
         [0080]    While embodiments and applications of this invention have been shown and described, it would be apparent to those skilled in the art having the benefit of this disclosure that many more modifications than mentioned above are possible without departing from the inventive concepts herein. The invention, therefore, is not to be restricted except by the appended claims and their equivalents.