# Patent

## Title
Rotation angle detection device

## Abstract

In a rotation angle detection device, when a condition that two sensors among three magnetic sensors sense one and the same magnetic pole for three consecutive sampling periods is satisfied, a rotation angle is computed based on output signals from the two sensors, sampled at three sampling timings. When the output signals sampled at the three sampling timings satisfy a prescribed requirement, an angular width error correction value corresponding to the magnetic pole sensed by the two sensors and amplitudes are computed, and stored in association with the magnetic pole. If the condition is not satisfied, the rotation angle is computed based on the information stored in a memory and the output signals from two sensors among the three magnetic sensors, the two magnetic sensors including one of the three magnetic sensors, which detects the magnetic pole of which the angular width error correction value is stored in the memory.

## Background
INCORPORATION BY REFERENCE
The disclosure of Japanese Patent Application No. 2012-271640 filed on Dec. 12, 2012 including the specification, drawings and abstract is incorporated herein by reference in its entirety.
BACKGROUND OF THE INVENTION
1. Field of the Invention
The invention relates to a rotation angle detection device that detects a rotation angle of a rotary body.
2. Description of the Related Art
As a rotation angle detection device that detects a rotation angle of a rotary body, there has been known a rotation angle detection device that detects a rotation angle of a rotor of a brushless motor with the use of a detection rotor that rotates in accordance with the rotation of the brushless motor. Specifically, as illustrated in FIG. 16, a detection rotor 201 (hereinafter, referred to as “rotor 201”) includes a cylindrical magnet 202 having a plurality of magnetic pole pairs corresponding to magnetic pole pairs formed in a rotor of a brushless motor. Two magnetic sensors 221, 222 are arranged around the rotor 201 at a predetermined angular interval around the rotation central axis of the rotor 201. The magnetic sensors 221, 222 respectively output sinusoidal signals having a predetermined phase difference. On the basis of the two sinusoidal signals, a rotation angle of the rotor 201 (a rotation angle of the brushless motor) is detected.
In this example, the magnet 202 has five magnetic pole pairs. That is, the magnet 202 has ten magnetic poles arranged at equal angular intervals. The magnetic poles are arranged at angular intervals of 36° (180° in electrical angle) around the rotation central axis of the rotor 201. Further, the two magnetic sensors 221, 222 are arranged at an angular interval of 18° (90° in electrical angle) around the rotation central axis of the rotor 201.
The direction indicated by an arrow in FIG. 16 is defined as the forward rotation direction of the detection rotor 201. The rotation angle of the rotor 201 increases as the rotor 201 is rotated in the forward direction, whereas the rotation angle of the rotor 201 decreases as the rotor 201 is rotated in the reverse direction. The magnetic sensors 221, 222 output sinusoidal signals S1, S2, respectively. As illustrated in FIG. 17, one period of each of the sinusoidal signals S1, S2 corresponds to a duration in which the rotor 201 rotates an angle of 72° (360° in electrical angle) corresponding to one magnetic pole pair.
The angular range corresponding to one rotation of the rotor 201 is divided into five sections corresponding to the five magnetic pole pairs, a start position of each section is defined as 0°, and an end position of each section is defined as 360°. A rotation angle of the rotor 201 expressed under the above-described conditions is an electrical angle θ of the rotor 201. In this case, the first magnetic sensor 221 outputs an output signal of S1=A1·sin θ, and the second magnetic sensor 222 outputs an output signal of S2=A2·cos θ. Each of A1 and A2 represents an amplitude. If the amplitude A1 of the output signal S1 and the amplitude A2 of the output signal S2 are assumed to be equal to each other, the electrical angle θ of the rotor 201 is obtained with the use of both the output signals S1, S2 based on the following expression.




  
    
      
        θ
        =
        
        ⁢
        
          
            tan
            
              -
              1
            
          
          ⁡
          
            (
            
              sin
              ⁢
              
                
              
              ⁢
              
                θ
                /
                cos
              
              ⁢
              
                
              
              ⁢
              θ
            
            )
          
        
      
    
  
  
    
      
        =
        
        ⁢
        
          
            tan
            
              -
              1
            
          
          ⁡
          
            (
            
              
                S
                1
              
              /
              
                S
                2
              
            
            )
          
        
      
    
  




The thus obtained electrical angle θ is used to control the brushless motor. Refer to, for example, Japanese Patent Application Publication No. 2008-26297 (JP 2008-26297 A).
In the above-described conventional rotation angle detection device, the rotation angle θ is computed on the assumption that the amplitudes A1, A2 of the output signals S1, S2 output from the magnetic sensors 221, 222 are equal to each other. However, the amplitudes A1, A2 of the output signals S1, S2 vary depending on variations of the temperature characteristics of the magnetic sensors 221, 222 and temperature changes. Therefore, an error may be caused in detection of a rotation angle of the rotor due to variations of the temperature characteristics of the magnetic sensors 221, 222 and temperature changes.
SUMMARY OF THE INVENTION
One object of the invention is to provide a rotation angle detection device that is able to detect a rotation angle with a high degree of accuracy.
A rotation angle detection device according to an aspect of the invention includes: a multipolar magnet that rotates in accordance with rotation of a rotary body, and that has a plurality of magnetic poles; three magnetic sensors that respectively output sinusoidal signals having a predetermined phase difference in accordance with rotation of the multipolar magnet; a sampling unit that samples an output signal from each of the magnetic sensors at prescribed timings; a first computation unit that computes a rotation angle of the rotary body based on the output signals from two magnetic sensors among the three magnetic sensors, the output signals being sampled at three sampling timings, when a condition that both the two magnetic sensors among the three magnetic sensors sense one and the same magnetic pole for three consecutive sampling periods is satisfied, and computes information regarding a magnetic pole width of the magnetic pole sensed by the two magnetic sensors and information regarding amplitudes of the output signals from the two magnetic sensors and stores the information regarding the magnetic pole width and the information regarding the amplitudes in association with the magnetic pole sensed by the two magnetic sensors, at all times or when the output signals sampled at the three sampling timings satisfy a prescribed requirement; and a second computation unit that computes the rotation angle of the rotary body based on the information stored by the first computation unit and the output signals from two magnetic sensors among the three magnetic sensors, the two magnetic sensors including one of the three magnetic sensors, which senses the magnetic pole associated with the stored information regarding the magnetic pole width, when the condition is not satisfied.
According to the above-described aspect, the rotation angle of the rotary body is computed based on the output signals from two magnetic sensors among the three magnetic sensors, the output signals being sampled at three sampling timings, when the condition that both the two magnetic sensors among the three magnetic sensors sense one and the same magnetic pole for three consecutive sampling periods is satisfied. Therefore, it is possible to compute the rotation angle with a high degree of accuracy. On the other hand, when the above-described condition is not satisfied, the rotation angle of the rotary body is computed based on the information stored by the first computation unit and the output signals from two magnetic sensors among the three magnetic sensors, the two magnetic sensors including one of the three magnetic sensors, which senses the magnetic pole associated with the stored information regarding the magnetic pole width. Therefore, it is possible to compute the rotation angle at an accuracy close to the accuracy achieved by the first computation unit.



BRIEF DESCRIPTION OF THE DRAWINGS
The foregoing and further features and advantages of the invention will become apparent from the following description of example embodiments with reference to the accompanying drawings, wherein like numerals are used to represent like elements and wherein:
FIG. 1 is a schematic view illustrating the schematic configuration of an electric power steering system to which a rotation angle detection device according to an embodiment of the invention is applied;
FIG. 2 is a schematic diagram illustrating the electrical configuration of a motor control ECU;
FIG. 3 is a schematic diagram schematically illustrating the configuration of an electric motor;
FIG. 4 is a graph illustrating an example of a manner of setting a q-axis current command value Iq* with respect to a detected steering torque Th;
FIG. 5 is a schematic view schematically illustrating the configuration of a torque sensor;
FIG. 6 is a schematic diagram illustrating the configuration of a first magnet and the arrangement of three magnetic sensors;
FIG. 7 is a schematic diagram illustrating waveforms of output signals from a first magnetic sensor, a second magnetic sensor and a third magnetic sensor;
FIG. 8A is a schematic view illustrating the case where a third computation mode is applied;
FIG. 8B is a schematic view illustrating the case where a fourth computation mode is applied;
FIG. 8C is a schematic view illustrating the case where a fifth computation mode is applied;
FIG. 9 is a graph illustrating the third computation mode;
FIG. 10 is a flowchart showing the operation of a first rotation angle computation unit;
FIG. 11A is a flowchart showing part of the procedure of a rotation angle computing process based on forced rotation in step S1 in FIG. 10;
FIG. 11B is a flowchart showing part of the procedure of the rotation angle computing process based on forced rotation in step S1 in FIG. 10;
FIG. 11C is a flowchart showing part of the procedure of the rotation angle computing process based on forced rotation in step S1 in FIG. 10;
FIG. 12 is a schematic diagram showing part of the contents of a memory in a torque computation ECU;
FIG. 13 is a flowchart showing the detailed procedure of a relative pole number setting process;
FIG. 14A is a schematic diagram illustrating the relative pole number setting process;
FIG. 14B is a schematic diagram illustrating the relative pole number setting process;
FIG. 14C is a schematic diagram illustrating the relative pole number setting process;
FIG. 15A is a flowchart showing part of the procedure of a normal rotation angle computing process in step S2 in FIG. 10;
FIG. 15B is a flowchart showing part of the procedure of the normal rotation angle computing process in step S2 in FIG. 10;
FIG. 15C is a flowchart showing part of the procedure of the normal rotation angle computing process in step S2 in FIG. 10;
FIG. 16 is a schematic diagram illustrating a rotation angle detection method executed by a conventional rotation angle detection device; and
FIG. 17 is a schematic diagram illustrating waveforms of output signals from a first magnetic sensor and a second magnetic sensor.



