Angle sensor with automatic angle calibration and calibration measurement method thereof
Through the automatic calibration method combining the light emitting diode protective case and the PCB board, the microcontroller system and adjustable resistor are used to realize automatic calibration of high-resolution angle sensors, solving the reliability and accuracy problems of traditional sensors in dusty environments. Reduces costs and enhances anti-electromagnetic interference capabilities.
Patent Information
- Application Number
- CN202410774937.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-06-17
AI Technical Summary
Existing angle sensors have poor reliability and accuracy in dusty and dirty environments, and are affected by electromagnetic noise, have low resolution and inconvenient zero adjustment operation. Especially in some application scenarios, it is difficult to achieve automatic calibration, resulting in errors and drifts.
The light emitting diode protective case and the PCB board are combined to realize automatic angle calibration through the transmission structure and the microcontroller system, and the Burgundy bottle-type optical transmission channel and current amplifier circuit are used to improve resolution, and the angle measurement is combined with adjustable resistor and AD8605 chip. , uses cubic polynomial function fitting and least squares method to solve to achieve automatic calibration.
It realizes a high-resolution angle sensor, with strong automatic calibration capability, long life, low cost, and strong anti-electromagnetic interference capability, solving the error and drift problems of traditional sensors under environmental factors and external interference, saving design and manufacturing process Time and cost.
Smart Images

