Angle calibration method, electronic equipment and storage medium
By elliptical fitting and abnormal point removal of sampling points output by the angle sensor, calibrating into a standard circle, the signal deviation problem caused by installation errors in brushless motor control is solved, and the accuracy and stability of motor control is improved.
Patent Information
- Application Number
- CN202510260284.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-06-06
AI Technical Summary
In brushless motor control, installation errors or other factors cause deviations in the signal amplitude and phase output of the angle sensor, thereby reducing the accuracy of the motor control.
By elliptical fitting of the sampling points output by the angle sensor, identifying and removing the abnormal points, obtaining a second fitting curve, and calibrating it into a standard circle to optimize the data and calibrating the error of the sensor installation position.
Improves the accuracy and stability of motor control, reduces the impact of noise and interference on the system, and optimizes the accuracy of data.
Smart Images

Figure CN120101731A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and in particular to an angle calibration method, electronic equipment and storage medium. Background Art
[0002] In the field of brushless motor control, accurate acquisition of motor rotor angle information is the key to achieving efficient control. The operation of brushless motors depends on accurate perception of the rotor position so that the motor windings can be commutated at the right time to achieve efficient and stable operation.
[0003] At present, there are two main ways to obtain angles: sensorless and sensored. Among the sensored methods, there are two types: directly obtaining digital angle information and directly obtaining orthogonal signals of magnetic field rotation, such as sine and cosine signals. Sensors that directly obtain angle information have compensation mechanisms in their chips and are highly accurate and responsive, but they are more expensive. Sensors that directly obtain rotating orthogonal signals usually do not have compensation and require an external processor to decode the angle information, but they are cheaper.
[0004] Figure 1 The installation method of the angle sensor is shown. The sensor directly obtains the rotation orthogonal signal. Ideally, the magnet is directly opposite the center of the sensor and the magnetic field is evenly distributed. The sensor can obtain Figure 2 The cosine and sinine signals are completely orthogonal as shown in the figure. However, due to the error in the installation position and other factors, there are deviations in the amplitude and phase. Figure 3 The cosine and sinine signals shown in the figure are directly analyzed as follows: Figure 4 As shown in the figure, the red one is the standard circle, and the blue one is the circle after cosine and sinine analysis when there is an error. This directly affects the accuracy of angle analysis, thereby reducing the accuracy of motor control. Summary of the invention
[0005] The present invention provides an angle calibration method, an electronic device and a storage medium to solve the problem of signal deviation caused by installation error or other factors, thereby reducing the accuracy of motor control.
[0006] According to one aspect of the present invention, there is provided an angle calibration method, comprising:
[0007] Acquire sampling points output by the angle sensor, and perform linear fitting of an ellipse on the sampling points to obtain a first fitting curve;
[0008] Determining an outlier point according to the first fitting curve;
[0009] After removing the abnormal points, linear fitting of the ellipse is performed again to obtain a second fitting curve;
[0010] The second fitting curve is calibrated to a standard circle.
[0011] Optionally, the acquiring sampling points output by the angle sensor and performing linear fitting of an ellipse on the sampling points to obtain a first fitting curve includes:
[0012] The sampling points are obtained by using the least square method, and a linear ellipse fitting is performed on the sampling points to obtain a first fitting curve.
[0013] Optionally, determining an outlier point according to the first fitting curve includes:
[0014] Determine the threshold interval of normal points;
[0015] An abnormal point in the first fitting curve is determined according to the threshold interval.
[0016] Optionally, after removing the abnormal point, performing linear fitting of the ellipse again to obtain a second fitting curve, the method further includes: acquiring the coordinates of the center of the first fitting curve and the second fitting curve, the offset angle, the major axis, and the minor axis data information;
[0017] The step of calibrating the second fitting curve to a standard circle comprises:
[0018] Determine a calibrated ellipse according to the offset angle and the center coordinates of the second fitting curve;
[0019] The calibrated ellipse is calibrated to a standard circle.
[0020] Optionally, determining the calibrated ellipse according to the offset angle and the center coordinates of the second fitting curve includes:
[0021] The calibrated ellipse is determined from the following parametric equations for a circle:
[0022]
[0023] Where x' is the corrected x point, y' is the corrected y point, θ is the offset angle, c x is the x-axis center of the ellipse, c y is the y-axis center of the ellipse.
[0024] Optionally, calibrating the calibrated ellipse to a standard circle includes:
[0025] Determine the scaling factors of the X and Y axes according to the maximum and minimum values of the X and Y axes of the ellipse;
[0026] Determine the center offset of the ellipse according to the maximum value, minimum value of the X and Y axes and the scaling factor;
[0027] The standard circle sampling value is determined according to the scaling factor, the actual ellipse value and the circle center offset.
[0028] Optionally, the scaling factors of the X and Y axes are determined according to the maximum and minimum values of the X and Y axes. The specific calculation formula is:
[0029]
[0030] Among them, X sf and Y sf are the scaling factors for the X and Y axes respectively, max and Y min are the maximum and minimum values of the Y axis, respectively, max and X min are the maximum and minimum values of the X-axis respectively;
[0031] The center offset of the ellipse is determined according to the maximum value, minimum value and scaling factor of the X and Y axes, and the calculation formula is:
[0032]
[0033] Among them, X off and Y off Respectively represent the center offset of the X-axis and Y-axis.
[0034] Optionally, the standard circle sampling value is determined according to the scaling factor, the actual ellipse value and the circle center offset, and the calculation formula is:
[0035]
[0036] Among them, X x and Y y is the standard circle sampling value, rotated_sinx' and rotated_cosx' are the actual ellipse values.
[0037] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0038] at least one processor; and
[0039] a memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the angle calibration method described in any embodiment of the present invention.
[0041] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the angle calibration method described in any embodiment of the present invention when executed.
[0042] The technical solution of the embodiment of the present invention can better describe the overall trend of the sensor output by performing ellipse fitting on the sampling points output by the angle sensor, and can reduce the impact of noise and interference on the system by identifying and removing abnormal points. The first fitting curve and the second fitting curve are obtained by two fittings, and the second fitting curve is calibrated to optimize the data. The technical solution of the embodiment of the present invention calibrates the amplitude and phase deviations caused by the errors in the installation position of the sensor and the influence of other factors, improves the motor control accuracy, and thus improves the stability of the motor control.
[0043] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 This is a schematic diagram of the angle sensor installation method;
[0046] Figure 2 This is a schematic diagram of the cosine and sinine signals obtained by the angle sensor under ideal conditions;
[0047] Figure 3 This is a schematic diagram of the cosine and sinine signals obtained by the angle sensor when there is an installation error;
[0048] Figure 4 It is a schematic diagram of the circle directly obtained by analysis and the standard circle when there is an installation error;
[0049] Figure 5 is a flow chart of an angle calibration method provided according to an embodiment of the present invention;
[0050] Figure 6 is a flow chart of another angle calibration method provided according to an embodiment of the present invention;
[0051] Figure 7is a schematic diagram of a first fitting curve and a second fitting curve according to an embodiment of the present invention;
[0052] Figure 8 is a flow chart of another angle calibration method provided according to an embodiment of the present invention;
[0053] Fig. 9 is a flow chart of another angle calibration method provided according to an embodiment of the present invention;
[0054] Fig.10 is a schematic diagram of a calibrated ellipse and a standard circle according to an embodiment of the present invention;
[0055] Fig.11 It is a schematic diagram of the structure of an electronic device for implementing the angle calibration method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0058] Figure 5 A flowchart of an angle calibration method is provided for an embodiment of the present invention. This embodiment can be applied to scenarios requiring high-precision angle measurement, such as motor control, industrial automation, and automotive electronics. Figure 5 As shown, the method includes:
[0059] S101, acquiring sampling points output by the angle sensor, and performing linear fitting of an ellipse on the sampling points to obtain a first fitting curve;
[0060] Among them, the angle sensor is a sensor that can measure angles, and is usually used to detect the angle change of a rotating object. The output data can be an angle value or other physical quantities related to the angle. The sampling point refers to the data point obtained from the angle sensor. The sampling point can be fitted into an ellipse using a linear fitting method to obtain a first fitting curve. Specifically, the sampling point can be fitted using a least squares method to obtain the first fitting curve.
[0061] S102, determining an abnormal point according to the first fitting curve;
[0062] Among them, the abnormal points may be caused by sensor failure, external interference, measurement error or other abnormal conditions. The abnormal points can be data with large deviations or points far away from the ellipse equation, which need to be removed.
[0063] S103, after removing the abnormal points, performing linear fitting of the ellipse again to obtain a second fitting curve;
[0064] Among them, outliers are removed from the original sampling points, and ellipse fitting is performed on the remaining normal points again to obtain a second fitting curve. The second fitting curve is closer to the actual data distribution.
[0065] S104: calibrate the second fitting curve to a standard circle.
[0066] Among them, calibration can convert the second fitting curve of the ellipse shape into a standard circle. The parameters of the ellipse can be extracted from the second fitting curve, including the center coordinates, major axis, minor axis and rotation angle. The calibration coefficient is calculated according to the ellipse parameters. The coordinates of the ellipse are mapped to the coordinates of the standard circle through mathematical transformation. The lengths of the major axis and minor axis of the calibrated ellipse are different, and they can be made equal by scaling and calibrated to a standard circle.
[0067] The technical solution of the embodiment of the present invention can better describe the overall trend of the sensor output by performing ellipse fitting on the sampling points output by the angle sensor, and can reduce the impact of noise and interference on the system by identifying and removing abnormal points. The first fitting curve and the second fitting curve are obtained by two fittings, and the second fitting curve is calibrated to optimize the data. The technical solution of the embodiment of the present invention calibrates the amplitude and phase deviations caused by the errors in the installation position of the sensor and the influence of other factors, improves the motor control accuracy, and thus improves the stability of the motor control.
[0068] In some optional embodiments of the present invention, acquiring sampling points output by the angle sensor and performing linear fitting of an ellipse on the sampling points to obtain a first fitting curve includes:
[0069] The sampling points are obtained by using the least square method, and the linear fitting of the ellipse is performed on the sampling points to obtain the first fitting curve.
[0070] Among them, due to the non-uniform distribution of the magnetic field and the error of the sensor installation position, the center of the magnetic field will also have deviations. The least squares method can be used to extract the information of the ellipse. The general form of the ellipse equation is: 2 +Axy+By 2 +Cx+Dy+E=0, the least squares method is used to fit the elliptical equation to the sampling points, which actually calculates the values of A, B, C, D, and E.
[0071] Specifically, because there are 5 parameters, the number of sampling points must be at least 5. For example, you can set the number of sampling points to 20. N represents the number of sampling points. The partial derivatives of A, B, C, D, and E are:
[0072]
[0073] by For example,
[0074]
[0075] Put the terms containing A, B, C, D, E on the left, and the terms not containing A, B, C, D, E on the right, and we get:
[0076] ∑Ax 2 y 2 +∑Bxy 3 +∑Cx 2 y+∑Dxy 2 +∑Exy=∑-x 3 y;
[0077] Written in matrix form:
[0078]
[0079] akin, The matrix forms are as follows:
[0080]
[0081] Among them, ∑1=N, and the five matrices are merged as follows:
[0082]
[0083] can be written as:
[0084]
[0085] but The fitting coefficients can be obtained, thereby obtaining the first fitting curve and the second fitting curve.
[0086] Figure 6 is a flowchart of another angle calibration method provided according to an embodiment of the present invention; in some optional embodiments of the present invention, reference Figure 5 and Figure 6 After further refining S102, determining the abnormal point according to the first fitting curve, the method includes:
[0087] S201, acquiring sampling points output by the angle sensor, and performing linear fitting of an ellipse on the sampling points to obtain a first fitting curve;
[0088] S202, determining a threshold interval of normal points;
[0089] Among them, the normal point refers to the data point that meets the expected first fitting curve, and the threshold interval refers to a reasonable range determined according to the result of ellipse fitting, which is used to judge whether the data point is a normal point. It can be based on the statistical distribution of the geometric parameters of the ellipse or based on experience.
[0090] S203: Determine an abnormal point in the first fitting curve according to the threshold interval.
[0091] Among them, an outlier is a data point that does not meet the threshold interval. The deviation of each sampling point is compared with the threshold interval. If the deviation of the sampling point exceeds the threshold interval, it is considered an outlier. All points that exceed the threshold are marked as outliers. Among them, Figure 7 is a schematic diagram of the first fitting curve and the second fitting curve of an embodiment of the present invention. Figure 7 As shown, red is the position of the points collected after one rotation, and green is the fitted elliptic curve and the obtained ellipse information data.
[0092] S204, after removing the abnormal points, performing linear fitting of the ellipse again to obtain a second fitting curve;
[0093] S205: calibrate the second fitting curve to a standard circle.
[0094] The technical solution of the embodiment of the present invention can remove errors caused by sensor nonlinearity, installation deviation, etc. by determining the threshold range and identifying abnormal points. After removing the abnormal points, the remaining data points are closer to the actual situation, reducing the deviation caused by abnormal values.
[0095] Figure 8 is a flowchart of another angle calibration method provided according to an embodiment of the present invention; in some optional embodiments of the present invention, reference Figure 5 and Figure 8After removing the abnormal points in S103 and performing linear fitting of the ellipse again to obtain the second fitting curve, S304 is added to obtain the center coordinates, offset angle, major axis, and minor axis data information of the second fitting curve; and after further refining S104 to calibrate the second fitting curve to a standard circle, the method includes:
[0096] S301, acquiring sampling points output by the angle sensor, and performing linear fitting of an ellipse on the sampling points to obtain a first fitting curve;
[0097] S302, determining an abnormal point according to the first fitting curve;
[0098] S303, after removing the abnormal points, performing linear fitting of the ellipse again to obtain a second fitting curve;
[0099] S304, obtaining the coordinates of the center of the second fitting curve, the offset angle, the major axis, and the minor axis data information;
[0100] Among them, the center coordinates refer to the coordinates of the center point of the ellipse. The offset angle refers to the angle between the major axis of the ellipse and the coordinate axis. The major axis and minor axis data represent the length of the major axis of the ellipse and the length of the minor axis of the ellipse respectively. The above parameters can be extracted from the second fitting curve.
[0101] S305, determining a calibrated ellipse according to the offset angle and the center coordinates of the second fitting curve;
[0102] The position and direction of the ellipse can be adjusted by adjusting the center coordinates and the offset angle of the second fitting curve to make it closer to the ideal state. The calibrated ellipse is determined by rotation and translation operations.
[0103] S306, calibrating the calibrated ellipse into a standard circle.
[0104] The length of the major axis and the minor axis of a standard circle are equal, that is, the radius. The ellipse can be converted to a standard circle by scaling and offsetting. By calculating the scaling factor and determining the center offset, the sampling points on the ellipse are adjusted according to the scaling factor and the center offset, and the calibrated ellipse can be calibrated to a standard circle.
[0105] The technical solution of the present invention can more accurately calibrate the position and shape of the ellipse by obtaining the center coordinates, offset angle, major axis and minor axis of the second fitting curve. The ellipse is converted into a standard circle through rotation and translation operations. The reliability of the data is improved through calibration.
[0106] In some optional embodiments of the present invention, determining the calibrated ellipse according to the offset angle and the center coordinates of the second fitting curve includes:
[0107] The calibrated ellipse is determined from the following parametric equations for a circle:
[0108]
[0109] Where x' is the corrected x point, y' is the corrected y point, θ is the offset angle, c x is the x-axis center of the ellipse, c y is the y-axis center of the ellipse.
[0110] Fig. 9 is a flowchart of another angle calibration method provided according to an embodiment of the present invention. Figure 8 and Fig. 9 After further refining S306, calibrating the calibrated ellipse to a standard circle, the method includes:
[0111] S401, acquiring sampling points output by the angle sensor, and performing linear fitting of an ellipse on the sampling points to obtain a first fitting curve;
[0112] S402, determining an abnormal point according to the first fitting curve;
[0113] S403, after removing the abnormal points, performing linear fitting of the ellipse again to obtain a second fitting curve;
[0114] S404, obtaining the coordinates of the center of the second fitting curve, the offset angle, the major axis, and the minor axis data information;
[0115] S405, determining a calibrated ellipse according to the offset angle and the center coordinates of the second fitting curve;
[0116] S406, determining the scaling factors of the X and Y axes according to the maximum and minimum values of the X and Y axes of the ellipse;
[0117] The scaling factors of the X and Y axes are used to scale the major and minor axes of the ellipse to the same length. The maximum and minimum values of the X and Y axes of the ellipse correspond to the endpoints of the major and minor axes of the ellipse, respectively. The scaling factor can adjust the major and minor axes of the ellipse to equal length, thereby converting the ellipse into a circle.
[0118] S407, determining the center offset of the ellipse according to the maximum value, minimum value and scaling factor of the X and Y axes;
[0119] The center offset of the ellipse refers to the displacement of the center of the ellipse relative to the coordinate origin. The center position of the ellipse can be determined by the maximum and minimum values of the X-axis and Y-axis of the ellipse, thereby determining the center offset of the ellipse.
[0120] S408: Determine a standard circle sampling value according to the scaling factor, the actual ellipse value, and the circle center offset.
[0121] The standard circle sampling value refers to the coordinates of the points on the ellipse that are obtained by scaling and offsetting the points on the ellipse to meet the standard circle. The points on the ellipse can be mapped to the standard circle according to the scaling factor and the center offset. Fig.10 The calibrated ellipse and the perfect circle are shown.
[0122] The technical solution of the embodiment of the present invention can adjust the major and minor axes of the ellipse to equal lengths by calculating the scaling factor, thereby converting the ellipse into a standard circle. By calculating the center offset, the center position of the ellipse can be more accurately determined. The position of the ellipse can be more accurately adjusted to make it closer to the standard circle. By adjusting the points on the ellipse to points on the standard circle through the scaling factor and the center offset, the conversion from the ellipse to the standard circle is realized.
[0123] In some optional embodiments of the present invention, the scaling factors of the X and Y axes are determined according to the maximum and minimum values of the X and Y axes of the ellipse. The specific calculation formula is:
[0124]
[0125] Among them, X sf and Y sf are the scaling factors for the X and Y axes respectively, max ,Y min are the maximum and minimum values of the Y axis, respectively, max and X min are the maximum and minimum values of the X-axis respectively;
[0126] The center offset of the ellipse is determined according to the maximum and minimum values of the X and Y axes and the scaling factor. The calculation formula is:
[0127]
[0128] Among them, X off and Y off Respectively represent the center offset of the X-axis and Y-axis.
[0129] In some optional embodiments of the present invention, the standard circle sampling value is determined according to the scaling factor, the actual ellipse value and the circle center offset, and the calculation formula is:
[0130]
[0131] Among them, X x and Y y is the standard circle sampling value, rotated_sinx' and rotated_cosx' are the actual ellipse values.
[0132] Fig.11A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0133] like Fig.11 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0134] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0135] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the angle calibration method.
[0136] In some embodiments, the angle calibration method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the angle calibration method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the angle calibration method in any other appropriate manner (e.g., by means of firmware).
[0137] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0138] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0139] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0140] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0141] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0142] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0143] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0144] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An angle calibration method, characterized in that: include: Acquire sampling points output by the angle sensor, and perform linear fitting of an ellipse on the sampling points to obtain a first fitting curve; Determining an outlier point according to the first fitting curve; After removing the abnormal points, linear fitting of the ellipse is performed again to obtain a second fitting curve; The second fitting curve is calibrated to a standard circle.
2. The method according to claim 1, characterized in that The step of acquiring sampling points output by the angle sensor and performing linear fitting of an ellipse on the sampling points to obtain a first fitting curve comprises: The sampling points are obtained by using the least square method, and a linear ellipse fitting is performed on the sampling points to obtain a first fitting curve.
3. The method according to claim 1, characterized in that The determining of the outlier point according to the first fitting curve comprises: Determine the threshold interval of normal points; An abnormal point in the first fitting curve is determined according to the threshold interval.
4. The method according to claim 1, characterized in that: After removing the abnormal point, performing linear fitting of the ellipse again to obtain a second fitting curve, the method further includes: obtaining the coordinates of the center of the second fitting curve, the offset angle, the major axis, and the minor axis data information; The step of calibrating the second fitting curve to a standard circle comprises: Determine a calibrated ellipse according to the offset angle and the center coordinates of the second fitting curve; The calibrated ellipse is calibrated to a standard circle.
5. The method according to claim 4, characterized in that The step of determining the calibrated ellipse according to the offset angle and the center coordinates of the second fitting curve includes: The calibrated ellipse is determined from the following parametric equations for a circle: Where x' is the corrected x point, y' is the corrected y point, θ is the offset angle, c x is the x-axis center of the ellipse, c y is the y-axis center of the ellipse.
6. The method according to claim 4, characterized in that The step of calibrating the calibrated ellipse into a standard circle comprises: Determine the scaling factors of the X and Y axes according to the maximum and minimum values of the X and Y axes of the ellipse; Determine the center offset of the ellipse according to the maximum value, minimum value of the X and Y axes and the scaling factor; The standard circle sampling value is determined according to the scaling factor, the actual ellipse value and the circle center offset.
7. The method according to claim 6, characterized in that The scaling factors of the X and Y axes are determined according to the maximum and minimum values of the X and Y axes of the ellipse. The specific calculation formula is: Among them, X sf and Y sf are the scaling factors for the X and Y axes respectively, max ,Y min are the maximum and minimum values of the Y axis, respectively, max and X min are the maximum and minimum values of the X-axis respectively; The center offset of the ellipse is determined according to the maximum value, minimum value and scaling factor of the X and Y axes, and the calculation formula is: Among them, X off and Y off Respectively represent the center offset of the X-axis and Y-axis.
8. The method according to claim 7, characterized in that The standard circle sampling value is determined according to the scaling factor, the actual ellipse value and the center offset, and the calculation formula is: Among them, X x and Y y is the standard circle sampling value, rotated_sinx' and rotated_cosx' are the actual ellipse values.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the angle calibration method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the angle calibration method according to any one of claims 1 to 8 when executed.
Citation Information
Cited By
Robot servo motor rotor position estimation method based on circle fitting
CN121939858A