DETAILED DESCRIPTION OF EMBODIMENTS
Hereinafter, embodiments of the invention will be described with reference to the accompanying drawings. As illustrated in FIG. 1, an electric power steering system 1 includes a steering wheel 2, which serves as a steering member used to steer a vehicle, a steered mechanism 4 that steers steered wheels 3 in accordance with the rotation of the steering wheel 2, and a steering assist mechanism 5 used to assist a driver in performing a steering operation. The steering wheel 2 and the steered mechanism 4 are mechanically connected to each other via a steering shaft 6 and an intermediate shaft 7.
The steering shaft 6 includes an input shaft 8 connected to the steering wheel 2 and an output shaft 9 connected to the intermediate shaft 7. The input shaft 8 and the output shaft 9 are connected to each other via a torsion bar 10 so as to be rotatable relative to each other on the same axis. That is, when the steering wheel 2 is rotated, the input shaft 8 and the output shaft 9 rotate in the same direction while rotating relative to each other.
A torque sensor (torque detection device) 11, to which a rotation angle detection device according to an embodiment of the invention is applied, is arranged around the steering shaft 6. The torque sensor 11 detects a steering torque applied to the steering wheel 2 on the basis of a relative rotational displacement between the input shaft 8 and the output shaft 9. The steering torque detected by the torque sensor 11 is input into an electronic control unit 12 for motor control (hereinafter, referred to as “motor control ECU 12”).
The steered mechanism 4 is formed of a rack-and-pinion mechanism including a pinion shaft 13 and a rack shaft 14 that serves as a steered shaft. The steered wheels 3 are connected to respective end portions of the rack shaft 14 via tie rods 15 and knuckle arms (not illustrated). The pinion shaft 13 is connected to the intermediate shaft 7. The pinion shaft 13 rotates in accordance with steering of the steering wheel 2. A pinion 16 is connected to a distal end of the pinion shaft 13.
The rack shaft 14 linearly extends along the lateral direction of the vehicle (the direction orthogonal to the direction in which the vehicle travels straight ahead). A rack 17 that meshes with the pinion 16 is formed at an axially intermediate portion of the rack shaft 14. The pinion 16 and the rack 17 convert the rotation of the pinion shaft 13 into an axial movement of the rack shaft 14. By moving the rack shaft 14 in the axial direction, the steered wheels 3 are steered.
When the steering wheel 2 is steered (rotated), the rotation is transmitted to the pinion shaft 13 via the steering shaft 6 and the intermediate shaft 7. The rotation of the pinion shaft 13 is converted into an axial movement of the rack shaft 14 by the pinion 16 and the rack 17. As a result, the steered wheels 3 are steered. The steering assist mechanism 5 includes an electric motor 18 that generates steering assist force and a speed-reduction mechanism 19 that transmits torque output from the electric motor 18 to the steered mechanism 4. The electric motor 18 is formed of a three-phase brushless motor in the present embodiment. The speed-reduction mechanism 19 is formed of a worm gear mechanism including a worm shaft 20 and a worm wheel 21 that meshes with the worm shaft 20. The speed-reduction mechanism 19 is housed in a gear housing 22 that serves as a transmission mechanism housing.
The worm shaft 20 is driven to be rotated by the electric motor 18. The worm wheel 21 is connected to the steering shaft 6 so as to be rotatable in the same direction as the rotation direction of the steering shaft 6. The worm wheel 21 is driven to be rotated by the worm shaft 20. When the worm shaft 20 is driven to be rotated by the electric motor 18, the worm wheel 21 is driven to be rotated, and the steering shaft 6 rotates. The rotation of the steering shaft 6 is transmitted to the pinion shaft 13 via the intermediate shaft 7. The rotation of the pinion shaft 13 is converted into an axial movement of the rack shaft 14. As a result, the steered wheels 3 are steered. That is, when the worm shaft 20 is driven to be rotated by the electric motor 18, the steered wheels 3 are steered.
A rotation angle of a rotor of the electric motor 18 (a rotor rotation angle) is detected by a rotation angle sensor 25 such as a resolver. A signal output from the rotation angle sensor 25 is input into the motor control ECU 12. The electric motor 18 is controlled by the motor control ECU 12 that serves as a motor control unit. FIG. 2 is a schematic diagram illustrating the electrical configuration of the motor control ECU 12.
The motor control ECU 12 realizes appropriate steering assistance suited to a steering state, by driving the electric motor 18 on the basis of a steering torque Th detected by the torque sensor 11. The motor control ECU 12 includes a microcomputer 40, a drive circuit (inverter circuit) 31 that is controlled by the microcomputer 40 and that supplies electric power to the electric motor 18, and a current detection unit 32 that detects a motor current passing through the electric motor 18.
The electric motor 18 is, for example, a three-phase brushless motor, and includes a rotor 100, which serves as a field magnet, and a stator 105 provided with U-phase, V-phase, and W-phase stator coils 101, 102, 103, as schematically illustrated in FIG. 3. The electric motor 18 may be an electric motor of an inner rotor type, in which a stator is arranged outside a rotor so as to face the rotor, or may be an electric motor of an outer rotor type, in which a stator is arranged inside a tubular rotor so as to face the rotor.
A UVW coordinate system that is a three-phase fixed coordinate system is defined, in which a U-axis, a V-axis, and a W-axis are set to the respective directions of the U-phase stator coil 101, the V-phase stator coil 102 and the W-phase stator coil 13. A dq coordinate system (an actual rotating coordinate system) that is a two-phase rotating coordinate system is defined, in which a d-axis that is a magnetic pole axis is set to the magnetic pole direction of the rotor 100 and a q-axis that is a torque axis is set to the direction orthogonal to the d-axis within a rotary plane of the rotor 100. The dq coordinate system is a rotating coordinate system that rotates together with the rotor 100. In the dq coordinate system, because only a q-axis current contributes to generation of torque of the rotor 100, a d-axis current is set to zero and the q-axis current is controlled on the basis of a desired torque. A rotation angle (electrical angle) θ-S of the rotor 100 is a rotation angle of the d-axis with respect to the U-axis. The dq coordinate system is an actual rotating coordinate system that rotates in accordance with the rotor angle θ-S. With the use of the rotor angle θ-S, coordinate conversion between the UVW coordinate system and the dq coordinate system can be executed.
The microcomputer 40 includes a CPU and memories (a ROM, a RAM, a non-volatile memory, etc.), and is configured to function as a plurality of functional processing units by executing predetermined programs. The functional processing units include a current command value setting unit 41, a current deviation computation unit 42, a PI (Proportional Integral) control unit 43, a dq/UVW conversion unit 44, a PWM (Pulse Width Modulation) control unit 45, a UVW/dq conversion unit 46, and a rotation angle computation unit 47.
The rotation angle computation unit 47 computes a rotor rotation angle (electrical angle) (hereinafter, referred to as “rotor angle θS”) of the electric motor 18 on the basis of a signal output from the rotation angle sensor 25. The current command value setting unit 41 sets current values, which are values of currents that should be passed through coordinate axes of the dq coordinate system, as current command values. Specifically, the current command value setting unit 41 sets a d-axis current command value Id* and a q-axis current command value Iq* (hereinafter, the d-axis current command value Id* and the q-axis current command value Iq* will be collectively referred to as “two-phase current command values Idq*” where appropriate). More specifically, the current command value setting unit 41 sets the q-axis current command value Iq* to a significant value, whereas it sets the d-axis current command value Id* to zero. More specifically, the current command value setting unit 41 sets the q-axis current command value Iq* on the basis of the detected steering torque Th detected by the torque sensor 11.
An example of a manner of setting the q-axis current command value Iq* with respect to the detected steering torque Th is shown in FIG. 4. With regard to the detected steering torque Th, for example, a torque for steering to the right takes a positive value, and a torque for steering to the left takes a negative value. The q-axis current command value Iq* takes a positive value when an operation assist force for steering to the right should be generated by the electric motor 18, and takes a negative value when an operation assist force for steering to the left should be generated by the electric motor 18. The q-axis current command value Iq* with respect to a positive value of the detected steering torque Th takes a positive value, and the q-axis current command value Iq* with respect to a negative value of the detected steering torque Th takes a negative value. When the detected steering torque Th is zero, the q-axis current command value Iq* is zero. The q-axis current command value Iq* is set such that the absolute value of the q-axis current command value Iq* increases as the absolute value of the detected steering torque Th increases.
The two-phase current command values Idq* set by the current command value setting unit 41 are provided to the current deviation computation unit 42. The current detection unit 32 detects a U-phase current IU, a V-phase current IV, and a W-phase current Iw for the electric motor 18 (hereinafter, the U-phase current IU, the V-phase current IV, and the W-phase current Iw will be collectively referred to as “three-phase detected currents IUVW” where appropriate). The three-phase detected currents IUVW detected by the current detection unit 32 are provided to the UVW/dq conversion unit 46.
The UVW/dq conversion unit 46 executes coordinate conversion from the three-phase detected currents IUVW (the U-phase current IU, the V-phase current IV, and the W-phase current Iw) of the UVW coordinate system detected by the current detection unit 32, into two-phase detected currents Id, Iq of the dq coordinate system (hereinafter, the two-phase detected currents Id, Iq will be collectively referred to as “two-phase detected currents Idq” where appropriate). The rotor angle θS computed by the rotation angle computation unit 47 is used for this coordinate conversion.
The current deviation computation unit 42 computes deviations between the two-phase current command values Idq* set by the current command value setting unit 41 and the two-phase detected currents Idq provided from the UVW/dq conversion unit 46. Specifically, the current deviation computation unit 42 computes a deviation of the d-axis detected current Id with respect to the d-axis current command value Id* and a deviation of the q-axis detected current Iq with respect to the q-axis current command value Iq*. These deviations are provided to the PI control unit 43.
The PI control unit 43 generates two-phase voltage command values Vdq* (the d-axis voltage command value Vd* and the q-axis voltage command value Vq*), which are values of voltages that should be applied to the electric motor 18, by executing a PI computation on the current deviations computed by the current deviation computation unit 42. The two-phase voltage command values Vdq* are provided to the dq/UVW conversion unit 44. The dq/UVW conversion unit 44 executes coordinate conversion from the two-phase voltage command values Vdq* into three-phase voltage command values VUVW*. The rotor angle θS computed by the rotation angle computation unit 47 is used for this coordinate conversion. The three-phase voltage command values VUVW* consist of a U-phase voltage command value VU*, a V-phase voltage command value VV*, and a W-phase voltage command value Vw*. The three-phase voltage command values VUVW* are provided to the PWM control unit 45.
The PWM control unit 45 generates a U-phase PWM control signal, a V-phase PWM control signal, and a W-phase PWM control signal having duty ratios corresponding to the U-phase voltage command value VU*, the V-phase voltage command value VV*, and the W-phase voltage command value Vw*, respectively, and provides these control signals to the drive circuit 31. The drive circuit 31 is formed of an inverter circuit with three phases corresponding to the U-phase, the V-phase, and the W-phase. When power elements constituting the inverter circuit are controlled by the PWM control signals provided from the PWM control unit 45, voltages corresponding to the three-phase voltage command values VUVW* are applied to the U-phase stator coil 101, the V-phase stator coil 102 and the W-phase stator coil 103 of the electric motor 18.
The current deviation computation unit 42 and the PI control unit 43 constitute a current feedback controller. Due to the action of the current feedback controller, motor currents passing through the electric motor 18 are controlled so as to approach the two-phase current command values Idq* set by the current command value setting unit 41. FIG. 5 is a schematic view schematically showing the configuration of the torque sensor 11.
An annular first magnet (a multipolar magnet) 61 is connected to the input shaft 8 so as to be rotatable together with the input shaft 8. Three magnetic sensors 71, 72, 73 that respectively output sinusoidal signals having a phase difference in accordance with the rotation of the first magnet 61 are arranged below the first magnet 61. An annular second magnet (a multipolar magnet) 62 is connected to the output shaft 9 so as to be rotatable together with the output shaft 9. Three magnetic sensors 74, 75, 76 that respectively output sinusoidal signals having a phase difference in accordance with the rotation of the second magnet 62 are arranged above the second magnet 62.
The output signals S1 to S6 from the respective magnetic sensors 71 to 76 are input into a torque computation ECU 77 used to compute a steering torque that is applied to the input shaft 8. A power supply for the torque computation ECU 77 is turned on when an ignition key is turned on. When the ignition key is turned off, an ignition key off operation signal indicating that the ignition key is turned off is input into the torque computation ECU 77. A magnetic sensor including an element having electrical characteristics that vary due to the action of a magnetic force, for example, a Hall element or a magnetoresistive element (a MR element) may be used as each of the magnetic sensors. In the present embodiment, a Hall element is used as each of the magnetic sensors.
The magnets 61, 62, the magnetic sensors 71 to 76, and the torque computation ECU 77 constitute the torque sensor 11. The torque computation ECU 77 includes a microcomputer. The microcomputer is provided with a CPU and memories (a ROM, a RAM, a nonvolatile memory, etc.), and functions as a plurality of functional processing units by executing predetermined programs. The functional processing units include a first rotation angle detection device 77A, a second rotation angle detection device 77B, and a torque computation unit 77C.
The first rotation angle detection device 77A computes the rotation angle (an electrical angle θA) of the input shaft 8 on the basis of the output signals S1, S2, S3 from the three magnetic sensors 71, 72, 73. The second rotation angle detection device 77B computes the rotation angle (an electrical angle θB) of the output shaft 9 on the basis of the output signals S4, S5, S6 from the three magnetic sensors 74, 75, 76. The torque computation unit 77C computes the steering torque Th applied to the input shaft 8 on the basis of the rotation angle θA of the input shaft 8 detected by the first rotation angle detection device 77A and the rotation angle θB of the output shaft 9 detected by the second rotation angle detection device 77B. Specifically, the steering torque Th is computed according to the following expression (1) where K is a spring constant of the torsion bar 10 and N is the number of magnetic pole pairs formed in each of the magnets 61, 62.

Th={(θA−θB)/N}×K  (1)

The first magnet 61, the magnetic sensors 71, 72, 73 and the first rotation angle detection device 77A detect the rotation angle θA of the input shaft 8. The second magnet 62, the magnetic sensors 74, 75, 76 and the second rotation angle detection device 77B detect the rotation angle θB of the output shaft 9. Because an operation of the first rotation angle detection device is the same as an operation of the second rotation angle detection device, only the operation of the first rotation angle detection device will be described below.

FIG. 6 is a schematic diagram illustrating the configuration of the first magnet 61 and the arrangement of the three magnetic sensors 71, 72, 73. The first magnet 61 has four magnetic pole pairs (M1, M2), (M3, M4), (M5, M6), (M7, M8) arranged at equal angular intervals in the circumferential direction. That is, the first magnet 61 has the eight magnetic poles M1 to M8 arranged at the equal angular intervals. The magnetic poles M1 to M8 are arranged at angular intervals (angular widths) of approximately 45° (approximately 180° in electrical angle) around the central axis of the input shaft 8. The magnitudes of magnetic forces of the magnetic poles M1 to M8 are substantially equal to each other.
The three magnetic sensors 71, 72, 73 are arranged so as to face a lower annular end face of the first magnet 61. In the following description, the magnetic sensor 71 will be referred to as a first magnetic sensor 71, the magnetic sensor 72 will be referred to as a second magnetic sensor 72, and the magnetic sensor 73 will be referred to as a third magnetic sensor 73 where appropriate. The first magnetic sensor 71 and the second magnetic sensor 72 are arranged at an angular interval of 120° in electrical angle around the central axis of the input shaft 8. The second magnetic sensor 72 and the third magnetic sensor 73 are arranged at an angular interval of 120° in electrical angle around the central axis of the input shaft 8. Therefore, the first magnetic sensor 71 and the third magnetic sensor 73 are arranged at an angular interval of 240° in electrical angle around the central axis of the input shaft 8.
The direction indicated by an arrow in FIG. 6 is defined as the forward rotation direction of the input shaft 8. The rotation angle of the input shaft 8 increases as the input shaft 8 is rotated in the forward direction, and the rotation angle of the input shaft 8 decreases as the input shaft 8 is rotated in the reverse direction. Sinusoidal signals S1, S2, S3 are respectively output from the magnetic sensors 71, 72, 73 in accordance with rotation of the input shaft 8, as illustrated in FIG. 7. Note that a rotation angle (deg) on the abscissa axis in FIG. 7 represents a mechanical angle.
In the following description, the output signal S1 from the first magnetic sensor 71 will be referred to as a first output signal S1 or a first sensor value S1, the output signal S2 from the second magnetic sensor 72 will be referred to as a second output signal S2 or a second sensor value S2, and the output signal S3 from the third magnetic sensor 73 will be referred to as a third output signal S3 or a third sensor value S3, where appropriate. In the following description, a rotation angle of the input shaft 8 will be denoted by θ instead of θA, for convenience of explanation. If each of the output signals S1, S2, S3 is a sinusoidal signal and a rotation angle of the input shaft 8 is θ (electrical angle), the output signal S1 from the first magnetic sensor 71 is expressed by S1=A1·sin θ, the output signal S2 from the second magnetic sensor 72 is expressed by S2=A2·sin(θ+120), and the output signal S3 from the third magnetic sensor 73 is expressed by S3=A3·sin(θ+240). Each of A1, A2 and A3 represents an amplitude. The phase difference between the first output signal S1 and the second output signal S2 is 120°. The phase difference between the second output signal S2 and the third output signal S3 is also 120°. Therefore, the phase difference between the first output signal S1 and the third output signal S3 is 240°.
A basic concept of a method of computing the rotation angle θ with the use of the first rotation angle detection device 77A will be described. The first rotation angle detection device 77A includes a rotation angle computation unit. The modes of computation of the rotation angle θ executed by the rotation angle computation unit include a first computation mode to a fifth computation mode. Each computation mode will be described below. The first computation mode is a computation mode that is applied when both the first and second magnetic sensors 71, 72 sense one and the same magnetic pole for three consecutive sampling periods (three consecutive computation periods). In the first computation mode, the rotation angle θ is computed on the basis of the output signals from the first and second magnetic sensors 71, 72, which are sampled at three sampling timings.
A phase difference (electrical angle) between the first output signal S1 and the second output signal S2 will be denoted by C. The number of the present sampling period (the number of the present computation period) will be denoted by (n), the number of the immediately preceding sampling period will be denoted by (n−1), and the number of the second preceding sampling period will be denoted by (n−2). A correction value used to correct a rotation angle computing error due to the variations of angular widths (magnetic pole widths, pitch widths) of the magnetic poles M1 to M8 will be referred to as an angular width error correction value (a magnetic pole width error correction value), and will be denoted by E.
When the phase difference C, the numbers of the sampling periods (n), (n−1), (n−2), and the angular width error correction value E are used, the first output signals S1 sampled in the present sampling period, the immediately preceding sampling period, and the second preceding sampling period, and the second output signals S2 sampled in the present sampling period, the immediately preceding sampling period, and the second preceding sampling period can be expressed by the following expressions (2a), (2b), (2c), (2d), (2e), (2f), respectively.

S1(n)=A1(n)sin(E1(n)θ(n))  (2a)

S1(n−1)=A1(n−1)sin(E1(n−1)θ(n−1))  (2b)

S1(n−2)=A1(n−2)sin(E1(n−2)θ(n−2))  (2c)

S2(n)=A2(n)sin(E2(n)θ(n)+C)  (2d)

S2(n−1)=A2(n−1)sin(E2(n−1)θ(n−1)+C)  (2e)

S2(n−2)=A2(n−2)sin(E2(n−2)θ(n−2)+C)  (2f)

In the expressions (2a) to (2f), E1(x) is an angular width error correction value corresponding to a magnetic pole sensed by the first magnetic sensor 71 in an x-th computation period. E2(x) is an angular width error correction value corresponding to a magnetic pole sensed by the second magnetic sensor 72 in an x-th computation period.

If an angular width of a given magnetic pole is w (electrical angle), an angular width error θerr (electrical angle) of this magnetic pole can be defined by the following expression (3).

θerr=w−180  (3)

The angular width error correction value E for this magnetic pole can be defined by the following expression (4).

E=180/w=180/(θerr+180)  (4)

The angular width error correction value E for each magnetic pole is a piece of information regarding a magnetic pole width of the magnetic pole. Note that the piece of the information regarding the magnetic pole width of each magnetic pole may be an angular width w of the magnetic pole or an angular width error θerr of the magnetic pole.

