Magnetic sensor, magnetic encoder and lens detection device

By using resistors with different resistance values ​​and correction resistors in the magnetic sensor, combined with the configuration of multiple magnetoresistance effect elements and the bias magnetic field, the impact of the noise magnetic field on the detection value is solved, and high accuracy and simplified structure are achieved. detection effect.

CN113532486BActive Publication Date: 2024-09-10TDK CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110423689.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-04-20
Filing Date
2021-04-20
Publication Date
2024-09-10
Estimated Expiration
2041-04-20

AI Technical Summary

Technical Problem

Existing magnetic sensors are easily affected by noise magnetic fields when detecting the object's magnetic field, resulting in errors in the detection values, and the structure for removing the noise component is complex.

Method used

A magnetic sensor is designed, which uses resistors with different resistance values ​​​​and correction resistors, which are connected in series and constituted according to the periodic changes of the magnetic field components to reduce the influence of the noise magnetic field, and through the configuration of multiple magnetoresistance effect elements And the bias magnetic field optimizes the resistance value change and reduces the resistance value change caused by the noise magnetic field.

Benefits of technology

It achieves effective reduction of the influence of noise magnetic field under a simple structure, improves the accuracy and precision of detection signals, and simplifies the process of removing noise components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113532486B_ABST
    Figure CN113532486B_ABST
Patent Text Reader

Abstract

The magnetic sensor of the present invention comprises a first resistor having a first resistance value and a first correction resistor having a second resistance value. The first resistor and the first correction resistor are connected in series. The first resistor is configured so that the first resistance value changes periodically according to the periodic change of the intensity of the magnetic field component. The first correction resistor is configured so that the change of the sum of the first resistance value and the second resistance value caused by the noise magnetic field is smaller than the change of the first resistance value caused by the noise magnetic field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a magnetic sensor, a magnetic encoder using the magnetic sensor, and a lens detection device. Background Art

[0002] A magnetic encoder using the magnetic sensor is used to detect the position of a movable object whose position changes in a specified direction. The specified direction refers to a linear direction or a rotational direction. The magnetic encoder for detecting the position of a movable object is constructed in such a way that the relative position of a magnetic field generator such as a magnetic scale relative to the magnetic sensor changes within a specified range in response to the change in the position of the movable object.

[0003] When the relative position of the magnetic field generator to the magnetic sensor changes, the intensity of the component in one direction of the target magnetic field generated by the magnetic field generator and applied to the magnetic sensor changes. The magnetic sensor detects the intensity of the component in one direction of the target magnetic field, for example, and generates two detection signals corresponding to the intensity of the component in one direction and having different phases. The magnetic encoder generates a detection value corresponding to the relative position of the magnetic field generator to the magnetic sensor based on the two detection signals.

[0004] The magnetic sensor for the magnetic encoder is used as a magnetic sensor using a plurality of magnetoresistive effect elements. For example, International Publication No. 2009 / 031558 and Chinese Patent Application Publication No. 107076808A disclose a magnetic sensor in which a plurality of GMR (giant magnetoresistive effect) elements are arranged as magnetoresistive effect elements in the relative movement direction of the magnet and the magnetic sensor and in a direction perpendicular to the relative movement direction.

[0005] In a magnetic encoder, in addition to the object magnetic field, a noise magnetic field other than the object magnetic field is sometimes applied to the magnetic sensor. As the noise magnetic field, there is, for example, the earth's magnetism or the leakage magnetic field from the motor. When the noise magnetic field is applied to the magnetic sensor in this way, the magnetic sensor detects the composite magnetic field of the object magnetic field and the noise magnetic field. For example, when the intensity of the noise magnetic field is constant over time, the intensity of the component of the noise magnetic field in one direction appears as an offset in the detection signal. As a result, an error is generated in the detection value.

[0006] The specification of Chinese patent application publication No. 1049137992A discloses a position detection device, which is a magnetic scale type position detector, and includes: two magnetic sensors, which detect the recorded signal of the magnetic scale as a sine wave signal; two magnetic sensors, which detect a signal representing a component of noise that is not dependent on the wavelength of the signal recorded on the magnetic scale (a signal representing a DC component); and two subtractors, which detect the difference between the sine wave signal and the signal representing the DC component. In the position detector, a signal from which the noise component has been removed is obtained by the subtractor.

[0007] In the position detection device disclosed in the specification of Chinese Patent Application Publication No. 1049137992A, in order to remove the noise component, in addition to the magnetic sensor for detecting the recording signal of the magnetic scale, a magnetic sensor for detecting the noise component and a subtractor for removing the noise component are also required, which has a problem of complex structure. Summary of the invention

[0008] An object of the present invention is to provide a magnetic sensor capable of reducing the influence of a noise magnetic field with a simple structure, and a magnetic encoder and a lens position detection device using the magnetic sensor.

[0009] The magnetic sensor of the present invention is a magnetic sensor that detects a target magnetic field containing a magnetic field component in a first direction and a noise magnetic field other than the target magnetic field. The magnetic sensor of the present invention comprises a first resistor having a first resistance value, a first correction resistor having a second resistance value, a first port, and a second port. The first resistor and the first correction resistor are connected in series between the first port and the second port.

[0010] The first resistor is configured such that the first resistance value changes periodically according to the periodic change in the intensity of the magnetic field component. The first correction resistor is configured such that the change in the sum of the first resistance value and the second resistance value caused by the noise magnetic field is smaller than the change in the first resistance value caused by the noise magnetic field.

[0011] In the magnetic sensor of the present invention, the first correction resistor may be configured so that a change in the second resistance value caused by the magnetic field component is smaller than a change in the first resistance value caused by the magnetic field component. Alternatively, the first correction resistor may be configured so that a change in the second resistance value caused by the magnetic field component becomes zero.

[0012] In addition, in the magnetic sensor of the present invention, it is also possible that: the first resistor and the first correction resistor each include a plurality of magnetoresistance effect elements. Each of the plurality of magnetoresistance effect elements includes: a magnetization fixed layer having magnetization with a fixed direction; a free layer having magnetization with a direction that can change according to the direction and strength of the magnetic field component; and a gap layer arranged between the magnetization fixed layer and the free layer. It is also possible that: the magnetization direction of each of the plurality of magnetoresistance effect elements of the first resistor is the first magnetization direction. In addition, it is also possible that: the magnetization direction of each of the plurality of magnetoresistance effect elements of the first correction resistor is a second magnetization direction opposite to the first magnetization direction.

[0013] In the case where the first resistor and the first correction resistor each include a plurality of magnetoresistance effect elements, the plurality of magnetoresistance effect elements of the first correction resistor may be arranged in a manner arranged at a predetermined interval along the first direction. In this case, the distance from the magnetoresistance effect element located at one end in the first direction to the magnetoresistance effect element located at the other end in the first direction among the plurality of magnetoresistance effect elements of the first correction resistor may be a distance corresponding to 1 to 10 cycles of the change in the intensity of the magnetic field component.

[0014] Furthermore, when the first resistor and the first correction resistor each have a plurality of magnetoresistance effect elements, the number of the plurality of magnetoresistance effect elements of the first resistor may be greater than the number of the plurality of magnetoresistance effect elements of the first correction resistor.

[0015] In addition, when the first resistor and the first correction resistor each include a plurality of magnetoresistance effect elements, each of the plurality of magnetoresistance effect elements may further include a bias magnetic field generator that generates a bias magnetic field applied to the free layer and whose direction intersects the first direction. Alternatively, the free layer may have a shape magnetic anisotropy in which the easy magnetization axis direction is oriented in a direction intersecting the first direction.

[0016] Furthermore, when the first resistor and the first correction resistor each include a plurality of magnetoresistive effect elements, the gap layer may be a tunnel barrier layer.

[0017] In addition, the magnetic sensor of the present invention may also be: further provided with: a second resistor having a third resistance value; a second correction resistor having a fourth resistance value; and a third port, which is provided between the first resistor and the first correction resistor and the second port. It may also be: the second resistor and the second correction resistor are connected in series between the second port and the third port. It may also be: the second resistor changes periodically with the third resistance value according to the change of the periodic intensity of the magnetic field component, and the phase of the change of the third resistance value is different from the phase of the change of the first resistance value. It may also be: the second correction resistor is configured in a manner that the change of the sum of the third resistance value and the fourth resistance value caused by the noise magnetic field is smaller than the change of the third resistance value caused by the noise magnetic field. In addition, in this case, it may also be: the first port is a power supply port to which a voltage of a specified magnitude is applied. In addition, it may also be: the second port is connected to a grounding port of the ground wire.

[0018] The magnetic encoder of the present invention comprises the magnetic sensor of the present invention and a magnetic field generator for generating a target magnetic field. The magnetic sensor and the magnetic field generator are configured so that the intensity of the magnetic field component changes when the relative position of the magnetic field generator with respect to the magnetic sensor changes.

[0019] The magnetic encoder of the present invention may also include a detection value generating circuit. In this case, the magnetic sensor may generate at least one detection signal having a corresponding relationship with the magnetic field component. In addition, the detection value generating circuit may generate a detection value having a corresponding relationship with the relative position of the magnetic field generator relative to the magnetic sensor based on the at least one detection signal.

[0020] In the magnetic encoder of the present invention, the magnetic field generator may be a magnetic scale in which a plurality of groups of N poles and S poles are alternately arranged in a predetermined direction. In this case, at least one detection signal may include an ideal component that changes periodically in a manner that draws an ideal sine curve, and an error component that is equivalent to a higher harmonic of the ideal component. The first resistor may be configured in a manner that reduces the error component.

[0021] The lens position detection device of the present invention is a device for detecting the position of a lens whose position can be changed. The lens position detection device of the present invention comprises the magnetic sensor of the present invention and a magnetic field generator for generating a target magnetic field. The lens is configured to be movable in a first direction. The magnetic sensor and the magnetic field generator are configured so that the intensity of the magnetic field component changes when the position of the lens changes.

[0022] The lens position detection device of the present invention may also include a detection value generating circuit. In this case, the magnetic sensor may generate at least one detection signal having a corresponding relationship with the magnetic field component. In addition, the detection value generating circuit may generate a detection value having a corresponding relationship with the position of the lens based on the at least one detection signal.

[0023] In the lens position detection device of the present invention, the magnetic field generator may be a magnetic scale having a plurality of groups of N poles and S poles arranged alternately in a predetermined direction. In this case, at least one detection signal may include an ideal component that changes periodically in a manner that draws an ideal sine curve, and an error component that is a harmonic of the ideal component. The first resistor may be configured in a manner that reduces the error component.