Figure CN118670303B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sensors, and in particular to an angle sensor with automatic angle calibration and a calibration measurement method thereof. Background Art
[0002] From industrial automation to the medical field, robotics has transformed many industries. Accurate position sensing is essential to send the necessary information to the robot controller for precise motion control. The traditional solution for measuring the angular position of a robot arm or a rotating axis is to use optical encoders and magnetic angle sensors.
[0003] Although optical encoders have high resolution, they are expensive and in dusty and dirty environments (such as industrial applications), contaminants will accumulate on the encoder disc, affecting reliability and accuracy. Magnetic angle sensors use magnetic encoder discs instead of slotted photoelectric encoder discs, which are more durable and vibration-resistant than optical encoders. However, the electromagnetic noise generated by the motor will have a great impact on the magnetic angle sensor, and position changes will cause position drift. In addition, the resolution of magnetic angle sensors is relatively low. The resolution of the above two angle sensors is determined by the encoder disc, so a new encoder disc must be used every time a different resolution is required, which increases the time and cost of the design and manufacturing process.
[0004] Angle sensors may have errors or drifts during use due to environmental factors, external interference, and other reasons. At this time, it is necessary to perform zero adjustment on the angle sensor to return the sensor to its initial state to ensure the accuracy of the sensor. The zero adjustment of optical encoders and magnetic angle sensors is often performed manually after removal, which not only wastes time but also the accuracy of zero adjustment cannot be guaranteed. In addition, manual zero adjustment is not convenient in some scenarios, such as angle sensors used in antennas and radars. Therefore, in this application scenario, there is an urgent need for an angle sensor with automatic angle calibration, high resolution, low temperature drift, long life, low cost, and strong resistance to electromagnetic radiation interference. Summary of the invention
[0005] The problem to be solved by the present invention is to provide an angle sensor with automatic angle calibration and a calibration measurement method thereof, so as to realize automatic angle calibration, have a long service life, low cost, little influence by electromagnetic interference, and high resolution.
[0006] The present invention adopts the following technical scheme: an angle sensor with automatic angle calibration, comprising: a light emitting diode protective shell, a receiving PCB (Printed Circuit Board, PCB) board protective shell, a transmitting PCB board, and a receiving PCB board.
[0007] Specifically, the light-emitting diode protective shell includes: a transmission structure, a threaded sleeve hole, a first screw hole, a burgundy bottle-shaped light transmission channel, and a convex groove;
[0008] The PCB board receiving protective shell comprises: three second screw holes with an included angle of 120°, a wiring hole, and a groove;
[0009] The transmitting PCB board includes: transmitting board holes, light emitting diodes and transmitting board circuits;
[0010] The receiving PCB board includes: a photodiode, a receiving board hole, a voltage conversion circuit, a current amplification circuit, a single-chip computer system, and an angle measurement circuit.
[0011] Specifically, the light emitting diode protective shell is used to protect the transmitting PCB board, and is transmitted between the transmission structure and the rotating shaft of the rotating structure to be tested and the receiving PCB board protective shell;
[0012] The receiving PCB board protective shell is used to fix the receiving PCB board, and is embedded in the internal groove and the convex groove in the light-emitting diode protective shell, so that the light-emitting diode protective shell and the receiving PCB board protective shell can be flexibly rotated;
[0013] The light emitting diode emits a light beam, which is converged through the Burgundy bottle-shaped light transmission channel and then irradiated on the photodiode to generate a photocurrent, which is amplified by the current amplifier circuit and then input into the I / O port of the single-chip computer system;
[0014] The angle measurement circuit includes an adjustable resistor dedicated for angle measurement, an AD8605 chip and a protective resistor; the AD8605 chip receives the angle-related analog voltage signal given by the adjustable resistor dedicated for angle measurement, and converts it into a digital signal after being input into the ADC pin of the single-chip computer system through the protective resistor;
[0015] The single chip microcomputer system performs information processing through software programming to complete automatic angle calibration.
[0016] Specifically, in the light-emitting diode protective shell, the transmission structure includes a four-layer structure: the bottom layer is a support body with an angle of 120°, the top three layers are progressive cylinders, and the top layer is a transmission rod, which is used to engage with the angle measurement-specific adjustable resistor in the receiving PCB board to achieve a transmission effect, and transmits between the light-emitting diode and the rotating shaft of the rotating structure to be measured and the receiving PCB board protective shell, thereby changing the resistance value.
[0017] The threaded sleeve hole is used to fix the light-emitting diode protective shell and the threaded sleeve on the rotating shaft of the structure to be tested. The shape is a groove dug out of a cylinder. The hole diameter is consistent with the outer diameter of the threaded sleeve, and the two have the same thread type, equal pitch, and consistent rotation direction.
[0018] There are four first screw holes, which are used to fix the transmitting PCB board on the light emitting diode protective shell.
[0019] The burgundy bottle-shaped light transmission channel is used to converge the light beam so that more light energy can be irradiated onto a single photodiode. The outer surface has a light-shielding coating to prevent light divergence to improve resolution. The bottle mouth is circular, the radius of which is the same as the radius of the circumscribed circle of the photodiode, and the center of the bottle mouth is aligned with the photodiode; the convex groove is used to be embedded in the groove of the PCB board protective shell, and plays a role in fixing and flexibly rotating between the two protective shells.
[0020] Specifically, in the PCB receiving protective shell, the second screw hole is used to fix the PCB receiving board on the PCB receiving protective shell; the wiring hole is used for externally connecting cables to various circuits on the PCB board.
[0021] Specifically, in the transmitting PCB board, there are four transmitting board holes with an angle of 90° between them; the light emitting diode is used to emit a light beam, which is converged through the Burgundy bottle-shaped light transmission channel and then irradiated on the photodiode to generate a photocurrent.
[0022] Specifically, in the receiving PCB board, 18 photodiodes are distributed at the edge of the circular receiving PCB board, with equal spacing and an angle of 20°; after being irradiated by light, photocurrent is generated and then input into the input / output (I / O) port of the single-chip microcomputer system after passing through the current amplification circuit.
[0023] The receiving plate has three holes, which are evenly distributed at the edge of the circular receiving PCB board with an angle of 120°, and are used for fixing the screws and the screw holes on the receiving PCB board protection box.
[0024] The voltage conversion circuit is used to convert a 5V DC voltage into a 3.3V DC voltage for use by various circuits and a single-chip computer system; the current amplification circuit is used to amplify the photocurrent generated by a photodiode.
[0025] The single chip microcomputer system is used for overall information processing, and realizes analysis of the photocurrent of the photodiode, conversion of the actual angle value and the corresponding resistance value, fitting of the cubic polynomial function of the angle with respect to the resistance value, and solution of the coefficients of the cubic polynomial function through software programming.
[0026] The angle measurement circuit is used to convert the analog voltage signal corresponding to the resistance value input into the ADC pin of the single-chip computer system into a digital signal.
[0027] Specifically, the angle measurement circuit includes a decoupling inductor, a decoupling capacitor, an adjustable resistor dedicated for angle measurement, an AD8605 chip, and a protection resistor.
[0028] The decoupling inductor and the decoupling capacitor are used to smooth the DC voltage in the circuit and filter out low-frequency and high-frequency noise in the power supply, thereby reducing electromagnetic radiation interference and improving electromagnetic compatibility.
[0029] The angle measurement-specific adjustable resistor is embedded in the transmission rod and is electrically connected to the IN+ pin of AD8605. When the transmission rod rotates, its resistance value will also change accordingly; the AD8605 chip is an operational amplifier chip, which is used to amplify the angle-related analog voltage value given by the angle measurement-specific adjustable resistor and input it into the ADC pin of the single-chip computer system through two protection resistors.
[0030] The protective resistor plays an overcurrent protection role for the entire angle measurement circuit, preventing the circuit current from being too large and burning out the chip and the angle measurement-specific adjustable resistor.
[0031] The technical solution of the present invention also provides an automatic calibration measurement method for an angle sensor, comprising the following steps:
[0032] S1. Install and fix the LED protective shell, the receiving PCB protective shell, the transmitting PCB and the receiving PCB;
[0033] S2, connect 5V DC voltage through external cable, output 3.3V DC voltage through voltage conversion circuit for use by transmitting PCB board and receiving PCB board circuit;
[0034] S3, the light emitting diode emits a light beam, which is converged through the burgundy bottle-shaped light transmission channel and then irradiated on the photodiode, so that all the photodiodes generate a photocurrent which passes through the current amplification circuit and is connected to the I / O port of the single-chip computer system;
[0035] S4, keep the receiving PCB board protective shell fixed, and drive the light emitting diode protective shell to rotate through the rotating shaft of the rotating structure to be tested;
[0036] S5, the single-chip computer system converts the photocurrent of the photodiode into voltage. When the voltage of a certain I / O port is the largest and the resistance of the angle measurement adjustable resistor is the smallest, the angle is set to 0° to increase the angle measurement range.
[0037] S6, continue to rotate the LED protective shell, and fit the cubic polynomial of angle with resistance value through software programming in the single-chip computer system; wherein a data point is set every 20°, and the angle and resistance value are matched, and there are four data points in every 60°;
[0038] S7. In the single-chip microcomputer system, the least square method is used to solve the polynomial coefficients of the six segmented intervals of 0° to 60°, 60° to 120°, 120° to 180°, 180° to 240°, 240° to 300°, and 300° to 360°, and the polynomial functions of the angles of the six segmented intervals with respect to the resistance value are obtained;
[0039] S8. Until the photocurrents of all photodiodes have reached their maximum values, in different segmented intervals, according to the cubic polynomial function, an angle value corresponding to the resistance of the currently measured angle measurement dedicated adjustable resistor can be obtained, thereby completing an angle calibration.
[0040] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0041] 1. The present invention is based on the principle of photoelectric tube, combined with adjustable resistor and single chip microcomputer, so that the angle sensor can realize automatic angle calibration while having high resolution, and solves the problem that the existing angle sensor may have errors or drifts in some application scenarios due to environmental factors, external interference and other reasons, but is not convenient for manual zero adjustment;
[0042] 2. The present invention utilizes the programmable function of the single-chip microcomputer, which has strong programmability and can adjust the resolution through programming, saving time and cost in the design and manufacturing process;
[0043] 3. The present invention does not use a coding disk and through a special circuit design, it has a longer service life, lower cost, and is less affected by electromagnetic interference than optical encoders and magnetic angle sensors. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a block diagram of the angle sensor system of the present invention;
[0045] Figure 2 It is a schematic diagram of the three-dimensional structure of the angle sensor of the present invention;
[0046] Figure 3 This is a schematic diagram of the three-dimensional structure of the light emitting diode protective shell of the angle sensor of the present invention;
[0047] Figure 4 This is a schematic diagram of the three-dimensional structure of the angle sensor receiving the PCB board protection shell of the present invention;
[0048] Figure 5 This is a schematic diagram of the transmitting PCB board of the angle sensor of the present invention;
[0049] Figure 6 This is a schematic diagram of a PCB board receiving the angle sensor of the present invention;
[0050] Figure 7An angle measurement circuit diagram of the angle sensor of the present invention;
[0051] Figure 8 This is a flow chart of the automatic calibration measurement method of the angle sensor of the present invention;
[0052] The accompanying drawings are marked as follows: 1. LED protective shell; 1-1. Transmission structure; 1-2. Threaded sleeve hole; 1-3. First screw hole; 1-4. Burgundy bottle-shaped light transmission channel; 1-5. Convex groove; 2. Receiving PCB board protective shell; 2-1. Second screw hole; 2-2. Wiring hole; 2-3. Groove; 3. Transmitter plate hole; 4. LED; 5. Light beam; 6. Photodiode; 7. Receiving plate hole; 8. Voltage conversion circuit; 9. Current amplification circuit; 10. Single chip microcomputer system; 11. Angle measurement circuit. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the application is further elaborated in detail below in conjunction with the accompanying drawings. The described embodiments are only a part of the embodiments involved in the present invention. All non-innovative embodiments of other researchers in the field on this embodiment belong to the protection scope of the present invention. At the same time, for the step numbering in the embodiment of the present invention, it is only set for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0054] In one embodiment of the present invention, the angle sensor with automatic angle calibration, such as Figure 2 As shown, it includes: a light emitting diode protection shell 1, a receiving PCB board protection shell 2, a transmitting PCB board, and a receiving PCB board;
[0055] The light-emitting diode protective shell 1 is used to protect the transmitting PCB board, and to transmit between the rotating shaft of the rotating structure to be tested and the receiving PCB board protective shell 2, including: a transmission structure 1-1, a threaded sleeve hole 1-2, a first screw hole 1-3, a Burgundy bottle-shaped light transmission channel 1-4, and a convex groove 1-5.
[0056] The light emitting diode protective shell 1 and the receiving PCB board protective shell 2 are inlaid through the convex groove 1-5 and the groove 2-3, so as to play the role of fixing and flexibly rotating between the two protective shells.
[0057] like Figure 3As shown, the top layer of the transmission structure 1-1 is a transmission rod, which is used to connect to the angle measurement-specific adjustable resistor R1 in the receiving PCB board, and plays a transmission effect. When the transmission rod rotates, its resistance value will also change accordingly; the threaded sleeve hole 1-2 is used to fix the light-emitting diode protective shell and the threaded sleeve on the rotating shaft of the rotating structure to be measured. The shape is a groove dug out of a cylinder. The aperture is consistent with the outer diameter of the threaded sleeve, and the two have the same thread type, equal pitch, and consistent rotation direction. Insert the threaded sleeve on the rotating shaft to be measured into the threaded sleeve hole 1-2 and tighten it to complete the fixation of the two;
[0058] The first screw hole 1-3 is used to fix the transmitting PCB board on the light-emitting diode protective shell, and the screw is passed through the transmitting board hole 3 on the transmitting PCB board to reach the screw hole and tighten it; the burgundy bottle-shaped light transmission channel 1-4 is used to converge the light beam so that more light energy can be irradiated on a single photodiode, and the outer surface has a light-shielding coating to prevent light divergence to improve resolution. The bottle mouth is circular, and the radius is the same as the radius of the circumscribed circle of the photodiode, and the center of the bottle mouth is aligned with the photodiode, and the bottle bottom circle is larger than the transmitting PCB board.
[0059] Accept PCB board protective shell 2, such as Figure 4 As shown, it includes: three second screw holes 2-1 with an angle of 120°, a wiring hole 2-2, and a groove 2-3. The wires in the sensor and the leads on the PCB pass through the wiring hole 2-2 for external cables; the second screw hole 2-1 is used to fix the receiving PCB board on the receiving PCB board protective shell 2, which is achieved by screws passing through the receiving board hole 7 on the receiving PCB board to reach the second screw hole and tighten.
[0060] The transmitting PCB board includes: a transmitting board hole 3, a light emitting diode 4 and a transmitting board circuit;
[0061] like Figure 5 As shown, the light emitting diode 4 is used to emit a light beam 5, which is converged through the Burgundy bottle-shaped light transmission channel 1-4 and then irradiated onto the photodiode 6, causing the photodiode to generate a photocurrent.
[0062] The receiving PCB board includes: a photodiode 6, a receiving board hole 7, a voltage conversion circuit 8, a current amplification circuit 9, a single chip system 10, and an angle measurement circuit 11.
[0063] like Figure 6 As shown, eighteen photodiodes 6 are distributed at the edge of the circular receiving PCB board, with equal spacing and an angle of 20°. After being irradiated by light, photocurrent is generated and input into the I / O port of the single-chip computer system 10 after passing through the current amplification circuit.
[0064] The voltage conversion circuit 8 is used to convert the 5V DC voltage into a 3.3V DC voltage for use by various circuits and the single-chip computer system 10; the current amplifier circuit 9 is used to amplify the photocurrent generated by the photodiode to improve the resolution; the single-chip computer system 10 is used to process the overall information, and through software programming, it realizes the analysis of the size of the photocurrent of the photodiode, the conversion of the actual angle value and the corresponding resistance value, the fitting of the cubic polynomial function of the angle with respect to the resistance value, and the solution of the coefficients of the cubic polynomial function.
[0065] The angle measurement circuit 11 is used to convert the analog voltage signal corresponding to the resistance value input to the ADC pin of the single chip computer system 10 into a digital signal.
[0066] Specifically, in the angle measurement circuit 11 of this embodiment, as Figure 7 As shown, the 3.3V DC voltage first passes through the 100μF decoupling inductor L1 and the 0.1μF and 10μF decoupling capacitors C1 and C2, and then is grounded through the 0.1μF decoupling capacitor C3. The two ends of the angle measurement-specific adjustable resistor R9 are connected in parallel with C3, and a wire is led out to be electrically connected to the IN+ pin of the AD8605 chip. At the same time, the IN+ pin and IN- are grounded through a 0.1μF decoupling capacitor. The V+ pin is connected to a 3.3V stable DC voltage as the power supply voltage of the AD8605 chip. The OUT pin is electrically connected to the ADC pin of the microcontroller system 10 through the protection resistors R2 and R3. At the same time, R2, R3 and R3 and the ADC pins are grounded through 0.1μF and 1μF decoupling capacitors C8 and C7 respectively.
[0067] Furthermore, the decoupling inductor L1 and the decoupling capacitors C1, C2, C3, C4, C5, C6, C7, and C8 are used to smooth the DC voltage in the circuit and filter out low-frequency and high-frequency noise in the power supply, thereby reducing electromagnetic radiation interference and improving electromagnetic compatibility; the angle measurement-specific adjustable resistor is engaged with the transmission rod, with a maximum resistance of 10 kΩ, and its resistance value will change accordingly when the transmission rod rotates.
[0068] The AD8605 chip is an operational amplifier chip, which is used to amplify the angle-related analog voltage value given by the angle measurement dedicated adjustable resistor and input it to the ADC pin of the single-chip computer system 10 through two protection resistors; the protection resistors R2 and R3 play an overcurrent protection role for the entire angle measurement circuit, preventing the circuit current from being too large and burning the chip and the angle measurement dedicated adjustable resistor.
[0069] Based on the above angle sensor, the angle is automatically calibrated and measured, as shown in the following method: Figure 2 and Figure 8 As shown, the following steps are included;
[0070] Step 1: Install and fix all devices as required;
[0071] Step 2: Connect a 5V DC voltage through an external cable, and output a 3.3V DC voltage through a voltage conversion circuit for use by various circuits and the single-chip microcomputer system;
[0072] Step 3, the photocurrent generated by all the photodiodes is electrically connected to the I / O port of the single-chip computer system after passing through the current amplification circuit;
[0073] Step 4: Keep the protective shell of the PCB board fixed, and the rotating shaft of the rotating structure to be tested drives the protective shell of the light-emitting diode to rotate.
[0074] Step 5, the single-chip computer system converts the photocurrent of the photodiode into a voltage, and when the voltage of a certain I / O port is the largest and the resistance value of the angle measurement adjustable resistor is the smallest at this time, the angle is defined as 0°;
[0075] Furthermore, ensuring that the resistance of the angle measurement adjustable resistor is minimal is to maximize the range of angle measurement;
[0076] Step 6: Let the LED protection box continue to rotate, and program a cubic polynomial fitting angle with respect to resistance value in the software; where every 20°, the angle corresponds to a specific resistance value as a data point, that is, there are four data points within every 60°.
[0077] Furthermore, the fitted angle polynomial with respect to the resistance value is:
[0078] Step seven, program in the software to use the least squares method through the single-chip computer system to solve the polynomial coefficients of the six segmented intervals of 0° to 60°, 60° to 120°, 120° to 180°, 180° to 240°, 240° to 300°, and 300° to 360°, and obtain the polynomial function of the six segmented interval angles with respect to the resistance value.
[0079] Furthermore, the least squares method is calculated as follows:
[0080] (1) Assume the fitting polynomial is
[0081]
[0082] Among them, R represents the resistance value of the angle measurement dedicated adjustable resistor collected by the single chip microcomputer, a 0 、a 1 、a 2 、a 3 represent the polynomial coefficients, It means the angle value corresponding to the above resistance value after the polynomial coefficient is solved and the polynomial is fitted;
[0083] (2) The sum of the distances from the data points corresponding to the angle of resistance in a certain interval to this curve, that is, the sum of squared errors is
[0084]
[0085] Among them, θ i Represents the four fixed angle values corresponding to the four data points in the segmented interval, each fixed angle is an integer multiple of 20°, i = 1, 2, 3, 4; σ 2 represents the sum of squared errors;
[0086] (3) According to the least squares principle, find a on the right side of the equation i The partial derivative of
[0087]
[0088] Among them, R i Indicates the actual resistance value of the angle measurement dedicated adjustable resistor corresponding to each fixed angle in the four data points;
[0089] (4) Simplified
[0090]
[0091]
[0092] (5) Convert to matrix form
[0093]
[0094] (6) Simplified
[0095]
[0096] (7) Further simplification gives the following four equations:
[0097] θ 1 =a 0 +a 1 R 1 +a 2 R 1 2 +a 3 R 1 3
[0098] θ 2 =a 0 +a 1 R 2 +a 2 R 2 2 +a 3 R 2 3
[0099] θ 3 =a 0 +a 1 R 3 +a 2 R 3 2 +a 3 R 3 3
[0100] θ 4 =a 0 +a 1 R 4 +a 2 R 4 2 +a 3 R 4 3
[0101] (8) Solve the four equations simultaneously to obtain the coefficient a of the cubic polynomial in each segment interval 0 、a 1 、a 2 、a 3 .
[0102] Step eight, until all photodiode photocurrents have reached the maximum value, in different segmented intervals, according to the cubic polynomial function, an angle value corresponding to the resistance of the currently measured angle measurement dedicated adjustable resistor can be obtained, thus completing an angle calibration.
[0103] In summary, the present invention enables the angle sensor to achieve automatic angle calibration while having a high resolution, thereby solving the problem of errors or drifts that may occur during the use of the sensor due to environmental factors, external interference, etc.; it utilizes the programmable function of the single-chip microcomputer, has strong programmability, and can adjust the resolution through programming, saving time and cost in the design and manufacturing process.
[0104] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An angle sensor with automatic angle calibration, It is characterized in that include: A light emitting diode protective shell (1), a receiving PCB board protective shell (2), a transmitting PCB board, and a receiving PCB board; The light emitting diode protective shell (1) is used to protect the emitting PCB board, and is transmitted between the transmission structure (1-1) and the rotating shaft of the rotating structure to be measured, and the receiving PCB board protective shell (2), and is provided with a Burgundy bottle-shaped light transmission channel (1-4) and a convex groove (1-5) inside; The PCB receiving protective shell (2) is used to fix the PCB receiving shell and is provided with a groove (2-2) inside; the groove (2-2) and the convex groove (1-5) are embedded to enable the light emitting diode protective shell (1) and the PCB receiving protective shell (2) to be rotatably connected; The transmitting PCB board comprises: a transmitting board hole (3), a light emitting diode (4), and a transmitting board circuit; The receiving PCB board comprises a photodiode (6), a receiving board hole (7), a voltage conversion circuit (8), a current amplification circuit (9), a single chip computer system (10), and an angle measurement circuit (11); The light emitting diode (4) emits a light beam (5), which is converged through the Burgundy bottle-shaped light transmission channel (1-4) and irradiated onto the photodiode (6) to generate a photocurrent, which is amplified by the current amplifier circuit (9) and then input into the I / O port of the single-chip computer system (10); The angle measurement circuit (11) comprises an angle measurement dedicated adjustable resistor, an AD8605 chip and a protective resistor; the AD8605 chip receives an angle-related analog voltage signal given by the angle measurement dedicated adjustable resistor, and converts the received analog voltage signal into a digital signal after being input into an ADC pin of a single-chip computer system (10) via the protective resistor; The single chip computer system (10) performs information processing through software programming to complete automatic angle calibration.
2. The angle sensor for automatic angle calibration according to claim 1, It is characterized in that The transmission structure (1-1) has four layers, wherein the first layer, the second layer and the third layer are cylinders that are arranged in a progressive manner from top to bottom, and the fourth layer is a support body supported by three support shafts with an included angle of 120°; the first layer is a transmission rod, which is used to engage with an adjustable resistor specially used for angle measurement in a PCB board, and adjust the value of the resistor through transmission; The burgundy bottle-shaped light transmission channel (1-4) is used to converge the light beam (5), has a light-shielding coating on the outer surface, has a circular bottle mouth, has a radius that is the same as the radius of the circumscribed circle of the photodiode (6), and the center of the bottle mouth is aligned with the photodiode (6).
3. The angle sensor for automatic angle calibration according to claim 2, It is characterized in that The light-emitting diode protective shell (1) further comprises: a threaded sleeve hole (1-2) and a first screw hole (1-3); The threaded sleeve hole (1-2) is used to fix the rotating structure to be measured, and is in the shape of a cylindrical groove, the diameter of the groove is consistent with the outer diameter of the threaded sleeve on the rotating shaft of the rotating structure to be measured, and the thread type is the same, the pitch is equal, and the rotation direction is consistent; there are four first screw holes (1-3) for fixing the transmitting PCB board on the light-emitting diode protective shell (1).
4. The angle sensor with automatic angle calibration according to claim 1, It is characterized in that The light emitting diode (4) is arranged at the center of the transmitting PCB board, the transmitting board has four holes (3) with an included angle of 90°, and is fixed by screws and the first screw holes (1-3) on the light emitting diode protective shell (1).
5. The angle sensor with automatic angle calibration according to claim 2, It is characterized in that The receiving PCB board protective shell (2) further comprises a second screw hole (2-1) and a wiring hole (2-2); the second screw holes (2-1) have three holes, the angles between which are all 120°, and are used to fix the receiving PCB board; the wiring hole (2-2) is used to pass the external cable of the receiving PCB board circuit.
6. The angle sensor with automatic angle calibration according to claim 5, It is characterized in that The receiving PCB board is circular, and there are 18 photodiodes (6) which are evenly spaced and distributed at the circular edge of the receiving PCB board, and the angle between adjacent photodiodes (6) is 20°; The receiving plate has three holes (7) distributed at the edge of the circular receiving PCB board with an included angle of 120°, and is fixed by screws and the second screw holes (2-1) on the receiving PCB board protective shell (2); The voltage conversion circuit (8) converts a 5V DC voltage into a 3.3V DC voltage for use by a receiving board circuit and a single-chip computer system (10).
7. The angle sensor with automatic angle calibration according to claim 6, It is characterized in that The angle measurement dedicated adjustable resistor is embedded in the transmission rod, has a maximum resistance of 10 kΩ, and is electrically connected to the IN+ pin of AD8605. When the transmission rod rotates, the resistance value changes accordingly. The AD8605 chip is an operational amplifier chip, which is used to amplify the angle-related analog voltage value given by the angle measurement dedicated adjustable resistor and input it into the ADC pin of the single-chip computer system (10) through two protective resistors. The protective resistor is used to perform overcurrent protection on the angle measurement circuit (11).
8. The angle sensor with automatic angle calibration according to claim 7, It is characterized in that The angle measurement circuit (11) further comprises a decoupling inductor and a decoupling capacitor; the decoupling inductor and the decoupling capacitor are used to smooth the direct current voltage in the circuit and filter the low-frequency and high-frequency noise in the power supply, thereby reducing electromagnetic radiation interference.
9. An automatic calibration measurement method for an angle sensor, applied to the angle sensor according to any one of claims 1 to 8, It is characterized in that The following steps are involved: S1. Install and fix the LED protective shell, the receiving PCB protective shell, the transmitting PCB and the receiving PCB; S2, connect 5V DC voltage through external cable, output 3.3V DC voltage through voltage conversion circuit for use by transmitting PCB board and receiving PCB board circuit; S3, the light emitting diode emits a light beam, which is converged through the burgundy bottle-shaped light transmission channel and then irradiated on the photodiode, so that all the photodiodes generate a photocurrent which passes through the current amplification circuit and is connected to the I / O port of the single-chip computer system; S4, keep the protective shell of the receiving PCB board fixed, and drive the protective shell of the light-emitting diode to rotate through the rotating shaft of the rotating structure to be tested; S5, the single-chip computer system converts the photocurrent of the photodiode into voltage. When the voltage of a certain I / O port is the largest and the resistance of the angle measurement adjustable resistor is the smallest, the angle is set to 0° to increase the angle measurement range. S6, continue to rotate the LED protective shell, and fit the cubic polynomial of angle with resistance value through software programming in the single-chip computer system; wherein a data point is set every 20°, and the angle and resistance value are matched, and there are four data points in every 60°; S7. In the single-chip microcomputer system, the least square method is used to solve the polynomial coefficients of the six segmented intervals of 0° to 60°, 60° to 120°, 120° to 180°, 180° to 240°, 240° to 300°, and 300° to 360°, and the polynomial functions of the angles of the six segmented intervals with respect to the resistance value are obtained; S8. Until the photocurrents of all photodiodes have reached their maximum values, in different segmented intervals, according to the cubic polynomial function, an angle value corresponding to the resistance of the currently measured angle measurement dedicated adjustable resistor can be obtained, thereby completing an angle calibration.
10. The automatic calibration measurement method for an angle sensor according to claim 9, It is characterized in that In step S7, the least square method includes the following sub-steps: S7.
1. Set the fitting polynomial, expressed as: Among them, R represents the resistance value of the angle measurement dedicated adjustable resistor collected by the single chip microcomputer, a 0 、a 1 、a 2 、a 3 denote the polynomial coefficients, It means the angle value corresponding to the above resistance value after the polynomial coefficient is solved and the polynomial is fitted; S7.
2. Calculate the sum of the distances from the data points corresponding to the angle of resistance in a certain interval to this curve, expressed as: Among them, θ i Represents the four fixed angle values corresponding to the four data points in the segmented interval, each fixed angle is an integer multiple of 20°, i = 1, 2, 3, 4; σ 2 represents the sum of squared errors; S7.
3. According to the least squares principle, find a on the right side of the equation i The partial derivative of : Among them, R i Indicates the actual resistance value of the angle measurement dedicated adjustable resistor corresponding to each fixed angle in the four data points; S7.4, simplify and obtain: S7.5, into matrix form: S7.6, simplify and obtain: S7.7, further simplify to obtain the following four equations: θ 1 s 0 +a 1 R 1 +a 2 R 1 2 +a 3 R 1 3 θ 2 s 0 +a 1 R 2 +a 2 R 2 2 +a 3 R 2 3 θ 3 s 0 +a 1 R 3 +a 2 R 3 2 +a 3 R 3 3 θ 4 s 0 +a 1 R 4 +a 2 R 4 2 +a 3 R 4 3 S7.
8. Solve the four equations simultaneously to obtain the coefficient a of the cubic polynomial in each segment interval. 0 、a 1 、a 2 、a 3 .