If C is a known quantity, the number of unknown quantities included in the six expressions expressed by the expressions (2a) to (2f) is 16. Because the number of the unknown quantities is greater than the number of the expressions, simultaneous equations constituted of the six expressions cannot be solved in this state. Therefore, in the present embodiment, by setting a short sampling interval (sampling period), variations of amplitudes due to temperature changes between three sampling timings are assumed to be non-existent. That is, on the assumption that amplitudes A1(n), A1(n−1) A1(n−2) of the output signals from the first magnetic sensor 71, which are sampled at three sampling timings, are equal to each other, the amplitudes A1(n), A1(n−1), A1(n−2) are expressed by A1. Similarly, on the assumption that amplitudes A2(n), A2(n−1), A2(n−2) of the output signals from the second magnetic sensor 72, which are sampled at three sampling timings, are equal to each other, the amplitudes A2(n), A2(n−1), A2(n−2) are expressed by A2.
When both the magnetic sensors 71, 72 sense one and the same magnetic pole at the three sampling timings, angular width error correction values E1(n), E1(n−1), E1(n−2), E2(n), E2(n−1), E2(n−2) included in the output signals from the magnetic sensors 71, 72, which are sampled at the three sampling timings, are equal to each other, and hence they are expressed by E. As a result, the expressions (2a) to (2f) can be expressed by the following expressions (5a) to (5f), respectively.

S1(n)=A1 sin(Eθ(n))  (5a)

S1(n−1)=A1 sin(Eθ(n−1))  (5b)

S1(n−2)=A1 sin(Eθ(n−2))  (5c)

S2(n)=A2 sin(Eθ(n)+C)  (5d)

S2(n−1)=A2 sin(Eθ(n−1)+C)  (5e)

S2(n−2)=A2 sin(Eθ(n−2)+C)  (5f)

The number of unknown quantities (A1, A2, E, θ(n), θ(n−1), θ(n−2)) included in these six expressions is six. That is, the number of the unknown quantities is equal to or smaller than the number of the expressions, and hence simultaneous equations constituted of the six expressions can be solved. Therefore, by solving the simultaneous equations constituted of the six expressions (5a) to (5f), the rotation angle θ(n) of the input shaft 8 can be computed.
Hereinafter, the case where the phase difference C between the sinusoidal signals output from the magnetic sensors 71, 72 is 120° will be described in detail. When the phase difference C is 120°, the six expressions (5a) to (5f) can be expressed by the following expressions (6a) to (6f), respectively.

S1(n)=A1 sin(Eθ(n))  (6a)

S1(n−1)=A1 sin(Eθ(n−1))  (6b)

S1(n−2)=A1 sin(Eθ(n−2))  (6c)

S2(n)=A2 sin(Eθ(n)+120)  (6d)

S2(n−1)=A2 sin(Eθ(n−1)+120)  (6e)

S2(n−2)=A2 sin(Eθ(n−2)+120)  (6f)

If Eθ(n) is regarded as one unknown quantity, by solving simultaneous equations constituted of four expressions (6a), (6b), (6d), (6e) among the six expressions (6a) to (6f), Eθ(n) can be expressed by the following expression (7) (hereinafter, referred to as “Eθ basic arithmetic expression (7)”).




  
    
      
        
          
            E
            ⁢
            
              
            
            ⁢
            
              θ
              ⁡
              
                [
                n
                ]
              
            
          
          =
          
            
              
                1
                4
              
              ⁢
              
                
                  cos
                  
                    -
                    1
                  
                
                ⁡
                
                  (
                  
                    1
                    -
                    
                      
                        
                          (
                          
                            
                              3
                              ⁢
                              
                                
                              
                              ⁢
                              
                                p
                                1
                                2
                              
                              ⁢
                              
                                p
                                2
                                2
                              
                            
                            -
                            
                              2
                              ⁢
                              
                                
                              
                              ⁢
                              
                                p
                                1
                                2
                              
                            
                            -
                            
                              2
                              ⁢
                              
                                
                              
                              ⁢
                              
                                p
                                2
                                2
                              
                            
                            +
                            
                              
                                p
                                1
                              
                              ⁢
                              
                                p
                                2
                              
                            
                          
                          )
                        
                        2
                      
                      
                        2
                        ⁢
                        
                          
                            (
                            
                              
                                p
                                1
                              
                              -
                              
                                p
                                2
                              
                            
                            )
                          
                          2
                        
                        ⁢
                        
                          (
                          
                            
                              p
                              1
                              2
                            
                            +
                            
                              
                                p
                                1
                              
                              ⁢
                              
                                p
                                2
                              
                            
                            +
                            
                              p
                              2
                              2
                            
                          
                          )
                        
                      
                    
                  
                  )
                
              
            
            -
            
              
                1
                4
              
              ⁢
              
                
                  cos
                  
                    -
                    1
                  
                
                ⁡
                
                  (
                  
                    
                      1
                      2
                    
                    -
                    
                      
                        3
                        2
                      
                      ·
                      
                        
                          
                            
                              p
                              1
                            
                            ⁢
                            
                              p
                              2
                            
                          
                          +
                          
                            p
                            2
                            2
                          
                        
                        
                          
                            p
                            1
                            2
                          
                          +
                          
                            
                              p
                              1
                            
                            ⁢
                            
                              p
                              2
                            
                          
                          +
                          
                            p
                            2
                            2
                          
                        
                      
                    
                  
                  )
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
        
        ⁢
        where
        ⁢
        
          

        
        ⁢
        
          
        
        ⁢
        
          
            p
            1
          
          =
          
            
              
                
                  
                    S
                    1
                  
                  ⁡
                  
                    [
                    n
                    ]
                  
                
                
                  
                    S
                    1
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      1
                    
                    ]
                  
                
              
              ⁢
              
                
              
              ⁢
              
                p
                2
              
            
            =
            
              
                
                  S
                  2
                
                ⁡
                
                  [
                  n
                  ]
                
              
              
                
                  S
                  2
                
                ⁡
                
                  [
                  
                    n
                    -
                    1
                  
                  ]
                
              
            
          
        
      
    
    
      
        (
        7
        )
      
    
  




By solving simultaneous equations constituted of the six expressions (6a) to (6f), the angular width error correction value E can be expressed by the following expression (8) (hereinafter, referred to as “E arithmetic expression (8)”).




  
    
      
        
          E
          =
          
            
              1
              240
            
            ·
            
              
                cos
                
                  -
                  1
                
              
              ⁡
              
                (
                
                  
                    
                      
                        
                          q
                          1
                          2
                        
                        ⁢
                        
                          t
                          2
                        
                      
                      -
                      
                        2
                        ⁢
                        
                          
                        
                        ⁢
                        
                          q
                          1
                        
                        ⁢
                        
                          q
                          2
                        
                        ⁢
                        t
                      
                      +
                      
                        q
                        2
                        2
                      
                    
                    
                      2
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                          t
                          ⁡
                          
                            (
                            
                              
                                
                                  
                                    S
                                    1
                                  
                                  ⁡
                                  
                                    [
                                    n
                                    ]
                                  
                                
                                ⁢
                                
                                  
                                    S
                                    2
                                  
                                  ⁡
                                  
                                    [
                                    n
                                    ]
                                  
                                
                              
                              -
                              
                                
                                  
                                    S
                                    1
                                  
                                  ⁡
                                  
                                    [
                                    
                                      n
                                      -
                                      1
                                    
                                    ]
                                  
                                
                                ⁢
                                
                                  
                                    S
                                    2
                                  
                                  ⁡
                                  
                                    [
                                    
                                      n
                                      -
                                      1
                                    
                                    ]
                                  
                                
                              
                            
                            )
                          
                        
                        2
                      
                    
                  
                  -
                  1
                
                )
              
            
          
        
        ⁢
        
          

        
        ⁢
        where
        ⁢
        
          

        
        ⁢
        
          
            q
            1
          
          =
          
            
              
                
                  S
                  1
                
                ⁡
                
                  [
                  
                    n
                    -
                    1
                  
                  ]
                
              
              2
            
            -
            
              
                
                  S
                  1
                
                ⁡
                
                  [
                  n
                  ]
                
              
              2
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            q
            2
          
          =
          
            
              
                
                  S
                  2
                
                ⁡
                
                  [
                  n
                  ]
                
              
              2
            
            -
            
              
                
                  S
                  2
                
                ⁡
                
                  [
                  
                    n
                    -
                    1
                  
                  ]
                
              
              2
            
          
        
        ⁢
        
          

        
        ⁢
        
          t
          =
          
            
              
                
                  
                    
                      
                        
                          S
                          1
                        
                        ⁡
                        
                          [
                          n
                          ]
                        
                      
                      ⁢
                      
                        
                          S
                          2
                        
                        ⁡
                        
                          [
                          n
                          ]
                        
                      
                      ⁢
                      
                        q
                        3
                      
                    
                    +
                    
                      
                        
                          S
                          1
                        
                        ⁡
                        
                          [
                          
                            n
                            -
                            1
                          
                          ]
                        
                      
                      ⁢
                      
                        
                          S
                          2
                        
                        ⁡
                        
                          [
                          
                            n
                            -
                            1
                          
                          ]
                        
                      
                      ⁢
                      
                        q
                        4
                      
                    
                    +
                  
                
              
              
                
                  
                    
                      
                        S
                        1
                      
                      ⁡
                      
                        [
                        
                          n
                          -
                          2
                        
                        ]
                      
                    
                    ⁢
                    
                      
                        S
                        2
                      
                      ⁡
                      
                        [
                        
                          n
                          -
                          2
                        
                        ]
                      
                    
                    ⁢
                    
                      q
                      1
                    
                  
                
              
            
            
              
                
                  
                    
                      
                        
                          S
                          1
                        
                        ⁡
                        
                          [
                          n
                          ]
                        
                      
                      ⁢
                      
                        
                          S
                          2
                        
                        ⁡
                        
                          [
                          n
                          ]
                        
                      
                      ⁢
                      
                        q
                        5
                      
                    
                    +
                    
                      
                        
                          S
                          1
                        
                        ⁡
                        
                          [
                          
                            n
                            -
                            1
                          
                          ]
                        
                      
                      ⁢
                      
                        
                          S
                          2
                        
                        ⁡
                        
                          [
                          
                            n
                            -
                            1
                          
                          ]
                        
                      
                      ⁢
                      
                        q
                        6
                      
                    
                    +
                  
                
              
              
                
                  
                    
                      
                        S
                        1
                      
                      ⁡
                      
                        [
                        
                          n
                          -
                          2
                        
                        ]
                      
                    
                    ⁢
                    
                      
                        S
                        2
                      
                      ⁡
                      
                        [
                        
                          n
                          -
                          2
                        
                        ]
                      
                    
                    ⁢
                    
                      q
                      2
                    
                  
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            q
            3
          
          =
          
            
              
                
                  S
                  1
                
                ⁡
                
                  [
                  
                    n
                    -
                    2
                  
                  ]
                
              
              2
            
            -
            
              
                
                  S
                  1
                
                ⁡
                
                  [
                  
                    n
                    -
                    1
                  
                  ]
                
              
              2
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            q
            4
          
          =
          
            
              
                
                  S
                  1
                
                ⁡
                
                  [
                  n
                  ]
                
              
              2
            
            -
            
              
                
                  S
                  1
                
                ⁡
                
                  [
                  
                    n
                    -
                    2
                  
                  ]
                
              
              2
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            q
            5
          
          =
          
            
              
                
                  S
                  2
                
                ⁡
                
                  [
                  
                    n
                    -
                    1
                  
                  ]
                
              
              2
            
            -
            
              
                
                  S
                  2
                
                ⁡
                
                  [
                  
                    n
                    -
                    2
                  
                  ]
                
              
              2
            
          
        
        ⁢
        
          

        
        ⁢
        
          
            q
            6
          
          =
          
            
              
                
                  S
                  2
                
                ⁡
                
                  [
                  
                    n
                    -
                    2
                  
                  ]
                
              
              2
            
            -
            
              
                
                  S
                  2
                
                ⁡
                
                  [
                  n
                  ]
                
              
              2
            
          
        
      
    
    
      
        (
        8
        )
      
    
  




By dividing Eθ(n) computed according to the Eθ basic arithmetic expression (7) by the angular width error correction value E computed according to the E arithmetic expression (8), θ(n) can be obtained. That is, θ(n) can be obtained according to the following expression (9).

θ(n)=Eθ(n)/E  (9)

Note that, when at least one of the denominators of the fractions included in the expression (8) is zero, the angular width error correction value E cannot be computed according to the expression (8). Therefore, in the present embodiment, when at least one of the denominators of the fractions included in the expression (8) is zero, the immediately preceding computed angular width error correction value E is used as the present angular width error correction value E.
The case where at least one of the denominators of the fractions included in the expression (8) is zero is the case where at least one of the three conditions expressed by the following expressions (10), (11), (12) is satisfied.

S1[n]S2[n]−S1[n−1]S2[n−1]=0  (10)

S1[n]S2[n]q3+S1[n−1]S2[n−1]q4+S1[n−2]S2[n−2]q1=0  (11)

S1[n]S2[n]q5+S1[n−1]S2[n−1]q6+S1[n−2]S2[n−2]q2=0  (12)

where

q1=S1[n−1]2−S1 [n]2 

q2=S2[n]2−S2[n−1]2 

q3=S1[n−2]2−S1[n−1]2 

q4=S1[n]2−S1[n−2]2 

q5=S2[n−1]2−S2[n−2]2 

q6=S2[n−2]2−S2[n]2 

When at least one of the denominators of the fractions included in the Eθ basic arithmetic expression (7) is zero, Eθ(n) cannot be computed according to the Eθ basic arithmetic expression (7). In the present embodiment, when at least one of the denominators of the fractions included in the Eθ basic arithmetic expression (7) is zero, Eθ(n) is computed according to an arithmetic expression that differs from the Eθ basic arithmetic expression (7). Further, in the present embodiment, if Eθ(n) can be computed according to an arithmetic expression that is simpler than the Eθ basic arithmetic expression (7) although Eθ(n) can be computed according to the Eθ basic arithmetic expression (7), Eθ(n) is computed according to the arithmetic expression that is simpler than the basic Eθ arithmetic expression (7). In the present embodiment, the case where Eθ(n) can be computed more easily than using the basic Eθ arithmetic expression (7) is the case where S2(n)=0 or the case where S1(n)=0.
In the present embodiment, as arithmetic expressions used to compute Eθ(n), ten kinds of arithmetic expressions including the Eθ basic arithmetic expression (7) are prepared. Table 1 shows the ten kinds of arithmetic expressions and the conditions for the arithmetic expressions. Note that, at the time of computing Eθ(n), whether the conditions are satisfied is determined starting from the conditions on the top of Table 1. If it is determined that the conditions are satisfied, whether the subsequent conditions are satisfied is not determined. Then, Eθ(n) is computed according to the arithmetic expression corresponding to the conditions that are determined to be satisfied.









TABLE 1






CONDITIONS (AND)
ARITHMETIC

















1
S1[n] ≠ 0, S2[n − 1] ≠ 0, S2[n] ≠ 0, 
Eθ BASIC ARITHMETIC EXPRESSION