[0024] In the magnetic sensor of the present invention, in the magnetic encoder and the lens position detection device, the first resistor is configured so that the first resistance value changes periodically according to the change in the periodic intensity of the magnetic field component. In addition, the first correction resistor is configured so that the change in the sum of the first resistance value and the second resistance value caused by the noise magnetic field is smaller than the change in the first resistance value caused by the noise magnetic field. Therefore, according to the present invention, the influence of the noise magnetic field can be reduced with a simple structure.

[0025] Other objects, features and advantages of the present invention will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a perspective view showing the magnetic encoder according to the first embodiment of the present invention.

[0027] Figure 2 It is a front view showing the magnetic encoder according to the first embodiment of the present invention.

[0028] Figure 3 It is a plan view showing the magnetic sensor according to the first embodiment of the present invention.

[0029] Figure 4 This is a circuit diagram showing the structure of the magnetic sensor according to the first embodiment of the present invention.

[0030] Figure 5 1 is a plan view showing the first resistor according to the first embodiment of the present invention.

[0031] Figure 6 1 is a plan view showing a first correction resistor according to the first embodiment of the present invention.

[0032] Figure 7 This is a perspective view showing a first example of the magnetoresistive effect element according to the first embodiment of the present invention.

[0033] Figure 8 It is a perspective view showing a second example of the magnetoresistive effect element according to the first embodiment of the present invention.

[0034] Fig.9A It is an explanatory diagram schematically showing the first signal according to the first embodiment of the present invention.

[0035] Fig. 9B It is an explanatory diagram schematically showing the second signal according to the first embodiment of the present invention.

[0036] Fig. 9C It is an explanatory diagram schematically showing the third signal according to the first embodiment of the present invention.

[0037] Fig.10 : is a waveform diagram showing the waveforms of the first and second detection signals in the model of the comparative example.

[0038] Fig.11 It is a characteristic diagram showing the errors of the model of the embodiment and the model of the comparative example.

[0039] Fig.12 It is a perspective view showing a lens module including the position detection device according to the first embodiment of the present invention.

[0040] Fig.13 It is a perspective view showing a position detection device according to the first embodiment of the present invention.

[0041] Fig.14 This is a perspective view showing a first modified example of the magnetoresistive effect element according to the first embodiment of the present invention.

[0042] Fig.15 It is a plan view showing a second modified example of the magnetoresistive effect element according to the first embodiment of the present invention.

[0043] Fig.16 It is a plan view showing a third modified example of the magnetoresistive effect element according to the first embodiment of the present invention.

[0044] Fig.17 It is a plan view showing a fourth modified example of the magnetoresistive effect element according to the first embodiment of the present invention.

[0045] Fig.18 It is a plan view showing a fifth modified example of the magnetoresistive effect element according to the first embodiment of the present invention.

[0046] Fig.19 It is a plan view showing a magnetic sensor according to a second embodiment of the present invention.

[0047] Fig. 20It is a plan view showing a magnetic sensor according to a third embodiment of the present invention.

[0048] Fig.21 It is a plan view showing a part of a magnetic sensor according to a fourth embodiment of the present invention.

[0049] Fig. 22 It is a plan view showing a part of a magnetic sensor according to a fifth embodiment of the present invention.

[0050] Fig.23 It is a plan view showing a magnetic sensor according to a sixth embodiment of the present invention.

[0051] Fig.24 : is a circuit diagram showing the structure of a magnetic sensor according to a sixth embodiment of the present invention. DETAILED DESCRIPTION

[0052] [First embodiment]

[0053] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. Figure 1 and Figure 2 A schematic configuration of a magnetic encoder according to a first embodiment of the present invention will be described. Figure 1 It is a perspective view showing the magnetic encoder 1 . Figure 2 1 is a front view showing the magnetic encoder 1. The magnetic encoder 1 according to the present embodiment includes a magnetic sensor 2 according to the present embodiment and a magnetic field generator 3.

[0054] The magnetic field generator 3 generates a target magnetic field MF as a magnetic field (detection target magnetic field) to be detected by the magnetic sensor 2. The target magnetic field MF includes a magnetic field component in a direction parallel to a virtual straight line. The magnetic sensor 2 and the magnetic field generator 3 are configured so that the intensity of the magnetic field component changes when the relative position of the magnetic field generator 3 relative to the magnetic sensor 2 changes. The magnetic sensor 2 detects the target magnetic field MF including the above-mentioned magnetic field component and generates at least one detection signal corresponding to the intensity of the magnetic field component.

[0055] The magnetic field generator 3 may also be a magnetic ruler in which a plurality of groups of N poles and S poles are alternately arranged in a specified direction. The magnetic ruler may be an object in which a magnetic medium such as a magnetic tape is alternately magnetized into a plurality of groups of N poles and S poles, or may be an object in which a plurality of magnets are arranged along the above-mentioned specified direction. In addition, the magnetic sensor 2 or the magnetic field generator 3 can move within a specified range along a specified direction. As the magnetic sensor 2 or the magnetic field generator 3 moves, the relative position of the magnetic field generator 3 relative to the magnetic sensor 2 changes. The specified direction may be a linear direction or a rotational direction.

[0056] In this embodiment, the magnetic field generator 3 is a linear scale having multiple sets of N poles and S poles magnetized in a straight line direction. The magnetic sensor 2 or the magnetic field generator 3 can move along the long side direction of the magnetic field generator 3. Figure 2 As shown, the distance between two adjacent N poles in the long side direction of the magnetic field generator 3 (the same as the distance between two adjacent S poles in the longitudinal direction of the magnetic field generator) is called 1 pitch, and the size of 1 pitch is represented by the symbol Lp.

[0057] Here, if Figure 1 and Figure 2 As shown in FIG. 1 , the X direction, the Y direction, and the Z direction are defined. In this embodiment, a direction parallel to the long side direction of the magnetic field generator 3 is set as the X direction. In addition, two directions perpendicular to the X direction, that is, two directions orthogonal to each other, are set as the Y direction and the Z direction. Figure 2 In the above example, the Y direction is represented as Figure 2 In addition, the direction opposite to the X direction is set as -X direction, the direction opposite to the Y direction is set as -Y direction, and the direction opposite to the Z direction is set as -Z direction.

[0058] The magnetic sensor 2 is arranged at a position separated from the magnetic field generator 3 in the Z direction. The magnetic sensor 2 is configured to detect the intensity of the magnetic field component MFx in a direction parallel to the X direction of the target magnetic field MF at a predetermined position. The intensity of the magnetic field component MFx is represented by a positive value when the direction of the magnetic field component MFx is the X direction, and is represented by a negative value when the direction of the magnetic field component MFx is the -X direction. When the magnetic sensor 2 or the magnetic field generator 3 moves in a direction parallel to the X direction, the intensity of the magnetic field component MFx changes periodically. The direction parallel to the X direction corresponds to the first direction of the present invention.

[0059] The magnetic sensor 2 also detects a noise magnetic field Mex other than the target magnetic field. The noise magnetic field Mex may include a component parallel to the X direction, a component parallel to the Y direction, and a component parallel to the Z direction. In the present embodiment, in particular, the magnetic sensor 2 detects the intensity of the component in the direction parallel to the X direction of the noise magnetic field Mex. The noise magnetic field Mex may be the same magnetic field within the moving range of the magnetic sensor 2 or the magnetic field generator 3, or may be at least one magnetic field whose direction and intensity vary according to the position within the moving range.

[0060] Next, refer to Figure 3 and Figure 4 , the magnetic sensor 2 is described in detail. Figure 3 1 is a plan view showing the magnetic sensor 2 . Figure 4 2 is a circuit diagram showing the structure of the magnetic sensor 2. Figure 4As shown, the magnetic encoder 1 further includes a detection value generating circuit 4. The detection value generating circuit 4 generates a detection value Vs having a corresponding relationship with the relative position of the magnetic field generator 3 relative to the magnetic sensor 2 based on at least one detection signal corresponding to the intensity of the magnetic field component MFx generated by the magnetic sensor 2. The detection value generating circuit 4 can be implemented by, for example, an application-specific integrated circuit (ASIC) or a microcomputer.

[0061] The magnetic sensor 2 includes a first resistor R11, a second resistor R12, a third resistor R13, and a fourth resistor R14, each of which is configured so that its resistance value changes periodically according to the change of the periodic intensity of the magnetic field component MFx. Each of the first to fourth resistors R11, R12, R21, and R22 includes a plurality of magnetoresistive elements (hereinafter referred to as MR elements) 50.

[0062] The magnetic sensor 2 further includes a first calibration resistor C11, a second calibration resistor C12, a third calibration resistor C21, and a fourth calibration resistor C22. Each of the first to fourth calibration resistors C11, C12, C21, and C22 includes a plurality of MR elements 50. The number of MR elements 50 in each of the first to fourth resistors R11, R12, R21, and R22 is preferably greater than the number of the plurality of MR elements 50 in each of the first to fourth calibration resistors C11, C12, C21, and C22.

[0063] The magnetic sensor 2 further includes a power port V1, a ground port G1, a first output port E1, and a second output port E2. A voltage of a predetermined magnitude is applied to the power port V1. The ground port G1 is grounded. The first and second output ports E1 and E2 are connected to the detection value generation circuit 4. The magnetic sensor 2 is preferably driven by a constant voltage.

[0064] The power port V1 corresponds to the first port of the present invention. The ground port G1 corresponds to the second port of the present invention. The first and second output ports E1 and E2 correspond to the third port of the present invention.

[0065] The magnetic sensor 2 generates a signal corresponding to the potential of the first output port E1 as a first detection signal S1, and generates a signal corresponding to the potential of the second output port E2 as a second detection signal S2. The detection value generation circuit 4 generates a detection value Vs based on the first and second detection signals S1 and S2. In addition, at least one of the magnetic sensor 2 and the detection value generation circuit 4 is configured to correct the amplitude, phase, and offset of each of the first and second detection signals S1 and S2.

[0066] like Figure 4As shown, the first resistor R11 and the first correction resistor C11 are connected in series between the power supply port V1 and the first output port E1. The second resistor R12 and the second correction resistor C12 are connected in series between the ground port G1 and the first output port E1. The first output port E1 is provided between the first resistor R11 and the first correction resistor C11 and the ground port G1.

