Angle detection circuit, angle detection method, angle detection device and storage medium
By introducing a control circuit into the angle detection circuit, error correction of the angle sensor is solved, and the problem that the measurement accuracy of the resistive angle sensor is affected by external parameters is achieved, achieving higher measurement accuracy and product reliability.
Patent Information
- Application Number
- CN202311106889.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2025-02-28
AI Technical Summary
The linear output characteristics of the resistive angle sensor are susceptible to external parameters, resulting in a reduced measurement accuracy.
An angle detection circuit is designed, including an angle sensor and a control circuit. The control circuit detects the output signal of the angle sensor, determines the target deviation error, and uses the preset correction value calculation formula to correct the angle information until the measurement accuracy requirements are met.
Through the calibration process, the nonlinear error of the angle sensor is reduced, the measurement accuracy is improved, and the product stability and reliability are enhanced.
Smart Images

Figure CN119533267A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sensor technology, and in particular to an angle detection circuit, an angle detection method, a device and a storage medium. Background Art
[0002] The resistive sensor is actually a variable resistor. Its principle is to divide the voltage signal loaded on both ends of the sensor, output a voltage signal proportional to the value to be measured, and convert the proportional voltage signal into the measured signal to achieve the design purpose.
[0003] In related technologies, the passive characteristics of resistive sensors determine that they are more easily affected by external parameters, such as the input impedance of the integrated circuit connected to them on the user's circuit board, the parasitic impedance of the PCB line, etc. These parameters will directly cause the linear output characteristics of the resistive sensor to exhibit nonlinear characteristics, affecting the measurement accuracy of the resistive sensor.
[0004] Therefore, how to overcome the above-mentioned technical defects has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art.
[0006] To this end, a first aspect of the present invention provides an angle detection circuit.
[0007] A second aspect of the present invention provides an angle detection method.
[0008] A third aspect of the present invention provides an angle detection device.
[0009] A fourth aspect of the present invention provides an angle detection device.
[0010] A fifth aspect of the present invention provides a readable storage medium.
[0011] In view of this, the first aspect of the present invention provides an angle detection circuit including: an angle sensor for detecting first angle information; a control circuit electrically connected to the angle sensor, the control circuit being used to determine first actual angle information corresponding to the second angle information when the angle sensor detects second angle information; determine a target deviation error based on an angle difference between the first actual angle information and the second angle information, perform error correction on the first angle information through a calculation formula of the target deviation error and a preset correction value, and obtain corrected first angle information; when the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than an angle difference threshold, determine the corrected first angle information as the target angle information.
[0012] The present application defines an angle detection circuit, which includes an angle sensor and a control circuit. The angle sensor is a resistive angle sensor. The resistive angle sensor is essentially a variable resistor, and its principle is to drive the contact slider through the rotation of the angle, thereby dividing the voltage signal loaded on the two ends of the angle sensor, and outputting a voltage signal that is proportional to the rotation angle. The user converts the proportional voltage signal into the first angle information, thereby realizing angle monitoring. The control circuit is connected to the angle sensor, and the control circuit can process the angle signal output by the angle sensor to calibrate the output result of the angle sensor according to the processing result, or perform feedback control on the angle sensor.
[0013] Specifically, the second angle information is preset before the angle sensor works, and the second angle information corresponds to a preset calibration angle. Thereafter, in the process of controlling the angle sensor to obtain the first angle information, if the angle sensor detects the second angle information, the first actual angle information corresponding to the second angle information is determined.
[0014] After determining the first actual angle information, the target deviation error is determined based on the angle difference between the first actual angle information and the second angle information. The second angle information is the detection value of the angle sensor, the first actual angle information is the actual value of the angle to be detected by the angle sensor, and the target deviation error is the current measurement error of the angle sensor.
[0015] After determining the target deviation error, the target deviation error is substituted into the calculation formula of the preset correction value, and the first angle information is error corrected with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor during operation.
[0016] Finally, after completing the error correction process of the above angle sensor, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor is within a reasonable range, and the angle sensor can meet the measurement accuracy requirements, and then the calibration process is completed. On the contrary, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor exceeds the reasonable range, and the angle sensor still cannot meet the measurement accuracy requirements, and then select the new second angle information and repeat the above calibration process until the calibrated angle sensor meets the measurement accuracy requirements.
[0017] It can be seen that by setting the above control circuit, the sensor can be calibrated with the help of the calibration process that can be realized by the control circuit. Specifically, the sensor can be combined with the theoretical target signal and the actual output signal of the sensor to eliminate the error of the sensor, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor, thereby solving the technical problem that the external parameters of the sensor directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor. Then, the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of the related products is achieved.
[0018] In addition, the angle detection circuit provided by the present invention may also have the following additional technical features:
[0019] In some technical solutions, optionally, the calculation formula of the correction value is:
[0020] y1=y0-ε1×sin(y0);
[0021] Among them, y1 is the corrected first angle information, y0 is the first angle information, and ε1 is the target deviation error.
[0022] In this technical solution, the calculation formula of the correction value is: y1 = y0-ε1×sin(y0). Among them, y0 is the first angle information detected by the angle sensor, and ε1 is the target deviation error corresponding to the second angle information detected by the angle sensor. After the first angle information and the target deviation error are substituted into the above formula, the calibrated first angle information corresponding to the current target deviation error can be calculated. Compared with y0, y1 calculated by this calculation formula is closer to the first actual angle information. When this formula is introduced into the sensor calibration process, the control can eliminate the error of the sensor by combining the theoretical target signal of the sensor and the actual output signal, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor. This achieves the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of related products.
[0023] In some technical solutions, optionally, the number of the second angle information is at least two, and the target deviation error includes at least two deviation errors corresponding to the at least two second angle information one by one;
[0024] The control circuit is used to perform error correction on the first angle information through a calculation formula of a target deviation error and a preset correction value to obtain the corrected first angle information, specifically including:
[0025] Performing error correction on the first angle information by using a calculation formula of one of the at least two deviation errors and a correction value to obtain corrected first angle information; and
[0026] The control circuit is also used to:
[0027] When the angle difference between the corrected first angle information and the second actual angle information is greater than or equal to the angle difference threshold, the corrected first angle information is error-corrected again by using the calculation formula of the other deviation errors and the correction value among the at least two deviation errors, until the angle difference between the first angle information after the second correction and the second actual angle is less than the angle difference threshold, and the first angle information after the second correction is determined as the target angle information.
[0028] In this technical solution, the number of second angle information is at least two, and the sensor can be multi-calibrated through at least two second angle information.
[0029] Specifically, among the at least two second angle information, each second angle information includes a deviation error corresponding to it. After determining the at least two deviation errors, one of the at least two deviation errors is selected and substituted into the calculation formula of the preset correction value, so as to perform error correction on the first angle information with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor during operation.
[0030] Thereafter, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor is within a reasonable range, the angle sensor can meet the measurement accuracy requirements, and the calibration process is then completed. On the contrary, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor exceeds the reasonable range, and the angle sensor still cannot meet the measurement accuracy requirements. Then, the corrected first angle information is corrected again by using the calculation formula of the other deviation errors and correction values in at least two deviation errors, until the angle difference between the first angle information corrected again and the second actual angle is less than the angle difference threshold, the first angle information corrected again is determined as the target angle information, until the calibrated angle sensor meets the measurement accuracy requirements, or all deviation errors are selected.
[0031] It can be seen that by setting the above control circuit, the angle sensor can be calibrated multiple times with the help of the control circuit, and specifically, the sensor error can be eliminated by combining the sensor's theoretical target signal and the actual output signal, so as to reduce the influence of the sensor's external parameters on the sensor's measurement accuracy, thereby solving the technical problem that the sensor's external parameters directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor. This can achieve the technical effect of optimizing the angle detection circuit, reducing the angle sensor's measurement error, and improving the working stability and reliability of related products.
[0032] In some technical solutions, optionally, the calculation formula of the correction value is:
[0033] y3=y2-ε2×sin(2×y2);
[0034] Among them, y3 is the corrected first angle information, y2 is the first angle information, and ε2 is the deviation error.
[0035] In this technical solution, the calculation formula of the correction value is: y3 = y2-ε2×sin(2×y2). Among them, y2 is the first angle information detected by the angle sensor, and ε2 is the deviation error corresponding to one of the second angle information detected by the angle sensor. After the first angle information and the target deviation error are substituted into the above formula, the calibrated first angle information corresponding to the current deviation error can be calculated. Compared with y2, y3 calculated by this calculation formula is closer to the first actual angle information. When this formula is introduced into the sensor calibration process, the control can eliminate the error of the sensor by combining the theoretical target signal of the sensor and the actual output signal, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor. This achieves the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of related products.
[0036] In some technical solutions, optionally, the angle sensor is a variable resistor angle sensor, and the first angle information is associated with a resistance value of the variable resistor angle sensor.
[0037] In this technical solution, the angle sensor is a variable resistor angle sensor. Its principle is that the angle rotation drives the contact slider, thereby dividing the voltage signal loaded on both ends of the angle sensor, and outputting a voltage signal proportional to the rotation angle. The user converts the proportional voltage signal into the first angle information, thereby realizing angle monitoring.
[0038] In some technical schemes, optionally, the angle detection circuit also includes: a first resistor, a first end of the first resistor is electrically connected to the control circuit, and a second end of the first resistor is electrically connected to the angle sensor; a second resistor, a first end of the second resistor is used to receive a power supply signal, and a second end of the second resistor is electrically connected to the angle sensor; a third resistor, a first end of the third resistor is electrically connected to the angle sensor, and a second end of the third resistor is grounded.
[0039] In the technical solution, the angle detection circuit also includes a first resistor, a second resistor and a third resistor. Specifically, the first end of the first resistor is connected to the control circuit, and the second end of the first resistor is connected to the detection resistor. The first end of the second resistor is connected to the power supply circuit, and the second end of the second resistor is connected to the detection resistor. The first end of the third resistor is connected to the detection resistor, and the second end of the third resistor is grounded.
[0040] Specifically, the detection resistor, the control circuit, the first resistor, the second resistor and the third resistor constitute a nonlinear optimization circuit.
[0041] The selection of the first resistor and its maximum value are limited by the minimum effective resolution voltage of the A / D (analog to digital converter) sampling module, the A / D module sampling capacitance, the A / D sampling frequency, the angle voltage signal frequency and the filter bandwidth.
[0042] The selection of the second resistor and the third resistor should be based on a comprehensive analysis of the nonlinear characteristics, balance the original nonlinear signal error center deviation, and make a reasonable selection. The selection of the second resistor and the third resistor is mainly to eliminate zero bias to improve the effectiveness of the calculation formula of the correction value.
[0043] The combination of the first resistor, the second resistor and the third resistor is to better ensure the validity of the calculation formula of the correction value. The application of the calculation formula of the correction value is to simplify the calibration steps from all-point calibration to limited-point calibration.
[0044] A second aspect of the present invention provides an angle detection method, which is performed by the angle detection circuit in any of the above technical solutions, and the method includes:
[0045] Detecting first angle information;
[0046] When the angle sensor detects the second angle information, determining first actual angle information corresponding to the second angle information;
[0047] Determine the target deviation error according to the angle difference between the first actual angle information and the second angle information, and perform error correction on the first angle information through a calculation formula of the target deviation error and a preset correction value to obtain the corrected first angle information;
[0048] When the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is smaller than the angle difference threshold, the corrected first angle information is determined as the target angle information.
[0049] In this technical solution, an angle detection method performed by the angle detection circuit in any of the above technical solutions is defined.
[0050] Specifically, the second angle information is preset before the angle sensor works, and the second angle information corresponds to a preset calibration angle. Thereafter, in the process of controlling the angle sensor to obtain the first angle information, if the angle sensor detects the second angle information, the first actual angle information corresponding to the second angle information is determined.
[0051] After determining the first actual angle information, the target deviation error is determined based on the angle difference between the first actual angle information and the second angle information. The second angle information is the detection value of the angle sensor, the first actual angle information is the actual value of the angle to be detected by the angle sensor, and the target deviation error is the current measurement error of the angle sensor.
[0052] After determining the target deviation error, the target deviation error is substituted into the calculation formula of the preset correction value, and the first angle information is error corrected with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor during operation.
[0053] Finally, after completing the error correction process of the above angle sensor, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor is within a reasonable range, and the angle sensor can meet the measurement accuracy requirements, and then the calibration process is completed. On the contrary, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor exceeds the reasonable range, and the angle sensor still cannot meet the measurement accuracy requirements, and then select the new second angle information and repeat the above calibration process until the calibrated angle sensor meets the measurement accuracy requirements.
[0054] It can be seen that by limiting the above angle detection method, the sensor can be calibrated with the help of the calibration process that can be realized by the control circuit. Specifically, the sensor can be combined with the theoretical target signal and the actual output signal of the sensor to eliminate the error of the sensor, so as to reduce the influence of the sensor's external parameters on the sensor's measurement accuracy, thereby solving the technical problem that the sensor's external parameters directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor. Then, the technical effect of optimizing the angle detection circuit, reducing the angle sensor's measurement error, and improving the working stability and reliability of related products is achieved.
[0055] In some technical solutions, optionally, the calculation formula of the correction value is:
[0056] y1=y0-ε1×sin(y0);
[0057] Among them, y1 is the corrected first angle information, y0 is the first angle information, and ε1 is the target deviation error.
[0058] In this technical solution, the calculation formula of the correction value is: y1 = y0-ε1×sin(y0). Among them, y0 is the first angle information detected by the angle sensor, and ε1 is the target deviation error corresponding to the second angle information detected by the angle sensor. After the first angle information and the target deviation error are substituted into the above formula, the calibrated first angle information corresponding to the current target deviation error can be calculated. Compared with y0, y1 calculated by this calculation formula is closer to the first actual angle information. When this formula is introduced into the sensor calibration process, the control can eliminate the error of the sensor by combining the theoretical target signal of the sensor and the actual output signal, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor. This achieves the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of related products.
[0059] In some technical solutions, optionally, the number of the second angle information is at least two, and the target deviation error includes at least two deviation errors corresponding to the at least two second angle information one by one;
[0060] The first angle information is corrected by using a calculation formula of a target deviation error and a preset correction value to obtain the corrected first angle information, specifically including:
[0061] Performing error correction on the first angle information by using a calculation formula of one of at least two deviation errors and a correction value to obtain corrected first angle information;
[0062] When the angle difference between the corrected first angle information and the second actual angle information is greater than or equal to the angle difference threshold, the corrected first angle information is error-corrected again by using the calculation formula of the other deviation errors and the correction value among the at least two deviation errors, until the angle difference between the first angle information after the second correction and the second actual angle is less than the angle difference threshold, and the first angle information after the second correction is determined as the target angle information.
[0063] In this technical solution, the number of second angle information is at least two, and the sensor can be multi-calibrated through at least two second angle information.
[0064] Specifically, among the at least two second angle information, each second angle information includes a deviation error corresponding to it. After determining the at least two deviation errors, one of the at least two deviation errors is selected and substituted into the calculation formula of the preset correction value, so as to perform error correction on the first angle information with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor during operation.
[0065] Thereafter, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor is within a reasonable range, the angle sensor can meet the measurement accuracy requirements, and the calibration process is then completed. On the contrary, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor exceeds the reasonable range, and the angle sensor still cannot meet the measurement accuracy requirements. Then, the corrected first angle information is corrected again by using the calculation formula of the other deviation errors and correction values in at least two deviation errors, until the angle difference between the first angle information corrected again and the second actual angle is less than the angle difference threshold, the first angle information corrected again is determined as the target angle information, until the calibrated angle sensor meets the measurement accuracy requirements, or all deviation errors are selected.
[0066] It can be seen that by setting the above control circuit, the angle sensor can be calibrated multiple times with the help of the control circuit, and specifically, the sensor error can be eliminated by combining the sensor's theoretical target signal and the actual output signal, so as to reduce the influence of the sensor's external parameters on the sensor's measurement accuracy, thereby solving the technical problem that the sensor's external parameters directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor. This can achieve the technical effect of optimizing the angle detection circuit, reducing the angle sensor's measurement error, and improving the working stability and reliability of related products.
[0067] In some technical solutions, optionally, the calculation formula of the correction value is:
[0068] y3=y2-ε2×sin(2×y2);
[0069] Among them, y3 is the corrected first angle information, y2 is the first angle information, and ε2 is the deviation error.
[0070] In this technical solution, the calculation formula of the correction value is: y3 = y2-ε2×sin(2×y2). Among them, y2 is the first angle information detected by the angle sensor, and ε2 is the deviation error corresponding to one of the second angle information detected by the angle sensor. After the first angle information and the target deviation error are substituted into the above formula, the calibrated first angle information corresponding to the current deviation error can be calculated. Compared with y2, y3 calculated by this calculation formula is closer to the first actual angle information. When this formula is introduced into the sensor calibration process, the control can eliminate the error of the sensor by combining the theoretical target signal of the sensor and the actual output signal, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor. This achieves the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of related products.
[0071] A third aspect of the present invention provides an angle detection device, which is executed by the angle detection circuit in any of the above technical solutions, and the device includes:
[0072] A detection module, used for detecting first angle information;
[0073] A first determining module, configured to determine first actual angle information corresponding to the second angle information when the angle sensor detects the second angle information;
[0074] A correction module, used to determine a target deviation error according to an angle difference between the first actual angle information and the second angle information, and to perform error correction on the first angle information by using a calculation formula of the target deviation error and a preset correction value to obtain corrected first angle information;
[0075] The second determination module is used to determine the corrected first angle information as the target angle information when the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than an angle difference threshold.
[0076] In this technical solution, an angle detection device implemented by the angle detection circuit in any of the above technical solutions is defined, and the angle detection device includes: a detection module, a first determination module, a correction module, and a second determination module.
[0077] Specifically, the second angle information is preset before the angle sensor works, and the second angle information corresponds to a preset calibration angle. Thereafter, when the detection module controls the angle sensor to obtain the first angle information, if the angle sensor detects the second angle information, the first determination module determines the first actual angle information corresponding to the second angle information.
[0078] After determining the first actual angle information, the correction module determines the target deviation error based on the angle difference between the first actual angle information and the second angle information. The second angle information is the detection value of the angle sensor, the first actual angle information is the actual value of the angle to be detected by the angle sensor, and the target deviation error is the current measurement error of the angle sensor.
[0079] After determining the target deviation error, the correction module brings the target deviation error into the calculation formula of the preset correction value, and performs error correction on the first angle information with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor during operation.
[0080] Finally, after completing the error correction process of the above angle sensor, if the second determination module determines that the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor is within a reasonable range, and the angle sensor can meet the measurement accuracy requirements, and then the calibration process is completed. On the contrary, if the second determination module determines that the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor exceeds the reasonable range, and the angle sensor still cannot meet the measurement accuracy requirements, and then select the new second angle information and repeat the above calibration process until the calibrated angle sensor meets the measurement accuracy requirements.
[0081] It can be seen that by limiting the above-mentioned angle detection device, the sensor can be calibrated with the help of the calibration process that can be realized by the control circuit. Specifically, the sensor can be combined with the theoretical target signal of the sensor and the output signal of the actual output to eliminate the error of the sensor, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor, thereby solving the technical problem that the external parameters of the sensor directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor. Then, the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of related products is achieved.
[0082] The third aspect of the present invention provides an angle detection device, which includes: a memory, in which programs or instructions are stored; a processor, which executes the programs or instructions stored in the memory to implement the steps of the angle detection method in any of the above technical solutions.
[0083] In this technical solution, an angle detection device is provided that can implement the steps of the angle detection method in any of the above-mentioned technical solutions. Therefore, the angle detection device has the advantages of the angle detection method in any of the above-mentioned technical solutions and can implement the technical effects of the angle detection method in any of the above-mentioned technical solutions. To avoid repetition, it will not be repeated here.
[0084] A fourth aspect of the present invention provides a readable storage medium having a program or instruction stored thereon, which, when executed by a processor, implements the steps of the angle detection method in any of the above technical solutions.
[0085] In this technical solution, a readable storage medium is provided which can implement the steps of the angle detection method in any of the above-mentioned technical solutions after being read by a processor. Therefore, the readable storage medium has the advantages of the angle detection method in any of the above-mentioned technical solutions and can implement the technical effects of the angle detection method in any of the above-mentioned technical solutions. To avoid repetition, it will not be repeated here.
[0086] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0088] Figure 1 A circuit diagram of an angle detection circuit according to an embodiment of the present invention is shown;
[0089] Figure 2A flow chart of an angle detection method according to an embodiment of the present invention is shown;
[0090] Figure 3 A flowchart showing an angle detection method according to an embodiment of the present invention is shown.
[0091] Figure 4 A structural block diagram of an angle detection device according to an embodiment of the present invention is shown;
[0092] Figure 5 A structural block diagram of an angle detection device according to an embodiment of the present invention is shown;
[0093] Figure 6 Graphs of data before and after sensor calibration according to one embodiment of the present invention are shown.
[0094] in, Figure 1 The corresponding relationship between the reference numerals and component names in the figure is:
[0095] 100 is an angle detection circuit, R0 is an angle sensor, 110 is a control circuit, R1 is a first resistor, R2 is a second resistor, and R3 is a third resistor. DETAILED DESCRIPTION
[0096] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0097] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0098] Refer to the following Figures 1 to 6 An angle detection circuit, an angle detection method, an angle detection device, and a storage medium according to some embodiments of the present invention are described.
[0099] like Figure 1As shown, an embodiment of the present invention proposes an angle detection circuit 100 including: an angle sensor R0, used to detect first angle information; a control circuit 110, electrically connected to the angle sensor R0, and the control circuit 110 is used to determine first actual angle information corresponding to the second angle information when the angle sensor R0 detects second angle information; determine a target deviation error according to an angle difference between the first actual angle information and the second angle information, and perform error correction on the first angle information through a calculation formula of the target deviation error and a preset correction value to obtain corrected first angle information; when the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than an angle difference threshold, determine the corrected first angle information as the target angle information.
[0100] The present application defines an angle detection circuit 100, which includes an angle sensor R0 and a control circuit 110. The angle sensor R0 is a resistive angle sensor R0. The resistive angle sensor R0 is essentially a variable resistor, and its principle is to drive the contact slider through the rotation of the angle, thereby dividing the voltage signal loaded on both ends of the angle sensor R0, and outputting a voltage signal proportional to the rotation angle. The user converts the proportional voltage signal into the first angle information, thereby realizing angle monitoring. The control circuit 110 is connected to the angle sensor R0, and the control circuit 110 can process the angle signal output by the angle sensor R0, so as to calibrate the output result of the angle sensor R0 according to the processing result, or perform feedback control on the angle sensor R0.
[0101] Specifically, the second angle information is preset before the angle sensor R0 works, and the second angle information corresponds to a preset calibration angle. Thereafter, in the process of controlling the angle sensor R0 to obtain the first angle information, if the angle sensor R0 detects the second angle information, the first actual angle information corresponding to the second angle information is determined.
[0102] After determining the first actual angle information, the target deviation error is determined based on the angle difference between the first actual angle information and the second angle information. The second angle information is the detection value of the angle sensor R0, the first actual angle information is the actual value of the angle to be detected by the angle sensor R0, and the target deviation error is the current measurement error of the angle sensor R0.
[0103] After determining the target deviation error, the target deviation error is substituted into the calculation formula of the preset correction value, and the first angle information is error corrected with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information is used as the output value of the calibrated angle sensor R0, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor R0 during operation.
[0104] Finally, after completing the error correction process of the angle sensor R0, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor R0 is within a reasonable range, and the angle sensor R0 can meet the measurement accuracy requirements, and then the calibration process is completed. On the contrary, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor R0 exceeds the reasonable range, and the angle sensor R0 still cannot meet the measurement accuracy requirements, and then select the new second angle information and repeat the above calibration process until the calibrated angle sensor R0 meets the measurement accuracy requirements.
[0105] It can be seen that by setting the above control circuit 110, the sensor can be calibrated with the help of the calibration process that can be realized by the control circuit 110. Specifically, the sensor can be combined with the theoretical target signal of the sensor and the output signal of the actual output to eliminate the error of the sensor, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor, thereby solving the technical problem that the external parameters of the sensor directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor R0. Then, the technical effect of optimizing the angle detection circuit 100, reducing the measurement error of the angle sensor R0, and improving the working stability and reliability of related products is achieved.
[0106] In addition, the angle detection circuit 100 provided by the present invention may also have the following additional technical features:
[0107] In some technical solutions, optionally, the calculation formula of the correction value is:
[0108] y1=y0-ε1×sin(y0);
[0109] Among them, y1 is the corrected first angle information, y0 is the first angle information, and ε1 is the target deviation error.
[0110] In this technical solution, the calculation formula of the correction value is: y1=y0-ε1×sin(y0). Among them, y0 is the first angle information detected by the angle sensor R0, and ε1 is the target deviation error corresponding to the second angle information detected by the angle sensor R0. After the first angle information and the target deviation error are substituted into the above formula, the calibrated first angle information corresponding to the current target deviation error can be calculated. Compared with y0, the y1 calculated by this calculation formula is closer to the first actual angle information. When this formula is introduced into the sensor calibration process, the control can eliminate the error of the sensor by combining the theoretical target signal of the sensor and the actual output signal, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor. This achieves the technical effect of optimizing the angle detection circuit 100, reducing the measurement error of the angle sensor R0, and improving the working stability and reliability of related products.
[0111] In some technical solutions, optionally, the number of the second angle information is at least two, and the target deviation error includes at least two deviation errors corresponding to the at least two second angle information one by one;
[0112] The control circuit 110 is used to perform error correction on the first angle information by using a calculation formula of a target deviation error and a preset correction value to obtain the corrected first angle information, specifically including:
[0113] Performing error correction on the first angle information by using a calculation formula of one of the at least two deviation errors and a correction value to obtain corrected first angle information; and
[0114] The control circuit 110 is also used for:
[0115] When the angle difference between the corrected first angle information and the second actual angle information is greater than or equal to the angle difference threshold, the corrected first angle information is error-corrected again by using the calculation formula of the other deviation errors and the correction value among the at least two deviation errors, until the angle difference between the first angle information after the second correction and the second actual angle is less than the angle difference threshold, and the first angle information after the second correction is determined as the target angle information.
[0116] In this technical solution, the number of second angle information is at least two, and the sensor can be multi-calibrated through at least two second angle information.
[0117] Specifically, among the at least two second angle information, each second angle information includes a deviation error corresponding thereto. After determining the at least two deviation errors, one of the deviation errors is selected from the at least two deviation errors and brought into the calculation formula of the preset correction value, so as to perform error correction on the first angle information with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor R0, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor R0 during operation.
[0118] Thereafter, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor R0 is within a reasonable range, the angle sensor R0 can meet the measurement accuracy requirement, and the calibration process is then completed. On the contrary, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor R0 exceeds the reasonable range, the angle sensor R0 still cannot meet the measurement accuracy requirement, and then the corrected first angle information is corrected again by the calculation formula of the other deviation errors and the correction value in at least two deviation errors, until the angle difference between the first angle information corrected again and the second actual angle is less than the angle difference threshold, the first angle information corrected again is determined as the target angle information, until the calibrated angle sensor R0 meets the measurement accuracy requirement, or all deviation errors are selected.
[0119] It can be seen that by setting the above control circuit 110, the angle sensor R0 can be calibrated multiple times with the help of the control circuit 110, and specifically, the sensor error can be eliminated by combining the sensor's theoretical target signal and the actual output signal, so as to reduce the influence of the sensor's external parameters on the sensor's measurement accuracy, thereby solving the technical problem that the sensor's external parameters directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor R0. This can achieve the technical effect of optimizing the angle detection circuit 100, reducing the angle sensor R0 measurement error, and improving the working stability and reliability of related products.
[0120] like Figure 6 As shown in the figure, after the angle sensor R0 has been calibrated twice, the detection error is significantly reduced.
[0121] in, Figure 6 The horizontal axis in is the actual input (degrees), the vertical axis on the left is the sensor angle output (degrees), and the vertical axis on the right is the detection error (degrees).
[0122] Arrow a shows the error curve before correction, arrow b shows the error curve after the first correction, and arrow c shows the error curve after the second correction.
[0123] In some technical solutions, optionally, the calculation formula of the correction value is:
[0124] y3=y2-ε2×sin(2×y2);
[0125] Among them, y3 is the corrected first angle information, y2 is the first angle information, and ε2 is the deviation error.
[0126] In this technical solution, the calculation formula of the correction value is: y3 = y2-ε2×sin(2×y2). Among them, y2 is the first angle information detected by the angle sensor R0, and ε2 is the deviation error corresponding to one of the second angle information detected by the angle sensor R0. After the first angle information and the target deviation error are substituted into the above formula, the calibrated first angle information corresponding to the current deviation error can be calculated. Compared with y2, y3 calculated by this calculation formula is closer to the first actual angle information. Substituting this formula into the sensor calibration process enables the control to eliminate the error of the sensor in combination with the theoretical target signal of the sensor and the actual output signal, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor. Thereby, the technical effect of optimizing the angle detection circuit 100, reducing the measurement error of the angle sensor R0, and improving the working stability and reliability of related products is achieved.
[0127] In some technical solutions, optionally, the angle sensor R0 is a variable resistor angle sensor R0, and the first angle information is associated with a resistance value of the variable resistor angle sensor R0.
[0128] In this technical solution, the angle sensor R0 is a variable resistor angle sensor R0. Its principle is that the contact slider is driven by the rotation of the angle, so that the voltage signal loaded on both ends of the angle sensor R0 is divided, and a voltage signal proportional to the rotation angle is output. The user converts the proportional voltage signal into the first angle information, thereby realizing angle monitoring.
[0129] In some technical schemes, optionally, the angle detection circuit 100 also includes: a first resistor R1, a first end of the first resistor R1 is electrically connected to the control circuit 110, and a second end of the first resistor R1 is electrically connected to the angle sensor R0; a second resistor R2, a first end of the second resistor R2 is used to receive a power supply signal, and a second end of the second resistor R2 is electrically connected to the angle sensor R0; a third resistor R3, a first end of the third resistor R3 is electrically connected to the angle sensor R0, and a second end of the third resistor R3 is grounded.
[0130] In this technical solution, the angle detection circuit 100 further includes a first resistor R1, a second resistor R2 and a third resistor R3. Specifically, a first end of the first resistor R1 is connected to the control circuit 110, and a second end of the first resistor R1 is connected to the detection resistor. A first end of the second resistor R2 is connected to the power supply circuit, and a second end of the second resistor R2 is connected to the detection resistor. A first end of the third resistor R3 is connected to the detection resistor, and a second end of the third resistor R3 is grounded.
[0131] Specifically, the detection resistor, the control circuit 110 , the first resistor R1 , the second resistor R2 , and the third resistor R3 form a nonlinear optimization circuit.
[0132] The selection of the first resistor R1 and its maximum value are limited by the minimum effective resolution voltage of the A / D (analog to digital converter) sampling module, the A / D module sampling capacitance, the A / D sampling frequency, the angle voltage signal frequency and the filter bandwidth.
[0133] The selection of the second resistor R2 and the third resistor R3 should be based on a comprehensive analysis of the nonlinear characteristics, balance the original nonlinear signal error center deviation, and be reasonably selected. The selection of the second resistor R2 and the third resistor R3 is mainly to eliminate zero bias to improve the effectiveness of the calculation formula of the correction value.
[0134] The combination of the first resistor R1, the second resistor R2 and the third resistor R3 is to better ensure the validity of the calculation formula of the correction value. The application of the calculation formula of the correction value is to simplify the calibration steps from all-point calibration to limited-point calibration.
[0135] like Figure 2 As shown, an embodiment of the present invention provides an angle detection method, which is performed by the angle detection circuit in any of the above technical solutions, and the method includes:
[0136] Step 202, detecting first angle information;
[0137] Step 204, when the angle sensor detects the second angle information, determining first actual angle information corresponding to the second angle information;
[0138] Step 206, determining a target deviation error according to an angle difference between the first actual angle information and the second angle information, and performing error correction on the first angle information by using a calculation formula of the target deviation error and a preset correction value to obtain corrected first angle information;
[0139] Step 208: When the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, the corrected first angle information is determined as the target angle information.
[0140] In this technical solution, an angle detection method performed by the angle detection circuit in any of the above technical solutions is defined.
[0141] Specifically, the second angle information is preset before the angle sensor works, and the second angle information corresponds to a preset calibration angle. Thereafter, in the process of controlling the angle sensor to obtain the first angle information, if the angle sensor detects the second angle information, the first actual angle information corresponding to the second angle information is determined.
[0142] After determining the first actual angle information, the target deviation error is determined based on the angle difference between the first actual angle information and the second angle information. The second angle information is the detection value of the angle sensor, the first actual angle information is the actual value of the angle to be detected by the angle sensor, and the target deviation error is the current measurement error of the angle sensor.
[0143] After determining the target deviation error, the target deviation error is substituted into the calculation formula of the preset correction value, and the first angle information is error corrected with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor during operation.
[0144] Finally, after completing the error correction process of the above angle sensor, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor is within a reasonable range, and the angle sensor can meet the measurement accuracy requirements, and then the calibration process is completed. On the contrary, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor exceeds the reasonable range, and the angle sensor still cannot meet the measurement accuracy requirements, and then select the new second angle information and repeat the above calibration process until the calibrated angle sensor meets the measurement accuracy requirements.
[0145] It can be seen that by limiting the above angle detection method, the sensor can be calibrated with the help of the calibration process that can be realized by the control circuit. Specifically, the sensor can be combined with the theoretical target signal and the actual output signal of the sensor to eliminate the error of the sensor, so as to reduce the influence of the sensor's external parameters on the sensor's measurement accuracy, thereby solving the technical problem that the sensor's external parameters directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor. Then, the technical effect of optimizing the angle detection circuit, reducing the angle sensor's measurement error, and improving the working stability and reliability of related products is achieved.
[0146] In some technical solutions, optionally, the calculation formula of the correction value is:
[0147] y1=y0-ε1×sin(y0);
[0148] Among them, y1 is the corrected first angle information, y0 is the first angle information, and ε1 is the target deviation error.
[0149] In this technical solution, the calculation formula of the correction value is: y1 = y0-ε1×sin(y0). Among them, y0 is the first angle information detected by the angle sensor, and ε1 is the target deviation error corresponding to the second angle information detected by the angle sensor. After the first angle information and the target deviation error are substituted into the above formula, the calibrated first angle information corresponding to the current target deviation error can be calculated. Compared with y0, y1 calculated by this calculation formula is closer to the first actual angle information. When this formula is introduced into the sensor calibration process, the control can eliminate the error of the sensor by combining the theoretical target signal of the sensor and the actual output signal, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor. This achieves the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of related products.
[0150] like Figure 3 As shown, in some technical solutions, optionally, the number of the second angle information is at least two, and the target deviation error includes at least two deviation errors corresponding to the at least two second angle information one by one;
[0151] The first angle information is corrected by using a calculation formula of a target deviation error and a preset correction value to obtain the corrected first angle information, specifically including:
[0152] Step 302, performing error correction on the first angle information by using a calculation formula of a deviation error among at least two deviation errors and a correction value to obtain corrected first angle information;
[0153] Step 304, when the angle difference between the corrected first angle information and the second actual angle information is greater than or equal to the angle difference threshold, the corrected first angle information is again error corrected by using the calculation formula of other deviation errors and correction values among at least two deviation errors, until the angle difference between the first angle information again corrected and the second actual angle is less than the angle difference threshold, and the first angle information again corrected is determined as the target angle information.
[0154] In this technical solution, the number of second angle information is at least two, and the sensor can be multi-calibrated through at least two second angle information.
[0155] Specifically, among the at least two second angle information, each second angle information includes a deviation error corresponding to it. After determining the at least two deviation errors, one of the at least two deviation errors is selected and substituted into the calculation formula of the preset correction value, so as to perform error correction on the first angle information with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor during operation.
[0156] Thereafter, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor is within a reasonable range, the angle sensor can meet the measurement accuracy requirements, and the calibration process is then completed. On the contrary, if the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor exceeds the reasonable range, and the angle sensor still cannot meet the measurement accuracy requirements. Then, the corrected first angle information is corrected again by using the calculation formula of the other deviation errors and correction values in at least two deviation errors, until the angle difference between the first angle information corrected again and the second actual angle is less than the angle difference threshold, the first angle information corrected again is determined as the target angle information, until the calibrated angle sensor meets the measurement accuracy requirements, or all deviation errors are selected.
[0157] It can be seen that by setting the above control circuit, the angle sensor can be calibrated multiple times with the help of the control circuit, and specifically, the sensor error can be eliminated by combining the sensor's theoretical target signal and the actual output signal, so as to reduce the influence of the sensor's external parameters on the sensor's measurement accuracy, thereby solving the technical problem that the sensor's external parameters directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor. This can achieve the technical effect of optimizing the angle detection circuit, reducing the angle sensor's measurement error, and improving the working stability and reliability of related products.
[0158] In some technical solutions, optionally, the calculation formula of the correction value is:
[0159] y3=y2-ε2×sin(2×y2);
[0160] Among them, y3 is the corrected first angle information, y2 is the first angle information, and ε2 is the deviation error. In this technical solution, the calculation formula of the correction value is: y3 = y2-ε2×sin(2×y2). Among them, y2 is the first angle information detected by the angle sensor, and ε2 is the deviation error corresponding to one of the second angle information detected by the angle sensor. After the first angle information and the target deviation error are brought into the above formula, the calibrated first angle information corresponding to the current deviation error can be calculated. Compared with y2, y3 calculated by this calculation formula is closer to the first actual angle information. Bringing this formula into the sensor calibration process enables the control to eliminate the error of the sensor in combination with the theoretical target signal of the sensor and the actual output signal, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor. Thereby achieving the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of related products.
[0161] like Figure 4 As shown, an embodiment of the present invention provides an angle detection device 400, which is executed by the angle detection circuit in any of the above technical solutions, and the device includes:
[0162] A detection module 402, configured to detect first angle information;
[0163] A first determination module 404, configured to determine first actual angle information corresponding to the second angle information when the angle sensor detects the second angle information;
[0164] A correction module 406 is used to determine a target deviation error according to an angle difference between the first actual angle information and the second angle information, and to perform error correction on the first angle information by using a calculation formula of the target deviation error and a preset correction value to obtain corrected first angle information;
[0165] The second determination module 408 is configured to determine the corrected first angle information as the target angle information when the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than an angle difference threshold.
[0166] In this technical solution, an angle detection device 400 executed by the angle detection circuit in any of the above technical solutions is defined. The angle detection device 400 includes: a detection module 402, a first determination module 404, a correction module 406 and a second determination module 408.
[0167] Specifically, the second angle information is preset before the angle sensor works, and the second angle information corresponds to a preset calibration angle. Thereafter, in the process of the detection module 402 controlling the angle sensor to obtain the first angle information, if the angle sensor detects the second angle information, the first determination module 404 determines the first actual angle information corresponding to the second angle information.
[0168] After determining the first actual angle information, the correction module 406 determines the target deviation error based on the angle difference between the first actual angle information and the second angle information, where the second angle information is the detection value of the angle sensor, the first actual angle information is the actual value of the angle to be detected by the angle sensor, and the target deviation error is the current measurement error of the angle sensor.
[0169] After determining the target deviation error, the correction module 406 brings the target deviation error into the calculation formula of the preset correction value, and performs error correction on the first angle information with the result calculated by the calculation formula, thereby obtaining the corrected first angle information. The corrected first angle information serves as the output value of the calibrated angle sensor, which is closer to the first actual angle information than the second angle information, that is, the correction process can reduce the nonlinear error generated by the angle sensor during operation.
[0170] Finally, after completing the error correction process of the above-mentioned angle sensor, if the second determination module 408 determines that the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor is within a reasonable range, and the angle sensor can meet the measurement accuracy requirements, and then the calibration process is completed. On the contrary, if the second determination module 408 determines that the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is greater than or equal to the angle difference threshold, it means that the nonlinear error of the calibrated angle sensor exceeds the reasonable range, and the angle sensor still cannot meet the measurement accuracy requirements, and then selects the new second angle information and repeats the above-mentioned calibration process until the calibrated angle sensor meets the measurement accuracy requirements.
[0171] It can be seen that by limiting the above-mentioned angle detection device 400, the sensor can be calibrated with the help of the calibration process that can be realized by the control circuit. Specifically, the sensor can be combined with the theoretical target signal of the sensor and the output signal of the actual output to eliminate the error of the sensor, so as to reduce the influence of the external parameters of the sensor on the measurement accuracy of the sensor, thereby solving the technical problem that the external parameters of the sensor directly cause the linear output characteristics of the resistive sensor to present nonlinear characteristics, affecting the measurement accuracy of the resistive angle sensor. Then, the technical effect of optimizing the angle detection circuit, reducing the measurement error of the angle sensor, and improving the working stability and reliability of the related products is achieved.
[0172] like Figure 5 As shown, an embodiment of the present invention provides an angle detection device 500, which includes: a memory 502, in which a program or instruction is stored; a processor 504, which executes the program or instruction stored in the memory 502 to implement the steps of the angle detection method in any of the above technical solutions.
[0173] In this technical solution, an angle detection device 500 is provided which can implement the steps of the angle detection method in any of the above-mentioned technical solutions. Therefore, the angle detection device 500 has the advantages of the angle detection method in any of the above-mentioned technical solutions and can implement the technical effects of the angle detection method in any of the above-mentioned technical solutions. To avoid repetition, it will not be repeated here.
[0174] An embodiment of the present invention provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the angle detection method in any of the above technical solutions are implemented.
[0175] In this technical solution, a readable storage medium is provided which can implement the steps of the angle detection method in any of the above-mentioned technical solutions after being read by a processor. Therefore, the readable storage medium has the advantages of the angle detection method in any of the above-mentioned technical solutions and can implement the technical effects of the angle detection method in any of the above-mentioned technical solutions. To avoid repetition, it will not be repeated here.
[0176] It should be clarified that in the claims, specification and drawings of the present invention, the term "multiple" refers to two or more than two. Unless otherwise clearly defined, the orientation or position relationship indicated by the terms "upper" and "lower" is based on the orientation or position relationship shown in the drawings, which is only for the purpose of more conveniently describing the present invention and making the description process simpler, rather than indicating or implying that the device or element referred to must have the specific orientation described, be constructed and operated in a specific orientation, so these descriptions cannot be understood as limiting the present invention; the terms "connect", "install", "fix" and the like should be understood in a broad sense. For example, "connection" can be a fixed connection between multiple objects, or a detachable connection between multiple objects, or an integral connection; it can be a direct connection between multiple objects, or an indirect connection between multiple objects through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances of the above data.
[0177] In the claims, specification and drawings of the present invention, the description of the terms "one embodiment", "some embodiments", "specific embodiments" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In the claims, specification and drawings of the present invention, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0178] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An angle detection circuit, characterized in that: include: An angle sensor, used for detecting first angle information; A control circuit is electrically connected to the angle sensor. The control circuit is used for determining first actual angle information corresponding to the second angle information when the angle sensor detects the second angle information; Determine a target deviation error according to an angle difference between the first actual angle information and the second angle information, and perform error correction on the first angle information using a calculation formula of the target deviation error and a preset correction value to obtain corrected first angle information; When the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than an angle difference threshold, the corrected first angle information is determined as the target angle information.
2. The angle detection circuit according to claim 1, characterized in that: The calculation formula of the correction value is: y1=y0-ε1×sin(y0); Among them, y1 is the corrected first angle information, y0 is the first angle information, and ε1 is the target deviation error.
3. The angle detection circuit according to claim 1, characterized in that: The number of the second angle information is at least two, and the target deviation error includes at least two deviation errors corresponding to the at least two second angle information one by one; The control circuit is used to perform error correction on the first angle information by using a calculation formula of the target deviation error and a preset correction value to obtain the corrected first angle information, specifically including: Performing error correction on the first angle information by using a deviation error of the at least two deviation errors and a calculation formula of the correction value to obtain the corrected first angle information; and The control circuit is also used for: When the angle difference between the corrected first angle information and the second actual angle information is greater than or equal to the angle difference threshold, the corrected first angle information is error-corrected again by using the calculation formula of the other deviation errors among the at least two deviation errors and the correction value, until the angle difference between the corrected first angle information and the second actual angle is less than the angle difference threshold, and the corrected first angle information is determined as the target angle information.
4. The angle detection circuit according to claim 3, characterized in that: The calculation formula of the correction value is: y3=y2-ε2×sin(2×y2); Among them, y3 is the corrected first angle information, y2 is the first angle information, and ε2 is the deviation error.
5. The angle detection circuit according to claim 1, characterized in that: The angle sensor is a variable resistance angle sensor, and the first angle information is associated with a resistance value of the variable resistance angle sensor.
6. The angle detection circuit according to claim 1, characterized in that: Also includes: a first resistor, wherein a first end of the first resistor is electrically connected to the control circuit, and a second end of the first resistor is electrically connected to the angle sensor; a second resistor, wherein a first end of the second resistor is used to receive a power supply signal, and a second end of the second resistor is electrically connected to the angle sensor; A third resistor, wherein a first end of the third resistor is electrically connected to the angle sensor, and a second end of the third resistor is grounded.
7. An angle detection method, performed by the angle detection circuit according to any one of claims 1 to 6, characterized in that: The method comprises: detecting first angle information; In a case where the angle sensor detects second angle information, determining first actual angle information corresponding to the second angle information; Determine the target deviation error according to the angle difference between the first actual angle information and the second angle information, and perform error correction on the first angle information by using a calculation formula of the target deviation error and a preset correction value to obtain corrected first angle information; When the angle difference between the corrected first angle information and the second actual angle information corresponding to the first angle information is less than an angle difference threshold, the corrected first angle information is determined as the target angle information.
8. The angle detection method according to claim 7, characterized in that: The calculation formula of the correction value is: y1=y0-ε1×sin(y0); Among them, y1 is the corrected first angle information, y0 is the first angle information, and ε1 is the target deviation error.
9. The angle detection method according to claim 7, characterized in that: The number of the second angle information is at least two, and the target deviation error includes at least two deviation errors corresponding to the at least two second angle information one by one; The step of performing error correction on the first angle information by using a calculation formula of the target deviation error and a preset correction value to obtain the corrected first angle information specifically includes: Performing error correction on the first angle information by using a deviation error of the at least two deviation errors and a calculation formula of the correction value to obtain the corrected first angle information; When the angle difference between the corrected first angle information and the second actual angle information is greater than or equal to the angle difference threshold, the corrected first angle information is error-corrected again by using the calculation formula of the other deviation errors among the at least two deviation errors and the correction value, until the angle difference between the corrected first angle information and the second actual angle is less than the angle difference threshold, and the corrected first angle information is determined as the target angle information.
10. The angle detection method according to claim 9, characterized in that: The calculation formula of the correction value is: y3=y2-ε2×sin(2×y2); Among them, y3 is the corrected first angle information, y2 is the first angle information, and ε2 is the deviation error.
11. An angle detection device, implemented by the angle detection circuit according to any one of claims 1 to 6, characterized in that: The device comprises: A detection module, used for detecting first angle information; A first determining module, configured to determine first actual angle information corresponding to the second angle information when the angle sensor detects the second angle information; a correction module, configured to determine the target deviation error according to an angle difference between the first actual angle information and the second angle information, and perform error correction on the first angle information by using a calculation formula of the target deviation error and a preset correction value to obtain corrected first angle information; The second determination module is used to determine the corrected first angle information as the target angle information when the angle difference between the corrected first angle information and second actual angle information corresponding to the first angle information is less than an angle difference threshold.
12. An angle detection device, characterized in that: include: A memory, wherein a program or an instruction is stored in the memory; A processor, wherein the processor executes the program or instructions stored in the memory to implement the steps of the angle detection method according to any one of claims 7 to 10.
13. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the angle detection method as described in any one of claims 7 to 10 are implemented.