S1[n − 1] ≠ 0, P1 − P2 ≠ 0
(EXPRESSION (7))


2
S1[n] ≠ 0, S2[n − 1] ≠ 0, S2[n] ≠ 0, 
Eθ[n] ← IMMEDIATELY PRECEDING VALUE



S1[n − 1] ≠ 0, P1 − P2 = 0



 


3
S1[n] ≠ 0, S2[n − 1] ≠ 0, S2[n] ≠ 0,  S1[n − 1] = 0, S2[n − 1] > 0




  
    E
    ⁢
    
      
    
    ⁢
    
      θ
      ⁢
      
        
      
      [
      n
      ]
    
  
  =
  
    
      
        sin
        
          -
          1
        
      
      (
      
        
          
            3
          
          2
        
        ·
        
          
            
              S
              2
            
            ⁡
            
              [
              n
              ]
            
          
          
            
              S
              2
            
            ⁡
            
              [
              
                n
                -
                1
              
              ]
            
          
        
      
      )
    
    -
    120
  






 


4
S1[n] ≠ 0, S2[n − 1] ≠ 0, S2[n] ≠ 0,  S1[n − 1] = 0, S2[n − 1] < 0




  
    E
    ⁢
    
      
    
    ⁢
    
      θ
      ⁢
      
        
      
      [
      n
      ]
    
  
  =
  
     
    
      
        
          sin
          
            -
            1
          
        
        (
        
          
            -
            
              
                3
              
              2
            
          
          ·
          
            
              
                S
                2
              
              ⁡
              
                [
                n
                ]
              
            
            
              
                S
                2
              
              ⁡
              
                [
                
                  n
                  -
                  1
                
                ]
              
            
          
        
        )
      
      -
      120
    
  






 


5
S1[n] ≠ 0, S2[n − 1] ≠ 0, S2[n] = 0, S1[n] > 0
Eθ[n] = 60


6
S1[n] ≠ 0, S2[n − 1] ≠ 0, S2[n] = 0, S1[n] < 0
Eθ[n] = −120


 


7
S1[n] ≠ 0, S2[n − 1] = 0, S1[n − 1] > 0




  
    E
    ⁢
    
      
    
    ⁢
    
      θ
      ⁢
      
        
      
      [
      n
      ]
    
  
  =
  
    
      sin
      
        -
        1
      
    
    (
    
      
        
          3
        
        2
      
      ·
      
        
          
            S
            1
          
          ⁡
          
            [
            n
            ]
          
        
        
          
            S
            1
          
          ⁡
          
            [
            
              n
              -
              1
            
            ]
          
        
      
    
    )
  






 


8
S1[n] ≠ 0, S2[n − 1] = 0, S1[n − 1] < 0




  
    E
    ⁢
    
      
    
    ⁢
    
      θ
      ⁢
      
        
      
      [
      n
      ]
    
  
  =
  
    
      sin
      
        -
        1
      
    
    (
    
      
        -
        
          
            3
          
          2
        
      
      ·
      
        
          
            S
            1
          
          ⁡
          
            [
            n
            ]
          
        
        
          
            S
            1
          
          ⁡
          
            [
            
              n
              -
              1
            
            ]
          
        
      
    
    )
  






 


9
S1[n] = 0, S2[n] > 0
Eθ[n] = 0


10
S1[n] = 0, S2[n] < 0
Eθ[n] = 180









The first arithmetic expression from the top of Table 1 is the Eθ basic arithmetic expression (7). The Eθ basic arithmetic expression (7) is used when the condition that neither S1(n) nor S2(n) is zero and the condition that none of the denominators of the fractions included in the Eθ basic arithmetic expression (7) are zero are both satisfied. The condition that none of the denominators of the fractions included in the Eθ basic arithmetic expression (7) are zero is satisfied when p1−p2≠0, p12+p1p2+p22≠0, S1(n−1)≠0, and S2(n−1)≠0. Note that S1(n−1) is the denominator of p1 and S2(n−1) is the denominator of p2.
Note that, p12+p1p2+p22=0 is satisfied only when p1=p2=0. However, the phase of a sinusoidal signal output from the first magnetic sensor 71 is 120° different from the phase of a sinusoidal signal output from the second magnetic sensor 72, and hence the sensor values S1, S2 from both the magnetic sensors 71, 72 do not become zero at the same time. Therefore, p12+p1p2+p22=0 is not satisfied. Therefore, the condition that none of the denominators of the fractions included in the Eθ basic arithmetic expression (7) are zero is satisfied when all the conditions that p1−p2≠0, S1(n−1)≠0, and S2(n−1)≠0 are satisfied.
The second arithmetic expression from the top of Table 1 is an arithmetic expression that is used when p1−p2=0. The case where p1−p2=0 is satisfied will be considered blow. In this case, because p1=p2, the following expression (13) is satisfied.




  
    
      
        
          
            
              A
              1
            
            ⁢
            sin
            ⁢
            
              
            
            ⁢
            E
            ⁢
            
              
            
            ⁢
            
              θ
              ⁡
              
                [
                n
                ]
              
            
          
          
            
              A
              1
            
            ⁢
            sin
            ⁢
            
              
            
            ⁢
            E
            ⁢
            
              
            
            ⁢
            
              θ
              ⁡
              
                [
                
                  n
                  -
                  1
                
                ]
              
            
          
        
        =
        
          
            
              A
              2
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        [
                        n
                        ]
                      
                    
                  
                  +
                  120
                
                )
              
            
          
          
            
              A
              2
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        [
                        
                          n
                          -
                          1
                        
                        ]
                      
                    
                  
                  +
                  120
                
                )
              
            
          
        
      
    
    
      
        (
        13
        )
      
    
  




When this expression is deformed, the following expression (14) can be obtained.




  
    
      
        
          
            
              sin
              ⁢
              
                
              
              ⁢
              E
              ⁢
              
                
              
              ⁢
              
                θ
                ⁡
                
                  [
                  
                    n
                    -
                    1
                  
                  ]
                
              
            
            
              sin
              ⁢
              
                
              
              ⁢
              E
              ⁢
              
                
              
              ⁢
              
                θ
                ⁡
                
                  [
                  n
                  ]
                
              
            
          
          ·
          
            
              sin
              ⁢
              
                
              
              ⁢
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        [
                        n
                        ]
                      
                    
                  
                  +
                  120
                
                )
              
            
            
              sin
              ⁢
              
                
              
              ⁢
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        [
                        
                          n
                          -
                          1
                        
                        ]
                      
                    
                  
                  +
                  120
                
                )
              
            
          
        
        =
        1
      
    
    
      
        (
        14
        )
      
    
  




The case where the expression (14) is satisfied is the case where Eθ(n) is equal to Eθ(n−1), that is, the case where the present value Eθ(n) is equal to the immediately preceding value Eθ(n−1). When the condition that neither S1(n) nor S2(n) is zero, the condition that neither the denominator S1(n−1) of p1 nor the denominator S2(n−1) of p2 is zero, and the condition that p1−p2=0 are all satisfied, the immediately preceding computed Eθ(n−1) is used as the present Eθ(n).
The third and fourth arithmetic expressions from the top of Table 1 are arithmetic expressions that are used when the denominator S1(n−1) of p1 is zero. Because S1(n−1)=A1 sin Eθ(n−1), S1(n−1)=0 is satisfied when sin Eθ(n−1)=0. That is, when Eθ(n−1) is 0° or 180°, S1(n−1) is zero. Because S2(n−1)=A2 sin(Eθ(n−1)+120), S2(n−1)>0 is satisfied when Eθ(n−1) is 0°, and S2(n−1)<0 is satisfied when Eθ(n−1) is 180°. Eθ(n−1)=0 is satisfied when S1(n−1)=0 and S2(n−1)>0, and Eθ(n−1)=180 is satisfied when S1(n−1)=0 and S2(n−1)<0.
When Eθ(n−1)=0, the expressions (6c), (6d) are expressed by the following expressions (15c), (15d), respectively.

S2(n)=A2 sin(Eθ(n)+120)  (15c)

S2(n−1)=A2 sin 120=√3/2·A2  (15d)

The following expression (16) is obtained from the expression (15d).

A2=(2/√3)·S2(n−1)  (16)

When the expression (16) is substituted into the expression (15c), the following expression (17) is obtained.

sin(Eθ(n)+120)=(√3/2)·(S2(n)/S2(n−1))  (17)

Eθ(n) can be computed according to the following expression (18).




  
    
      
        
          E
          ⁢
          
            
          
          ⁢
          
            θ
            ⁡
            
              [
              n
              ]
            
          
        
        =
        
          
            
              sin
              
                -
                1
              
            
            ⁡
            
              (
              
                
                  
                    3
                  
                  2
                
                ·
                
                  
                    
                      S
                      2
                    
                    ⁡
                    
                      [
                      n
                      ]
                    
                  
                  
                    
                      S
                      2
                    
                    ⁡
                    
                      [
                      
                        n
                        -
                        1
                      
                      ]
                    
                  
                
              
              )
            
          
          -
          120
        
      
    
    
      
        (
        18
        )
      
    
  




As shown in the third row from the top of Table 1, when the conditions that neither S1(n) nor S2(n) is zero, the denominator S2(n−1) of p2 is not zero, the denominator S1(n−1) of p1 is zero, and S2(n−1)>0 are all satisfied, Eθ(n) is computed according to the arithmetic expression expressed by the expression (18). On the other hand, when Eθ(n−1)=180, the expressions (6c), (6d) are expressed by the following expressions (19c), (19d), respectively.

S2(n)=A2 sin(Eθ(n)+120)  (19c)

S2(n−1)=A2 sin 300=−√3/2·A2  (19d)

The following expression (20) is obtained from the expression (19d).

A2=(−2/√3)·S2(n−1)  (20)

When the expression (20) is substituted into the expression (19c), the following expression (21) is obtained.

sin(Eθ(n)+120)=(−√3/2)·(S2(n)/S2(n−1))  (21)

Eθ(n) can be computed according to the following expression (22).




  
    
      
        
          E
          ⁢
          
            
          
          ⁢
          
            θ
            ⁡
            
              [
              n
              ]
            
          
        
        =
        
          
            
              sin
              
                -
                1
              
            
            ⁡
            
              (
              
                
                  -
                  
                    
                      3
                    
                    2
                  
                
                ·
                
                  
                    
                      S
                      2
                    
                    ⁡
                    
                      [
                      n
                      ]
                    
                  
                  
                    
                      S
                      2
                    
                    ⁡
                    
                      [
                      
                        n
                        -
                        1
                      
                      ]
                    
                  
                
              
              )
            
          
          -
          120
        
      
    
    
      
        (
        22
        )
      
    
  




As shown in the fourth row from the top of Table 1, when the conditions that neither S1(n) nor S2(n) is zero, the denominator S2(n−1) of p2 is not zero, the denominator S1(n−1) of p1 is zero, and S2(n−1)<0 are all satisfied, Eθ(n) is computed according to the arithmetic expression expressed by the expression (22). The fifth and sixth arithmetic expressions from the top of Table 1 are arithmetic expressions used when S2(n)=0 is satisfied. Because S2(n)=A2 sin(Eθ(n)+120), when sin(Eθ(n)+120)=0, S2(n)=0 is satisfied. That is, when Eθ(n) is −120° or 60°, S2(n)=0 is satisfied. Because S1(n)=A1 sin Eθ(n), S1(n)<0 is satisfied when Eθ(n) is −120°, and S1(n)>0 is satisfied when Eθ(n)=60°. Eθ(n)=60 is satisfied when S2(n)=0 and S1(n)>0, and Eθ(n)=−120 is satisfied when S2(n)=0 and S1(n)<0.
As shown in the fifth row from the top of Table 1, when the conditions that S1(n) is not zero, the denominator S2(n−1) of p2 is not zero, S2(n)=0, and S1(n)>0 are all satisfied, Eθ(n) is computed as 60°. As shown in the sixth row from the top of Table 1, when the conditions that S1(n) is not zero, the denominator S2(n−1) of p2 is not zero, S2(n)=0, and S1(n)<0 are all satisfied, Eθ(n) is computed as −120°.
The seventh and eighth arithmetic expressions from the top of Table 1 are arithmetic expressions used when the denominator S2(n−1) of p2 is zero. Because S2(n−1)=A2 sin(Eθ(n−1)+120), when sin(Eθ(n−1)+120)=0, S2(n−1)=0 is satisfied. That is, when Eθ(n−1) is −120° or 60°, S2(n−1) is zero. Because S1(n−1)=A1 sin Eθ(n−1), S1(n−1)<0 is satisfied when Eθ(n−1) is −120°, and S1(n−1)>0 is satisfied when Eθ(n−1) is 60°. Therefore, Eθ(n−1)=60 is satisfied when S2(n−1)=0 and S1(n−1)>0, and Eθ(n−1)=−120 is satisfied when S2(n−1)=0 and S1(n−1)<0.
When Eθ(n−1)=60, the expressions (6a), (6b) are expressed by the following expressions (23a), (23b), respectively.

S1(n)=A1 sin Eθ(n)  (23a)

S1(n−1)=A1 sin 60=√3/2·A1  (23b)

The following expression (24) is obtained from the expression (23b).

A1=(2/√3)·S1(n−1)  (24)

When the expression (24) is substituted into the expression (23a), the following expression (25) is obtained.

sin Eθ(n)=(√3/2)·(S1(n)/S1(n−1))  (25)

Eθ(n) can be computed according to the following expression (26).




  
    
      
        
          E
          ⁢
          
            
          
          ⁢
          
            θ
            ⁡
            
              [
              n
              ]
            
          
        
        =
        
          
            sin
            
              -
              1
            
          
          ⁡
          
            (
            
              
                
                  3
                
                2
              
              ·
              
                
                  
                    S
                    1
                  
                  ⁡
                  
                    [
                    n
                    ]
                  
                
                
                  
                    S
                    1
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      1
                    
                    ]
                  
                
              
            
            )
          
        
      
    
    
      
        (
        26
        )
      
    
  




As shown in the seventh row from the top of Table 1, when the conditions that S1(n) is not zero, the denominator S2(n−1) of p2 is zero, and S1(n−1)>0 are all satisfied, Eθ(n) is computed according to the arithmetic expression expressed by the expression (26). On the other hand, when Eθ(n−1)=−120, the expressions (6a), (6b) are expressed by the following expressions (27a), (27b), respectively.

S1(n)=A1 sin Eθ(n)  (27a)

S1(n−1)=A1 sin(−120)=−√3/2·A2  (27b)

The following expression (28) is obtained from the following expression (27b).

A1=(−2/√3)·S1(n−1)  (28)

When the expression (28) is substituted into the expression (27a), the following expression (29) is obtained.

sin Eθ(n)=(−√3/2)·(S1(n)/S1(n−1))  (29)

Eθ(n) can be computed according to the following expression (30).




  
    
      
        
          E
          ⁢
          
            
          
          ⁢
          
            θ
            ⁡
            
              [
              n
              ]
            
          
        
        =
        
          
            sin
            
              -
              1
            
          
          ⁡
          
            (
            
              
                -
                
                  
                    3
                  
                  2
                
              
              ·
              
                
                  
                    S
                    1
                  
                  ⁡
                  
                    [
                    n
                    ]
                  
                
                
                  
                    S
                    1
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      1
                    
                    ]
                  
                
              
            
            )
          
        
      
    
    
      
        (
        30
        )
      
    
  