[0067] In addition, if Figure 4 As shown, the third resistor R21 and the third correction resistor C21 are connected in series between the power supply port V1 and the second output port E2. The fourth resistor R22 and the fourth correction resistor C22 are connected in series between the ground port G1 and the second output port E2. The second output port E2 is provided between the third resistor R21 and the third correction resistor C21 and the ground port G1.

[0068] In addition, if Figure 4 As shown, the first resistor R11 and the second resistor R12 are connected in series via a first connection point P1 connected to the first output port E1, and the third resistor R21 and the fourth resistor R22 are connected in series via a second connection point P2 connected to the second output port E2.

[0069] The end of the first resistor R11 opposite to the first connection point P1 is connected to the first correction resistor C11. The first correction resistor C11 is connected to the power supply port V1. The above-mentioned end of the first resistor R11 is an end on the circuit diagram.

[0070] The end portion of the second resistor R12 on the opposite side to the first connection point P1 (the end portion on the circuit diagram) is connected to the second correction resistor C12. The second correction resistor C12 is connected to the ground port G1.

[0071] The end portion of the third resistor R21 opposite to the second connection point P2 (the end portion on the circuit diagram) is connected to the third correction resistor C21. The third correction resistor C21 is connected to the power supply port V1.

[0072] The end portion of the fourth resistor R22 opposite to the second connection point P2 (the end portion on the circuit diagram) is connected to the fourth correction resistor C22. The fourth correction resistor C22 is connected to the ground port G1.

[0073] Here, the resistance value of the first resistor R11 is referred to as a first resistance value, and the resistance value of the first correction resistor C11 is referred to as a second resistance value. In addition to the magnetic field component MFx, the first resistance value also changes according to the noise magnetic field Mex. The first correction resistor C11 is configured so that the change in the sum of the first resistance value and the second resistance value caused by the noise magnetic field Mex is smaller than the change in the first resistance value caused by the noise magnetic field Mex.

[0074] In addition to the magnetic field component MFx, the resistance values ​​of each of the second to fourth resistors R12, R21, and R22 also change according to the noise magnetic field Mex. The second correction resistor C12 is configured in such a way that the change in the sum of the resistances of the second resistor R12 and the second correction resistor C12 caused by the noise magnetic field Mex is smaller than the change in the resistance value of the second resistor R12 caused by the noise magnetic field Mex. The third correction resistor C21 is configured in such a way that the change in the sum of the resistances of the third resistor R21 and the third correction resistor C21 caused by the noise magnetic field Mex is smaller than the change in the resistance value of the third resistor R21 caused by the noise magnetic field Mex. The fourth correction resistor C22 is configured in such a way that the change in the sum of the resistances of the fourth resistor R22 and the fourth correction resistor C22 caused by the noise magnetic field Mex is smaller than the change in the resistance value of the fourth resistor R22 caused by the noise magnetic field Mex.

[0075] In addition, the second resistor R12 is configured so that the phase of the change in the resistance value of the second resistor R12 is different from the phase of the change in the resistance value of the first resistor R11. Similarly, the fourth resistor R22 is configured so that the phase of the change in the resistance value of the fourth resistor R22 is different from the phase of the change in the resistance value of the third resistor R21. In this embodiment, the phase difference between these resistance values ​​is equal to or approximately equal to 1 / 2 of the period of the change in the resistance value.

[0076] like Figure 3 As shown, the magnetic sensor 2 further includes a substrate 10, a power terminal 11, a ground terminal 12, a first output terminal 13, and a second output terminal 14 arranged on the substrate 10. The power terminal 11 constitutes a power port V1. The ground terminal 12 constitutes a ground port G1. The first and second output terminals 13 and 14 constitute first and second output ports E1 and E2, respectively.

[0077] like Figure 3 As shown, the first and second resistors R11 and R12 are arranged in the first region R1 on the substrate 10. The third and fourth resistors R21 and R22 are arranged in the second region R2 on the substrate 10. In the direction parallel to the X direction, at least a portion of the second region R2 is located at a different position from the first region R1. Figure 3In the example shown, a portion of the second region R2 overlaps a portion of the first region R1 .

[0078] The second region R2 may be located in the X direction or in the −X direction relative to the first region R1 . Figure 3 An example is shown in which the second region R2 is located in the X direction relative to the first region R1. In addition, the first region R1 and the second region R2 may be located at the same position with respect to the Z direction, or may be located at different positions from each other.

[0079] In addition, if Figure 3 As shown, in the direction parallel to the Y direction, the first and second resistors R11 and R12 are arranged between the third resistor R21 and the fourth resistor R22. The first calibration resistor C11 is arranged in the Y direction of the third resistor R21. The third calibration resistor C21 is arranged between the third resistor R21 and the first calibration resistor C11.

[0080] The second calibration resistor C12 is disposed in the -Y direction of the fourth resistor R22. The fourth calibration resistor C22 is disposed between the fourth resistor R22 and the second calibration resistor C12.

[0081] Next, the structures of the first to fourth resistors R11, R12, R21, and R22 are described. The first and second detection signals S1 and S2 each include an ideal component that periodically changes with a predetermined signal period in a manner that depicts an ideal sinusoidal curve (including a sine waveform and a cosine waveform). In this embodiment, the first to fourth resistors R11, R12, R21, and R22 are configured so that the phase of the ideal component of the first detection signal S1 and the phase of the ideal component of the second detection signal S2 are different from each other. Figure 2 The size Lp of one pitch shown corresponds to one period in the ideal component, that is, 360° in electrical angle.

[0082] In addition to the ideal component, the first and second detection signals S1 and S2 each include an error component corresponding to a harmonic of the ideal component. In this embodiment, the first to fourth resistors R11, R12, R21, and R22 are configured to reduce the error component.

[0083] In the following, the structures of the first to fourth resistors R11, R12, R21, and R22 are specifically described. First, the structure of the MR element 50 is described. In the present embodiment, the MR element 50 is a spin valve type MR element. The spin valve type MR element contains: a magnetization fixed layer having a magnetization with a fixed direction; a free layer having a magnetization whose direction can change according to the magnetic field component MFx; and a gap layer, which is arranged between the magnetization fixed layer and the free layer. The spin valve type MR element can be a TMR (tunnel magnetoresistance effect) element or a GMR (giant magnetoresistance effect) element. In the present embodiment, in particular, in order to reduce the size of the magnetic sensor 2, the MR element 50 is preferably a TMR element. In the TMR element, the gap layer is a tunnel barrier layer. In the GMR element, the gap layer is a non-magnetic conductive layer. In a spin valve type MR element, the resistance value changes according to the angle between the magnetization direction of the free layer and the magnetization direction of the fixed layer. When the angle is 0°, the resistance value becomes minimum, and when the angle is 180°, the resistance value becomes maximum.

[0084] exist Figure 4 In FIG. 1 , the arrows drawn in the first to fourth resistors R11, R12, R21, and R22 indicate the magnetization direction of each of the magnetization fixed layers of the plurality of MR elements 50 included in the resistors. The magnetization direction of each of the magnetization fixed layers of the plurality of MR elements 50 included in the first and third resistors R11 and R21 is the X direction. The magnetization direction of each of the magnetization fixed layers of the plurality of MR elements 50 included in the second and fourth resistors R12 and R22 is the -X direction. In this case, the magnetization direction of each of the free layers of the plurality of MR elements 50 changes on the XY plane according to the strength of the magnetic field component MFx. As a result, the potentials of the first and second output ports E1 and E2 change according to the strength of the magnetic field component MFx.

[0085] Next, the configuration of the plurality of MR elements 50 of each of the first to fourth resistors R11, R12, R21, and R22 is described. Here, a collection of more than one MR element 50 is referred to as an element group. Each of the first to fourth resistors R11, R12, R21, and R22 includes a plurality of element groups. In order to reduce the error component, the plurality of element groups are configured at predetermined intervals based on a pitch size Lp. In addition, in the following description, when the configuration of the plurality of element groups is described, the description will be based on the predetermined position of the element group. The predetermined position is, for example, the center of gravity of the element group when viewed from the Z direction.

[0086] Figure 5 is a top view showing the first resistor R11. Figure 5As shown, the first resistor R11 includes eight element groups 31, 32, 33, 34, 35, 36, 37, and 38. Each of the element groups 31 to 38 is divided into four parts. One or more MR elements 50 are configured in each part. Therefore, each element group includes four or more MR elements 50. A plurality of MR elements 50 may be connected in series within an element group. In this case, a plurality of element groups may be connected in series. Alternatively, a plurality of MR elements 50 may be connected in series regardless of the element group.

[0087] exist Figure 5 In order to reduce the error component of the third harmonic (third harmonic) equivalent to the ideal component, the error component of the fifth harmonic (fifth harmonic) equivalent to the ideal component, and the error component of the seventh harmonic (seventh harmonic) equivalent to the ideal component, element groups 31 to 38 are arranged. Figure 5 As shown, the element groups 31 to 34 are arranged in the X direction. The element group 32 is arranged at a position Lp / 10 away from the element group 31 in the X direction. The element group 33 is arranged at a position Lp / 6 away from the element group 31 in the X direction. The element group 34 is arranged at a position Lp / 10+Lp / 6 away from the element group 31 in the X direction (a position Lp / 6 away from the element group 32 in the X direction).

[0088] In addition, if Figure 5 As shown, the element groups 35 to 38 are arranged in the X direction in the -Y direction of the element groups 31 to 34. The element group 35 is arranged at a position Lp / 14 away from the element group 31 in the X direction. The element group 36 is arranged at a position Lp / 14+Lp / 10 away from the element group 31 in the X direction (a position Lp / 14 away from the element group 32 in the X direction). The element group 37 is arranged at a position Lp / 14+Lp / 6 away from the element group 31 in the X direction (a position Lp / 14 away from the element group 33 in the X direction). The element group 38 is arranged at a position Lp / 14+Lp / 10+Lp / 6 away from the element group 31 in the X direction (a position Lp / 14 away from the element group 34 in the X direction).

[0089] The configuration of the plurality of element groups for reducing the plurality of error components is not limited to Figure 5The example shown. Here, n and m are respectively set to integers greater than 1 and different from each other. For example, in the case of reducing the error component equivalent to the 2n+1 harmonic, the first element group is arranged at a position Lp / (4n+2) away in the X direction relative to the second element group. In addition, in the case of reducing the error component equivalent to the 2m+1 harmonic, the third element group is arranged at a position Lp / (4m+2) away in the X direction relative to the first element group, and the fourth element group is arranged at a position Lp / (4m+2) away in the X direction relative to the second element group. In this way, in the case of reducing the error component equivalent to multiple higher harmonics, the multiple element groups used to reduce the error component equivalent to a certain higher harmonic are respectively arranged at positions separated by a prescribed interval based on a spacing size Lp in the X direction relative to the multiple element groups used to reduce the error component equivalent to other higher harmonics.

