Angle sensor and angle sensor system
11255702 · 2022-02-22
Assignee
Inventors
Cpc classification
G01D5/145
PHYSICS
International classification
Abstract
An angle sensor includes a plurality of magnetic sensors and a processor. The plurality of magnetic sensors generate a plurality of detection values representing directions of a composite magnetic field, which is a composite of a magnetic field to be detected and a noise magnetic field. The processor assumes a group of estimated unknowns. The group of estimated unknowns is a set of estimated values of a first, a second, and a third unknown. The first unknown corresponds to an angle detection value. The second unknown corresponds to the direction of the noise magnetic field. The third unknown corresponds to the strength of the noise magnetic field. The processor executes a process for determining the group of estimated unknowns a plurality of times, and assumes an estimated value of the first unknown in the last determined group of estimated unknowns as the angle detection value.
Claims
1. An angle sensor for generating an angle detection value having a correspondence with an angle to be detected, comprising: a plurality of magnetic sensors for detecting a composite magnetic field at a plurality of detection positions different from each other and generating a plurality of detection values that represent directions of the composite magnetic field, the composite magnetic field being a composite of a magnetic field to be detected and a noise magnetic field other than the magnetic field to be detected; and a processor for generating the angle detection value, wherein at the plurality of detection positions, directions of the magnetic field to be detected change with the angle to be detected, manners in which either the directions or strengths, or both of the directions and strengths of the magnetic field to be detected change with the angle to be detected vary among the plurality of detection positions, the processor assumes a group of unknowns, a group of provisional unknowns, and a group of estimated unknowns, the group of unknowns is a set of a first unknown, a second unknown, and a third unknown, the first unknown is a value corresponding to the angle detection value, the second unknown is a value corresponding to a direction of the noise magnetic field, the third unknown is a value corresponding to a strength of the noise magnetic field, the group of provisional unknowns is a set of provisional values of the first to third unknowns, the group of estimated unknowns is a set of estimated values of the first to third unknowns, and the processor executes a first process and a second process so that the number of executions of the first process is two or more, the first process being a process for determining the group of estimated unknowns on the basis of the plurality of detection values and the group of provisional unknowns, the second process being a process for assuming the group of estimated unknowns determined by the first process as a new group of provisional unknowns for the first process to be executed next time, the processor further executing a third process for assuming an estimated value of the first unknown in the group of estimated unknowns determined by the last executed first process as the angle detection value; wherein the processor further assumes approximate functions, the approximate functions being first derivatives of model functions representing the plurality of detection values with the group of unknowns as variables, and the first process determines the group of estimated unknowns on the basis of the plurality of detection values, the group of provisional unknowns, and the approximate functions; wherein the processor further assumes a plurality of temporary detection values, a plurality of discrepancy values, a group of change amounts, and a group of approximate discrepancy values, the plurality of temporary detection values are values in the group of provisional unknowns in the model functions, the plurality of discrepancy values are differences between corresponding ones of the plurality of detection values and the plurality of temporary detection values, the group of change amounts is a set of change amounts of the estimated values of the first to third unknowns in the group of estimated unknowns with respect to the provisional values of the first to third unknowns in the group of provisional unknowns, the group of approximate discrepancy values is a set of a plurality of approximate discrepancy values corresponding to the plurality of discrepancy values, and is determined from the approximate functions and the group of change amounts, and the first process determines the group of change amounts so that the group of approximate discrepancy values becomes a set of approximate values to the plurality of discrepancy values, and further determines the group of estimated unknowns on the basis of the group of change amounts thus determined.
2. The angle sensor according to claim 1, wherein the first process determines the group of change amounts so that a sum of squares of differences between corresponding ones of the plurality of discrepancy values and the plurality of approximate discrepancy values is minimized.
3. The angle sensor according to claim 1, wherein the third process is executed if a change amount of the estimated value of the first unknown in the group of change amounts is smaller than or equal to a predetermined value.
4. The angle sensor according to claim 1, wherein the model functions are nonlinear functions including a plurality of periodic functions with the first unknown as a variable.
5. The angle sensor according to claim 1, wherein each of the plurality of magnetic sensors includes: a first signal generator for generating a first signal, the first signal having a correspondence with a cosine of an angle that the direction of the composite magnetic field forms with respect to a reference direction; a second signal generator for generating a second signal, the second signal having a correspondence with a sine of the angle that the direction of the composite magnetic field forms with respect to the reference direction; and a computing circuit for generating a corresponding one of the plurality of detection values on the basis of the first and second signals, the corresponding one of the plurality of detection values representing the angle that the direction of the composite magnetic field forms with respect to the reference direction.
6. The angle sensor according to claim 5, wherein each of the first and second signal generators includes at least one magnetic detection element.
7. An angle sensor system comprising: the angle sensor according to claim 1; and a magnetic field generator for generating the magnetic field to be detected.
8. The angle sensor system according to claim 7, wherein a relative position of the magnetic field generator with respect to the plurality of detection positions is variable, and the angle to be detected has a correspondence with the relative position of the magnetic field generator.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
(14) A preferred embodiment of the present invention will now be described in detail with reference to the drawings. First, reference is made to
(15) The magnetic field generator 5 in the embodiment is a magnet 6 of a cylindrical shape having a central axis. The magnet 6 has an N pole and an S pole that are arranged symmetrically with respect to an imaginary plane including the aforementioned central axis. The magnet 6 rotates around the central axis. This causes the direction of the detection-target magnetic field generated by the magnet 6 to rotate around a center of rotation C including the central axis.
(16) The angle sensor 1 is configured to detect the detection-target magnetic field and generate an angle detection value θs having a correspondence with an angle to be detected. Hereinafter, the angle to be detected will be referred to as detection-target angle, and denoted by a symbol θ. The detection-target angle θ in the present embodiment is an angle corresponding to the rotational position of the magnet 6.
(17) The angle sensor 1 includes a plurality of magnetic sensors. The plurality of magnetic sensors detect a composite magnetic field at a plurality of detection positions different from each other, and generate a plurality of detection values that represent the directions of the composite magnetic field. The composite magnetic field is a composite of the detection-target magnetic field and a noise magnetic field Mex other than the detection-target magnetic field. At the plurality of detection positions, the directions of the detection-target magnetic field change with the detection-target angle θ. Manners in which either the directions or strengths, or both of the directions and strengths of the detection-target magnetic field change with the detection-target angle θ vary among the plurality of detection positions.
(18) The number of the detection positions may be three or more. The number of the detection positions will be represented by M (M is an integer greater than or equal to 3). In the present embodiment, a reference plane P is defined at each of the M detection positions. Alternatively, a reference plane P common to the M detection positions is defined. The reference plane P is an imaginary plane parallel to either one of the end faces of the magnet 6. The M detection positions are located in the respective corresponding reference planes P or in the common reference plane P. In the following description, the M detection positions are assumed to be located in the common reference plane P.
(19) Directions of the noise magnetic field Mex at the M detection positions are identical. Strengths of the noise magnetic field Mex at the M detection positions are equal.
(20) In the present embodiment, the plurality of magnetic sensors are M magnetic sensors. The M magnetic sensors are disposed to face the aforementioned one of the end faces of the magnet 6. Hereinafter, the M magnetic sensors will be referred to as the first to M-th magnetic sensors. An i-th magnetic sensor will be denoted by the symbol 10i, where i is any integer between 1 and M inclusive. The detection position corresponding to the magnetic sensor 10i will be denoted by the symbol Pi. The reference direction corresponding to the magnetic sensor 10i will be denoted by the symbol DRi. The detection value generated by the magnetic sensor 10i will be denoted by the symbol θsi. The magnetic sensor 10i generates, as the detection value θsi, a value having a correspondence with an angle θdi that the direction DMi of the detection-target magnetic field at the detection position Pi forms with respect to the reference direction DRi.
(21) Now, definitions of directions used in the present embodiment will be described with reference to
(22) The reference direction DRi is in the reference plane P and intersects the detection position Pi. The direction DMi of the detection-target magnetic field at the detection position Pi is also in the reference plane P. In the present embodiment, the reference direction DRi is the X direction. In the reference plane P the direction DMi of the detection-target magnetic field rotates around the detection position Pi. In the present embodiment, it is assumed that the direction DMi of the detection-target magnetic field rotates counterclockwise in
(23) In the present embodiment, the angle θdi is equal to the detection-target angle θ if the magnet 6 generates an ideal detection-target magnetic field. However, the angle θdi is not always ideal and may slightly differ from the detection-target angle θ due to uneven magnetization of the magnet 6 or other factors.
(24) In situations where there exists a noise magnetic field Mex, the magnetic sensor 10i detects a composite magnetic field at the detection position Pi, the composite magnetic field being a composite of the detection-target magnetic field and the noise magnetic field Mex, and generates a detection value θsi representing the direction of the composite magnetic field. An angle that the direction of the composite magnetic field detected by the magnetic sensor 10i forms with respect to the reference direction DRi will be denoted by the symbol θi. The positive and negative signs of the angle θi are defined in the same manner as those of the angle θdi.
(25) Possible configurations of the angle sensor system 100 according to the present embodiment are not limited to the example shown in
(26) Reference is now made to
(27) In the example shown in
(28) Each of the first and second signal generators 11i and 12i includes at least one magnetic detection element. The at least one magnetic detection element may include at least one magnetoresistive element. The magnetoresistive element may be a giant magnetoresistive (GMR) element, a tunneling magnetoresistive (TMR) element, or an anisotropic magnetoresistive (AMR) element. The at least one magnetic detection element may include at least one other element than a magnetoresistive element, such as a Hall element, for detecting a magnetic field.
(29) The angle sensor 1 further includes a processor 20 for generating the angle detection value θs. The angle detection value θs is generated on the basis of M detection values θs1, θs2, . . . , and θsM. The processor 20 can be implemented by an ASIC or a microcomputer, for example. A description will be given later as to the configuration of the processor 20 and how to generate the angle detection value θs.
(30) The configuration of the first and second signal generators 11i and 12i will now be described.
(31)
(32) In the present embodiment, each of the magnetic detection elements R11 to R14 and R21 to R24 includes a plurality of magnetoresistive (MR) elements connected in series. Each of the plurality of MR elements is a spin-valve MR element, for example. The spin-valve MR element includes a magnetization pinned layer whose magnetization direction is pinned, a free layer which is a magnetic layer whose magnetization direction changes with the direction of the detection-target magnetic field, and a nonmagnetic layer located between the magnetization pinned layer and the free layer. The spin-valve MR element may be a TMR element or a GMR element. In the TMR element, the nonmagnetic layer is a tunnel barrier layer. In the GMR element, the nonmagnetic layer is a nonmagnetic conductive layer. The resistance of the spin-valve MR element changes with the angle that the magnetization direction of the free layer forms with respect to the magnetization direction of the magnetization pinned layer. The resistance of the spin-valve MR element is at its minimum value when the foregoing angle is 0°, and at its maximum value when the foregoing angle is 180°. In
(33) In the first signal generator 11i, the magnetization pinned layers of the MR elements included in the magnetic detection elements R11 and R14 are magnetized in the X direction, and the magnetization pinned layers of the MR elements included in the magnetic detection elements R12 and R13 are magnetized in the −X direction. In this case, the potential difference between the output ports E11 and E12 changes with the cosine of the angle θi that the direction of the composite magnetic field at the detection position Pi forms with respect to the reference direction DRi. The difference detector 18 outputs a signal corresponding to the potential difference between the output ports E11 and E12 as the first signal S1i. The first signal S1i thus has a correspondence with the cosine of the angle θi.
(34) In the second signal generator 12i, the magnetization pinned layers of the MR elements included in the magnetic detection elements R21 and R24 are magnetized in the Y direction, and the magnetization pinned layers of the MR elements included in the magnetic detection elements R22 and R23 are magnetized in the −Y direction. In this case, the potential difference between the output ports E21 and E22 changes with the sine of the angle θi that the direction of the composite magnetic field at the detection position Pi forms with respect to the reference direction DRi. The difference detector 28 outputs a signal corresponding to the potential difference between the output ports E21 and E22 as the second signal S2i. The second signal S2i thus has a correspondence with the sine of the angle θi.
(35) In the light of the production accuracy of the MR elements and other factors, the magnetization directions of the magnetization pinned layers of the MR elements in the signal generators 11i and 12i may be slightly different from the above-described directions.
(36) An example configuration of the magnetic detection elements will now be described with reference to
(37) Next, a method for generating the detection value θsi will be described concretely. The computing circuit 15i determines θsi in accordance with Eq. (1) below.
θsi=atan(S2i/S1i) (1)
(38) Note that “atan” represents an arctangent.
(39) For θsi ranging from 0° to less than 360°, Eq. (1) yields two solutions of θsi that are 180° different in value. Which of the two solutions of θsi in Eq. (1) is the true value of θsi can be determined in accordance with the combination of the signs of S1i and S2i. The computing circuit 15i determines θsi within the range of 0° to less than 360° in accordance with Eq. (1) and the determination on the combination of the signs of S1i and S2i.
(40) A method for generating the angle detection value θs will now be described. To begin with, a description will be given of the strength and direction of the detection-target magnetic field. In the present embodiment, a magnetic field whose strength decreases with increasing distance from the center of rotation C (see
(41)
(42) As shown in
(43) In the present embodiment, in order to reproduce the strengths and directions of the detection-target magnetic field having the above-described characteristic as faithfully as possible, the strength Hdi and angle θdi (see
(44) The strength Hdi of the detection-target magnetic field at the detection position Pi is expressed in Eq. (2) below. The right-hand side of Eq. (2) represents the function modeling the strength Hdi.
(45)
(46) The angle θdi at the detection position Pi is expressed in Eq. (3) below. The right-hand side of Eq. (3) represents the function modeling the angle θdi.
(47)
(48) In Eqs. (2) and (3), k is an integer greater than or equal to 1, and represents the order of the periodic function with the detection-target angle θ as a variable. Hd0 and θd0 are constants. A.sub.i_k, B.sub.i_k, C.sub.i_k, and D.sub.i_k are constants each determined on the basis of i and k. In the example shown in
(49) The constants A.sub.i_k, B.sub.i_k, C.sub.i_k, and D.sub.i_k are determined in advance before the use of the angle sensor system 100. For example, the constants A.sub.i_k, B.sub.i_k, C.sub.i_k, and D.sub.i_k can be determined by determining the distributions of the strengths and directions of the detection-target magnetic field in the reference plane P by simulation, and analyzing the distributions. Suppose, for example, that the imaginary circle shown in
(50) Now, the detection value θsi generated by the magnetic sensor 10i and a method for generating the angle detection value θs will be described in outline. When there is no noise magnetic field Mex, in theory, the detection value θsi is expressed in Eq. (4) below using the strength Hdi of the detection-target magnetic field, the cosine of the angle θdi, and the sine of the angle θdi.
(51)
(52) Here, the strength of the noise magnetic field Mex will be denoted by the symbol H.sub.EX, and the angle that the direction of the noise magnetic field Mex forms with respect to the reference direction DRi will be denoted by the symbol θ.sub.EX. When there exists the noise magnetic field Mex, in theory, the detection value θsi is expressed in Eq. (5) below.
(53)
(54) The right-hand side of Eq. (5) represents a model function representing the detection value θsi. As described above, since Hdi and θdi both include a plurality of periodic functions with the detection-target angle θ as a variable, the model function is a nonlinear function including a plurality of periodic functions with the detection-target angle θ as a variable.
(55) The model function on the right-hand side of Eq. (5) includes variables H.sub.EX and θ.sub.EX in addition to the detection-target angle θ. Eq. (5) is a nonlinear equation with θ, θ.sub.EX, and H.sub.EX as variables. Eq. (5) is defined for each of the M magnetic sensors 10i having respective different values of i. The M detection values θsi are thus expressed in M Eqs. (5) with respective different values of i.
(56) The detection-target angle θ is not known. In the present embodiment, an unknown θ.sub.MA corresponding to the detection-target angle θ is assumed. In the present embodiment, θ.sub.EX and H.sub.EX are also unknowns. θ.sub.EX and H.sub.EX will hereinafter be referred to as unknowns θ.sub.EX and H.sub.EX. Therefore, M Eqs. (5) with respective different values of i can be said to be M nonlinear equations with unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX as variables.
(57) The unknown θ.sub.MA is a value corresponding to the angle detection value θs, and corresponds to the first unknown in the present invention. The unknown θ.sub.EX is a value corresponding to the direction of the noise magnetic field Mex, and corresponds to the second unknown in the present invention. The unknown H.sub.EX is a value corresponding to the strength of the noise magnetic field Mex, and corresponds to the third unknown in the present invention.
(58) In the present embodiment, an estimated value of the unknown θ.sub.MA is determined by numerical calculation on the basis of the M nonlinear equations with the foregoing unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX as variables, and the estimated value is assumed to be the angle detection value θs.
(59) Next, a method for generating the angle detection value θs will be specifically described. A set of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX will hereinafter be referred to as a group of unknowns and denoted by the symbol X. The right-hand side of Eq. (5) can be said to be a model function representing the detection value θsi with the group of unknowns X as variables. The model function is a nonlinear function including a plurality of periodic functions with the unknown θ.sub.MA as a variable. The right-hand side of Eq. (5) will hereinafter be represented by θsi(X). θsi(X) is a function with θ.sub.MA, θ.sub.EX, and H.sub.EX as variables.
(60) A value of the unknown θ.sub.MA will be denoted by the symbol Pθ.sub.MA. A value of the unknown θ.sub.EX will be denoted by the symbol Pθ.sub.EX. A value of the unknown H.sub.EX will be denoted by the symbol PH.sub.EX. A set of Pθ.sub.MA, Pθ.sub.EX and PH.sub.EX will be denoted by the symbol X.sub.P. Modifying Eq. (5) by Taylor expansion up to the first order on the basis of X.sub.P yields the following approximate equation (6) expressing θsi(X).
(61)
(62) The first term on the right-hand side of Eq. (6), θsi(X.sub.P), represents the value of θsi(X) in X.sub.P. θsi(X.sub.P) is a value obtained by substituting Pθ.sub.MA, Pθ.sub.EX, and PH.sub.EX into θ.sub.MA, θ.sub.EX, and H.sub.EX of θsi(X), respectively. θsi(X.sub.P) is an imaginary detection value. θsi(X.sub.P) will hereinafter be referred to as a temporary detection value and denoted by the symbol θei.
(63) ∂θsi(X.sub.P)/∂θ.sub.MA in the second term on the right-hand side of Eq. (6) represents the value of a first derivative obtained by partially differentiating θsi(X) with respect to θ.sub.MA in X.sub.P. ∂θsi(X.sub.P)/∂θ.sub.EX in the third term on the right-hand side of Eq. (6) represents the value of a first derivative obtained by partially differentiating θsi(X) with respect to θ.sub.EX in X.sub.P. ∂θsi(X.sub.P)/∂H.sub.EX in the fourth term on the right-hand side of Eq. (6) represents the value of a first derivative obtained by partially differentiating θsi(X) with respect to H.sub.EX in X.sub.P.
(64) The actual detection value θsi generated by the magnetic sensor 10i is also approximated by the right-hand side of Eq. (6). Hence, consider an equation obtained by replacing the left-hand side of Eq. (6) with the detection value θsi. Then, define a difference between the actual detection value θsi and the temporary detection value θei as a discrepancy value Dθi. Subtracting the temporary detection value θei, i.e., θsi(X.sub.P) from both sides of the equation obtained by replacing the left-hand side of Eq. (6) with the detection value θsi yields the following approximate equation (7) expressing the discrepancy value Dθi.
(65)
(66) In Eq. (7), Δθ.sub.MA represents θ.sub.MA−Pθ.sub.MA, Δθ.sub.EX represents θ.sub.EX−Pθ.sub.EX, and ΔH.sub.EX represents H.sub.EX−PH.sub.EX. Since θ.sub.MA, θ.sub.EX, and H.sub.EX are unknowns, Δθ.sub.MA, Δθ.sub.EX, and ΔH.sub.EX are also unknowns. The right-hand side of Eq. (7) expresses an approximate discrepancy value that is a value equivalent to the discrepancy value Dθi.
(67) In the present embodiment, approximate functions, which are first derivatives of the model functions representing the M detection values θs1, θs2, . . . , θsM with the group of unknowns X as variables, are assumed. The approximate functions are represented by an M-row three-column matrix H including, as its elements, the first derivatives of the model functions representing the M detection values θs1, θs2, . . . , θsM, i.e., the model functions θsi(X). An i-th row of the matrix H includes, as its elements, a first derivative obtained by partially differentiating θsi(X) with respect to θ.sub.MA, a first derivative obtained by partially differentiating θsi(X) with respect to θ.sub.EX, and a first derivative obtained by partially differentiating θsi(X) with respect to H.sub.EX. All such first derivatives are functions with θ.sub.MA, θ.sub.EX, and H.sub.EX as variables. The matrix H is expressed in Eq. (8) below.
(68)
(69) M approximate discrepancy values corresponding to M discrepancy values Dθ1, Dθ2, . . . , DθM are determined by calculating a product H.sub.PV.sub.DX of a matrix H.sub.P and a three-dimensional column vector V.sub.DX. The matrix H.sub.P is obtained by respectively substituting PO.sub.MA, PO.sub.EX, and PH.sub.EX into the variables θ.sub.MA, θ.sub.EX, and H.sub.EX in the first derivatives which are the elements of the matrix H. The three-dimensional column vector V.sub.DX includes Δθ.sub.MA, Δθ.sub.EX, and ΔH.sub.EX as its elements. The vector V.sub.DX is expressed in Eq. (9) below.
V.sub.DX.sup.T=[Δθ.sub.MA,Δθ.sub.EX,ΔH.sub.EX] (9)
(70) In the present embodiment, approximate solutions to the unknowns Δθ.sub.MA, Δθ.sub.EX, and ΔH.sub.EX are determined so that the M approximate discrepancy values become nearly equal to the corresponding ones of the M discrepancy values Dθ1, Dθ2, . . . , DθM. Specifically, in the present embodiment, the approximate solutions to the unknowns Δθ.sub.MA, Δθ.sub.EX, and ΔH.sub.EX are determined so that the sum of the squares of differences between the corresponding ones of the M discrepancy values Dθ1, Dθ2, . . . , DθM and the M approximate discrepancy values is minimized. With the approximate solutions to the unknowns Δθ.sub.MA, Δθ.sub.EX, and ΔH.sub.EX thus determined, estimated values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX are determined.
(71) The estimated values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX are closer to the true values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX than Pθ.sub.MA, PO.sub.EX, and PH.sub.EX, respectively. Here, assuming the set of the estimated values of the unknowns θ.sub.MA, θ.sub.EX and H.sub.EX as a new X.sub.P and determining new approximate solutions to the unknowns Δθ.sub.MA, Δθ.sub.EX and ΔH.sub.EX on the basis of the new X.sub.P gives new estimated values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX. The new estimated values are even closer to the true values. In the present embodiment, the processor 20 repeats the process for determining estimated values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX to bring the estimated values closer to the true values.
(72) Now, the processes to be executed by the processor 20 will be described specifically with reference to
(73) To generate the angle detection value θs, the processor 20 assumes the foregoing group of unknowns X, a group of provisional unknowns X.sub.n-1, a group of estimated unknowns X.sub.n, and a group of change amounts EX.sub.n. The group of provisional unknown X.sub.n-1 is a set of provisional values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX. The group of estimated unknowns X.sub.n is a set of estimated values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX. The provisional values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX will hereinafter be referred to as provisional values Aθ.sub.MA, Aθ.sub.EX, and AH.sub.EX, respectively. The estimated values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX will be denoted by the symbols Bθ.sub.MA, Bθ.sub.EX, and BH.sub.EX, respectively.
(74) The group of change amounts EX.sub.n is a set of change amounts of the estimated values Bθ.sub.MA, Bθ.sub.EX, and BH.sub.EX with respect to the provisional values Aθ.sub.MA, Aθ.sub.EX, and AH.sub.EX. The change amounts of the estimated values Bθ.sub.MA, Bθ.sub.EX, and BH.sub.EX will hereinafter be denoted by the symbols Eθ.sub.MA, Eθ.sub.EX, and EH.sub.EX, respectively.
(75) The processor 20 further assumes the foregoing approximate functions, i.e., the approximate functions represented by the matrix H, a plurality of temporary detection values θei, a plurality of discrepancy values Dθi, and a group of approximate discrepancy values Z. The first derivatives, which are the elements of the matrix H (see Eq. (8)), are determined in advance. The matrix H may be stored either in the iterative calculation unit 21 or in a storage unit (not shown) included in the processor 20. The plurality of temporary detection values θei that the processor 20 assumes are the values of θsi(X) in the group of provisional unknowns X.sub.n-1. The temporary detection values θei are obtained by substituting the provisional values Aθ.sub.MA, Aθ.sub.EX, and AH.sub.EX into the variables θ.sub.MA, θ.sub.EX, and H.sub.EX in θsi(X), respectively. The plurality of discrepancy values Dθi are differences between corresponding ones of the plurality of detection values θsi and the plurality of temporary detection values θei.
(76) The group of approximate discrepancy values Z is a set of a plurality of approximate discrepancy values corresponding to the plurality of discrepancy values Dθi, and is determined from the foregoing approximate functions represented by the matrix H and the group of change amounts EX.sub.n. In the present embodiment, the plurality of approximate discrepancy values are M approximate discrepancy values z1, z2, . . . , zM. The M approximate discrepancy values z1, z2, . . . , zM are determined by calculating a product H.sub.n-1V.sub.EXn of a matrix H.sub.n-1 and a three-dimensional column vector V.sub.EXn. The matrix H.sub.n-1 is obtained by substituting the provisional values Aθ.sub.MA, Aθ.sub.EX, and AH.sub.EX into the variables θ.sub.MA, θ.sub.EX, and H.sub.EX in the first derivatives which are the elements of the matrix H. The three-dimensional column vector V.sub.EXn includes the change amounts Eθ.sub.MA, Eθ.sub.EX, and EH.sub.EX as its elements. The vector V.sub.EXn is expressed in Eq. (10) below.
V.sub.EXn.sup.T=[Eθ.sub.MA,Eθ.sub.EX,EH.sub.EX] (10)
(77) To generate the angle detection value θs, the processor 20 executes a first process for determining the group of estimated unknowns X.sub.n. In the present embodiment, the first process determines the group of estimated unknowns X.sub.n on the basis of the plurality of detection values θsi and the group of provisional unknowns X.sub.n-1. In particular, in the present embodiment, the group of estimated unknowns X.sub.n is determined on the basis of the foregoing approximate functions in addition to the plurality of detection values θsi and the group of provisional unknowns X.sub.n-1. The first process is executed by the iterative calculation unit 21 of the processor 20.
(78) Now, the first process will be described concretely. In the first process, the iterative calculation unit 21 initially obtains the plurality of temporary detection values θei on the basis of the group of provisional unknowns X.sub.n-1. The iterative calculation unit 21 then obtains the plurality of discrepancy values Dθi on the basis of the plurality of detection values θsi and the plurality of temporary detection values θei. The iterative calculation unit 21 then obtains the matrix H.sub.n-1 on the basis of the group of provisional unknowns X.sub.n-1.
(79) Next, the iterative calculation unit 21 determines the group of change amounts EX.sub.n so that the group of approximate discrepancy values Z becomes a set of approximate values to the plurality of discrepancy values Dθi. Specifically, the processor 20 determines the group of change amounts EX.sub.n so that the sum of the squares of differences between the corresponding ones of the M discrepancy values Dθ1, Dθ2, . . . , DθM and the M approximate discrepancy values z1, z2, . . . , zM is minimized.
(80) Here, an M-dimensional column vector that includes the M discrepancy values Dθ1, Dθ2, . . . , DθM as its elements will be denoted by the symbol V.sub.Y, and an M-dimensional column vector that includes the M approximate discrepancy values z1, z2, . . . , zM as its elements will be denoted by the symbol V.sub.Z. The vectors V.sub.Y and V.sub.Z are expressed in Eqs. (11) and (12) below, respectively.
V.sub.Y.sup.T=[Dθ1,Dθ2, . . . ,DθM] (11)
V.sub.Z.sup.T=[z1,z2, . . . ,zM] (12)
(81) If the group of approximate discrepancy values Z is a set of approximate values to the M discrepancy values Dθ1, Dθ2, . . . , DθM, then the vector V.sub.Z is approximately equal to the vector V.sub.Y. The vector V.sub.Z is expressed as a product H.sub.n-1V.sub.EXn of the matrix H.sub.n-1 and the vector V.sub.EXn. The vector V.sub.Y is therefore expressed in Eq. (13) below.
V.sub.Y≈H.sub.n-1V.sub.EXn (13)
(82) Specifically, the determination of the group of change amounts EX.sub.n is implemented by defining a least squares cost function F for determining the vector V.sub.EXn that minimizes the difference between the left- and right-hand sides of Eq. (13), and determining the vector V.sub.EXn that minimizes the value of the function F. The function F is defined as Eq. (14) below.
(83)
(84) Partial differentiation of Eq. (14) with respect to V.sub.EXn yields Eq. (15) below.
∂F/∂V.sub.EXn=2(−H.sub.n-1.sup.TV.sub.Y+H.sub.n-1.sup.TH.sub.n-1V.sub.EXn) (15)
(85) When V.sub.EXn minimizes the value of the function F, ∂F/∂V.sub.EXn=0 is satisfied. Thus, V.sub.EXn that minimizes the value of the function F is expressed in Eq. (16) below.
V.sub.EXn=(H.sub.n-1.sup.TH.sub.n-1).sup.−1H.sub.n-1.sup.TV.sub.Y (16)
(86) In the present embodiment, the processor 20 determines a set of the three elements of the vector V.sub.EXn calculated in accordance with Eq. (16), i.e., a set of approximate solutions to the change amounts Eθ.sub.MA, Eθ.sub.EX and EH.sub.EX as the group of change amounts EX.sub.n.
(87) In the first process, the iterative calculation unit 21 then determines the group of estimated unknowns X.sub.n on the basis of the determined group of change amounts EX.sub.n. Here, a three-dimensional column vector that includes as its elements the provisional values Aθ.sub.MA, Aθ.sub.EX, and AH.sub.EX in the group of provisional unknowns X.sub.n-1 will be denoted by the symbol and a three-dimensional column vector that includes as its elements the estimated values Bθ.sub.MA, Bθ.sub.EX, and BH.sub.EX in the group of estimated unknowns X.sub.n will be denoted by the symbol V.sub.n. The vectors V.sub.n-1 and V.sub.n are expressed in Eqs. (17) and (18) below, respectively.
V.sub.n-1.sup.T=[Aθ.sub.MA,Aθ.sub.EX,AH.sub.EX] (17)
V.sub.n.sup.T=[Bθ.sub.MA,Bθ.sub.EX,BH.sub.EX] (18)
(88) The vector V.sub.n is expressed in the following Eq. (19) using the vector and the vector V.sub.EXn.
V.sub.n=V.sub.n-1+V.sub.EXn (19)
(89) The iterative calculation unit 21 determines a set of the three elements of the vector V.sub.n calculated in accordance with Eq. (19), i.e., a set of the estimated values Bθ.sub.MA, Bθ.sub.EX, and BH.sub.EX as the group of estimated unknowns X.sub.n.
(90) To generate the angle detection value θs, the processor 20 executes a second process and a third process in addition to the first process for determining the group of estimated unknowns X.sub.n. The second process is a process for assuming the group of estimated unknowns X.sub.n determined by the first process as a new group of provisional unknowns X.sub.n-1 for the first process to be executed next time. The second process is executed by the iterative calculation unit 21. The iterative calculation unit 21 executes the first process and the second process so that the number of executions of the first process is two or more.
(91) Through the repetition of the first process, the estimated value Bθ.sub.MA approaches the true value of the first unknown θ.sub.MA. As the estimated value Bθ.sub.MA approaches the true value of the first unknown θ.sub.MA, the change amount Eθ.sub.MA in the group of change amounts EX.sub.n decreases. The third process is executed by the angle detection value determination unit 22 if the change amount Eθ.sub.MA is less than or equal to a predetermined value. The third process is a process for assuming the estimated value Bθ.sub.MA in the group of estimated unknowns X.sub.n determined by the last executed first process as the angle detection value θs.
(92) Reference is now made to
(93) In the method for generating the angle detection value θs, the iterative calculation unit 21 initially defines the variable n as an integer greater than or equal to 1, assumes n=1, and assumes a group of initial unknowns X.sub.0 as the group of provisional unknowns X.sub.n-1 (step S11). The group of initial unknowns X.sub.0 is a set of initial values of the provisional values Aθ.sub.MA, Aθ.sub.EX, and AH.sub.EX. The group of initial unknowns X.sub.0 may be stored either in the iterative calculation unit 21 or in the storage unit (not shown) included in the processor 20.
(94) The iterative calculation unit 21 then determines the group of change amounts EX.sub.n on the basis of the plurality of detection values θsi, the group of provisional unknowns X.sub.n-1, and the approximate functions represented by the matrix H (step S12). The iterative calculation unit 21 then determines the group of estimated unknowns X.sub.n on the basis of the determined group of change amounts EX.sub.n (step S13). The estimated values Bθ.sub.MA, Bθ.sub.EX, and BH.sub.EX are thereby determined.
(95) Next, the iterative calculation unit 21 determines whether n is greater than or equal to 2 and the change amount Eθ.sub.MA is less than or equal to a predetermined value (step S14). If n is neither greater than nor equal to 2 and the change amount Eθ.sub.MA is neither less than nor equal to the predetermined value (NO), the iterative calculation unit 21 assumes n+1 as new n and assumes the group of estimated unknowns X.sub.n as a new group of provisional unknowns X.sub.n-1 (step S15), and the flow returns to step S12.
(96) In step S14, if n is greater than or equal to 2 and the change amount Eθ.sub.MA is less than or equal to the predetermined value (YES), the angle detection value determination unit 22 assumes the estimated value Bθ.sub.MA determined in step S13 as the angle detection value θs (step S16).
(97) Steps S12 and S13 correspond to the first process. Step S15 corresponds to the second process. Step S16 corresponds to the third process.
(98) Next, the operation and effect of the angle sensor 1 and the angle sensor system 100 according to the present embodiment will be described. In the present embodiment, the processor 20 executes the foregoing first and second processes so that the number of executions of the first process is two or more, and executes the third process for assuming the estimated value Bθ.sub.MA determined by the last executed first process as the angle detection value θs.
(99) In the present embodiment, the strength and direction of the detection-target magnetic field at any position in the reference plane P change depending on the detection-target angle θ. In the present embodiment, in order to reproduce the strengths and directions of the detection-target magnetic field having such a characteristic as faithfully as possible, the strength Hdi and angle θdi of the detection-target magnetic field at a detection position Pi are modeled by nonlinear functions including a plurality of periodic functions with the detection-target angle θ as a variable, as expressed in the foregoing Eqs. (2) and (3), and the detection value θsi is represented by a nonlinear model function as expressed in the foregoing Eq. (5).
(100) An example of methods for generating an angle detection value θs in the presence of a noise magnetic field Mex is to estimate the angle detection value θs by a single process using the least squares method on the basis of a plurality of detection values θsi. However, if the strength Hdi and angle θdi of the detection-target magnetic field at a detection position Pi are represented by nonlinear functions as described above, it is not possible to accurately determine the angle detection value θs with the single process using the least squares method.
(101) In contrast, according to the present embodiment, as has been described with reference to Eqs. (6) to (8), the foregoing approximate functions, i.e., the approximate functions represented by the matrix H are determined in advance by using Taylor expansion up to the first order, and the first process is executed repeatedly in order to generate the angle detection value θs. The first process includes determining the group of change amounts EX.sub.n by using the plurality of discrepancy values Dθi obtained from the plurality of detection values θsi and the matrix H.sub.n-1 obtained from the matrix H, and determining the estimated values Bθ.sub.MA, Bθ.sub.EX, and BH.sub.EX on the basis of the determined group of change amounts EX.sub.n.
(102) In the present embodiment, each time the number of executions of the first process increases, the discrepancy values Dθi and approximate discrepancy values corresponding to the discrepancy values Dθi become smaller. Also, the change amounts Eθ.sub.MA, Eθ.sub.EX, and EH.sub.EX in the group of change amounts EX.sub.n having a correspondence with the group of approximate discrepancy values Z which is a set of the approximate discrepancy values become smaller, so that the estimated values Bθ.sub.MA, Bθ.sub.ER, and BH.sub.EX in the group of estimated unknowns X.sub.n approach the true values of the unknowns θ.sub.MA, θ.sub.EX, and H.sub.EX in the group of unknowns X. According to the present embodiment, it thus becomes possible to generate a highly-accurate angle detection value θs with reduced angle error caused by a noise magnetic field Mex even if the strength Hdi and angle θdi of the detection-target magnetic field at a detection position Pi are not appropriate to be represented by linear functions.
(103) Next, a description will be given of the results of a simulation that was performed to examine the effect of the present embodiment. The simulation used a model of the angle sensor system 100 with four detection positions and four magnetic sensors. The four detection positions were different from each other. The four magnetic sensors in the model of the angle sensor system 100 will be referred to as first to fourth magnetic sensors, and respective detection values generated by the first to fourth magnetic sensors will be referred to as first to fourth detection values θs1, θs2, θs3, and θs4.
(104) The simulation determined an angle error occurring in the angle detection value θs generated by the model of the angle sensor system 100 in the presence of a noise magnetic field Mex having a constant direction and strength. In the simulation, the angle error was defined as a difference between the angle detection value θs and the detection-target angle θ.
(105) The simulation also determined respective errors of the first to fourth detection values θs1, θs2, θs3 and θs4. In the simulation, the error of the first detection value θs1 was defined as a difference between the first detection value θs1 and the detection-target angle θ; the error of the second detection value θs2 was defined as a difference between the second detection value θs2 and the detection-target angle θ; the error of the third detection value θs3 was defined as a difference between the third detection value θs3 and the detection-target angle θ; and the error of the fourth detection value θs4 was defined as a difference between the fourth detection value θs4 and the detection-target angle θ.
(106) In the simulation, the strength and direction of the detection-target magnetic field were modeled so that the strength Hdi and angle θdi of the detection-target magnetic field at a detection position Pi were represented by the functions on the right-hand sides of Eqs. (2) and (3), respectively, and those functions included periodic functions with k of 2 in value. In the simulation, an average value of the strengths of the detection-target magnetic field applied to the first to fourth magnetic sensors was set at 30 mT, and the strength of the noise magnetic field Mex was set at 5 mT.
(107)
(108)
(109) As shown in
(110) The present invention is not limited to the foregoing embodiment, and various modifications may be made thereto. For example, the angle sensor system of the present invention may include a magnetic scale instead of the magnet 6 as the magnetic field generator 5, the magnetic scale including a plurality of pairs of N and S poles arranged alternately in a liner configuration, with a plurality of magnetic sensors arranged in the vicinity of the periphery of the magnetic scale. In such a case, it is required that the relative position of the magnetic scale with respect to a plurality of detection positions be variable linearly in the direction in which the N and S poles of the magnetic scale are arranged. The angle to be detected in such a case may be an angle that represents the relative position of the magnetic scale with one pitch of the magnetic scale as 360°.
(111) Obviously, many modifications and variations of the present invention are possible in the light of the above teachings. Thus, it is to be understood that, within the scope of the appended claims and equivalents thereof, the invention may be practiced in other embodiments than the foregoing most preferable embodiment.