As shown by the eighth row from the top of Table 1, when the conditions that S1(n) is not zero, the denominator S2(n−1) of p2 is zero, and S1(n−1)<0 are all satisfied, Eθ(n) is computed according to an arithmetic expression expressed by the expression (30). The ninth and tenth arithmetic expressions from the top of Table 1 are arithmetic expressions that are used when S1(n)=0 is satisfied. Because S1(n)=A1 sin Eθ(n), when sin Eθ(n)=0, S1(n)=0 is satisfied. That is, when Eθ(n) is 0° or 180°, S1(n)=0 is satisfied. Because S2(n)=A2 sin(Eθ(n)+120), S2(n)>0 is satisfied when Eθ(n) is 0°, and S2(n)<0 is satisfied when Eθ(n) is 180°. Therefore, Eθ(n)=0 is satisfied when S1(n)=0 and S2(n)>0, and Eθ(n)=180 is satisfied when S1(n)=0 and S2(n)<0.
As shown in the ninth row from the top of Table 1, when the conditions that S1(n) is zero and S2(n)>0 are both satisfied, Eθ(n) is computed as 0°. Further, as shown in the tenth row from the top of Table 1, when the conditions that S1(n) is zero and S2(n)<0 are both satisfied, Eθ(n) is computed as 180°. When Eθ(n) is computed, it is possible to compute the amplitude A1 according to the expression (6a), and compute the amplitude A2 according to the expression (6d). That is, it is possible to compute E, θ(n), A1, A2 in the first computation mode.
The second computation mode is a computation mode that is applied when both the second and third magnetic sensors 72, 73 sense one and the same magnetic pole for three consecutive sampling periods (three consecutive computation periods). In the second computation mode, the rotation angle θ is computed on the basis of the output signals from the second and third magnetic sensors 72, 73, which are sampled at three sampling timings.
When the output signals S2, S3 from the second magnetic sensor 72 and the third magnetic sensor 73 are expressed with the use of an angular width error correction value E, the output signal S2(n) from the second magnetic sensor 72 is expressed by S2(n)=A2·sin(E2θ(n)+120), and the output signal S3(n) from the third magnetic sensor 73 is expressed by S3(n)=A3·sin(E3θ(n)+240). Note that, E3 is an angular width error correction value corresponding to a magnetic pole sensed by the third magnetic sensor 73. When the second magnetic sensor 72 and the third magnetic sensor 73 sense one and the same magnetic pole, E2 is equal to E3. Therefore, when E2 and E3 are denoted by E, the output signal S2(n) from the second magnetic sensor 72 is expressed by S2(n)=A2·sin(Eθ(n)+120), and the output signal S3(n) from the third magnetic sensor 73 is expressed by S3(n)=A3·sin(Eθ(n)+240).
When (Eθ(n)+120) is substituted by EΘ(n), the second output signal S2(n) is expressed by S2(n)=A2·sin EΘ(n), and the third output signal S3(n) is expressed by S3(n)=A3·sin(EΘ(n)+120). EΘ(n) and E can be computed with the use of the second output signal S2 and the third output signal S3 according to a method similar to the above-described method. Because EΘ(n)=Eθ(n)+120, θ(n)=(EΘ(n)−120)/E is satisfied. Therefore, the rotation angle θ(n) of the input shaft 8 can be computed by substituting the computed EΘ(n) and E into the expression θ(n)=(EΘ(n)−120)/E. When EΘ(n) is computed, the amplitude A2 and the amplitude A3 can be computed. That is, in the second computation mode, E, θ(n), A2, A3 can be computed.
When the second and third output signals S2, S3, which are sampled at three sampling timings and which are used to compute the rotation angle in the second computation mode, are expressed by the following expressions (31a) to (31f) after the model of the expressions (6a) to (6f), an EΘ basic arithmetic expression and an E arithmetic expression can be expressed by the following expressions (32), (33), respectively.




  
    
      
        
          
        
        ⁢
        
          
            
              S
              2
            
            ⁡
            
              (
              n
              )
            
          
          =
          
            
              A
              2
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        (
                        n
                        )
                      
                    
                  
                  +
                  120
                
                )
              
            
          
        
      
    
    
      
        (
        
          31
          ⁢
          
            
          
          ⁢
          a
        
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            
              S
              2
            
            ⁡
            
              (
              
                n
                -
                1
              
              )
            
          
          =
          
            
              A
              2
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        (
                        
                          n
                          -
                          1
                        
                        )
                      
                    
                  
                  +
                  120
                
                )
              
            
          
        
      
    
    
      
        (
        
          31
          ⁢
          
            
          
          ⁢
          b
        
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            
              S
              2
            
            ⁡
            
              (
              
                n
                -
                2
              
              )
            
          
          =
          
            
              A
              2
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        (
                        
                          n
                          -
                          2
                        
                        )
                      
                    
                  
                  +
                  120
                
                )
              
            
          
        
      
    
    
      
        (
        
          31
          ⁢
          
            
          
          ⁢
          c
        
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            
              S
              3
            
            ⁡
            
              (
              n
              )
            
          
          =
          
            
              A
              3
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        (
                        n
                        )
                      
                    
                  
                  +
                  120
                
                )
              
            
          
        
      
    
    
      
        (
        
          31
          ⁢
          
            
          
          ⁢
          d
        
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            
              S
              3
            
            ⁡
            
              (
              
                n
                -
                1
              
              )
            
          
          =
          
            
              A
              3
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        (
                        
                          n
                          -
                          1
                        
                        )
                      
                    
                  
                  +
                  120
                
                )
              
            
          
        
      
    
    
      
        (
        
          31
          ⁢
          
            
          
          ⁢
          e
        
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            
              S
              3
            
            ⁡
            
              (
              
                n
                -
                2
              
              )
            
          
          =
          
            
              A
              3
            
            ⁢
            
              sin
              ⁡
              
                (
                
                  
                    E
                    ⁢
                    
                      
                    
                    ⁢
                    
                      θ
                      ⁡
                      
                        (
                        
                          n
                          -
                          2
                        
                        )
                      
                    
                  
                  +
                  120
                
                )
              
            
          
        
      
    
    
      
        (
        
          31
          ⁢
          
            
          
          ⁢
          f
        
        )
      
    
  
  
    
      
        
          
            E
            ⁢
            
              
            
            ⁢
            
              θ
              ⁡
              
                [
                n
                ]
              
            
          
          =
          
            
              
                1
                4
              
              ⁢
              
                
                  cos
                  
                    -
                    1
                  
                
                ⁡
                
                  (
                  
                    1
                    -
                    
                      
                        
                          (
                          
                            
                              3
                              ⁢
                              
                                
                              
                              ⁢
                              
                                p
                                1
                                ′2
                              
                              ⁢
                              
                                p
                                2
                                ′2
                              
                            
                            -
                            
                              2
                              ⁢
                              
                                p
                                1
                                ′2
                              
                            
                            -
                            
                              2
                              ⁢
                              
                                p
                                2
                                ′2
                              
                            
                            +
                            
                              
                                p
                                1
                                ′
                              
                              ⁢
                              
                                p
                                2
                                ′
                              
                            
                          
                          )
                        
                        2
                      
                      
                        2
                        ⁢
                        
                          
                            (
                            
                              
                                p
                                1
                                ′
                              
                              -
                              
                                p
                                2
                                ′
                              
                            
                            )
                          
                          2
                        
                        ⁢
                        
                          (
                          
                            
                              p
                              1
                              ′2
                            
                            +
                            
                              
                                p
                                1
                                ′
                              
                              ⁢
                              
                                p
                                2
                                ′
                              
                            
                            +
                            
                              p
                              2
                              ′2
                            
                          
                          )
                        
                      
                    
                  
                  )
                
              
            
            -
            
              
                1
                4
              
              ⁢
              
                
                  cos
                  
                    -
                    1
                  
                
                ⁡
                
                  (
                  
                    
                      1
                      2
                    
                    -
                    
                      
                        3
                        2
                      
                      ·
                      
                        
                          
                            
                              p
                              1
                              ′
                            
                            ⁢
                            
                              p
                              2
                              ′
                            
                          
                          +
                          
                            p
                            2
                            ′2
                          
                        
                        
                          
                            p
                            1
                            ′2
                          
                          +
                          
                            
                              p
                              1
                              ′
                            
                            ⁢
                            
                              p
                              2
                              ′
                            
                          
                          +
                          
                            p
                            2
                            ′2
                          
                        
                      
                    
                  
                  )
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
        
        ⁢
        where
      
    
    
      
        (
        32
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            
              p
              1
              ′
            
            =
            
              
                
                  S
                  2
                
                ⁡
                
                  [
                  n
                  ]
                
              
              
                
                  S
                  2
                
                ⁡
                
                  [
                  
                    n
                    -
                    1
                  
                  ]
                
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            
              p
              2
              ′
            
            =
            
              
                
                  S
                  3
                
                ⁡
                
                  [
                  n
                  ]
                
              
              
                
                  S
                  3
                
                ⁡
                
                  [
                  
                    n
                    -
                    1
                  
                  ]
                
              
            
          
        
      
    
    
      
        
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            E
            =
            
              
                1
                240
              
              ·
              
                
                  cos
                  
                    -
                    1
                  
                
                ⁡
                
                  (
                  
                    
                      
                        
                          
                            q
                            1
                            ′2
                          
                          ⁢
                          
                            t
                            ′2
                          
                        
                        -
                        
                          2
                          ⁢
                          
                            q
                            1
                            ′
                          
                          ⁢
                          
                            q
                            2
                            ′
                          
                          ⁢
                          
                            t
                            ′
                          
                        
                        +
                        
                          q
                          2
                          ′2
                        
                      
                      
                        2
                        ⁢
                        
                          
                            
                              t
                              ′
                            
                            ⁡
                            
                              (
                              
                                
                                  
                                    
                                      S
                                      2
                                    
                                    ⁡
                                    
                                      [
                                      n
                                      ]
                                    
                                  
                                  ⁢
                                  
                                    
                                      S
                                      3
                                    
                                    ⁡
                                    
                                      [
                                      n
                                      ]
                                    
                                  
                                
                                -
                                
                                  
                                    
                                      S
                                      2
                                    
                                    ⁡
                                    
                                      [
                                      
                                        n
                                        -
                                        1
                                      
                                      ]
                                    
                                  
                                  ⁢
                                  
                                    
                                      S
                                      3
                                    
                                    ⁡
                                    
                                      [
                                      
                                        n
                                        -
                                        1
                                      
                                      ]
                                    
                                  
                                
                              
                              )
                            
                          
                          2
                        
                      
                    
                    -
                    1
                  
                  )
                
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          where
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            
              q
              1
              ′
            
            =
            
              
                
                  
                    S
                    2
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      1
                    
                    ]
                  
                
                2
              
              -
              
                
                  
                    S
                    2
                  
                  ⁡
                  
                    [
                    n
                    ]
                  
                
                2
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            
              q
              2
              ′
            
            =
            
              
                
                  
                    S
                    3
                  
                  ⁡
                  
                    [
                    n
                    ]
                  
                
                2
              
              -
              
                
                  
                    S
                    3
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      1
                    
                    ]
                  
                
                2
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            
              t
              ′
            
            =
            
              
                
                  
                    
                      
                        
                          
                            S
                            2
                          
                          ⁡
                          
                            [
                            n
                            ]
                          
                        
                        ⁢
                        
                          
                            S
                            3
                          
                          ⁡
                          
                            [
                            n
                            ]
                          
                        
                        ⁢
                        
                          q
                          3
                          ′
                        
                      
                      +
                      
                        
                          
                            S
                            2
                          
                          ⁡
                          
                            [
                            
                              n
                              -
                              1
                            
                            ]
                          
                        
                        ⁢
                        
                          
                            S
                            3
                          
                          ⁡
                          
                            [
                            
                              n
                              -
                              1
                            
                            ]
                          
                        
                        ⁢
                        
                          q
                          4
                          ′
                        
                      
                      +
                    
                  
                
                
                  
                    
                      
                        
                          S
                          2
                        
                        ⁡
                        
                          [
                          
                            n
                            -
                            2
                          
                          ]
                        
                      
                      ⁢
                      
                        
                          S
                          3
                        
                        ⁡
                        
                          [
                          
                            n
                            -
                            2
                          
                          ]
                        
                      
                      ⁢
                      
                        q
                        1
                        ′
                      
                    
                  
                
              
              
                
                  
                    
                      
                        
                          
                            S
                            2
                          
                          ⁡
                          
                            [
                            n
                            ]
                          
                        
                        ⁢
                        
                          
                            S
                            3
                          
                          ⁡
                          
                            [
                            n
                            ]
                          
                        
                        ⁢
                        
                          q
                          5
                          ′
                        
                      
                      +
                      
                        
                          
                            S
                            2
                          
                          ⁡
                          
                            [
                            
                              n
                              -
                              1
                            
                            ]
                          
                        
                        ⁢
                        
                          
                            S
                            3
                          
                          ⁡
                          
                            [
                            
                              n
                              -
                              1
                            
                            ]
                          
                        
                        ⁢
                        
                          q
                          6
                          ′
                        
                      
                      +
                    
                  
                
                
                  
                    
                      
                        
                          S
                          2
                        
                        ⁡
                        
                          [
                          
                            n
                            -
                            2
                          
                          ]
                        
                      
                      ⁢
                      
                        
                          S
                          3
                        
                        ⁡
                        
                          [
                          
                            n
                            -
                            2
                          
                          ]
                        
                      
                      ⁢
                      
                        q
                        2
                        ′
                      
                    
                  
                
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            
              q
              3
              ′
            
            =
            
              
                
                  
                    S
                    2
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      2
                    
                    ]
                  
                
                2
              
              -
              
                
                  
                    S
                    2
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      1
                    
                    ]
                  
                
                2
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            
              q
              4
              ′
            
            =
            
              
                
                  
                    S
                    2
                  
                  ⁡
                  
                    [
                    n
                    ]
                  
                
                2
              
              -
              
                
                  
                    S
                    2
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      2
                    
                    ]
                  
                
                2
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            
              q
              5
              ′
            
            =
            
              
                
                  
                    S
                    3
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      1
                    
                    ]
                  
                
                2
              
              -
              
                
                  
                    S
                    3
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      2
                    
                    ]
                  
                
                2
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            
              q
              6
              ′
            
            =
            
              
                
                  
                    S
                    3
                  
                  ⁡
                  
                    [
                    
                      n
                      -
                      2
                    
                    ]
                  
                
                2
              
              -
              
                
                  
                    S
                    3
                  
                  ⁡
                  
                    [
                    n
                    ]
                  
                
                2
              
            
          
        
      
    
    
      
        (
        33
        )
      
    
  