[0090] In this embodiment, the structure and configuration of the plurality of element groups of each of the second to fourth resistors R12, R21, and R22 are the same as the structure and configuration of the plurality of element groups in the first resistor R11. That is, each of the second to fourth resistors R12, R21, and R22 further includes a plurality of element groups having Figure 5 The eight element groups 31 to 38 of the structure and positional relationship shown in FIG. 1 are shown in FIG. 2 . In addition, the element group 31 of the second resistor R12 is arranged at the same position as the element group 31 of the first resistor R11 in the X direction. The element group 31 of the third resistor R21 is arranged at a position Lp / 4 away from the element group 31 of the first resistor R11 in the X direction. The element group 31 of the fourth resistor R22 is arranged at a position Lp / 4 away from the element group 31 of the second resistor R12 in the X direction.

[0091] Through the structure of the first to fourth resistors R11, R12, R21, and R22 described above, the phase difference between the ideal component of the second detection signal S2 and the ideal component of the first detection signal S1 is an odd multiple of 1 / 4 of the specified signal period (signal period of the ideal component), and the error components of the first and second detection signals S1 and S2 are reduced.

[0092] Furthermore, the magnetization direction of the magnetization fixed layer, the positions of the first to fourth resistors R11, R12, R21, and R22, and the positions of the element groups 31 to 38 may slightly deviate from the above directions and positions from the viewpoint of the accuracy of manufacturing the MR element.

[0093] Next, the structures of the first to fourth calibration resistors C11, C12, C21, and C22 will be described. As described above, each of the first to fourth calibration resistors C11, C12, C21, and C22 includes a plurality of MR elements 50. Figure 4In FIG. 1 , arrows drawn in the first to fourth correction resistors C11 , C12 , C21 , and C22 indicate the directions of magnetization of the magnetization fixed layers of the plurality of MR elements 50 included in the resistors.

[0094] The magnetization direction of each of the plurality of MR elements 50 of the first correction resistor C11 is a second magnetization direction opposite to the first magnetization direction of each of the plurality of MR elements 50 of the first resistor R11. In the present embodiment, the first magnetization direction is the X direction and the second magnetization direction is the -X direction.

[0095] The magnetization direction of each of the plurality of MR elements 50 of the second correction resistor C12 is a fourth magnetization direction opposite to the third magnetization direction of each of the plurality of MR elements 50 of the second resistor R12. In the present embodiment, the third magnetization direction is the -X direction and the fourth magnetization direction is the X direction.

[0096] The magnetization direction of each of the plurality of MR elements 50 of the third correction resistor C21 is a sixth magnetization direction opposite to the fifth magnetization direction of each of the plurality of MR elements 50 of the third resistor R21. In the present embodiment, the fifth magnetization direction is the X direction, and the sixth magnetization direction is the -X direction.

[0097] The magnetization direction of each of the plurality of MR elements 50 of the fourth correction resistor C22 is an eighth magnetization direction opposite to the seventh magnetization direction of each of the plurality of MR elements 50 of the fourth resistor R22. In the present embodiment, the seventh magnetization direction is the -X direction and the eighth magnetization direction is the X direction.

[0098] In addition, the plurality of MR elements 50 of each of the first to fourth correction resistors C11, C12, C21, and C22 are arranged in parallel at a predetermined interval along the X direction. In the present embodiment, in particular, the first to fourth correction resistors C11, C12, C21, and C22 each have a plurality of element groups connected in series, and the plurality of element groups are arranged in parallel along the X direction.

[0099] Figure 6 FIG. 1 is a top view showing the first correction resistor C11. Figure 6 As shown, the first correction resistor C11 includes a plurality of element groups 41 arranged at predetermined intervals. Each of the plurality of element groups 41 is divided into two parts. In each part, one or more MR elements 50 are arranged. Therefore, each element group includes two or more MR elements 50.

[0100] Here, among the plurality of MR elements 50 of the first correction resistor C11, the distance from the MR element 50 located at the end in the X direction to the MR element 50 located at the end in the -X direction is referred to as the first distance. The first distance is equal to the distance from the element group 41 located at the end in the X direction to the element group 41 located at the end in the -X direction among the plurality of element groups 41 of the first correction resistor C11. The plurality of MR elements 50 are arranged so that the first distance becomes a distance corresponding to the X period of the change in the intensity of the magnetic field component MFx. The above-mentioned X is preferably a value of 1 or more and 10 or less, and more preferably a value of 1 or more and 5 or less.

[0101] By the structure of the first correction resistor C11 described above, the change in the resistance value of each of the plurality of MR elements 50 is averaged within the range of X cycles (X is the above-mentioned preferred value) of the change in the intensity of the magnetic field component MFx. Therefore, the change in the resistance value of the first correction resistor C11 caused by the magnetic field component MFx is smaller than the change in the resistance value of the first resistor R11 caused by the magnetic field component MFx.

[0102] In the present embodiment, in particular, the plurality of MR elements 50 are arranged in such a manner that the first distance becomes a distance corresponding to one cycle of the change in the intensity of the magnetic field component MFx. In this case, the change in the resistance value of the first correction resistor C11 due to the magnetic field component MFx becomes 0 or almost 0. As a result, regardless of the relative position of the magnetic field generator 3 with respect to the magnetic sensor 2, the resistance value of the first correction resistor C11 changes only due to the noise magnetic field Mex. In addition, in the present embodiment, Figure 2 The size Lp of one pitch shown corresponds to a distance corresponding to one cycle of the change in the intensity of the magnetic field component MFx.

[0103] In this embodiment, the structure and configuration of the plurality of element groups in each of the second to fourth correction resistors C12, C21, and C22 are the same as the structure and configuration of the plurality of element groups in the first correction resistor C11. That is, each of the second to fourth correction resistors C12, C21, and C22 also includes Figure 6 The second to fourth correction resistors C12, C21, and C22 each change in resistance to the magnetic field component MFx and the noise magnetic field Mex in the same manner as the resistance of the first correction resistor C11.

[0104] In addition, the change in the resistance value of the second correction resistor C12 caused by the magnetic field component MFx is smaller than the change in the resistance value of the second resistor R12 caused by the magnetic field component MFx. The change in the resistance value of the third correction resistor C21 caused by the magnetic field component MFx is smaller than the change in the resistance value of the third resistor R21 caused by the magnetic field component MFx. The change in the resistance value of the fourth correction resistor C22 caused by the magnetic field component MFx is smaller than the change in the resistance value of the fourth resistor R22 caused by the magnetic field component MFx.

[0105] Here, for each of the first to fourth calibration resistors C11, C12, C21, and C22, the element group 41 located at the end in the -X direction is referred to as a reference element group 41. The reference element group 41 of the first calibration resistor C11 is arranged at the same or substantially the same position as the element group 31 of the first resistor R11 in the X direction. The reference element group 41 of the second calibration resistor C12 is arranged at the same or substantially the same position as the element group 31 of the second resistor R12 in the X direction. The reference element group 41 of the third calibration resistor C21 is arranged at the same or substantially the same position as the element group 31 of the third resistor R21 in the X direction. The reference element group 41 of the fourth calibration resistor C22 is arranged at the same or substantially the same position as the element group 31 of the fourth resistor R22 in the X direction.

[0106] In addition, the reference element group 41 of the second calibration resistor C12 is arranged at the same position as the reference element group 41 of the first calibration resistor C11 in the X direction. The reference element group 41 of the third calibration resistor C21 is arranged at a position Lp / 4 away from the reference element group 41 of the first calibration resistor C11 in the X direction. The reference element group 41 of the fourth calibration resistor C22 is arranged at a position Lp / 4 away from the reference element group 41 of the second calibration resistor C12 in the X direction.

[0107] Furthermore, the magnetization direction of the magnetization fixed layer, the positions of the first to fourth correction resistors C11, C12, C21, and C22, and the position of the element group 41 may be slightly deviated from the above directions and positions from the viewpoint of the manufacturing accuracy of the MR element 50. Furthermore, when the first distance is equal to the size Lp of one pitch, the change in the resistance value of each of the first to fourth correction resistors C11, C12, C21, and C22 caused by the magnetic field component MFx may be slightly changed from the viewpoint of the manufacturing accuracy of the MR element, etc.

[0108] Next, refer to Figure 7 and Figure 8 First and second examples of the MR element 50 will be described. Figure 7is a perspective view showing a first example of the MR element 50. In the first example, the MR element 50 includes a stacked film 50A including a magnetization fixed layer 51, a gap layer 52, and a free layer 53 stacked in sequence in the Z direction. The planar shape of the stacked film 50A viewed from the Z direction is a square or a nearly square.

[0109] The lower surface of the stacked film 50A of the MR element 50 is electrically connected to the lower surface of the stacked film 50A of other MR elements 50 via a lower electrode (not shown), and the upper surface of the stacked film 50A of the MR element 50 is also electrically connected to the upper surface of the stacked film 50A of other MR elements 50 via an upper electrode (not shown). As a result, a plurality of MR elements 50 are connected in series. In addition, the arrangement of the layers 51 to 53 in the stacked film 50A may be different from that of the stacked film 50A. Figure 7 The configuration shown in is reversed.

[0110] The MR element 50 also includes a bias magnetic field generator 50B that generates a bias magnetic field applied to the free layer 53. The direction of the bias magnetic field is a direction that intersects with the direction parallel to the X direction. In the first example, the bias magnetic field generator 50B includes two magnets 54 and 55. The magnet 54 is arranged in the -Y direction relative to the laminated film 50A. The magnet 55 is arranged in the Y direction relative to the laminated film 50A. In particular, in the first example, the laminated film 50A and the magnets 54 and 55 are arranged at a position that intersects with a virtual plane parallel to the XY plane. In addition, in Figure 7 In FIG. 1 , arrows in the magnets 54 and 55 indicate the directions of magnetization of the magnets 54 and 55. In the first example, the direction of the bias magnetic field is the Y direction.

