The present invention relates to an angle detection method and an angle detection device.
Conventionally, a configuration including an absolute angle position sensor such as an optical encoder and a resolver is known as a motor capable of accurately controlling a rotational position. However, the absolute angle position sensor is large in size and high in cost. Therefore, conventionally, there is a position estimation method of estimating a rotational position of a motor using three inexpensive and small magnetic sensors without using an absolute angle position sensor.
In the conventional position estimation method, the mechanical angle of the rotation shaft can be estimated with high accuracy using three inexpensive and small magnetic sensors, but higher estimation accuracy is sometimes required from the market.
One aspect of an exemplary angle detection method of the present invention is an angle detection method for detecting a mechanical angle of a rotation shaft, the angle detection method including: acquiring signals output from three magnetic sensors that detect a change in magnetic flux due to rotation of the rotation shaft as sensor signals, the three sensor signals having a phase difference of 120° in an electrical angle; extracting an intersection point at which two sensor signals among the three sensor signals intersect with each other and a zero-cross point at which each of the three sensor signals intersects with a reference signal level over one mechanical angle cycle; generating a linear function θ(Δx) representing a straight line connecting the intersection point and the zero-cross point adjacent to each other, wherein Δx is a length from a start point of the straight line to an any point on the straight line, and θ is a mechanical angle corresponding to an any point on the straight line; searching, as a maximum error point, a point at which an error between a mechanical angle θ calculated based on the linear function θ(Δx) and a mechanical angle θe acquired from an encoder installed on the rotation shaft is a maximum value among points on the straight line, and acquiring a length from a start point of the straight line to the maximum error point as Δx1; calculating a first curve based on an origin, a vertex, and a first control point among points in a two-axis coordinate system with the Δx as a horizontal axis and the error as a vertical axis, wherein the origin is a point at which the Δx and the error are zero, the vertex is a point at which the Δx is the Δx1 and the error is the maximum value, and the first control point is a point at which the Δx is a value between zero and Δx1 and the error is the maximum value; correcting, based on the first curve, a mechanical angle θ calculated based on the linear function θ(Δx) for a point included between a start point of the straight line and the maximum error point among a plurality of points on the straight line; obtaining a maximum error between a mechanical angle θ corrected in the correcting and a mechanical angle θe as a first maximum error; performing returning to the calculating a predetermined number of times after changing a value of Δx of the first control point in a direction in which the first maximum error decreases; calculating a second curve based on the vertex, an end point, and a second control point among points in the two-axis coordinate system, wherein the end point is a point at which the Δx corresponds to a maximum length Δxm of the straight line and the error is zero, and the second control point is a point at which the Δx is a value between Δx1 and Δxm and the error is the maximum value; correcting, based on the second curve, a mechanical angle θ calculated based on the linear function θ(Δx) for a point included between an end point of the straight line and the maximum error point among a plurality of points on the straight line; obtaining a maximum error between a mechanical angle θ corrected in the correcting and the mechanical angle θe as a second maximum error; performing returning to the calculating a predetermined number of times after changing the value of Δx of the second control point in a direction in which the second maximum error decreases; storing a value of Δx of the first control point at which the first maximum error is minimized and a value of Δx of the second control point at which the second maximum error is minimized as learning values; and correcting the mechanical angle θ based on the learning values.
One aspect of an exemplary angle detection device of the present invention is an angle detection device that detects a mechanical angle of a rotation shaft, the angle detection device including: three magnetic sensors that detect a change in magnetic flux due to rotation of the rotation shaft; and a signal processing unit that processes signals output from the three magnetic sensors. The signal processing unit is configured to execute: acquiring signals output from three sensor signals as sensor signals, the three sensor signals having a phase difference of 120° in an electrical angle; extracting an intersection point at which two sensor signals among the three sensor signals intersect with each other and a zero-cross point at which each of the three sensor signals intersects with a reference signal level over one mechanical angle cycle; generating a linear function θ(Δx) representing a straight line connecting the intersection point and the zero-cross point adjacent to each other, wherein Δx is a length from a start point of the straight line to an any point on the straight line, and θ is a mechanical angle corresponding to an any point on the straight line; searching, as a maximum error point, a point at which an error between a mechanical angle θ calculated based on the linear function θ(Δx) and a mechanical angle θe acquired from an encoder installed on the rotation shaft is a maximum value among points on the straight line, and acquiring a length from a start point of the straight line to the maximum error point as Δx1; calculating a first curve based on an origin, a vertex, and a first control point among points in a two-axis coordinate system with the Δx as a horizontal axis and the error as a vertical axis, wherein the origin is a point at which the Δx and the error are zero, the vertex is a point at which the Δx is the Δx1 and the error is the maximum value, and the first control point is a point at which the Δx is a value between zero and Δx1 and the error is the maximum value; correcting, based on the first curve, a mechanical angle θ calculated based on the linear function θ(Δx) for a point included between a start point of the straight line and the maximum error point among a plurality of points on the straight line; obtaining a maximum error between a mechanical angle θ corrected in the correcting and a mechanical angle θe as a first maximum error; performing returning to the calculating a predetermined number of times after changing a value of Δx of the first control point in a direction in which the first maximum error decreases; calculating a second curve based on the vertex, an end point, and a second control point among points in the two-axis coordinate system, wherein the end point is a point at which the Δx corresponds to a maximum length Δxm of the straight line and the error is zero, and the second control point is a point at which the Δx is a value between Δx1 and Δxm and the error is the maximum value; correcting, based on the second curve, a mechanical angle θ calculated based on the linear function θ(Δx) for a point included between an end point of the straight line and the maximum error point among a plurality of points on the straight line; obtaining a maximum error between a mechanical angle θ corrected in the correcting and the mechanical angle θe as a second maximum error; performing returning to the calculating a predetermined number of times after changing the value of Δx of the second control point in a direction in which the second maximum error decreases; storing a value of Δx of the first control point at which the first maximum error is minimized and a value of Δx of the second control point at which the second maximum error is minimized as learning values; and correcting the mechanical angle θ based on the learning values.
The above and other elements, features, steps, characteristics and advantages of the present disclosure will become more apparent from the following detailed description of the preferred embodiments with reference to the attached drawings.
An embodiment of the present invention will be described in detail below with reference to the drawings.
The sensor magnet 120 is a disk-shaped magnet attached to the rotor shaft 110. The sensor magnet 120 rotates in synchronization with the rotor shaft 110. The sensor magnet 120 has P (P is an integer of 1 or more) magnetic pole pairs. In the present embodiment, as an example, the sensor magnet 120 has four magnetic pole pairs. The magnetic pole pair means a pair of an N pole and an S pole. That is, in the present embodiment, the sensor magnet 120 has four pairs of N poles and S poles, and has a total of eight magnetic poles.
The angle detection device 1 includes a sensor group 10 and a signal processing unit 20. Although not illustrated in
The sensor group 10 includes three magnetic sensors 11, 12, and 13. On the circuit board, the magnetic sensors 11, 12, and 13 face the sensor magnet 120 and are disposed at predetermined intervals along the rotation direction of the sensor magnet 120. In the present embodiment, the magnetic sensors 11, 12, and 13 are disposed at 30° intervals along the rotation direction of the sensor magnet 120. Each of the magnetic sensors 11, 12, and 13 is an analog output type magnetic sensor including a magnetoresistive element such as a Hall element or a linear Hall IC.
When the rotor shaft 110 rotates, the sensor magnet 120 rotates in synchronization with the rotor shaft 110. Each of the three magnetic sensors 11, 12, and 13 detects a change in magnetic flux due to the rotation of the rotor shaft 110, that is, the rotation of the sensor magnet 120, and outputs an analog signal indicating a detection result of the change in magnetic flux to the signal processing unit 20.
One electrical angle cycle of each analog signal output from the magnetic sensors 11, 12, and 13 corresponds to 1/P of one mechanical angle cycle. In the present embodiment, since the number of pole pairs P of the sensor magnet 120 is “4”, one electrical angle cycle of each analog signal corresponds to ¼ of one mechanical angle cycle, that is, 90° in the mechanical angle. The analog signals output from the magnetic sensors 11, 12, and 13 have a phase difference of 120° from one another in electrical angle.
Hereinafter, each analog signal output from the three magnetic sensors 11, 12, and 13 to the signal processing unit 20 is referred to as a sensor signal. In the following description, the sensor signal output from the magnetic sensor 11 may be referred to as a U-phase sensor signal Hu, the sensor signal output from the magnetic sensor 12 may be referred to as a V-phase sensor signal Hv, and the sensor signal output from the magnetic sensor 13 may be referred to as a W-phase sensor signal Hw.
The signal processing unit 20 is a signal processing circuit that processes sensor signals output from the three magnetic sensors 11, 12, and 13. The signal processing unit 20 estimates the mechanical angle of the rotor shaft 110, which is the rotation shaft, based on the U-phase sensor signal Hu output from the magnetic sensor 11, the V-phase sensor signal Hv output from the magnetic sensor 12, and the W-phase sensor signal Hw output from the magnetic sensor 13. The signal processing unit 20 includes a processing unit 21 and a storage unit 22.
The processing unit 21 is a microprocessor such as a microcontroller unit (MCU), for example. The U-phase sensor signal Hu output from the magnetic sensor 11, the V-phase sensor signal Hv output from the magnetic sensor 12, and the W-phase sensor signal Hw output from the magnetic sensor 13 are input to the processing unit 21. The processing unit 21 is communicably connected to the storage unit 22 via a communication bus (not illustrated). The processing unit 21 executes at least the following two processing according to a program stored in the storage unit 22.
The processing unit 21 executes learning processing of acquiring learning data necessary for estimating the mechanical angle of the rotor shaft 110 as offline processing. The offline processing is processing executed before the angle detection device 1 is shipped from a manufacturing factory or before the angle detection device 1 is incorporated in a system on the customer side and is actually operated. In the learning processing, the processing unit 21 acquires learning data based on the sensor signals Hu, Hv, and Hw output from the magnetic sensors 11, 12, and 13 and an output signal AS of an encoder 200 (see
In addition, the processing unit 21 executes, as online processing, angle estimation processing of estimating a mechanical angle of the rotor shaft 110 based on the sensor signals Hu, Hv, and Hw output from the magnetic sensors 11, 12, and 13 and learning data obtained by the learning processing. The online processing is processing executed when the angle detection device 1 is incorporated in a system on the customer side and is actually operated.
The storage unit 22 includes a nonvolatile memory that stores programs necessary for causing the processing unit 21 to execute various processing, various setting data, the above-described learning data, and the like, and a volatile memory used as a temporary storage destination of data when the processing unit 21 executes various processing. The nonvolatile memory is, for example, an electrically erasable programmable read-only memory (EEPROM), a flash memory, or the like. The volatile memory is, for example, a random access memory (RAM) or the like.
Hereinafter, before describing learning processing and angle estimation processing executed by the processing unit 21 of the angle detection device 1 configured as described above, a conventional position estimation method will be briefly described in order to facilitate understanding of the present invention. In the following description, the conventional position estimation method may be referred to as a basic patent method. In the following, for convenience of description, the basic patent method will be described using each element illustrated in
First, learning processing executed by the processing unit 21 in the basic patent method will be described.
The processing unit 21 acquires signals output from the magnetic sensors 11, 12, and 13 as the sensor signals Hu, Hv, and Hw in a state where the sensor magnet 120 is rotated together with the rotor shaft 110. Specifically, an A/D converter is built in the processing unit 21, and the processing unit 21 acquires digital values of the U-phase sensor signal Hu, the V-phase sensor signal Hv, and the W-phase sensor signal Hw by digitally converting each of the U-phase sensor signal Hu, the V-phase sensor signal Hv, and the W-phase sensor signal Hw at a predetermined sampling frequency by the A/D converter.
At the time of execution of the learning processing, the rotor shaft 110 may be rotated by controlling energization of the motor 100 via a motor control device (not illustrated). Alternatively, the rotor shaft 110 may be connected to a rotating machine not illustrated, and the rotating machine may rotate the rotor shaft 110.
Based on the digital values of the sensor signals Hu, Hv, and Hw, the processing unit 21 extracts an intersection point at which two sensor signals among the three sensor signals intersect each other and a zero-cross point at which each of the three sensor signals intersects a reference signal level over one mechanical angle cycle. The reference signal level is, for example, a ground level. When the reference signal level is the ground level, the digital value of the reference signal level is “0”.
As illustrated in
For example, in a case where the sensor signal Hu is used as a reference, the processing unit 21 recognizes the zero-cross point obtained at the sampling timing (time t1) at which the mechanical angle is 0° among the zero-cross points of the sensor signal Hu as the start point of the pole pair region associated with the pole pair number “0”. In addition, the processing unit 21 recognizes the zero-cross point obtained at the sampling timing (time t2) at which the mechanical angle is 90° among the zero-cross points of the sensor signal Hu as the end point of the pole pair region associated with the pole pair number “0”. That is, the processing unit 21 determines the interval between the zero-cross point obtained at the time t1 and the zero-cross point obtained at the time t2 as the pole pair region associated with the pole pair number “0”.
The processing unit 21 also recognizes the zero-cross point obtained at the sampling timing (time t2) at which the mechanical angle is 90° among the zero-cross points of the sensor signal Hu as the start point of the pole pair region associated with the pole pair number “1”. Further, the processing unit 21 recognizes the zero-cross point obtained at the sampling timing (time t3) having the mechanical angle of 180° among the zero-cross points of the sensor signal Hu as the end point of the pole pair region associated with the pole pair number “1”. That is, the processing unit 21 determines the interval between the zero-cross point obtained at the time t2 and the zero-cross point obtained at the time t3 as the pole pair region associated with the pole pair number “1”.
The processing unit 21 also recognizes the zero-cross point obtained at the sampling timing (time t3) at which the mechanical angle is 180° among the zero-cross points of the sensor signal Hu as the start point of the pole pair region associated with the pole pair number “2”. In addition, the processing unit 21 recognizes the zero-cross point obtained at the sampling timing (time t4) having the mechanical angle of 270° among the zero-cross points of the sensor signal Hu as the end point of the pole pair region associated with the pole pair number “2”. That is, the processing unit 21 determines the interval between the zero-cross point obtained at the time t3 and the zero-cross point obtained at the time t4 as the pole pair region associated with the pole pair number “2”.
The processing unit 21 also recognizes the zero-cross point obtained at the sampling timing (time t4) at which the mechanical angle is 270° among the zero-cross points of the sensor signal Hu as the start point of the pole pair region associated with the pole pair number “3”. In addition, the processing unit 21 recognizes the zero-cross point obtained at the sampling timing (time t5) having the mechanical angle of 360° among the zero-cross points of the sensor signal Hu as the end point of the pole pair region associated with the pole pair number “3”. That is, the processing unit 21 determines the interval between the zero-cross point obtained at time t4 and the zero-cross point obtained at time t5 as the pole pair region associated with the pole pair number “3”.
As illustrated in
In
The processing unit 21 determines the interval between the zero-cross point P1 and the intersection point P2 as a section assigned with the section number “0”. The processing unit 21 determines the interval between the intersection point P2 and the zero-cross point P3 as a section assigned with the section number “1”. The processing unit 21 determines the interval between the zero-cross point P3 and the intersection point P4 as a section assigned with the section number “2”. The processing unit 21 determines the interval between the intersection point P4 and the zero-cross point P5 as a section assigned with the section number “3”. The processing unit 21 determines the interval between the zero-cross point P5 and the intersection point P6 as a section assigned with the section number “4”. The processing unit 21 determines the interval between the intersection point P6 and the zero-cross point P7 as a section assigned with the section number “5”.
The processing unit 21 determines the interval between the zero-cross point P7 and the intersection point P8 as a section assigned with the section number “6”. The processing unit 21 determines the interval between the intersection point P8 and the zero-cross point P9 as a section assigned with the section number “7”. The processing unit 21 determines the interval between the zero-cross point P9 and the intersection point P10 as a section assigned with the section number “8”. The processing unit 21 determines the interval between the intersection point P10 and the zero-cross point P11 as a section assigned with the section number “9”. The processing unit 21 determines the interval between the zero-cross point P11 and the intersection point P12 as a section assigned with the section number “10”. The processing unit 21 determines the interval between the intersection point P12 and the zero-cross point P13 as the section assigned with the section number “11”.
Note that in the following description, for example, the section assigned with the section number “0” will be referred to as “0th section”, and the section assigned with the section number “11” will be referred to as “11th section”.
As illustrated in
As illustrated in
Note that, in the following description, for example, a segment to which the segment number “0” is assigned will be referred to as a “1st segment”, and a segment to which a segment number “11” is assigned will be referred to as a “11th segment”.
The processing unit 21 generates a linear function θ(Δx) representing each segment. Δx is a length (digital value) from the start point of the segment to any point on the segment, and θ is a mechanical angle corresponding to any point on the segment. In
For example, the linear function θ(Δx) representing the segment is expressed by the following Expression (1). In the following Expression (1), “i” is a segment number and is an integer from 0 to 47. In the following description, the linear function θ(Δx) expressed by the following Expression (1) may be referred to as a mechanical angle estimation expression, and the mechanical angle θ calculated by the following Expression (1) may be referred to as a mechanical angle estimation value.
θ(Δx)=k[i]×Δx+θres[i] (1)
In the above Expression (1), k[i] is a coefficient called a normalization coefficient. In other words, k[i] is a coefficient representing the slope of the i-th segment. The normalization coefficient k[i] is expressed by the following Expression (2). In the following Expression (2), ΔXnorm[i] is a deviation of the digital value between the start point and the end point of the i-th segment. In
k[i]=θnorm[i]/ΔXnorm[i] (2)
In the above Expression (2), θnorm[i] is a deviation of the mechanical angle between the start point and the end point of the i-th segment, and is expressed by the following Expression (3). In the following Expression (3), t[i] is the time between the start point and the end point of the i-th segment, t[0] is the time between the start point and the end point of the 0th segment, and t[47] is the time between the start point and the end point of the 47th segment. In
θnorm[i]={t[i]/(t[0]+ . . . +t[47])}×360[degM] (3)
In the above Expression (1), θres[i] is a constant called an angle reset value of the i-th segment (an intercept of the linear function θ(Δx)). When the segment number “i” is “0”, the angle reset value θres[i] is expressed by the following Expression (4). When the segment number “i” is any one of “1” to “47”, the angle reset value θres[i] is expressed by the following Expression (5).
θres[i]=0[degM] (4)
θres[i]=Σ(θnorm[i−1]) (5)
By performing the learning processing as described above, the processing unit 21 acquires the correspondence relationship among the pole pair number, the section number, and the segment number, the feature data of each section, and the mechanical angle estimation expression of each segment, and stores the acquired data in the storage unit 22 as learning data. Note that the feature data of each section is a magnitude relationship among the digital values of the sensor signals Hu, Hv, and Hw included in each section, positive and negative signs, and the like. In addition, the normalization coefficient k[i] and the angle reset value θres[i] constituting the mechanical angle estimation expression of each segment are stored in the storage unit 22 as learning data.
Next, angle estimation processing executed by the processing unit 21 in the basic patent method will be described.
The processing unit 21 acquires the sensor signals Hu, Hv, and Hw output from the magnetic sensors 11, 12, and 13. Specifically, the processing unit 21 acquires the digital values of the U-phase sensor signal Hu, the V-phase sensor signal Hv, and the W-phase sensor signal Hw by digitally converting each of the U-phase sensor signal Hu, the V-phase sensor signal Hv, and the W-phase sensor signal Hw at a predetermined sampling frequency by the A/D converter.
Then, the processing unit 21 specifies the current section number and pole pair number based on the digital values of the sensor signals Hu, Hv, and Hw obtained at the current sampling timing. For example, in
Then, the processing unit 21 specifies the current segment number based on the specified current section number and pole pair number. For example, the processing unit 21 specifies the current segment number by an expression of “segment number=12×pole pair number+section number”. As described above, it is assumed that a section number “9” is specified as the current section number, and a pole pair number “2” is specified as the current pole pair number. In this case, the processing unit 21 specifies the segment number “33” as the current segment number (see
The processing unit 21 reads the normalization coefficient k[i] and the angle reset value θres[i] corresponding to the specified segment number “i” from the learning data stored in the storage unit 22, and calculates the mechanical angle estimation value θ by the mechanical angle estimation expression represented by the above Expression (1). Here, the digital value of the sensor signal corresponding to the specified segment is used as Δx to be substituted into the mechanical angle estimation expression. For example, as described above, when the segment number “33” is specified as the current segment number, the processing unit 21 reads the normalization coefficient k[33] and the angle reset value θres[33] from the storage unit 22, and substitutes the digital value (see
The above is the basic procedure for estimating the mechanical angle in the basic patent method on which the present invention is based.
In the basic patent method, correction processing of the sensor signals Hu, Hv, and Hw is performed in order to improve the estimation accuracy of the mechanical angle (accuracy of the mechanical angle estimation value θ). For example, as illustrated in
Therefore, when acquiring the digital values of the sensor signals Hu, Hv, and Hw at the time of execution of the learning processing and the angle estimation processing, the processing unit 21 in the basic patent method first executes the first correction processing for removing the in-phase signals from the sensor signals Hu, Hv, and Hw based on the following Expressions (6), (7), and (8).
Hiu0=Hu−(Hv+Hw)/2 (6)
Hiv0=Hv−(Hu+Hw)/2 (7)
Hiw0=Hw−(Hu+Hv)/2 (8)
In Expression (6), Hiu0 is a digital value of the U-phase sensor signal obtained by performing the first correction processing on the U-phase sensor signal Hu. In Expression (7), Hiv0 is a digital value of the V-phase sensor signal obtained by performing the first correction processing on the V-phase sensor signal Hv. In Expression (8), Hiw0 is a digital value of the W-phase sensor signal obtained by performing the first correction processing on the W-phase sensor signal Hw.
After executing the first correction processing, the processing unit 21 in the basic patent method executes the second correction processing for matching the amplitude values with respect to the sensor signals Hiu0, Hiv0, and Hiw0 based on the following Expressions (9) to (14).
Hiu1(ppn)=au_max(ppn)×Hiu0(ppn)+bu (9)
Hiu1(ppn)=au_min(ppn)×Hiu0(ppn)+bu (10)
Hiv1(ppn)=av_max(ppn)×Hiv0(ppn)+bv (11)
Hiv1(ppn)=av_min(ppn)×Hiv0(ppn)+bv (12)
Hiw1(ppn)=aw_max(ppn)×Hiw0(ppn)+b (13)
Hiw1(ppn)=aw_min(ppn)×Hiw0(ppn)+bw (14)
The processing unit 21 performs the second correction processing on the positive digital value of the U-phase sensor signal Hiu0 by the above Expression (9) using the information stored in the storage unit 22. Furthermore, the processing unit 21 performs the second correction processing on the negative digital value of the U-phase sensor signal Hiu0 by the above Expression (10) using the information stored in the storage unit 22.
The processing unit 21 performs the second correction processing on the positive digital value of the V-phase sensor signal Hiv0 by the above Expression (11) using the information stored in the storage unit 22. Furthermore, the processing unit 21 performs the second correction processing on the negative digital value of the V-phase sensor signal Hiv0 by the above Expression (12) using the information stored in the storage unit 22.
The processing unit 21 performs the second correction processing on the positive digital value of the W-phase sensor signal Hiw0 by the above Expression (13) using the information stored in the storage unit 22. Furthermore, the processing unit 21 performs the second correction processing on the negative digital value of the W-phase sensor signal Hiw0 by the above Expression (14) using the information stored in the storage unit 22.
In Expressions (9) and (10), Hiu1 is a digital value of the U-phase sensor signal obtained by performing the second correction processing on the U-phase sensor signal Hiu0. In Expressions (11) and (12), Hiv1 is a digital value of the V-phase sensor signal obtained by performing the second correction processing on the V-phase sensor signal Hiv0. In Expressions (13) and (14), Hiw1 is a digital value of the W-phase sensor signal obtained by performing the second correction processing on the W-phase sensor signal Hiw0.
In Expressions (9) to (14), ppn is the pole pair number from 0 to 3. In Expressions (9), (11), and (13), each of au_max(ppn), av_max(ppn), and aw_max(ppn) is a positive-side gain correction value for a positive digital value of one electrical angle cycle corresponding to each magnetic pole pair stored in the storage unit 22 in advance. In Expressions (10), (12), and (14), each of au_min(ppn), av_min(ppn), and aw_min(ppn) is a negative-side gain correction value for a negative-side digital value of one electrical angle cycle corresponding to each magnetic pole pair stored in advance in the storage unit 22. In Expressions (9) to (14), bu, bv, and bw each are the offset correction values of the phases stored in the storage unit 22. Note that au_max(ppn), av_max(ppn), aw_max(ppn), au_min(ppn), av_min(ppn), and aw_min(ppn) each are correction values for each pole pair. Therefore, the number of positive-side gain correction values is 12 (=3 phases×4 pole logarithms). Similarly, the number of negative-side gain correction values is 12.
After executing the second correction processing, the processing unit 21 in the basic patent method executes third correction processing for linearizing a part (divided signal) of the sensor signal corresponding to each segment with respect to the sensor signals Hiu1, Hiv1, and Hiw1. In
The processing unit 21 performs the third correction processing for changing the scale of each sensor signal by using a value stored in advance in the storage unit 22 as a coefficient on the sensor signals Hiu1, Hiv1, and Hiw1. By performing the third correction processing, the substantially S-shaped shape of the divided signal corresponding to each segment can be linearized. Here, the value stored in the storage unit 22 is a value designed in advance. In the third correction processing, calculation processing is performed by a correction formula such as a quadratic function, a cubic function, or a trigonometric function using a value designed in advance.
As an example, the processing unit 21 executes the third correction processing on the sensor signals Hiu1, Hiv1, and Hiw1 based on the following Expressions (15) to (17). In the following Expressions (15) to (17), a and b are coefficients stored in the storage unit 22 in advance.
Hiu2=b×tan (a×Hiu1) (15)
Hiv2=b×tan (a×Hiv1) (16)
Hiw2=b×tan (a×Hiw1) (17)
In Expression (15), Hiu2 is a digital value of the U-phase sensor signal obtained by performing the third correction processing on the U-phase sensor signal Hiu1. In Expression (16), Hiv2 is a digital value of the V-phase sensor signal obtained by performing the third correction processing on the V-phase sensor signal Hiv1. In Expression (17), Hiw2 is a digital value of the W-phase sensor signal obtained by performing the third correction processing on the W-phase sensor signal Hiw1.
As described above, in the basic patent method, the in-phase noise included in the sensor signals Hu, Hv, and Hw can be reduced by the first correction processing. In addition, in the basic patent method, the mutual variation of each sensor signal can be corrected by the second correction processing. Here, the mutual variation is, for example, a variation in an amplitude value and an offset component of each sensor signal. Further, in the basic patent method, the curved portion of the waveform of each sensor signal can be linearized by the third correction processing. In particular, since the length of a part (divided signal) of the sensor signal corresponding to the segment is made uniform by performing the second correction processing, it is easy to apply uniform calculation processing to all the divided signals in the third correction processing. Therefore, by performing the second correction processing before the third correction processing, the curved portion of the waveform can be further linearized.
As a result, in the basic patent method, the signal portion (divided signal) necessary for the calculation of the mechanical angle estimation value θ based on the above Expression (1) is further linearized, and the difference between the mechanical angle estimation value θ and the mechanical angle true value (mechanical angle indicated, for example, by an output signal of an encoder attached to the rotor shaft 110) can be reduced, so that highly accurate mechanical angle estimation can be performed.
However, as a result of the verification by the inventor of the present application, in a case where each sensor signal output from the magnetic sensors 11, 12, and 13 includes not only the third harmonic signal but also in-phase signals such as the fifth harmonic signal and the seventh harmonic signal, it has been found that the curved portion (divided signal) of the signal necessary for the calculation of the mechanical angle estimation value θ cannot be linearized even if the first, second, and third correction processing are performed.
As illustrated in
In
As illustrated in
An object of the present invention is to solve the technical problem of the basic patent method as described above, to further reduce an angle error generated between the mechanical angle estimation value θ and the mechanical angle true value, and to improve the mechanical angle detection accuracy of the rotation shaft.
Hereinafter, in order to solve the above technical problems, learning processing and angle estimation processing executed by the processing unit 21 of the angle detection device 1 according to the present embodiment will be described.
First, learning processing executed by the processing unit 21 of the angle detection device 1 according to the present embodiment will be described.
As illustrated in
Subsequently, intersection point learning is performed (step S2). In step S2, based on the digital values of the sensor signals Hu, Hv, and Hw, the processing unit 21 performs a second process of extracting an intersection point at which two sensor signals among the three sensor signals intersect with each other and a zero-cross point at which each of the three sensor signals intersect with a reference signal level over one mechanical angle cycle (second step), and performs a third process of generating a linear function θ(Δx) representing a straight line (segment) connecting the intersection points adjacent to each other and the zero-cross point, that is, a mechanical angle estimation expression of each segment (third step).
Since the processing from the first process to the third process is the same as the learning processing in the basic patent method, detailed description thereof will be omitted. Note that, in the present embodiment, the first correction processing, the second correction processing, and the third correction processing in the basic patent method are not performed on the sensor signals Hu, Hv, and Hw acquired in the first process.
By executing the processing from the first process to the third process, the processing unit 21 acquires the correspondence relationship among the pole pair number, the section number, and the segment number, the feature data of each section, and the mechanical angle estimation expression of each segment, and stores the acquired data in the storage unit 22 as learning data. Note that the feature data of each section is a magnitude relationship among the digital values of the sensor signals Hu, Hv, and Hw included in each section, positive and negative signs, and the like. In addition, the normalization coefficient k[i] and the angle reset value θres[i] constituting the mechanical angle estimation expression of each segment are stored in the storage unit 22 as learning data.
Subsequently, the processing unit 21 performs a fourth process of searching, as a maximum error point, a point at which an error between the mechanical angle estimation value θ calculated based on the mechanical angle estimation expression and the mechanical angle θe acquired from the output signal AS of the encoder 200 installed on the rotor shaft 110 is the maximum value among the points on the segment, and acquiring a length from the start point of the segment to the maximum error point as Δx1 (fourth step). Hereinafter, the mechanical angle θe acquired from the encoder 200 may be referred to as a mechanical angle true value.
Specifically, as illustrated in
For example, in a case where the number of sampling points of the divided signal W10 corresponding to the i-th segment L10 is 50, 50 mechanical angle estimation values θ[n] are obtained for the i-th segment L10 by the process of step S3. The processing unit 21 calculates an error θer[n] between each of the plurality of mechanical angle estimation values θ[n] obtained by the process of step S3 and the mechanical angle true value θer[n] obtained from the encoder 200, and acquires the largest error θer[n] among the plurality of calculated errors θer[n] as the maximum error value (step S4). The mechanical angle true value θe[n] is a mechanical angle true value θe obtained at the same sampling timing as the n-th sampling point. The error θer[n] can be calculated by an expression of “θer[n]=θe[n]−θ[n]”. The processing unit 21 stores the maximum error value and the digital value Δx[n] from which the maximum error value has been obtained in the storage unit 22. Hereinafter, the digital value Δx[n] at which the maximum error value is obtained may be referred to as a maximum error acquisition digital value.
When acquiring the maximum error value and the maximum error acquisition digital value of the i-th segment L10 as described above, the processing unit 21 determines whether the number of times of learning has reached a predetermined number (step S5). In the case of “No” in step S5, that is, in the case where the number of times of learning has not reached the predetermined number, the processing unit 21 calculates a moving average value of the current value and the previous value of the maximum error value, stores the calculated moving average value in the storage unit 22 as the previous value of the new maximum error value, calculates a moving average value of the current value and the previous value of the maximum error acquisition digital value, and stores the calculated moving average value in the storage unit 22 as the previous value of the new maximum error acquisition digital value (step S6). After executing the process of step S6, the processing unit 21 returns to the process of step S4. The number of times of learning is incremented each time the process of step S4 is executed.
On the other hand, in a case of “Yes” in step S5, that is, in a case where the number of times of learning has reached the predetermined number of times, the processing unit 21 proceeds to the process of the next step S7. By performing the fourth process including the processes from step S3 to step S6 as described above, the processing unit 21 searches for a point at which the error between the mechanical angle estimation value θ and the mechanical angle true value θe is the maximum value among the points on the i-th segment as the maximum error point, and acquires the length from the start point of the i-th segment to the maximum error point as Δx1. Here, Δx1 is the maximum error acquisition digital value finally stored in the storage unit 22, and the error value at the maximum error point is the maximum error value finally stored in the storage unit 22. The processing unit 21 acquires the maximum error value and the maximum error acquisition digital value for each of the 48 segments by performing the fourth process on all the 48 segments. Hereinafter, the maximum error value of the i-th segment is referred to as θerm[i], and the maximum error acquisition digital value of the i-th segment is referred to as Δx1[i].
Subsequently, the mechanical angle estimation value θ is corrected based on the Bézier curve (step S7). As one of the processes included in step S7, the processing unit 21 first executes the fifth process of calculating the first curve based on the origin P1, the vertex P3, and the first control point P2 among the points in the two-axis coordinate system with the digital value Δx on the horizontal axis and the error on the vertical axis (fifth step). In the present embodiment, as an example, a case where the first curve is the Bézier curve will be described.
In
The processing unit 21 calculates a Bézier curve in the left coordinate region XL based on the origin P1, the vertex P3, and the first control point P2. Hereinafter, the Bézier curve in the left coordinate region XL may be referred to as a first Bézier curve. The coordinates (Px, Py) of the point P located on the first Bézier curve in the left coordinate region XL are expressed by the following Expression (18). Note that, in the following Expression (18), t is resolution.
The Y coordinate Py of the point P is expressed by the following Expression (19) based on Expression (18). Since the Y-coordinate P1y of the origin P1 is 0, the following Expression (20) is obtained from Expression (19).
The X coordinate Px of the point P is expressed by the following Expression (21) based on Expression (18). A solution of the resolution t is expressed by the following Expression (22).
As described above, since the initial value of Δx at the first control point is a half value of the maximum error acquisition digital value Δx1[i], P3x=2P2x. When P3x=2P2x, the resolution t is expressed by the following Expression (23).
By substituting Expressions (22) and (23) into Expression (20), the Y coordinate Py (error corresponding to the digital value Δx[n]) of the point P can be calculated from the X coordinate Px (=Δx[n]) of the point P. Here, as described with reference to
Subsequently, as one of the processes included in step S7, the processing unit 21 executes a sixth process of correcting the mechanical angle estimation value θ calculated based on the mechanical angle estimation expression of the i-th segment based on the first Bézier curve for a point included between the start point and the maximum error point of the i-th segment among the plurality of points on the i-th segment (sixth step). Specifically, the processing unit 21 calculates the mechanical angle estimation value θ corrected by the first Bézier curve by substituting the digital value Δx[n] included between the start point (Δx[n]=0) of the i-th segment and the maximum error point (Δx[n]=Δx1[i]) into the following Expression (24). The following Expression (24) is a formula obtained by adding “Err1×Δx[n]” to Expression (1). Err1is a correction value conversion coefficient for converting the digital value Δx[n] into the error obtained by the fifth process (the Y coordinates Py of the plurality of points P located on the first Bézier curve).
θ(Δx[n])=k[i]×Δx[n]+θres[i]+Err1×Δx[n] (24)
The above is the description of step S7, and the processing unit 21 proceeds to step S8 after the end of step S7. In step S8, the processing unit 21 executes a seventh process of acquiring a maximum error between the mechanical angle estimation value θ(Δx[n]) corrected by the above-described sixth process and the mechanical angle true value θe[n] as a first maximum error (seventh step).
Subsequently, the processing unit 21 executes an eighth process in which the value of Δx of the first control point P2 (the X coordinate P2x of the first control point P2) is changed in a direction in which the first maximum error acquired in the left coordinate region XL decreases, and then the processing unit 21 returns to the fifth process a predetermined number of times (eighth step).
Specifically, when acquiring the first maximum error in the left coordinate region XL of the i-th segment as described above, the processing unit 21 determines whether the number of times of learning has reached a predetermined number of times (step S9). In a case where “No” in step S9, that is, in a case where the number of times of learning has not reached the predetermined number of times, the processing unit 21 changes the value of Δx of the first control point P2 (the X coordinate P2x of the first control point P2) in a direction in which the first maximum error decreases, and then returns to step S8 (step S10). The number of times of learning is incremented each time the process of step S8 is executed.
On the other hand, in a case of “Yes” in step S9, that is, in a case where the number of times of learning has reached the predetermined number of times, the processing unit 21 proceeds to the process of the next step S11. By performing the processes from step S7 to step S10 as described above, the processing unit 21 searches for the value of Δx of the first control point P2 (the X coordinate P2x of the first control point P2) at which the first maximum error in the left coordinate region XL of the i-th segment is the smallest. As a search method, for example, a binary search method may be used.
Although the left coordinate region XL of the two-axis coordinate system corresponding to the i-th segment has been described above, the same processes as described above are performed also for the right coordinate region XR of the two-axis coordinate system. That is, the processing unit 21 executes a ninth process of calculating a second curve of the right coordinate region XR based on the vertex P3, the end point P4, and the second control point P5 located in the right coordinate region XR among the points in the two-axis coordinate system with the digital value Δx on the horizontal axis and the error on the vertical axis (ninth step). In the present embodiment, as an example, a case where the second curve is a Bézier curve will be described.
In
The processing unit 21 calculates a Bézier curve in the right coordinate region XR based on the vertex P3, the end point P4, and the second control point P5 as described above. Hereinafter, the Bézier curve in the right coordinate region XR may be referred to as a second Bézier curve. Since the method of calculating the second Bézier curve in the right coordinate region XR is similar to the method of calculating the first Bézier curve in the left coordinate region XL, a detailed description thereof will be omitted. The processing unit 21 calculates the second Bézier curve in the right coordinate region XR based on the vertex P3, the end point P4, and the second control point P5 by a calculation method similar to that of the first Bézier curve. More precisely, the processing unit 21 calculates the Y coordinate Py of the plurality of points P located on the second Bézier curve from the digital value Δx[n] of each sampling point as an error corresponding to each digital value Δx[n].
Subsequently, the processing unit 21 executes a tenth process of correcting the mechanical angle estimation value θ calculated based on the mechanical angle estimation expression of the i-th segment based on the second Bézier curve for a point included between the end point and the maximum error point of the i-th segment among the plurality of points on the i-th segment (tenth step). Specifically, the processing unit 21 calculates the mechanical angle estimation value θ corrected by the second Bézier curve by substituting the digital value Δx[n] included between the end point (Δx[n]=ΔXnorm[i]) of the i-th segment and the maximum error point (Δx[n]=Δx1[i]) into the following Expression (25). The following Expression (25) is a formula obtained by adding “Err2×Δx[n]” to Expression (1). Err2 is a correction value conversion coefficient for converting the digital value Δx[n] into the error obtained by the ninth process (the Y coordinate Py of the plurality of points P located on the second Bézier curve).
θ(Δx[n])=k[i]×Δx[n]+θres[i]+Err2×Δx[n] (25)
The processing unit 21 executes an eleventh process of acquiring the maximum error between the mechanical angle estimation value θ(Δx[n]) corrected by the tenth process and the mechanical angle true value θe[n] as the second maximum error (eleventh step).
Subsequently, the processing unit 21 executes a twelfth process in which the value of Δx of the second control point P5 (the X coordinate P5x of the second control point P5) is changed in a direction in which the second maximum error acquired in the right coordinate region XR decreases, and then the processing unit 21 returns to the ninth process a predetermined number of times (twelfth step).
Specifically, when acquiring the second maximum error in the right coordinate region XR of the i-th segment as described above, the processing unit 21 determines whether the number of times of learning has reached a predetermined number of times (step S9). In a case where “No” in step S9, that is, in a case where the number of times of learning has not reached the predetermined number, the processing unit 21 changes the value of Δx of the second control point P5 (the X coordinate P5x of the second control point P5) in a direction in which the second maximum error decreases, and then returns to step S8 (step S10). The number of times of learning is incremented each time the process of step S8 is executed.
On the other hand, in a case of “Yes” in step S9, that is, in a case where the number of times of learning has reached the predetermined number of times, the processing unit 21 proceeds to the process of the next step S11. By performing the processes from step S7 to step S10 as described above, the processing unit 21 searches for the value of Δx of the second control point P5 (the X coordinate P5x of the second control point P5) at which the second maximum error in the right coordinate region XR of the i-th segment is the smallest. As a search method, for example, a binary search method may be used.
When the first control point P2 having the smallest first maximum error in the left coordinate region XL and the second control point P5 having the smallest second maximum error in the right coordinate region XR are obtained for the i-th segment by the above processes, the processing unit 21 proceeds to the process of the next step S11. In step S11, the processing unit 21 executes a thirteenth process of storing the value of Δx of the first control point P2 having the smallest first maximum error and the value of Δx of the second control point P5 having the smallest second maximum error in the storage unit 22 as learning values (thirteenth step).
The processing unit 21 performs the processes from the fifth process to the thirteenth process on all the 48 segments to acquire the value of Δx at the first control point P2 at which the first maximum error is smallest and the value of Δx at the second control point P5 at which the second maximum error is smallest for each of the 48 segments. As a result, at the end of the learning processing, for each of the 48 segments, the value of Δx at the first control point P2 at which the first maximum error is smallest and the value of Δx at the second control point P5 at which the second maximum error is smallest are stored in the storage unit 22 as learning values.
Next, angle estimation processing executed by the processing unit 21 in the present embodiment will be described.
The processing unit 21 acquires the sensor signals Hu, Hv, and Hw output from the magnetic sensors 11, 12, and 13. Specifically, the processing unit 21 acquires the digital values of the U-phase sensor signal Hu, the V-phase sensor signal Hv, and the W-phase sensor signal Hw by digitally converting each of the U-phase sensor signal Hu, the V-phase sensor signal Hv, and the W-phase sensor signal Hw at a predetermined sampling frequency by the A/D converter.
Then, the processing unit 21 specifies the current section number and pole pair number based on the digital values of the sensor signals Hu, Hv, and Hw obtained at the current sampling timing. For example, in
Then, the processing unit 21 specifies the current segment number based on the specified current section number and pole pair number. For example, the processing unit 21 specifies the current segment number by an expression of “segment number=12×pole pair number+section number”. As described above, it is assumed that a section number “9” is specified as the current section number, and a pole pair number “2” is specified as the current pole pair number. In this case, the processing unit 21 specifies the segment number “33” as the current segment number (see
Then, the processing unit 22 reads the normalization coefficient k[i] and the angle reset value θres[i] corresponding to the specified segment number “i” from the learning data stored in the storage unit 22, and calculates the mechanical angle estimation value θ by the mechanical angle estimation expression represented by Expression (1). Here, the digital value of the sensor signal corresponding to the specified segment is used as Δx to be substituted into the mechanical angle estimation expression. For example, as described above, when the segment number “33” is specified as the current segment number, the processing unit 21 reads the normalization coefficient k and the angle reset value θres from the storage unit 22, and substitutes the digital value (see
Then, the processing unit 21 executes a fourteenth process of correcting the mechanical angle estimation value θ based on the learning value stored in the storage unit 22 (fourteenth step). Specifically, after calculating the mechanical angle estimation value θ as described above, the processing unit 21 reads the learning value corresponding to the identified segment number “i”, that is, the value of Δx of the first control point P2 having the smallest first maximum error and the value of Δx of the second control point P5 having the smallest second maximum error from the storage unit 22, and corrects the mechanical angle estimation value θ by the first Bézier curve and the second Bézier curve based on the coordinates of the origin P1, the vertex P3, and the end point P4 in addition to the first control point P2 and the second control point P5. The mechanical angle estimation value θ obtained after the correction using such a Bézier curve has an error with the mechanical angle true value θe that is an extremely accurate value close to zero as much as possible.
As described above, in the basic patent method, in a case where the sensor signals output from the magnetic sensors 11, 12, and 13 include in-phase signals such as third-order, fifth-order, and seventh-order harmonic signals, even if the first, second, and third correction processing are performed, the estimation accuracy of the mechanical angle (the accuracy of the mechanical angle estimation value θ) based on the above Expression (1) decreases. In this regard, according to the present embodiment, even if the first, second, and third correction processing are not performed on the sensor signals output from the magnetic sensors 11, 12, and 13, it is possible to obtain the mechanical angle estimation value θ with extremely high accuracy in which the error from the mechanical angle true value θe is as close as possible to 0.
In addition, according to the third correction processing adopted in the basic patent method, the error generated between the mechanical angle estimation value θ and the mechanical angle true value θe greatly varies for each segment due to the difference in the degree of bending of the divided signal for each segment. In this regard, according to the present embodiment, even if the degree of bending of the divided signal is different for each segment, it is possible to obtain the mechanical angle estimation value θ with extremely high accuracy in which the error from the mechanical angle true value θe is as close as possible to zero for each segment.
According to the present embodiment, it is possible to solve the technical problem of the basic patent method as described above to further reduce an angle error generated between the mechanical angle estimation value θ and the mechanical angle true value θe, so as to improve the mechanical angle detection accuracy of the rotation shaft.
The present invention is not limited to the above embodiments, and the configurations described in the present description can be appropriately combined within a range not conflicting with one another.
For example, in the above embodiment, the case where the first curve and the second curve are Bézier curves has been exemplified, but the first curve and the second curve may be B-spline curves. Alternatively, the first curve and the second curve may be curves that can be calculated from at least three points.
In the above embodiment, the case where the sensor magnet 120 is used as a magnet for position detection, that is, a magnet that rotates in synchronization with the rotor shaft 110 of the motor 100 has been exemplified. However, the rotor magnet attached to the rotor of the motor 100 may be used as a magnet for position detection. The rotor magnet is also a magnet that rotates in synchronization with the rotor shaft 110, and has a plurality of magnetic pole pairs.
In the above embodiment, the case where the sensor group 10 includes the three magnetic sensors 11, 12, and 13 has been exemplified, but the number of magnetic sensors is not limited to three and may be N (N is a multiple of 3). Further, in the above embodiment, the case where the sensor magnet 120 has four magnetic pole pairs has been exemplified, but the number of pole pairs of the sensor magnet 120 is not limited to four. Similarly, when the rotor magnet is used as a magnet for position detection, the number of pole pairs of the rotor magnet is not limited to four.
Features of the above-described preferred embodiments and the modifications thereof may be combined appropriately as long as no conflict arises.
While preferred embodiments of the present disclosure have been described above, it is to be understood that variations and modifications will be apparent to those skilled in the art without departing from the scope and spirit of the present disclosure. The scope of the present disclosure, therefore, is to be determined solely by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
2021-090904 | May 2021 | JP | national |
This is the U.S. national stage of application No. PCT/JP2022/010669, filed on Mar. 10, 2022, and priority under 35 U.S.C. § 119(a) and 35 U.S.C. § 365(b) is claimed from Japanese Patent Application No. 2021-090904, filed on May 31, 2021.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2022/010669 | 3/10/2022 | WO |