In the first computation mode and the second computation mode, because the rotation angle θ(n) of the input shaft 8 is computed on the basis of the output signals from two magnetic sensors among the three magnetic sensors 71, 72, 73, which are sampled at three sampling timings, the highly accurate rotation angle can be computed. In the first computation mode and the second computation mode, even if the number of expressions used to compute the rotation angle θ(n) of the input shaft 8 is smaller than the number of unknown quantities originally included in these expressions, the rotation angle θ(n) of the input shaft 8 can be computed, and hence the number of sensor values required to compute the rotation angle θ(n) of the input shaft 8 can be reduced.
In the first computation mode and the second computation mode, the amplitudes of the output signals from the same magnetic sensor, which are sampled at the three sampling timings, are assumed to be equal to each other. The amplitudes of the output signals from the same magnetic sensor, which are sampled at three sampling timings, may be different values due to the influence of temperature changes. However, if the sampling interval is short, a temperature change between the three sampling timings is considerably small. Therefore, the amplitudes of the output signals from the same magnetic sensor, which are sampled at the three sampling timings, may be assumed to be equal to each other. Therefore, in the first computation mode and the second computation mode, variations of amplitudes due the influence of temperature changes between the three sampling timings can be compensated for. In the first computation mode and the second computation mode, because the amplitudes of the output signals from the two magnetic sensors used to compute the rotation angle are regarded as different unknown quantities, the influence of variations of temperature characteristics between the two magnetic sensors can be compensated for. As a result, the highly accurate rotation angle can be detected.
In each of the first computation mode and the second computation mode, it is possible to highly accurately compensate for variations of the angular widths (pitch widths) of the magnetic poles M1 to M8 of the magnet 61. Therefore, it is possible to detect a rotation angle with a smaller error. The third computation mode is a computation mode that is applied in the case where neither the first computation mode nor the second computation mode can be applied and the angular width error correction value E1 corresponding to a magnetic pole sensed by the first magnetic sensor 71 and the amplitude A1 of the first output signal S1 have already been computed in the first computation mode and stored in the memory. In the third computation mode, the rotation angle θ is computed mainly based on the output signal S1 from the first magnetic sensor 71.
The third computation mode is applied when the magnetic pole sensed by the second magnetic sensor 72 is changed from the one in the state where the same magnetic pole (M1 in this example) is sensed by the first and second magnetic sensors 71, 72, in the case where the magnet 61 (the input shaft 8) is rotating in the direction indicated by an arrow, for example, as illustrated in FIG. 8A.
When the angular width error correction value E and the number n of the present computation period are used, the output signal S1 from the first magnetic sensor 71, which is sampled in the present computation period, is expressed by the following expression (34).

S1(n)=A1(n)sin(E1θ(n))  (34)

E1 is the angular width error correction value corresponding to the magnetic pole sensed by the first magnetic sensor 71. The rotation angle θ(n) is expressed by the following expression (35) based on the expression (34).

θ(n)=(1/E1)sin−1(S1(n)/A1)  (35)

When E1 and A1 that are stored in the memory and that correspond to the magnetic pole sensed by the first magnetic sensor 71 are substituted into the expression (35), the rotation angle θ(n) is computed. However, when the rotation angle θ(n) is computed according to the expression (35), two rotation angles θ(n) are computed and therefore it is necessary to determine which of the two rotation angles θ(n) is the actual rotation angle. This determination method will be described with reference to FIG. 9. FIG. 9 shows waveforms of the first output signal S1, the second output signal S2, and the third output signal S3 in one period. A rotation angle (deg) on the abscissa axis in FIG. 9 represents an electrical angle.
As shown in FIG. 9, when the first output signal S1(n) takes, for example, a positive value, the rotation angles θ(n) corresponding to (1/E1)sin−1(S1(n)/A1) are two rotation angles, that is, a rotation angle in a region R1 from 0° to 90° and a rotation angle in a region R2 from 90° to 180°. On the other hand, when the first output signal S1(n) takes, for example, a negative value, the rotation angles θ(n) corresponding to (1/E1)sin−1(S1(n)/A1) are two rotation angles, that is, a rotation angle in a region U1 from 180° to 270° and a rotation angle in a region U2 from 270° to 360°.
In the present embodiment, it is determined which of the two rotation angles computed according to the expression (35) is the actual rotation angle, on the basis of one of the output signals S2, S3 from the two magnetic sensors 72, 73, which are the magnetic sensors other than the first magnetic sensor 71. For example, the case where the determination is made on the basis of the second output signal S2(n) will be described. 1⁄2 of the amplitude A2 of the second output signal S2 is set as a threshold a (a>0). The threshold a can be obtained on the basis of, for example, the amplitude A2 of the second output signal S2 that is stored in the memory and that corresponds to the magnetic pole sensed by the first magnetic sensor 71. Note that, 1⁄2 of the amplitude A1 of the first output signal S1 may be set as the threshold a (a>0).
The values that the rotation angle θ(n) of the input shaft 8 may take when the second output signal S2(n) is equal to or greater than the threshold a are within the range of 0° to 30° and the range of 270° to 360°. The values that the rotation angle θ(n) of the input shaft 8 may take when the second output signal S2(n) is smaller than the threshold −a are within the range of 90° to 210°. The values that the rotation angle θ(n) of the input shaft 8 may take when the second output signal S2(n) is equal to or greater than the threshold −a and smaller than the threshold a are within the range of 30° to 90° and the range of 210° to 270°.
Therefore, it is possible to determine which of the two rotation angles computed according to the expression (35) is the actual rotation angle on the basis of the second output signal S2(n). Specifically, in the case where the first output signal S1(n) takes a positive value, if the second output signal S2(n) is equal to or greater than the threshold −a, it is determined that the rotation angle in the region R1 among the two rotation angles computed according to the expression (35) is the actual rotation angle. On the other hand, if the second output signal S2(n) is smaller than the threshold −a, it is determined that the rotation angle in the region R2 among the two rotation angles computed according to the expression (35) is the actual rotation angle.
In the case where the first output signal S1(n) takes a negative value, if the second output signal S2(n) is smaller than the threshold a, it is determined that the rotation angle in the region U1 among the two rotation angles computed according to the expression (35) is the actual rotation angle. On the other hand, if the second output signal S2(n) is equal to or greater than the threshold a, it is determined that the rotation angle in the region U2 among the two rotation angles computed according to the expression (35) is the actual rotation angle.
The fourth computation mode is a computation mode that is applied in the case where neither the first computation mode nor the second computation mode can be applied and the angular width error correction value E2 corresponding to a magnetic pole sensed by the second magnetic sensor 72 and the amplitude A2 of the second output signal S2 have already been computed in the first computation mode or the third computation mode and stored in the memory. In the fourth computation mode, the rotation angle θ is computed mainly based on the output signal S2 from the second magnetic sensor 72.
The fourth computation mode is applied when the magnetic pole sensed by the first magnetic sensor 71 is changed from the one in the state where the same magnetic pole (M1 in this example) is sensed by the first and second magnetic sensors 71, 72, in the case where the magnet 61 (the input shaft 8) is rotating in the direction indicated by an arrow, for example, as illustrated in FIG. 8B.
When the angular width error correction value E and the number n of the present computation period are used, the output signal S2 from the second magnetic sensor 72, which is sampled in the present computation period, is expressed by the following expression (36).

S2(n)=A2(n)sin(E2θ(n)+120)  (36)

E2 is the angular width error correction value corresponding to the magnetic pole sensed by the second magnetic sensor 72. The rotation angle θ(n) is expressed by the following expression (37) based on the expression (36).

θ(n)=(1/E2){sin−1(S2(n)/A2)−120}  (37)

When E2 and A2 that are stored in the memory and that correspond to the magnetic pole sensed by the second magnetic sensor 72 are substituted into the expression (37), the rotation angle θ(n) is computed.
When the rotation angle θ(n) is computed according to the expression (37), two rotation angles θ(n) are computed. Then, it is determined which of the two rotation angles computed according to the expression (37) is the actual rotation angle, on the basis of one of the output signals S1, S3 from the two magnetic sensors 71, 73, which are the magnetic sensors other than the second magnetic sensor 72. For example, the case where the determination is made on the basis of the first output signal S1(n) will be described. 1⁄2 of the amplitude A1 of the first output signal S1 or 1⁄2 of the amplitude A2 of the second output signal S2 stored in the memory is set as a threshold a (a>0).
In the case where the second output signal S2(n) takes a positive value, if the first output signal S1(n) is smaller than the threshold −a, it is determined that the rotation angle within the range of 240° to 330° among the two rotation angles computed according to the expression (37) is the actual rotation angle. On the other hand, if the first output signal S1(n) is equal to or greater than the threshold −a, it is determined that the rotation angle within the range of 0° to 60° or the range of 330° to 360° among the two rotation angles computed according to the expression (37) is the actual rotation angle.
In the case where the second output signal S2(n) takes a negative value, if the first output signal S1(n) is equal to or greater than the threshold a, it is determined that the rotation angle within the range of 60° to 150° among the two rotation angles computed according to the expression (37) is the actual rotation angle. On the other hand, if the first output signal S1(n) is smaller than the threshold a, it is determined that the rotation angle within the range of 150° to 240° among the two rotation angles computed according to the expression (37) is the actual rotation angle.
The fifth computation mode is a computation mode that is applied in the case where neither the first computation mode nor the second computation mode can be applied and the angular width error correction value E3 corresponding to a magnetic pole sensed by the third magnetic sensor 73 and the amplitude A3 of the third output signal S3 have already been computed in the second computation mode and stored in the memory. In the fifth computation mode, the rotation angle θ is computed mainly based on the output signal S3 from the third magnetic sensor 73. The fifth computation mode is applied when the magnetic pole sensed by the second magnetic sensor 72 is changed from the one in the state where the same magnetic pole (M2 in this example) is sensed by the second and third magnetic sensors 72, 73, in the case where the magnet 61 (the input shaft 8) is rotating in the direction indicated by an arrow, for example, as illustrated in FIG. 8C.
When the angular width error correction value E and the number n of the present computation period are used, the output signal S3 from the third magnetic sensor 73, which is sampled in the present computation period, is expressed by the following expression (38).

S3(n)=A3(n)sin(E3θ(n)+240)  (38)

E3 is the angular width error correction value corresponding to the magnetic pole sensed by the third magnetic sensor 73. The rotation angle θ(n) is expressed by the following expression (39) based on the expression (38).

θ(n)=(1/E3){sin−1(S3(n)/A3)−240}  (39)