[0111] Figure 8 is a perspective view showing a second example of the MR element 50. The structure of the second example of the MR element 50 is the same as the structure of the first example of the MR element 50 except for the planar shape of the laminated film 50A and the positions of the magnets 54 and 55. In the second example, the magnets 54 and 55 are arranged at positions different from the laminated film 50A in the Z direction. Figure 8 In the example shown, the magnets 54 and 55 are particularly arranged in the Z direction of the laminated film 50A. The planar shape of the laminated film 50A viewed from the Z direction is a rectangular shape that is long in the Y direction. When viewed from the Z direction, the magnets 54 and 55 are arranged at positions that overlap with the laminated film 50A.

[0112] The direction of the bias magnetic field and the arrangement of the magnets 54 and 55 are not limited to Figure 7 and Figure 8For example, the direction of the bias magnetic field may be a direction inclined relative to the Y direction. In addition, the magnets 54 and 55 may be offset from each other in a direction parallel to the X direction. Other examples of the MR element 50 will be described later as modified examples.

[0113] Next, the method for generating the detection value Vs in the present embodiment will be described. The detection value generating circuit 4 generates the detection value Vs, for example, in the following manner. When the magnitude of the voltage applied to the power supply port V1 is Vdd, the detection value generating circuit 4 calculates the initial detection value, for example, by calculating atan[(S2-Vdd / 2) / (S1-Vdd / 2)] within a range of more than 0° and less than 360°. In addition, "atan" represents inverse tangent. The initial detection value may be the value of the inverse tangent itself, or may be a value obtained by adding a specified angle to the value of the inverse tangent.

[0114] When the value of the inverse tangent is 0°, for example, the position of the N pole of the magnetic field generator 3 coincides with the position of the first and second resistors R11 and R12 in the X direction. When the value of the inverse tangent is 180°, the position of the S pole of the magnetic field generator 3 coincides with the position of the first and second resistors R11 and R12 in the X direction. Therefore, the initial detection value has a corresponding relationship with the relative position (hereinafter, also referred to as relative position) of the magnetic field generator 3 with respect to the magnetic sensor 2 within one pitch.

[0115] In addition, the detection value generation circuit 4 sets the amount of one cycle of the initial detection value to 360 degrees of electrical angle, and counts the number of rotations of the electrical angle from the reference position. One rotation of the electrical angle is equivalent to the movement amount of one pitch of the relative position. The detection value generation circuit 4 generates a detection value Vs having a corresponding relationship with the relative position based on the initial detection value and the number of rotations of the electrical angle.

[0116] Next, the functions and effects of the magnetic encoder 1 and the magnetic sensor 2 involved in the present embodiment will be described. In the present embodiment, the first resistor R11 and the first correction resistor C11 are connected in series. The first resistor R11 is formed by forming a plurality of MR elements 50 as described above, and the resistance value of the first resistor R11 changes periodically according to the periodic change in the intensity of the magnetic field component MFx. The first correction resistor C11 is formed by forming a plurality of MR elements 50 as described above, and the change in the resistance value of the first correction resistor C11 caused by the magnetic field component MFx becomes 0, and only the resistance value of the first correction resistor C11 caused by the noise magnetic field Mex changes. Therefore, according to the present embodiment, the influence of the noise magnetic field Mex can be reduced.

[0117] Here, the signal equivalent to the potential at both ends of the first resistor R11 is called a first signal, the signal equivalent to the potential at both ends of the first correction resistor C11 is called a second signal, and the signal equivalent to the potential at both ends of the series circuit formed by the first resistor R11 and the first correction resistor C11 is called a third signal. 9A to 9C is an explanatory diagram schematically showing the first to third signals. 9A to 9C In FIG. 1 , the relative position of the magnetic field generator 3 relative to the magnetic sensor 2 is shown (in FIG. Figures 9A to 9C In the example, it is simply recorded as position. The changes of the first to third signals of ). Fig.9A shows the change of the first signal, Fig. 9B shows the change of the second signal, Fig. 9C The change of the third signal is shown. Figures 9A to 9C , the values ​​of the first to third signals when the direction of the magnetic field component MFx is the X direction are represented by positive values, and the values ​​of the first to third signals when the direction of the magnetic field component MFx is the -X direction are represented by negative values.

[0118] The first signal includes a main component that changes periodically according to the change in the periodic intensity of the magnetic field component MFx, and an error component that changes according to the noise magnetic field Mex. Fig.9A In FIG. 6 , symbol 61 represents the main component, symbol 62 represents the error component, and symbol 63 represents the first signal. 9A to 9C An example of a case where the direction and intensity of the noise magnetic field Mex are constant regardless of position and time is shown. Fig.9A As shown, the first signal 63 is offset due to the error component 62, ie, the noise magnetic field Mex.

[0119] In addition, if Fig.9A As shown, the error component 62 is constant and independent of position. Fig. 9B As shown, the second signal is also constant regardless of the position. However, the sign of the value of the second signal is opposite to that of the error component 62. This is because, as described above, the direction of magnetization (second magnetization direction) of the magnetization fixed layer of each of the plurality of MR elements 50 of the first correction resistor C11 is opposite to the direction of magnetization (first magnetization direction) of the magnetization fixed layer of each of the plurality of MR elements 50 of the first resistor R11. Fig. 9C As shown, in the third signal, the offset caused by the noise magnetic field Mex is eliminated. In this way, according to this embodiment, the influence of the noise magnetic field Mex on the first resistor R11 can be reduced.

[0120] The above description of the group of the first resistor R11 and the first correction resistor C11 also applies to the group of the second resistor R12 and the second correction resistor C12. According to this embodiment, the influence of the noise magnetic field Mex on the first and second resistors R11 and R12 can be reduced, and the influence of the noise magnetic field Mex on the potential appearing at the first output port E1 can be reduced.

[0121] Similarly, the above description of the group of the first resistor R11 and the first correction resistor C11 also applies to the group of the third resistor R21 and the third correction resistor C21, and the group of the fourth resistor R22 and the fourth correction resistor C22. According to this embodiment, the influence of the noise magnetic field Mex on each of the third and fourth resistors R21 and R22 can be reduced, and the influence of the noise magnetic field Mex on the potential appearing at the second output port E2 can be reduced. In addition, according to this embodiment, the influence of the noise magnetic field Mex appearing at the first and second output ports E1 and E2 can be reduced, thereby reducing the influence of the noise magnetic field Mex appearing at the first and second detection signals S1 and S2. As a result, the influence of the noise magnetic field Mex appearing in the detection value Vs can be reduced.

[0122] In addition, in this embodiment, by configuring a plurality of MR elements 50 as described above, the first to fourth resistors R11, R12, R21, R22 and the first to fourth correction resistors C11, C12, C21, C22 can be formed. Therefore, the structure of the magnetic sensor 2 is simple. As described above, according to this embodiment, the influence of the noise magnetic field can be reduced with a simple structure.

[0123] Hereinafter, the effect of the present embodiment when the intensity of the noise magnetic field Mex varies according to the position will be described with reference to the results of the simulation. First, the model of the embodiment and the model of the comparative example used in the simulation will be described. The model of the embodiment is a model of the magnetic encoder 1 involved in the present embodiment. The model of the comparative example is a model of the magnetic encoder of the comparative example which does not have the magnetic sensor 2 involved in the present embodiment but has the magnetic sensor of the comparative example. In the magnetic sensor of the comparative example, the first to fourth correction resistors C11, C12, C21, and C22 are not provided. The other structures of the magnetic encoder of the comparative example are the same as the structures of the magnetic encoder 1 involved in the present embodiment.

[0124] In the simulation, the relative position of the magnetic field generator 3 relative to the magnetic sensor 2 (hereinafter referred to as the relative position) is changed, and the detection value Vs is obtained when the noise magnetic field Mex whose strength varies according to the position is applied. The detection value Vs is obtained while being associated with the relative position. Then, the difference between the detection value Vs and the relative position associated with the detection value Vs is obtained. Hereinafter, the difference is referred to as an error. In addition, in the simulation, the offsets of the first and second detection signals S1 and S2 in the absence of the noise magnetic field Mex are set to 0.

[0125] Fig.10 : is a waveform diagram showing the waveforms of the first and second detection signals S1 and S2 in the model of the comparative example. Fig.10 In FIG. 1 , the horizontal axis represents the relative position, and the vertical axis represents the values ​​of the first and second detection signals S1 and S2, respectively. Fig.10 In FIG. 1 , symbol 71 represents the first detection signal S1, and symbol 72 represents the second detection signal S2. Fig.10 As shown, the offsets of the first and second detection signals S1 and S2 increase as the relative positions increase.

[0126] Fig.11 : is a characteristic diagram showing the errors of the model of the embodiment and the model of the comparative example. Fig.11 In , the horizontal axis represents the relative position and the vertical axis represents the error. Fig.11 In FIG. 1 , symbol 73 represents the error of the model of the embodiment, and symbol 74 represents the error of the model of the comparative example. Fig.11 As shown, the error 74 of the comparative example varies greatly, while the error 73 of the embodiment is almost 0. As can be understood from the simulation results, according to the present embodiment, the influence of the noise magnetic field Mex appearing in the detection value Vs can be reduced.

[0127] Furthermore, an example has been described so far in which each of the first to fourth correction resistors C11, C12, C21, and C22 is constructed in such a manner that the change in resistance value caused by the magnetic field component MFx is 0 and the change in resistance value is caused only by the noise magnetic field Mex. Here, the resistance value of the resistor is referred to as the first resistance value, and the resistance value of the correction resistor directly connected to the resistor is referred to as the second resistance value. Without being limited to the above case, if the correction resistor is constructed in such a manner that the change in the sum of the first resistance value and the second resistance value caused by the noise magnetic field Mex is smaller than the change in the first resistance value caused by the noise magnetic field Mex, the same effect as the above effect can be obtained. That is, if the correction resistor is constructed in such a manner that the change in the sum of the first resistance value and the second resistance value caused by the noise magnetic field Mex becomes smaller, then as referred to Fig.9A and Fig. 9CAs described above, the signal (third signal) corresponding to the potential at both ends of the series circuit composed of the resistor and the correction resistor has a smaller offset caused by the noise magnetic field Mex than the signal (first signal) corresponding to the potential at both ends of the resistor. As a result, the influence of the noise magnetic field Mex on the resistor can be reduced, and the influence of the noise magnetic field Mex appearing at the potential of the output port can be reduced.