When E3 and A3 that are stored in the memory and that correspond to the magnetic pole sensed by the third magnetic sensor 73 are substituted into the expression (39), the rotation angle θ(n) is computed.
When the rotation angle θ(n) is computed according to the expression (39), two rotation angles θ(n) are computed. Then, it is determined which of the two rotation angles computed according to the expression (39) is the actual rotation angle, on the basis of one of the output signals S1, S2 from the two magnetic sensors 71, 72, which are the magnetic sensors other than the third magnetic sensor 73. For example, the case where the determination is made on the basis of the second output signal S2(n) will be described. 1⁄2 of the amplitude A2 of the second output signal S2 or 1⁄2 of the amplitude A3 of the third output signal S3 stored in the memory is set as a threshold a (a>0).
In the case where the third output signal S3(n) takes a positive value, if the second output signal S2(n) is smaller than the threshold −a, it is determined that the rotation angle within the range of 120° to 210° among the two rotation angles computed according to the expression (39) is the actual rotation angle. On the other hand, if the second output signal S2(n) is equal to or greater than the threshold −a, it is determined that the rotation angle within the range of 210° to 300° among the two rotation angles computed according to the expression (39) is the actual rotation angle.
In the case where the third output signal S3(n) takes a negative value, if the second output signal S2(n) is equal to or greater than the threshold a, it is determined that the rotation angle within the range of 300° to 360° or the range of 0° to 30° among the two rotation angles computed according to the expression (39) is the actual rotation angle. On the other hand, if the second output signal S2(n) is smaller than the threshold a, it is determined that the rotation angle within the range of 30° to 120° among the two rotation angles computed according to the expression (39) is the actual rotation angle.
FIG. 10 is a flowchart showing the operation of the rotation angle computation unit. When a power supply for the torque computation ECU 77 is turned on, the rotation angle computation unit executes a rotation angle computing process based on forced rotation (step S1). In this process, the electric motor 18 is forced to rotate temporarily to rotate the input shaft 8 (the output shaft 9), and the rotation angle θ of the input shaft 8 is computed. Details of the process will be described later.
In the first computation mode and the second computation mode, if there is no change in the output signals from the two magnetic sensors used to compute the rotation angle θ(n) between the immediately preceding sampling timing and the present sampling timing, the immediately preceding computed values of Eθ(n) (or EΘ(n)), E, and θ(n) are used as the present values of Eθ(n) (or EΘ(n)), E, and θ(n) (see the second arithmetic expression from the top of Table 1). However, at the time when the power supply for the torque computation ECU 77 is turned on by turning on the ignition key, there are no immediately preceding computed values of Eθ(n) (or EΘ(n)), E, and θ(n). Therefore, if the output signals from the two magnetic sensors used to compute the rotation angle θ(n) do not change after the power supply of the torque computation ECU 77 is turned on, the rotation angle θ(n) cannot be computed. Therefore, in order to create the immediately preceding values of Eθ(n) (or EΘ(n)), E, and θ(n), the rotation angle computing process based on forced rotation is executed.
When the rotation angle computing process based on forced rotation ends, the rotation angle computation unit executes a normal rotation angle computing process (step S2). Details of the process will be described later. The normal rotation angle computing process is continuously executed until the ignition key is turned off. When the ignition key is turned off (YES in step S3), the rotation angle computation unit ends the normal rotation angle computing process.
FIG. 11A, FIG. 11B, and FIG. 11C are flowcharts showing the procedure of the rotation angle computing process based on forced rotation in step S1 in FIG. 10. The numbers assigned to the magnetic poles, as relative numbers, using the magnetic pole sensed by the first magnetic sensor 71 at the start of the rotation angle computing process based on forced rotation as a reference magnetic pole are defined as relative pole numbers. The relative pole number of a magnetic pole sensed by the first magnetic sensor 71 (hereinafter, referred to as “first relative pole number”) is expressed by a variable r1, the relative pole number of a magnetic pole sensed by the second magnetic sensor 72 (hereinafter, referred to as “second relative pole number”) is expressed by a variable r2, and the relative pole number of a magnetic pole sensed by the third magnetic sensor 73 (hereinafter, referred to as “third relative pole number”) is expressed by a variable r3. Each of the relative pole numbers r1, r2, r3 takes an integer from one to eight, the relative pole number that is smaller than one by one is eight, and the relative pole number that is greater than eight by one is one.
As shown in FIG. 12, in the memory of the torque computation ECU 77, there are provided, for example, areas denoted by e1 to e7. In the area e1, the angular width error correction values E are stored in association with the relative magnetic pole numbers 1 to 8. In the area e2, the amplitudes A1 of the first output signal S1 are stored in association with the relative magnetic pole numbers 1 to 8. In the area e3, the amplitudes A2 of the second output signal S2 are stored in association with the relative magnetic pole numbers 1 to 8. In the area e4, the amplitudes A3 of the third output signal S3 are stored in association with the relative magnetic pole numbers 1 to 8.
In the area e5, the first relative pole numbers r1(n−k) to r1(n) for multiple computation periods are stored. In the area e6, the second relative pole numbers r2(n−k) to r2(n) for the computation periods are stored. In the area e7, the third relative pole numbers r3(n−k) to r3(n) for the multiple computation periods are stored. Here, k is a natural number that is equal to or greater than 3. Referring back to FIG. 11A, the following description will be provided. In the rotation angle computing process based on forced rotation, the steering wheel 2 automatically rotates for a short time. Therefore, there is a possibility that a driver will erroneously recognize that a failure has occurred. Thus, the rotation angle computation unit gives the driver a warning to avoid an erroneous recognition (step S11). Specifically, the rotation angle computation unit transmits a warning output command to an image-voice control unit (not illustrated) used to control, for example, a display unit (not illustrated), and a voice output device (not illustrated) arranged in the vehicle. Upon reception of the warning output command, the image-voice control unit causes the display unit to display a message “STEERING WHEEL IS FORCEDLY ROTATED, BUT THERE IS NO FAILURE”, or causes the voice output device to output the message.
Then, the rotation angle computation unit drives the electric motor 18 to rotate the electric motor 18 in a first direction (step S12). Specifically, the rotation angle computation unit transmits, to the motor control ECU 12, a first forced rotation command according to which the electric motor 18 is driven to be rotated in the first direction. Upon reception of the first forced rotation command, the motor control ECU 12 drives the electric motor 18 to rotate the electric motor 18 in the first direction.
The rotation angle computation unit obtains the sensor values S1(n), S2(n), S3(n) from the respective magnetic sensors 71, 72, 73 (step S13). The process in step S13 is repeatedly executed with a predetermined computation period until an affirmative determination is made in step S19 or step S21 described later. The memory in the torque computation ECU 77 stores sensor values obtained at least at three timings. That is, the memory stores the sensor values from the sensor value obtained n-th preceding timing (n is a prescribed value) to the sensor value obtained most recently.
The rotation angle computation unit determines whether the present process is first process after the start of the rotation angle computing process based on forced rotation (step S14). If the present process is the first process after the start of the rotation angle computing process based on forced rotation (YES in step S14), the rotation angle computation unit executes a relative pole number setting process (step S15).
FIG. 13 is a flowchart showing the detailed procedure of the relative pole number setting process. First, the rotation angle computation unit determines whether the first output signal S1 is greater than zero (step S51). If the first output signal S1 is greater than zero (YES in step S51), the rotation angle computation unit determines that the magnetic pole sensed by the first magnetic sensor 71 is a north pole, and sets the first relative pole number r1 to one (step S54). Then, the rotation angle computation unit proceeds on to step S56.
On the other hand, if the first output signal S1 is equal to or smaller than zero (NO in step S51), the rotation angle computation unit determines whether the first output signal S1 is smaller than zero (step S52). If the first output signal S1 is smaller than zero (YES in step S52), the rotation angle computation unit determines that the magnetic pole sensed by the first magnetic sensor 71 is a south pole, and sets the first relative pole number r1 to two (step S55). Then, the rotation angle computation unit proceeds on to step S56.
If it is determined in step S52 that the first output signal S1 is equal to or greater than zero (NO in step S52), that is, if the first output signal S1 is zero, the rotation angle computation unit determines whether the second output signal S2 is greater than zero in order to determine whether the rotation angle of the input shaft 8 is 0° or 180° (step S53). If the second output signal S2 is greater than zero (YES in step S53), the rotation angle computation unit determines that the rotation angle of the input shaft 8 is 0°, and sets the first relative pole number r1 to one (step S54). Then, the rotation angle computation unit proceeds on to step S56.
On the other hand, if the second output signal S2 is equal to or smaller than zero (NO in step S53), the rotation angle computation unit determines that the rotation angle of the input shaft 8 is 180°, and sets the first relative pole number r1 to two (step S55). Then, the rotation angle computation unit proceeds on to step S56. In step S56, the rotation angle computation unit determines whether the condition that “S1≧0 and S2>0” or the condition that “S1≦0 and S2<0” is satisfied. When one of the above-described conditions is satisfied (YES in step S56), the rotation angle computation unit determines that the pole number of the magnetic pole sensed by the second magnetic sensor 72 is the same as the pole number of the magnetic pole sensed by the first magnetic sensor 71, and sets the second relative pole number r2 to the same number (r2=r1) as the first relative pole number r1 (step S57). Then, the rotation angle computation unit proceeds on to step S59.
On the other hand, when none of the conditions in step S56 are satisfied (NO in step S56), the rotation angle computation unit determines that the pole number of the magnetic pole sensed by the second magnetic sensor 72 is greater by one than the pole number of the magnetic pole sensed by the first magnetic sensor 71, and sets the second relative pole number r2 to a number greater by one than the first relative pole number r1 (r2=r1+1) (step S58). Then, the rotation angle computation unit proceeds on to step S59.
In step S59, the rotation angle computation unit determines whether the condition that “S1≧0 and S3<0” or the condition that “S1≦0 and S3>0” is satisfied. When one of the above-described conditions is satisfied (YES in step S59), the rotation angle computation unit determines that the pole number of the magnetic pole sensed by the third magnetic sensor 73 is greater by one than the pole number of the magnetic pole sensed by the first magnetic sensor 71, and sets the third relative pole number r3 to a number greater by one than the first relative pole number r1 (r3=r1+1) (step S60). Then, the rotation angle computation unit proceeds on to step S18 in FIG. 11B.
On the other hand, when none of the conditions in step S59 is satisfied (NO in step S59), the rotation angle computation unit determines that the pole number of the magnetic pole sensed by the third magnetic sensor 73 is greater by two than the pole number of the magnetic pole sensed by the first magnetic sensor 71, and sets the third relative pole number r3 to a number that is greater by two than the first relative pole number r1 (r3=r1+2) (step S61). Then, the rotation angle computation unit proceeds on to step S18 in FIG. 11B.
The reason why the second relative pole number r2 is set on the basis of the conditions in step S56 and the reason why the third relative pole number r3 is set on the basis of the conditions in step S59 will be described below. FIG. 14A, FIG. 14B, and FIG. 14C schematically illustrate signal waveforms of the first, second and third output signals S1, S2, S3 at the time when a magnetic pole pair constituted of, for example, the magnetic pole M1 and the magnetic pole M2 in the magnet 61 passes by the first magnetic sensor 71.
In FIG. 14A, FIG. 14B and FIG. 14C, in regions indicated by Q1, Q4, the pole number of the magnetic pole sensed by the second magnetic sensor 72 is the same as the pole number of the magnetic pole sensed by the first magnetic sensor 71. In regions indicated by Q2, Q3, Q5, Q6, the pole number of the magnetic pole sensed by the second magnetic sensor 72 is greater by one than the pole number of the magnetic pole sensed by the first magnetic sensor 71.
In the region Q1, both the sensor values S1, S2 satisfy the first condition that S1≧0 and S2>0. In the regions Q2, Q3, both the sensor values S1, S2 satisfy the second condition that S1>0 and S2≦0. In the region Q4, both the sensor values S1, S2 satisfy the third condition that S1≦0 and S2<0. In the regions Q5, Q6, both the sensor values S1, S2 satisfy the fourth condition that S1<0 and S2≧0. When one of the first condition and the third condition is satisfied, the rotation angle computation unit determines that the pole number of the magnetic pole sensed by the second magnetic sensor 72 is the same as the pole number of the magnetic pole sensed by the first magnetic sensor 71. On the other hand, when neither the first condition nor the third condition is satisfied, the rotation angle computation unit determines that the pole number of the magnetic pole sensed by the second magnetic sensor 72 is greater by one than the pole number of the magnetic pole sensed by the first magnetic sensor 71.
In FIG. 14A, FIG. 14B, and FIG. 14C, in regions indicated by Q1, Q2 and regions indicated by Q4, Q5, the pole number of the magnetic pole sensed by the third magnetic sensor 73 is greater by one than the pole number of the magnetic pole sensed by the first magnetic sensor 71. In regions indicated by Q3, Q6, the pole number of the magnetic pole sensed by the third magnetic sensor 73 is greater by two than the pole number of the magnetic pole sensed by the first magnetic sensor 71.
In the regions Q1, Q2, both the sensor values S1, S3 satisfy the fifth condition that S1≧0 and S3<0. In the region Q3, both the sensor values S1, S3 satisfy the sixth condition that S1>0 and S3≧0. In the regions Q4, Q5, both the sensor values S1, S3 satisfy the seventh condition that S1≦0 and S3>0. In the region Q6, both the sensor values S1, S3 satisfy the eighth condition that S1<0 and S3≦0. When one of the fifth condition and the seventh condition is satisfied, the rotation angle computation unit determines that the pole number of the magnetic pole sensed by the third magnetic sensor 73 is greater by one than the pole number of the magnetic pole sensed by the first magnetic sensor 71. On the other hand, when neither the fifth condition nor the seventh condition is satisfied, the rotation angle computation unit determines that the pole number of the magnetic pole sensed by the third magnetic sensor 73 is greater by two than the pole number of the magnetic pole sensed by the first magnetic sensor 71.
As shown in FIG. 11A, if it is determined in step S14 that the present process is not the first process after the start of the rotation angle computing process based on forced rotation (NO in step S14), the rotation angle computation unit proceeds on to step S16. In step S16, the rotation angle computation unit determines whether zero-crossing of each of the sensor values S1, S2, S3, that is, inversion of the sign of each of the sensor values S1, S2, S3 is detected, on the basis of the sensor values S1, S2, S3 stored in the memory. If zero-crossing is not detected (NO in step S16), the rotation angle computation unit proceeds on to step S18 in FIG. 11B.
If zero-crossing of one of the sensor values S1, S2, S3 is detected in step S16 (YES in step S16), the rotation angle computation unit executes a relative pole number updating process (step S17). Specifically, the rotation angle computation unit changes the relative pole number r1, r2 or r3, which is presently set for the magnetic sensor that outputs the sensor value zero-crossing of which is detected in step S16, to a number that is greater by one or a number that is smaller by one than the presently set relative pole number r1, r2 or r3 on the basis of the rotation direction of the input shaft 8 (the magnet 61).
When the rotation direction of the input shaft 8 is the forward direction (the direction indicated by the arrow in FIG. 6), the rotation angle computation unit updates the relative pole number r1, r2, or r3 presently set for the magnetic sensor that outputs the sensor value zero-crossing of which is detected in step S16, to a number that is greater by one than the presently set relative pole number r1, r2 or r3. On the other hand, when the rotation direction of the input shaft 8 is the reverse direction, the rotation angle computation unit updates the relative pole number r1, r2, or r3 presently set for the magnetic sensor that outputs the sensor value zero-crossing of which is detected in step S 16, to a number that is smaller by one than the presently set relative pole number r1, r2 or r3. As described above, the relative pole number that is smaller than the relative pole number “one” by one is “eight”. Further, the relative pole number that is greater than the relative pole number “eight” by one is “one”.
The rotation direction of the input shaft 8 can be determined on the basis of, for example, the immediately preceding value and the present value of the output signal zero-crossing of which is detected and the present value of the other output signal. Specifically, when the output signal zero-crossing of which is detected is the first output signal S1, if the condition that “the immediately preceding value of the first output signal S1 is greater than zero, the present value of the first output signal S1 is equal to or smaller than zero, and the second output signal S2 is smaller than zero” or the condition that “the immediately preceding value of the first output signal S1 is smaller than zero, the present value of the first output signal S1 is equal to or greater than zero, and the second output signal S2 is greater than zero” is satisfied, it is determined that the rotation direction is the forward direction (the direction indicated by the arrow in FIG. 6).
If the condition that “the immediately preceding value of the first output signal S1 is equal to or greater than zero, the present value of the first output signal S1 is smaller than zero, and the second output signal S2 is greater than zero” or the condition that “the immediately preceding value of the first output signal S1 is equal to or smaller than zero, the present value of the first output signal S1 is greater than zero, and the second output signal S2 is smaller than zero” is satisfied, it is determined that the rotation direction is the reverse direction. When the output signal zero-crossing of which is detected is the second output signal S2, if the condition that “the immediately preceding value of the second output signal S2 is greater than zero, the present value of the second output signal S2 is equal to or smaller than zero, and the first output signal S1 is greater than zero” or the condition that “the immediately preceding value of the second output signal S2 is smaller than zero, the present value of the second output signal S2 is equal to or greater than zero, and the first output signal S1 is smaller than zero” is satisfied, it is determined that the rotation direction is the forward direction (the direction indicated by the arrow in FIG. 6). On the other hand, if the condition that “the immediately preceding value of the second output signal S2 is equal to or greater than zero, the present value of the second output signal S2 is smaller than zero, and the first output signal S1 is smaller than zero” or the condition that “the immediately preceding value of the second output signal S2 is equal to or smaller than zero, the present value of the second output signal S2 is greater than zero, and the first output signal S1 is greater than zero” is satisfied, it is determined that the rotation direction is the reverse direction.
When the output signal zero-crossing of which is detected is the third output signal S3, if the condition that “the immediately preceding value of the third output signal S3 is greater than zero, the present value of the third output signal S3 is equal to or smaller than zero, and the second output signal S2 is greater than zero” or the condition that “the immediately preceding value of the third output signal S3 is smaller than zero, the present value of the third output signal S3 is equal to or greater than zero, and the second output signal S2 is smaller than zero” is satisfied, it is determined that the rotation direction is the forward direction (the direction indicated by the arrow in FIG. 6).
On the other hand, if the condition that “the immediately preceding value of the third output signal S3 is equal to or greater than zero, the present value of the third output signal S3 is smaller than zero, and the second output signal S2 is smaller than zero” or the condition that “the immediately preceding value of the third output signal S3 is equal to or smaller than zero, the present value of the third output signal S3 is greater than zero, and the second output signal S2 is greater than zero” is satisfied, it is determined that the rotation direction is the reverse direction. When the relative pole number updating process ends, the rotation angle computation unit proceeds on to step S18 in FIG. 11B. In step S18, the rotation angle computation unit determines whether the condition that the first and second magnetic sensors 71, 72 sense one and the same magnetic pole for three consecutive computation periods is satisfied. If the condition in step S18 is not satisfied (NO in step S18), the rotation angle computation unit determines whether the condition that the second and third magnetic sensors 72, 73 sense one and the same magnetic pole for three consecutive computation periods is satisfied (step S20). If the condition in step S20 is not satisfied (NO in step S20), the rotation angle computation unit returns to step S13 in FIG. 11A.
If it is determined in step S18 that the condition in step S18 is satisfied (YES in step S18), the rotation angle computation unit determines whether the condition that none of the denominators of the fractions included in the arithmetic expressions used to compute Eθ and E are zero is satisfied (step S19). If the condition in step S19 is not satisfied (NO in step S19), the rotation angle computation unit returns to step S13 in FIG. 11A. On the other hand, if the condition in step S19 is satisfied (YES in step S19), the rotation angle computation unit proceeds on to step S22.
If it is determined in step S20 that the condition in step S20 is satisfied (YES in step S20), the rotation angle computation unit determines whether the condition that none of the denominators of the fractions included in the arithmetic expressions used to compute EΘ and E are zero is satisfied (step S21). If the condition in step S21 is not satisfied (NO in step S21), the rotation angle computation unit returns to step S13 in FIG. 11A. On the other hand, if the condition in step S21 is satisfied (YES in step S21), the rotation angle computation unit proceeds on to step S22.
In step S22, the rotation angle computation unit drives the electric motor 18 to rotate the electric motor 18 in a second direction that is the opposite direction of the first direction. Specifically, the rotation angle computation unit transmits, to the motor control ECU 12, a second forced rotation command according to which the electric motor 18 is driven to be rotated in the second direction. Upon reception of the second forced rotation command, the motor control ECU 12 drives the electric motor 18 to rotate the electric motor 18 in the second direction.
Then, the rotation angle computation unit obtains the sensor values S1(n), S2(n), S3(n) from the respective magnetic sensors, 71, 72, 73 (step S23). The process in step S23 is repeatedly executed with a predetermined computation period until an affirmative determination is made in step S27 or step S31 described later. Then, the rotation angle computation unit determines whether zero-crossing of each of the sensor values S1, S2, S3, that is, inversion of the sign of each of the sensor values S1, S2, S3 is detected, on the basis of the sensor values S1, S2, S3 stored in the memory (step S24). If zero-crossing is not detected (NO in step S24), the rotation angle computation unit proceeds on to step S26 in FIG. 11C.
If zero-crossing of one of the sensor values S1, S2, S3 is detected in step S24 (YES in step S24), the rotation angle computation unit executes a relative pole number updating process (step S25). The relative pole number updating process is the same as the relative pole number updating process in step S17 described above. When the relative pole number updating process in step S25 ends, the rotation angle computation unit proceeds on to step S26 in FIG. 11C.
In step S26, the rotation angle computation unit determines whether the condition that both the first and second magnetic sensors 71, 72 sense one and the same magnetic pole for three consecutive computation periods is satisfied. If the condition in step S26 is not satisfied (NO in step S26), the rotation angle computation unit determines whether the condition that both the second and third magnetic sensors 72, 73 sense one and the same magnetic pole for three consecutive computation periods is satisfied (step S30). If the condition in step S30 is not satisfied (NO in step S30), the rotation angle computation unit returns to step S23 in FIG. 11B.
If it is determined in step S26 that the condition in step S26 is satisfied (YES in step S26), the rotation angle computation unit determines whether the condition that none of the denominators of the fractions included in the Eθ basic arithmetic expression and the E arithmetic expression for the first computation mode are zero is satisfied (step S27). If the condition in step S27 is not satisfied (NO in step S27), the rotation angle computation unit returns to step S23 in FIG. 11B.
If it is determined that the condition in step S27 is satisfied (YES in step S27), the rotation angle computation unit computes the values of θ(n), E, A1, and A2 in the first computation mode (step S28). Then, the rotation angle computation unit stores the computed values of E, A1, and A2 in the memory in association with the relative pole number of the magnetic pole sensed by the first and second magnetic sensors 71, 72 (step S29). The relative pole number of the magnetic pole sensed by the first and second magnetic sensors 71, 72 is the same number as the presently set first relative pole number r1 or second relative pole number r2. Specifically, the rotation angle computation unit stores the computed values of E, A1, and A2 in the storage locations in the areas e1, e2, e3 of the memory, which are associated with the presently set first relative pole number r1. Then, the rotation angle computation unit proceeds on to step S34.
If it is determined in step S30 that the condition in step S30 is satisfied (YES in step S30), the rotation angle computation unit determines whether the condition that none of the denominators of the fractions included in the EΘ basic arithmetic expression and the E arithmetic expression for the second computation mode are zero is satisfied (step S31). If the condition in step S31 is not satisfied (NO in step S31), the rotation angle computation unit returns to step S23 in FIG. 11B.
If it is determined that the condition in step S31 is satisfied (YES in step S31), the rotation angle computation unit computes the values of θ(n), E, A2, and A3 in the second computation mode (step S32). Then, the rotation angle computation unit stores the computed values of E, A2, and A3 in the memory in association with the relative pole number of the magnetic pole sensed by the second and third magnetic sensors 72, 73 (step S33). The relative pole number of the magnetic pole sensed by the second and third magnetic sensors 72, 73 is the same number as the presently set second relative pole number r2 or third relative pole number r3. Specifically, the rotation angle computation unit stores the computed values of E, A2, and A3 in the storage locations in the areas e1, e3, e4 of the memory, which are associated with the presently set third relative pole number r3. Then, the rotation angle computation unit proceeds on to step S34.
In step S34, the rotation angle computation unit stops driving of the electric motor 18 and cancels the warning for the driver. Specifically, the rotation angle computation unit transmits a driving stop command for the electric motor 18 to the motor control ECU 12, and also transmits a warning cancellation command to the image-voice control unit. Upon reception of the driving stop command for the electric motor 18, the motor control ECU 12 stops driving of the electric motor 18. Upon reception of the warning cancellation command, the image-voice control unit cancels the warning display, the warning voice output, or the like. Thus, the rotation angle computing process based on forced rotation ends.
FIG. 15A, FIG. 15B and FIG. 15C are flowcharts showing the procedure of the normal rotation angle computing process in step S2 in FIG. 10. The process in FIG. 15A, FIG. 15B and FIG. 15C is repeatedly executed with a predetermined computation period. The rotation angle computation unit obtains the sensor values S1(n), S2(n), S3(n) from the respective magnetic sensors, 71, 72, 73 (step S61). Then, the rotation angle computation unit determines whether zero-crossing of each of the sensor values S1, S2, S3, that is, inversion of the sign of each of the sensor values S1, S2, S3 is detected, on the basis of the sensor values S1, S2, S3 stored in the memory (step S62). If zero-crossing is not detected (NO in step S62), the rotation angle computation unit proceeds on to step S64.
If zero-crossing of one of the sensor values S1, S2, S3 is detected in step S62 (YES in step S62), the rotation angle computation unit executes a relative pole number updating process (step S63). The relative pole number updating process is the same as the relative pole number updating process in step S17 in FIG. 11A described above. When the relative pole number updating process in step S63 ends, the rotation angle computation unit proceeds on to step S64.
In step S64, the rotation angle computation unit determines whether the condition that both the first and second magnetic sensors 71, 72 sense one and the same magnetic pole for three consecutive computation periods is satisfied. If the condition in step S64 is satisfied (YES in step S64), the rotation angle computation unit computes the values of θ(n), E, A1, and A2 in the first computation mode (step S65). At the time of computing the rotation angle θ(n) in the first computation mode, the rotation angle computation unit determines whether the denominators of the fractions included in the Eθ basic arithmetic expression are not zero and whether the denominators of the fractions included in the E arithmetic expression are not zero, and computes the values of θ(n), E, A1, and A2 on the basis of the results of determinations.
After computing the values of θ(n), E, A1, and A2, the rotation angle computation unit determines whether the condition that none of the denominators of the fractions included in the Eθ basic arithmetic expression and the E arithmetic expression are zero is satisfied (step S66). If the condition in step S66 is satisfied (YES in step S66), the rotation angle computation unit stores the computed values of E, A1, and A2 in the memory in association with the relative pole number of the magnetic pole sensed by the first and second magnetic sensors 71, 72 (step S67). The relative pole number of the magnetic pole sensed by the first and second magnetic sensors 71, 72 is the same number as the presently set first relative pole number r1 or second relative pole number r2. Specifically, the rotation angle computation unit stores the computed values of E, A1, and A2 in the storage locations in the areas e1, e2, e3 of the memory, which are associated with the presently set first relative pole number r1. Note that, if the values of E, A1, and A2 have already been stored in the above-described storage locations in the areas e1, e2, e3 of the memory, the already stored values of E, A1, and A2 are overwritten with the presently computed values of E, A1, and A2. Then, the rotation angle computation unit ends the process in the present computation period.
If it is determined in step S66 that the condition in step S66 is not satisfied (NO in step S66), the rotation angle computation unit ends the process in the present computation period without executing the process in step S67. Therefore, in this case, the values of E, A1, and A2 computed in step S65 are not stored in the areas e1, e2, e3 of the memory.
If it is determined in step S64 that the condition in step S64 is not satisfied (NO in step S64), the rotation angle computation unit determines whether the condition that both the second and third magnetic sensors 72, 73 sense one and the same magnetic pole for three consecutive computation periods is satisfied (step S68). If the condition in step S68 is satisfied (YES in step S68), the rotation angle computation unit computes the values of θ(n), E, A2, and A3 in the second computation mode (step S69). At the time of computing the rotation angle θ(n) in the second computation mode, the rotation angle computation unit determines whether the denominators of the fractions included in the EΘ basic arithmetic expression are not zero and whether the denominators of the fractions included in the E arithmetic expression are not zero, and computes the values of θ(n), E, A2, and A3 on the basis of the results of determinations.
After computing the values of θ(n), E, A2, and A3, the rotation angle computation unit determines whether the condition that none of the denominators of the fractions included in the EΘ basic arithmetic expression and the E arithmetic expression are zero is satisfied (step S70). If the condition in step S70 is satisfied (YES in step S70), the rotation angle computation unit stores the computed values of E, A2, and A3 in the memory in association with the relative pole number of the magnetic pole sensed by the second and third magnetic sensors 72, 73 (step S71). The relative pole number of the magnetic pole sensed by the second and third magnetic sensors 72, 73 is the same number as the presently set second relative pole number r2 or third relative pole number r3. Specifically, the rotation angle computation unit stores the computed values of E, A2, and A3 in storage locations in the areas e1, e3, e4 of the memory, which are associated with the presently set third relative pole number r3. Note that, if the values of E, A2, and A3 have already been stored in the above-described storage locations in the areas e1, e3, e4 of the memory, the already stored values of E, A2, and A3 are overwritten with the presently computed values of E, A2, and A3. Then, the rotation angle computation unit ends the process in the present computation period.
If it is determined in step S70 that the condition in step S70 is not satisfied (NO in step S70), the rotation angle computation unit ends the process in the present computation period without executing the process in step S71. Therefore, in this case, the values of E, A2, and A3 computed in step S69 are not stored in the areas e1, e3, e4 of the memory.
If it is determined in step S68 that the condition in step S68 is not satisfied (NO in step S68), it is determined whether the magnetic pole width error correction value E corresponding to the magnetic pole sensed by the first magnetic sensor 71 is stored in the memory (step S72). This determination is made based on whether the magnetic pole width error correction value E is stored in a storage location in the area e1 of the memory, which is associated with the presently set first relative pole number r1.
If the magnetic pole width error correction value E corresponding to the magnetic pole sensed by the first magnetic sensor 71 is stored in the memory (YES in step S72), the rotation angle computation unit computes the rotation angle θ(n) in the third computation mode (step S73). Then, the rotation angle computation unit ends the process in the present computation period. If it is determined in step S72 that the magnetic pole width error correction value E corresponding to the magnetic pole sensed by the first magnetic sensor 71 is not stored in the memory (NO in step S72), the rotation angle computation unit proceeds on to step S74. In step S74A, the rotation angle computation unit determines whether the magnetic pole width error correction value E corresponding to the magnetic pole sensed by the second magnetic sensor 72 is stored in the memory. This determination is made based on whether the magnetic pole width error correction value E is stored in a storage location in the area e2 of the memory, which is associated with the presently set second relative pole number r2.
If the magnetic pole width error correction value E corresponding to the magnetic pole sensed by the second magnetic sensor 72 is stored in the memory (YES in step S74), the rotation angle computation unit computes the rotation angle θ(n) in the fourth computation mode (step S75). Then, the rotation angle computation unit ends the process in the present computation period. If it is determined in step S74 that the magnetic pole width error correction value E corresponding to the magnetic pole sensed by the second magnetic sensor 72 is not stored in the memory (NO in step S74), the rotation angle computation unit computes the rotation angle θ(n) in the fifth computation mode (step S76). Then, the rotation angle computation unit ends the process in the present computation period.
While one example embodiment of the invention has been described above, the invention may be implemented in various other embodiments. For example, step S66 in FIG. 15B may be omitted and step S67 may be executed after completion of the process in step S65. Likewise, step S70 in FIG. 15B may be omitted and step S71 may be executed after completion of the process in step S69.
A backup magnetic sensor may be arranged so as to be apart from the second magnetic sensor 72 in the radial direction of the input shaft 8. When the second magnetic sensor 72 malfunctions, an output signal from the backup magnetic sensor may be used instead of an output signal from the second magnetic sensor 72.