[0128] In addition, in this embodiment, the first to fourth correction resistors C11, C12, C21, and C22 are each configured so that a change in the second resistance value caused by the magnetic field component MFx is smaller than a change in the first resistance value caused by the magnetic field component MFx, thereby preventing the first signal (see Fig.9A ) relative to the third signal (reference Fig. 9C As a result, according to the present embodiment, it is possible to prevent the sensitivity of the magnetic sensor 2 to the magnetic field component MFx from being reduced.

[0129] In addition, in the present embodiment, the number of MR elements 50 of each of the first to fourth resistors R11, R12, R21, and R22 is greater than the number of MR elements 50 of each of the first to fourth correction resistors C11, C12, C21, and C22. Thus, according to the present embodiment, it is possible to prevent the sensitivity of the magnetic sensor 2 to the magnetic field component MFx from being reduced. In addition, according to the present embodiment, it is possible to suppress an increase in the resistance value of the half-bridge circuit composed of the first and second resistors R11, R12 and the first and second correction resistors C11, C12, and an increase in the resistance value of the half-bridge circuit composed of the third and fourth resistors R21, R22 and the third and fourth correction resistors C21, C22.

[0130] In addition, in this embodiment, as described above, the first to fourth resistors R11, R12, R21, and R22 are configured so as to reduce the error component of the harmonics corresponding to the ideal component. Therefore, according to this embodiment, the detection accuracy of the relative position can be improved.

[0131] However, in the present embodiment, the magnetic sensor 2 is preferably driven by a constant voltage. It is known that in the case of constant voltage drive, the potential of the first output port E1 (the first detection signal S1) is obtained by the resistance values ​​of the first and second resistors R11 and R12 and the magnitude of the voltage applied to the power supply port V1. Similarly, it is known that in the case of constant current drive, the potential of the first output port E1 (the first detection signal S1) is obtained by the resistance values ​​of the first to fourth resistors R11, R12, R21, and R22 and the current of the constant current drive.

[0132] Here, the following case is considered: the signal corresponding to the potential at both ends of an arbitrary MR element 50 includes an ideal component that changes periodically, an error component corresponding to an even-order harmonic of the ideal component, and an error component corresponding to an odd-order harmonic of the ideal component in a manner that draws an ideal sine curve; the first to fourth resistors R11, R12, R21, and R22 are configured in a manner that reduces the error component of the odd-order harmonic of the first and second detection signals S1 and S2. In this case, in the case of constant voltage driving, an error component corresponding to an even-order harmonic component is not generated in the first detection signal S1. However, in the case of constant current driving, an error component corresponding to an even-order harmonic component is generated in the first detection signal S1. Therefore, in the case of constant current driving, the first to fourth resistors R11, R12, R21, R22 are configured in such a way that the error component corresponding to the component of the odd-order harmonic of the first detection signal S1 is reduced, and on this basis, it is necessary to configure the first to fourth resistors R11, R12, R21, R22 so that the error component corresponding to the component of the even-order harmonic of the first detection signal S1 is reduced. From this point of view, the magnetic sensor 2 is preferably driven by a constant voltage.

[0133] The above description about the first detection signal S1 is also applicable to the second detection signal S2.

[0134] Next, we will refer to Fig.12 and Fig.13 , a lens position detection device (hereinafter simply referred to as a position detection device) involved in this embodiment is described. Fig.12 It is a perspective view showing a lens module including the position detection device according to the present embodiment. Fig.13 It is a perspective view showing the position detection device according to the present embodiment.

[0135] Fig.12 The lens module 300 shown is an object constituting a part of a camera for a smartphone, for example, and is used in combination with an image sensor 310 using a CMOS sensor or the like. Fig.12 In the example shown, the lens module 300 includes a triangular prism 302 and three lenses 303A, 303B, and 303C disposed between the image sensor 310 and the prism 302. At least one of the lenses 303A, 303B, and 303C is moved by a driving device (not shown) so as to be able to perform at least one of focusing and zooming.

[0136] Fig.13The lens module 300 further includes a lens holder 304 and a shaft 305 for holding the lens 303. In the lens module 300, the position of the lens 303 can be changed in the direction of the optical axis of the lens 303 by the lens holder 304, the shaft 305 and a driving device not shown. Fig.13 , the arrow with symbol D indicates the moving direction of the lens 303.

[0137] The lens module 300 further includes a position detection device 301 for detecting the position of a variable position lens 303. The position detection device 301 is used to detect the position of the lens 303 when focusing or zooming.

[0138] The position detection device 301 is a magnetic position detection device, and includes the magnetic sensor 2 involved in this embodiment and the magnetic field generator 3 of this embodiment. In the lens module 300, the magnetic sensor 2 and the magnetic field generator 3 are arranged such that when the position of the lens 303 changes along the moving direction D, the magnetic field component MFx (refer to Figure 2 ) changes in intensity. Specifically, the magnetic sensor 2 is fixed, and the magnetic field generator 3 is configured to be movable in a moving direction D together with the lens 303. The moving direction D is parallel to Figure 1 and Figure 2 Thus, when the position of the lens 303 changes, the relative position of the magnetic field generator 3 with respect to the magnetic sensor 2 changes, and as a result, the intensity of the magnetic field component MFx changes.

[0139] The position detection device 301 further includes a detection value generation circuit 4 according to this embodiment (see Figure 4 ). In the position detection device 301, a detection value Vs corresponding to the position of the lens 303 is generated based on the first and second detection signals S1 and S2 generated by the magnetic sensor 2. In addition, the position of the lens 303 corresponds to the relative position of the magnetic field generator 3 with respect to the magnetic sensor 2. The method for generating the detection value Vs in the position detection device 301 is the same as the method for generating the detection value Vs described above.

[0140] [Modifications]

[0141] Next, first to fifth modified examples of the MR element 50 of the present embodiment will be described. Fig.14 A first modification of the MR element 50 will be described. The structure of the first modification of the MR element 50 is basically the same as that of Figure 7 The first example of the MR element 50 shown is the same. However, in the first modification, the planar shape of the stacked film 50A viewed from the Z direction is circular or nearly circular.

[0142] Next, refer to Fig.15 The second modification of the MR element 50 is described. The second modification is different from the first modification in the following aspects. In the second modification, the bias magnetic field generator 50B is not provided. In addition, in the second modification, the planar shape of the stacked film 50A observed from the Z direction is an ellipse whose long axis direction intersects with the parallel direction of the X direction. The free layer 53 of the MR element 50 has a shape magnetic anisotropy in which the direction of the easy magnetization axis is oriented in a direction intersecting with the X direction. Fig.15 In the example shown, the easy magnetization axis direction is parallel to the Y direction. Alternatively, the easy magnetization axis direction may be inclined with respect to the Y direction.

[0143] Next, refer to Fig.16 A third variation of the MR element 50 is described. The third variation is different from the second variation in the following respects. In the third variation, the MR element 50 includes two stacked films 50A1 and 50A2 instead of the stacked film 50A in the second variation. The structure and shape of each of the stacked films 50A1 and 50A2 are the same as the structure and shape of the stacked film 50A in the second variation. The stacked films 50A1 and 50A2 are connected in parallel through electrodes to form a stacked film pair. The stacked film pair is connected in series with the stacked film pair of another MR element 50 through electrodes. For example, the lower surface of each of the stacked films 50A1 and 50A2 is electrically connected to the lower surface of the stacked films 50A1 and 50A2 of another MR element 50 through a lower electrode not shown in the figure, and the upper surface of each of the stacked films 50A1 and 50A2 is electrically connected to the upper surface of each of the stacked films 50A1 and 50A2 of another MR element 50 through an upper electrode not shown in the figure.

[0144] Next, refer to Fig.17 The fourth modification of the MR element 50 is described. The fourth modification is different from the second modification in the following aspects. The planar shape of the stacked film 50A observed from the Z direction is a rectangle whose length direction intersects with the parallel direction of the X direction. The free layer 53 of the MR element 50 has a shape magnetic anisotropy in which the direction of the easy magnetization axis is oriented in a direction intersecting with the X direction. Fig.17 In the example shown, the easy magnetization axis direction is parallel to the Y direction. The easy magnetization axis direction may be inclined with respect to the Y direction.

[0145] Next, refer to Fig.18The fifth modification of the MR element 50 is described. In the fifth modification, the stacked films 50A1 and 50A2 in the third modification are replaced with two stacked films 50A3 and 50A4 having the same structure and shape as the stacked film 50A in the fourth modification. The stacked films 50A3 and 50A4 are connected in parallel via electrodes to form a stacked film pair. The stacked film pair is connected in series with the stacked film pair of another MR element 50 via electrodes. In addition, in the fifth modification, the bias magnetic field generator 50B described above is provided. Figure 8 As in the second example of the MR element 50 shown, the magnets 54 and 55 of the bias magnetic field generator 50B are arranged at positions different from the stacked films 50A3 and 50A4 in the Z direction. In addition, when viewed from the Z direction, the magnets 54 and 55 are arranged at positions overlapping the stacked films 50A3 and 50A4.

[0146] [Second Embodiment]

[0147] Next, refer to Fig.19 A second embodiment of the present invention will be described. Fig.19 1 is a plan view showing the magnetic sensor according to the present embodiment.

[0148] In this embodiment, the arrangement of the third and fourth calibration resistors C21 and C22 is different from that in the first embodiment. That is, the reference element group 41 (see Figure 6 ) are arranged in the X direction in the reference element group 41 of the first correction resistor C11 and the element group 31 of the first resistor R11 (refer to Figure 5 In addition, the reference element group 41 of the fourth calibration resistor C22 is arranged at the same or substantially the same position as the reference element group 41 of the second calibration resistor C12 and the element group 31 of the second resistor R12 in the X direction.

[0149] In the present embodiment, the first to fourth correction resistors C11, C12, C21, and C22 are arranged at the same position or substantially the same position in the X direction. Therefore, according to the present embodiment, the size of the magnetic sensor 2 in the X direction can be reduced.

[0150] The other structures, functions and effects of this embodiment are the same as those of the first embodiment.

[0151] [Third Embodiment]

[0152] Next, refer to Fig. 20 A third embodiment of the present invention will be described. Fig. 20 1 is a plan view showing the magnetic sensor according to the present embodiment.

[0153] The magnetic sensor 2 according to the present embodiment is different from the first embodiment in the following respects. In the present embodiment, the element group 31 (see Figure 5 ) is arranged at a position Lp / 2 away from the element group 31 of the first resistor R11 in the X direction. In addition, the element group 31 of the fourth resistor R22 is arranged at a position Lp / 2 away from the element group 31 of the third resistor R21 in the X direction.

[0154] In addition, in the present embodiment, the magnetization direction of each of the plurality of MR elements 50 of the second and fourth resistors R12 and R22 is the X direction. That is, the magnetization direction of each of the plurality of MR elements 50 of the second and fourth resistors R12 and R22 is the same as the magnetization direction of each of the plurality of MR elements 50 of the first and third resistors R11 and R21. In addition, in the present embodiment, the magnetization direction of each of the plurality of MR elements 50 of the second and fourth correction resistors C12 and C22 is the -X direction.

[0155] In addition, the arrangement of the third and fourth correction resistors C21 and C22 may be the same as that of the second embodiment. The other structures, functions and effects of this embodiment are the same as those of the first or second embodiment.

[0156] [Fourth Embodiment]

[0157] Next, refer to Fig.21 A fourth embodiment of the present invention will be described. Fig.21 1 is a plan view showing the magnetic sensor according to the present embodiment.

[0158] In this embodiment, the structures of the first to fourth correction resistors C11, C12, C21, and C22 are different from those in the first embodiment. That is, in this embodiment, the plurality of element groups 41 of the first correction resistor C11 and the plurality of element groups 41 of the third correction resistor C21 are arranged alternately in parallel along the X direction. Fig.21 In FIG. 1 , for easy understanding, the plurality of element groups 41 of the third correction resistor C21 are hatched.

[0159] Similarly, the plurality of element groups 41 of the second correction resistor C12 and the plurality of element groups 41 of the fourth correction resistor C22 are arranged alternately in parallel along the X direction. Fig.21 In FIG. 1 , for easy understanding, the plurality of element groups 41 of the fourth correction resistor C22 are hatched.

[0160] According to the present embodiment, by configuring the first to fourth correction resistors C11 , C12 , C21 , and C22 as described above, it is possible to reduce the size of the magnetic sensor 2 in the Y direction.

[0161] In addition, the structures of the second and fourth resistors R12 and R22 and the structures of the second and fourth correction resistors C12 and C22 may be the same as those of the third embodiment. Other structures, functions and effects in this embodiment are the same as those in the first or third embodiment.

[0162] [Fifth Embodiment]

[0163] Next, refer to Fig. 22 A fifth embodiment of the present invention will be described. Fig. 22 1 is a plan view showing the magnetic sensor according to the present embodiment.

[0164] In this embodiment, the arrangement of the first to fourth correction resistors C11, C12, C21, and C22 is different from that of the first embodiment. That is, in this embodiment, the first correction resistor C11 is arranged in the -Y direction of the fourth resistor R22. The third correction resistor C21 is arranged between the fourth resistor R22 and the first correction resistor C11.

[0165] The second calibration resistor C12 is arranged in the Y direction of the third resistor R21. The fourth calibration resistor C22 is arranged between the third resistor R21 and the second calibration resistor C12.

[0166] exist Fig. 22 In FIG. 1 , arrows near the first to fourth resistors R11, R12, R21, R22 and the first to fourth correction resistors C11, C12, C21, C22 indicate the magnetization directions of the magnetization fixed layers of the plurality of MR elements 50 included in the resistors. In the present embodiment, the first resistor R11, the third resistor R21, the second correction resistor C12, and the fourth correction resistor C22 whose magnetization directions of the magnetization fixed layers of the MR elements 50 are in the X direction are arranged on the side of the substrate 10 that is biased toward the Y direction; the second resistor R12, the fourth resistor R22, the first correction resistor C11, and the third correction resistor C21 whose magnetization directions of the magnetization fixed layers of the MR elements 50 are in the -X direction are arranged on the side of the substrate 10 that is biased toward the -Y direction.

[0167] In addition, the configurations other than the first to fourth correction resistors C11, C12, C21, and C22 in the Y direction and the configurations of the first to fourth resistors R11, R12, R21, and R22 may be the same as those in any of the second to fourth embodiments. The other structures, functions, and effects in this embodiment are the same as those in any of the first to fourth embodiments.

[0168] [Sixth Embodiment]

[0169] Next, refer to Fig.23 and Fig.24 A sixth embodiment of the present invention will be described. Fig.23 1 is a plan view showing the magnetic sensor according to the present embodiment. Fig.24 : is a circuit diagram showing the structure of the magnetic sensor according to the present embodiment.

[0170] The magnetic sensor 102 involved in this embodiment includes: a first resistor R211, a second resistor R212, a third resistor R221, a fourth resistor R222, a fifth resistor R231, a sixth resistor R232, a seventh resistor R241, and an eighth resistor R242, wherein the above resistors have their resistance values ​​respectively according to the magnetic field component MFx (refer to Figure 2 ) is periodically changed by the change of the periodic strength of the resistor. The first to eighth resistors R211, R212, R221, R222, R231, R232, R241, and R242 each include a plurality of MR elements 50. In addition, each of the first to eighth resistors R211, R212, R221, R222, R231, R232, R241, and R242 includes the MR elements 50 of the first embodiment. Figure 5 The structure and positional relationship of eight component groups 31-38 are shown.

[0171] The magnetic sensor 102 further includes a first calibration resistor C211, a second calibration resistor C212, a third calibration resistor C221, a fourth calibration resistor C222, a fifth calibration resistor C231, a sixth calibration resistor C232, a seventh calibration resistor C241, and an eighth calibration resistor C242. Each of the first to eighth calibration resistors C211, C212, C221, C222, C231, C232, C241, and C242 includes a plurality of MR elements 50. In addition, each of the first to eighth calibration resistors C211, C212, C221, C222, C231, C232, C241, and C242 includes the MR elements 50 in the first embodiment. Figure 6 A plurality of component groups 41 having the structure and positional relationship shown.

[0172] The magnetic sensor 102 also includes two power supply ports V11 and V12, two ground ports G11 and G12, a first output port E11, a second output port E12, a third output port E21, a fourth output port E22, and two differential detectors 21 and 22. A voltage of a predetermined magnitude is applied to the power supply ports V11 and V12, respectively. The ground ports G11 and G12 are grounded. The magnetic sensor 102 can be driven by a constant voltage or a constant current.

[0173] The power ports V11 and V12 correspond to the first port of the present invention. The ground ports G11 and G12 correspond to the second port of the present invention. The first to fourth output ports E11, E12, E21, and E22 correspond to the third port of the present invention.

[0174] The difference detector 21 outputs a signal corresponding to the potential difference between the first and third output ports E11 and E21 as a first detection signal S11. The difference detector 22 outputs a signal corresponding to the potential difference between the second and fourth output ports E12 and E22 as a second detection signal S12.

[0175] The difference detectors 21 and 22 are connected to the detection value generation circuit 4 (see Figure 4 ). In the present embodiment, the detection value generating circuit 4 generates the detection value Vs based on the first and second detection signals S11 and S12. In addition, at least one of the magnetic sensor 102 and the detection value generating circuit 4 is configured in such a way that the amplitude, phase and offset of each of the first and second detection signals S11 and S12 can be corrected. The method for generating the detection value Vs is the same as the first embodiment except that the first and second detection signals S11 and S12 are used instead of the first and second detection signals S1 and S2.

[0176] like Fig.24 As shown, the first resistor R211 and the first correction resistor C211 are connected in series between the power port V11 and the first output port E11. The second resistor R212 and the second correction resistor C212 are connected in series between the ground port G11 and the first output port E11. The third resistor R221 and the third correction resistor C221 are connected in series between the power port V11 and the second output port E12. The fourth resistor R222 and the fourth correction resistor C222 are connected in series between the ground port G11 and the second output port E12.

[0177] The fifth resistor R231 and the fifth correction resistor C231 are connected in series between the power supply port V12 and the third output port E21. The sixth resistor R232 and the sixth correction resistor C232 are connected in series between the ground port G12 and the third output port E21. The seventh resistor R241 and the seventh correction resistor C241 are connected in series between the power supply port V12 and the fourth output port E22. The eighth resistor R242 and the eighth correction resistor C242 are connected in series between the ground port G12 and the fourth output port E22.

[0178] In addition, if Fig.24 As shown, the first resistor R211 and the second resistor R212 are connected in series via the first connection point P11 connected to the first output port E11. The third resistor R221 and the fourth resistor R222 are connected in series via the second connection point P12 connected to the second output port E12. The fifth resistor R231 and the sixth resistor R232 are connected in series via the third connection point P21 connected to the third output port E21. The seventh resistor R241 and the eighth resistor R242 are connected in series via the fourth connection point P22 connected to the fourth output port E22.

[0179] The end of the first resistor R211 opposite to the first connection point P11 (the end on the circuit diagram) is connected to the first correction resistor C211. The first correction resistor C211 is connected to the power supply port V11.

[0180] The end of the second resistor R212 opposite to the first connection point P11 (the end on the circuit diagram) is connected to the second correction resistor C212. The second correction resistor C212 is connected to the ground port G11.

[0181] The end portion (end portion on the circuit diagram) of the third resistor R221 opposite to the second connection point P12 is connected to the third correction resistor C221. The third correction resistor C221 is connected to the power supply port V11.

[0182] The end of the fourth resistor R222 opposite to the second connection point P12 (the end on the circuit diagram) is connected to the fourth correction resistor C222. The fourth correction resistor C222 is connected to the ground port G11.

[0183] The end of the fifth resistor R231 opposite to the third connection point P21 (the end on the circuit diagram) is connected to the fifth correction resistor C231. The fifth correction resistor C231 is connected to the power supply port V12.

[0184] The end of the sixth resistor R232 opposite to the third connection point P21 (the end on the circuit diagram) is connected to the sixth correction resistor C232. The sixth correction resistor C232 is connected to the ground port G12.

[0185] The end of the seventh resistor R241 opposite to the fourth connection point P22 (the end on the circuit diagram) is connected to the seventh correction resistor C241. The seventh correction resistor C241 is connected to the power supply port V12.

[0186] The end of the eighth resistor R242 opposite to the fourth connection point P22 (the end on the circuit diagram) is connected to the eighth correction resistor C242. The eighth correction resistor C242 is connected to the ground port G12.

[0187] like Fig.23 As shown, the magnetic sensor 102 further includes a substrate 110, two power terminals 111 and 112 arranged on the substrate 110, two ground terminals 113 and 114, a first output terminal 115, a second output terminal 116, a third output terminal 117, and a fourth output terminal 118. The power terminals 111 and 112 constitute power ports V11 and V12, respectively. The ground terminals 113 and 114 constitute ground ports G11 and G12, respectively. The first to fourth output terminals 115, 116, 117, and 118 constitute first to fourth output ports E11, E12, E21, and E22, respectively.

[0188] Here, if Fig.23 As shown, the magnetic sensor 102 is divided into a first part 102A and a second part 102B. Fig.23 , the boundary between the first part 102A and the second part 102B is shown by a dotted line. The second part 102B is located in the Y direction relative to the first part 102A. The first part 102A includes the first to fourth resistors R211, R212, R221, R222, the first to fourth calibration resistors C211, C212, C221, C222, the power terminal 111, the ground terminal 113, etc., and the first and second output terminals 115 and 116. The second part 102B includes the fifth to eighth resistors R231, R232, R241, R242, the fifth to eighth calibration resistors C231, C232, C241, C242, the power terminal 112, the ground terminal 114, and the fourth output terminals 117 and 118.

[0189] The configurations of the first to fourth resistors R211, R212, R221, R222 and the first to fourth correction resistors C211, C212, C221, C222 in the first portion 102A are the same as the configurations of the first to fourth resistors R11, R12, R21, R22 and the first to fourth correction resistors C11, C12, C21, C22 in the first embodiment. In addition, the configurations of the fifth to eighth resistors R231, R232, R241, R242 and the fifth to eighth correction resistors C231, C232, C241, C242 in the second portion 102B are also the same as the configurations of the first to fourth resistors R11, R12, R21, R22 and the first to fourth correction resistors C11, C12, C21, C22 in the first embodiment. In this embodiment, the fifth and sixth resistors R231 and R232 are arranged at the same positions as the first and second resistors R211 and R212 in the X direction. In addition, the seventh and eighth resistors R241 and R242 are arranged at the same positions as the third and fourth resistors R221 and R222 in the X direction.

[0190] Through the structure of the above-mentioned first to eighth resistors R211, R212, R221, R222, R231, R232, R241, and R242, the phase difference between the ideal component of the second detection signal S12 and the ideal component of the first detection signal S11 is an odd multiple of 1 / 4 of the specified signal period (signal period of the ideal component).

[0191] In addition, the structures of the first to fourth resistors R211, R212, R221, R222 and the first to fourth correction resistors C211, C212, C221, C222, and the structures of the fifth to eighth resistors R231, R232, R241, R242 and the fifth to eighth correction resistors C231, C232, C241, C242 may be the same as the structures of any one of the first to fourth resistors R11, R12, R21, R22 and the first to fourth correction resistors C11, C12, C21, C22 in the second to fifth embodiments. Other structures, functions and effects in this embodiment are the same as those in any one of the first to fifth embodiments.

[0192] In addition, the present invention is not limited to the above-mentioned embodiments, and various changes can be made. For example, the first to fourth correction resistors C11, C12, C21, and C22 can be arranged between the first resistor R11 and the second resistor R12. Alternatively, the first correction resistor C11 can also be arranged between the first resistor R11 and the third resistor R21, and the second correction resistor C12 can also be arranged between the second resistor R12 and the fourth resistor R22.

[0193] In addition, the magnetic sensor of the present invention may be provided with a first and a second common correction resistor to replace the first to fourth correction resistors C11, C12, C21, C22. The structures of the first and second common correction resistors are the same as the structures of the first to fourth correction resistors C11, C12, C21, C22. In the magnetic sensor, one end of the first common correction resistor is connected to the power supply port V1. At the other end of the first common correction resistor, the end of the first resistor R11 on the opposite side of the first connection point P1 and the end of the third resistor R21 on the opposite side of the second connection point P2 are connected. In addition, one end of the second common correction resistor is connected to the ground port G1. At the other end of the second common correction resistor, the end of the second resistor R12 on the opposite side of the first connection point P1 and the end of the fourth resistor R22 on the opposite side of the second connection point P2 are connected.

[0194] Furthermore, the number and arrangement of the MR elements 50 are not limited to the examples shown in the respective embodiments, and may be arbitrary as long as the requirements of the claims are satisfied.

[0195] In addition, the plurality of MR elements 50 of the first resistor R11 and the plurality of MR elements 50 of the second resistor R12 may be arranged at symmetrical positions centered on a virtual straight line parallel to the X direction. In addition, the plurality of MR elements 50 of the third resistor R21 and the plurality of MR elements 50 of the fourth resistor R22 may be arranged at symmetrical positions centered on the virtual straight line.

[0196] Alternatively, the magnetic field generator 3 may be a rotating scale having a plurality of sets of N poles and S poles magnetized in the rotation direction. The rotating scale may be a ring magnet or a magnetic medium such as a magnetic tape fixed to a ring or a disk.

[0197] In the sixth embodiment, the first part 102A and the second part 102B may be separated. In the sixth embodiment, the resistors R211, R212, R231, and R232 may form a first Wheatstone bridge circuit, and the resistors R221, R222, R241, and R242 may form a second Wheatstone bridge circuit. In this case, the first and second Wheatstone bridge circuits may be driven by a constant voltage or a constant current.

[0198] As is apparent from the above description, the present invention can be implemented in various forms and modifications. Therefore, within the scope of the equivalents of the claims, the present invention can be implemented even in forms other than the best form described above.

Claims

1. A magnetic sensor, characterized in that: A magnetic sensor for detecting a target magnetic field including a magnetic field component in a first direction and a noise magnetic field other than the target magnetic field. have: a first resistor having a first resistance value; A first calibration resistor having a second resistance value; First port; and Second port, The first resistor and the first correction resistor are connected in series between the first port and the second port, The first resistor is configured so that the first resistance value changes periodically according to changes in the periodic intensity of the magnetic field component. The first correction resistor is configured so that a change in the sum of the first resistance value and the second resistance value caused by the noise magnetic field is smaller than a change in the first resistance value caused by the noise magnetic field. The first resistor and the first correction resistor each include a plurality of magnetoresistive effect elements. Each of the plurality of magnetoresistive effect elements includes: a fixed magnetization layer having magnetization with a fixed direction; a free layer having magnetization with a direction that can be changed according to the direction of the magnetic field component and the intensity of the magnetic field component; and a gap layer disposed between the magnetization fixed layer and the free layer, The direction of magnetization of the magnetization fixed layer of each of the plurality of magnetoresistance effect elements of the first resistor is a first magnetization direction, The magnetization direction of the magnetization fixed layer of each of the plurality of magnetoresistive effect elements of the first correction resistor is a second magnetization direction opposite to the first magnetization direction.

2. The magnetic sensor according to claim 1, characterized in that: The first correction resistor is configured such that a change in the second resistance value caused by the magnetic field component is smaller than a change in the first resistance value caused by the magnetic field component.

3. The magnetic sensor according to claim 2, characterized in that: The first correction resistor is configured so that a change in the second resistance value caused by the magnetic field component becomes zero.

4. The magnetic sensor according to claim 1, characterized in that: The plurality of magnetoresistive effect elements of the first correction resistor are arranged in a manner aligned along the first direction at predetermined intervals. Among the multiple magnetoresistance elements of the first correction resistor, the distance from the magnetoresistance element located at one end in the first direction to the magnetoresistance element located at the other end in the first direction is a distance equivalent to 1 to 10 cycles of the change in the intensity of the magnetic field component.

5. The magnetic sensor according to claim 1, characterized in that: The number of the plurality of magnetoresistive effect elements of the first resistor is equal to or greater than the number of the plurality of magnetoresistive effect elements of the first correction resistor.

6. The magnetic sensor according to claim 1, characterized in that: Each of the plurality of magnetoresistive effect elements further includes a bias magnetic field generator that generates a bias magnetic field in a direction intersecting the first direction and applied to the free layer.

7. The magnetic sensor according to claim 1, characterized in that: The free layer has shape magnetic anisotropy in which the easy magnetization axis direction is oriented in a direction intersecting the first direction.

8. The magnetic sensor according to claim 1, characterized in that: The gap layer is a tunnel barrier layer.

9. The magnetic sensor according to claim 1, characterized in that: Also available: a second resistor having a third resistance value; a second correction resistor having a fourth resistance value; and a third port provided between the first resistor and the first calibration resistor and the second port, The second resistor and the second correction resistor are connected in series between the second port and the third port. The second resistor is configured such that the third resistance value changes periodically according to the change in the periodic intensity of the magnetic field component, and the phase of the change in the third resistance value is different from the phase of the change in the first resistance value. The second correction resistor is configured so that a change in the sum of the third resistance value and the fourth resistance value caused by the noise magnetic field is smaller than a change in the third resistance value caused by the noise magnetic field.

10. The magnetic sensor according to claim 1, characterized in that: The first port is a power port to which a voltage of a predetermined magnitude is applied, The second port is a ground port connected to a ground line.

11. A magnetic encoder, characterized in that: have: The magnetic sensor according to claim 1; and a magnetic field generator for generating a magnetic field of the object, The magnetic sensor and the magnetic field generator are configured such that the intensity of the magnetic field component changes when the relative position of the magnetic field generator with respect to the magnetic sensor changes.

12. The magnetic encoder according to claim 11, characterized in that: It also has a detection value generating circuit, The magnetic sensor generates at least one detection signal corresponding to the magnetic field component. The detection value generation circuit generates a detection value corresponding to a relative position of the magnetic field generator with respect to the magnetic sensor based on the at least one detection signal.

13. The magnetic encoder according to claim 12, characterized in that: The magnetic field generator is a magnetic scale having a plurality of groups of N poles and S poles arranged alternately in a specified direction. The at least one detection signal includes an ideal component that changes periodically in a manner that draws an ideal sine curve, and an error component that corresponds to a higher harmonic of the ideal component. The first resistor is configured in such a manner that the error component is reduced.

14. A lens position detection device, characterized in that: A lens position detection device for detecting the position of a lens whose position can be changed. have: The magnetic sensor according to claim 1; and a magnetic field generator for generating a magnetic field of the object, The lens is configured to be movable in the first direction. The magnetic sensor and the magnetic field generator are configured so that the intensity of the magnetic field component changes when the position of the lens changes.

15. The lens position detection device according to claim 14, characterized in that: It also has a detection value generating circuit, The magnetic sensor generates at least one detection signal corresponding to the magnetic field component. The detection value generation circuit generates a detection value corresponding to the position of the lens based on the at least one detection signal.

16. The lens position detection device according to claim 15, characterized in that: The magnetic field generator is a magnetic scale having a plurality of groups of N poles and S poles arranged alternately in a specified direction. The at least one detection signal includes an ideal component that changes periodically in a manner that draws an ideal sine curve, and an error component that corresponds to a higher harmonic of the ideal component. The first resistor is configured in such a manner that the error component is reduced.