## Claims

1. A rotation angle detection device comprising:
a multipolar magnet that rotates in accordance with rotation of a rotary body, and that has a plurality of magnetic poles;
three magnetic sensors that respectively output sinusoidal signals having a predetermined phase difference in accordance with rotation of the multipolar magnet;
a sampling unit that samples an output signal from each of the magnetic sensors at prescribed timings;
a computation unit that:
computes a rotation angle of the rotary body based on the output signals from two magnetic sensors among the three magnetic sensors, the output signals being sampled at three sampling timings, when a condition that both the two magnetic sensors among the three magnetic sensors sense one and the same magnetic pole for three consecutive sampling periods is satisfied;
computes information regarding a magnetic pole width of the magnetic pole sensed by the two magnetic sensors and information regarding amplitudes of the output signals from the two magnetic sensors and stores the information regarding the magnetic pole width and the information regarding the amplitudes in association with the magnetic pole sensed by the two magnetic sensors when the information regarding the magnetic pole width and the information regarding the amplitudes are not stored; and
computes the rotation angle of the rotary body based on the stored information and the output signals from two magnetic sensors among the three magnetic sensors, the two magnetic sensors including one of the three magnetic sensors, which senses the magnetic pole associated with the stored information regarding the magnetic pole width, when the condition is not satisfied.

2. The rotation angle detection device according to claim 1, wherein in a case where the three magnetic sensors are a first magnetic sensor, a second magnetic sensor, and a third magnetic sensor, a phase difference between an output signal from the first magnetic sensor and an output signal from the second magnetic sensor is 120°, and a phase difference between the output signal from the first magnetic sensor and an output signal from the third magnetic sensor is 240°.

3. The rotation angle detection device according to claim 2, wherein:
the information regarding the magnetic pole width of the magnetic pole is a magnetic pole width error correction value used to correct a rotation angle error based on a magnetic pole width error of the magnetic pole;
an output signal S1 from the first magnetic sensor is expressed by S1=A1 sin(E1θ) where A1 is an amplitude of the output signal from the first magnetic sensor, E1 is a magnetic pole width error correction value corresponding to a magnetic pole sensed by the first magnetic sensor, and θ is the rotation angle of the rotary body;
an output signal S2 from the second magnetic sensor is expressed by S2=A2 sin(E2θ+120) where A2 is an amplitude of the output signal from the second magnetic sensor and E2 is a magnetic pole width error correction value corresponding to a magnetic pole sensed by the second magnetic sensor; and
an output signal S3 from the third magnetic sensor is expressed by S3=A3 sin(E3θ+240) where A3 is an amplitude of the output signal from the third magnetic sensor and E3 is a magnetic pole width error correction value corresponding to a magnetic pole sensed by the third magnetic sensor.