A phase correction method, system and storage medium for a magnetic encoder
The phase correction method for magnetic encoders addresses the issue of installation errors by adjusting the signals to achieve orthogonal relationships, improving measurement accuracy and robustness in adverse conditions.
Patent Information
- Application Number
- CN202510024725.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2045-01-08
AI Technical Summary
The installation errors in magnetic encoders lead to a mismatch between the magnetic center point and the encoder chip center point, resulting in a phase difference between the signals detected by the Hall sensors, which affects the measurement accuracy.
A method and system for phase correction in magnetic encoders, involving the adjustment of initial signals to achieve orthogonal relationships by determining and applying offset phase values to the signals, ensuring accurate alignment and measurement precision.
The method effectively corrects the phase difference between the signals detected by the Hall sensors, enhancing the measurement accuracy of magnetic encoders by aligning the magnetic and encoder chip center points, thereby improving the robustness of the system in adverse environments.
Smart Images

Figure CN119437307B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of magnetic encoders, and in particular to a phase correction method, system and storage medium of a magnetic encoder. Background Art
[0002] Magnetic encoders are not affected by dust, humidity, high temperature and vibration, and can work stably in harsh environments, giving them high anti-interference capabilities. They are widely used in industrial automation and machinery manufacturing.
[0003] Ideally, the center point of the magnet in the magnetic encoder should coincide with the center point of the encoder chip, so that the two sets of signals sensed by the Hall sensor are in an ideal orthogonal relationship. However, due to the influence of installation errors during the installation of the magnet, the center point of the magnet in the magnetic encoder does not coincide with the center point of the encoder chip, resulting in a phase difference between the two sets of signals sensed by the Hall sensor, affecting the measurement accuracy of the magnetic encoder. Summary of the invention
[0004] In order to correct the phase difference between two groups of signals sensed by the Hall sensor in the magnetic encoder and improve the measurement accuracy of the magnetic encoder, the embodiments of the present application provide a phase correction method, system and storage medium for a magnetic encoder.
[0005] In a first aspect, this embodiment provides a phase correction method for a magnetic encoder, the method comprising:
[0006] Acquire the initial A signal and the initial B signal sensed by the Hall sensor, determine whether the initial A signal and the initial B signal are in an orthogonal relationship without phase difference, and if so, generate an orthogonal signal indicating that no phase correction is required;
[0007] If not, adjusting the amplitudes of the initial A signal and the initial B signal to obtain an amplitude A signal and an amplitude B signal with the same amplitude;
[0008] Based on the amplitude A signal and the amplitude B signal, determining an offset phase value by which the amplitude A signal and the amplitude B signal are respectively offset so that the two signals sensed by the Hall sensor are in an orthogonal relationship;
[0009] The offset phase value is substituted into two reference signals in an orthogonal relationship to obtain a correction A signal and a correction B signal, and the angle value of the magnetic encoder is obtained based on the correction A signal and the correction B signal.
[0010] In some embodiments, the initial A signal and the initial B signal are signals sampled for at least one week, and the amplitude adjustment of the initial A signal and the initial B signal includes:
[0011] Acquire the A signal amplitude of the initial A signal and the B signal amplitude of the initial B signal;
[0012] Dividing the initial A signal by the A signal amplitude to obtain the amplitude A signal;
[0013] The initial B signal is divided by the B signal amplitude to obtain the amplitude B signal.
[0014] In some embodiments, the initial A signal is a cosine wave signal, the initial B signal is a sine wave signal, and determining the offset phase value required to offset the amplitude A signal and the amplitude B signal so that the two signals sensed by the Hall sensor are in an orthogonal relationship comprises:
[0015] The amplitude A signal is adjusted to a reference A signal without phase deviation, and based on the reference A signal, the amplitude A signal and the amplitude B signal, the phase offset of the amplitude B signal is adjusted to obtain a phase-delayed B signal;
[0016] Acquire the actual amplitude of the reference A signal when the phase lag B signal has an angle of zero, and determine the actual angle of the A signal corresponding to the actual amplitude in the reference A signal;
[0017] The offset phase values of the amplitude A signal and the amplitude B signal respectively offset are determined based on the actual angle of the A signal.
[0018] In some embodiments, determining the offset phase values of the amplitude A signal and the amplitude B signal respectively offset based on the actual angle of the A signal includes:
[0019] The actual angles of the A signal are averaged to obtain the offset phase value of the lagging A signal and the offset phase value of the leading B signal.
[0020] In some embodiments, obtaining the angle value of the magnetic encoder based on the correction A signal and the correction B signal includes:
[0021] The correction A signal and the correction B signal are combined into a correction equation group, and the angle value of the magnetic encoder composed of the A signal amplitude, the B signal amplitude and the offset phase value is solved according to the correction equation group.
[0022] In some embodiments, substituting the offset phase value into two reference signals in an orthogonal relationship comprises:
[0023] Substituting the lagging offset phase value of the amplitude A signal into the cosine reference signal to obtain a correction A signal;
[0024] The leading offset phase value of the amplitude B signal is substituted into the sinusoidal reference signal to obtain a corrected B signal.
[0025] In some embodiments, determining whether the initial A signal and the initial B signal are in an orthogonal relationship without phase difference includes:
[0026] Acquire an initial A amplitude of the initial A signal and an initial B amplitude of the initial B signal when the angle of the initial A signal is zero;
[0027] Determine an initial amplitude difference between the initial A amplitude and the initial B amplitude, and judge whether the amplitude difference is one, if so, the initial A signal and the initial B signal are in an orthogonal relationship with no phase difference;
[0028] If not, the initial A signal and the initial B signal are not in an orthogonal relationship with no phase difference.
[0029] In a second aspect, this embodiment provides a phase correction system for a magnetic encoder, the system comprising: an acquisition module, a judgment module, a processing module and a correction module; wherein,
[0030] The acquisition module is used to acquire the initial A signal and the initial B signal sensed by the Hall sensor;
[0031] The judging module is used to judge whether the initial A signal and the initial B signal are in an orthogonal relationship;
[0032] The correction module is used to generate an orthogonal signal indicating that no phase correction is required if the initial A signal and the initial B signal are in an orthogonal relationship;
[0033] The processing module is used for adjusting the amplitudes of the initial A signal and the initial B signal to obtain an amplitude A signal and an amplitude B signal with the same amplitude if the initial A signal and the initial B signal are not in an orthogonal relationship;
[0034] The correction module is also used to determine, based on the amplitude A signal and the amplitude B signal, an offset phase value that is required to offset the amplitude A signal and the amplitude B signal respectively so that the two signals sensed by the Hall sensor are in an orthogonal relationship; substitute the offset phase value into the two reference signals in an orthogonal relationship to obtain a correction A signal and a correction B signal, and obtain the angle value of the magnetic encoder based on the correction A signal and the correction B signal.
[0035] In some embodiments, the initial A signal and the initial B signal are signals sampled for at least one week, and the processing module adjusts the amplitude of the initial A signal and the initial B signal including:
[0036] Acquire the A signal amplitude of the initial A signal and the B signal amplitude of the initial B signal;
[0037] Dividing the initial A signal by the A signal amplitude to obtain the amplitude A signal;
[0038] The initial B signal is divided by the B signal amplitude to obtain the amplitude B signal.
[0039] In a third aspect, this embodiment provides a computer-readable storage medium on which a computer program that can be run on a processor is stored. When the computer program is executed by the processor, a phase correction method for a magnetic encoder as described in the first aspect is implemented.
[0040] By adopting the above method, the present application first obtains the initial A signal and the initial B signal sensed by the Hall sensor, and determines whether the initial A signal and the initial B signal are in an orthogonal relationship without phase difference, to determine whether the center point of the magnet and the center point of the encoder chip coincide. If they are, it indicates that the center point of the magnet and the center point of the encoder chip coincide, and no phase correction is required. At this time, an orthogonal signal is generated that indicates that no phase correction is required.
[0041] If it does not belong to the case, it indicates that the center point of the magnet and the center point of the encoder chip do not coincide, and phase correction is required. At this time, the amplitude adjustment is performed first, and the initial A signal and the initial B signal are adjusted to obtain the same amplitude A signal and amplitude B signal.
[0042] Then, the phase adjustment is performed, and based on the amplitude A signal and the amplitude B signal, the offset phase value of the amplitude A signal and the amplitude B signal that needs to be offset respectively in order to make the two signals sensed by the Hall sensor in an orthogonal relationship is determined. The offset phase value is substituted into the two reference signals in an orthogonal relationship to obtain the correction A signal and the correction B signal, and the angle value of the magnetic encoder is obtained based on the correction A signal and the correction B signal. The phase difference between the two sets of signals sensed by the Hall sensor in the magnetic encoder is corrected to improve the measurement accuracy of the magnetic encoder. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a schematic diagram showing that the center point of the magnet in the magnetic encoder provided in the present application coincides with the center point of the encoder chip.
[0044] Figure 2 This is a schematic diagram showing that the center point of the magnet in the magnetic encoder provided in an embodiment of the present application does not coincide with the center point of the encoder chip.
[0045] Figure 3 It is a block diagram of a phase correction method for a magnetic encoder provided in an embodiment of the present application.
[0046] Figure 4 It is a block diagram for adjusting the amplitude of the initial A signal and the initial B signal provided in an embodiment of the present application.
[0047] Figure 5 The embodiment of the present application provides a block diagram of the offset phase value required to offset the amplitude A signal and the amplitude B signal respectively in order to determine that the two signals sensed by the Hall sensor are in an orthogonal relationship.
[0048] Figure 6 This is a framework diagram of a phase correction system of a magnetic encoder provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. However, it should be understood by those of ordinary skill in the art that the present application can be implemented without these details. For those of ordinary skill in the art, it is obvious that various changes can be made to the embodiments disclosed in the present application, and without departing from the principles and scope of the present application, the general principles defined in the present application can be applied to other embodiments and application scenarios. Therefore, the present application is not limited to the embodiments shown, but conforms to the broadest scope consistent with the scope claimed for protection in the present application.
[0050] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.
[0051] Figure 1 Schematic diagram of the coincidence of the center point of the magnet and the center point of the encoder chip in the magnetic encoder provided by the present application. Figure 1 As shown in the figure, ideally, the center point of the magnet in the magnetic encoder should coincide with the center point of the encoder chip. At this time, the signals sensed by the Hall sensors A and B are in an ideal orthogonal relationship, that is, A=cos(x) and B=sin(x). The magnetic encoder can perform precise measurements, that is, the precise angle x can be calculated through the inverse tangent.
[0052] Figure 2 Schematic diagram of a magnetic encoder provided in an embodiment of the present application in which the center point of the magnet does not coincide with the center point of the encoder chip. Figure 2 As shown, when the magnet is not installed accurately, that is, when the center point of the magnet does not coincide with the center point of the encoder chip, the signal sensed by the Hall sensor will have a phase difference and the amplitude will not be equal.
[0053] Figure 3 is a block diagram of a phase correction method for a magnetic encoder provided in an embodiment of the present application. Figure 3 As shown, a phase correction method for a magnetic encoder includes the following steps:
[0054] Step S100, obtaining the initial A signal and the initial B signal sensed by the Hall sensor, determining whether the initial A signal and the initial B signal are in an orthogonal relationship, and if so, generating an orthogonal signal indicating that no phase correction is required.
[0055] The above-mentioned initial A signal is the signal sensed by the Hall sensor A, and the initial B signal is the signal sensed by the Hall sensor B. And both the initial A signal and the initial B signal are signals sampled for at least one cycle. The signals detected by the Hall sensor A and the Hall sensor B for more than one cycle can be recorded simultaneously, so that the initial A signal and the initial B signal sensed by the Hall sensor can be obtained. The initial A signal and the initial B signal are specifically an expression. This embodiment is explained by taking the initial A signal and the initial B signal as signals sampled for one cycle as an example, that is, the signals detected by the Hall sensor A and the Hall sensor B for one cycle are recorded simultaneously.
[0056] After obtaining the initial A signal and the initial B signal, it is determined whether the initial A signal and the initial B signal are in an orthogonal relationship without phase difference to determine whether the center point of the magnet and the center point of the encoder chip coincide. The determination of whether the initial A signal and the initial B signal are in an orthogonal relationship without phase difference includes the following steps:
[0057] Step S101, obtaining an initial A amplitude of the initial A signal when the angle of the initial A signal is zero, and an initial B amplitude of the initial B signal.
[0058] Step S102, determining the initial amplitude difference between the initial A amplitude and the initial B amplitude, and judging whether the amplitude difference is one, if so, the initial A signal and the initial B signal are in an orthogonal relationship with no phase difference.
[0059] Step S103: If not, the initial A signal and the initial B signal are not in an orthogonal relationship without phase difference.
[0060] The above-mentioned zero moment refers to the initial moment of the initial A signal within one cycle, that is, the angle is zero. The initial A amplitude and the initial B amplitude can be obtained by substituting the zero moment into the initial A signal and the initial B signal. Then the initial A amplitude is subtracted from the initial B amplitude and the absolute value is obtained to obtain the initial amplitude difference between the initial A amplitude and the initial B amplitude. Then the obtained initial amplitude difference is compared with the value one to determine whether the initial A signal and the initial B signal belong to an orthogonal relationship without phase difference. If the initial amplitude difference is exactly equal to the value one, then the initial A signal and the initial B signal belong to an orthogonal relationship without phase difference; if the initial amplitude difference is not equal to the value one, then the initial A signal and the initial B signal do not belong to an orthogonal relationship without phase difference.
[0061] like Figure 1As shown in the figure, when the center point of the magnet coincides with the center point of the encoder chip, at time zero, the amplitude difference between the initial A signal and the initial B signal is one. The coincidence of the center point of the magnet and the center point of the encoder chip will cause the initial A signal and the initial B signal sensed by the Hall sensor to be in an orthogonal relationship with no phase difference. Figure 2 As shown in the figure, when the center point of the magnet and the center point of the encoder chip do not coincide, at time zero, the amplitude difference corresponding to the initial A signal and the initial B signal is not equal to one. The non-coincidence between the center point of the magnet and the center point of the encoder chip will cause the initial A signal and the initial B signal sensed by the Hall sensor to not be in an orthogonal relationship without phase difference.
[0062] When the initial A signal and the initial B signal are in an orthogonal relationship with no phase difference, it indicates that the center point of the magnet coincides with the center point of the encoder chip. At this time, an orthogonal signal indicating that no phase correction is required will be generated, and there is no need to perform phase correction on the encoder.
[0063] Step S200: If not, the initial A signal and the initial B signal are amplitude adjusted to obtain an amplitude A signal and an amplitude B signal with the same amplitude.
[0064] When the initial A signal and the initial B signal are not in an orthogonal relationship without phase difference, it indicates that the center point of the magnet and the center point of the encoder chip do not coincide, and the encoder needs to be phase corrected. At this time, the initial A signal and the initial B signal sensed by the Hall sensor have a phase difference, and the amplitudes are also not equal. First, adjust the amplitudes of the initial A signal and the initial B signal to be equal. Figure 4 1 is a block diagram of adjusting the amplitude of the initial A signal and the initial B signal provided by an embodiment of the present application. Figure 4 As shown, adjusting the amplitude of the initial A signal and the initial B signal includes the following steps:
[0065] Step S201, obtaining the A signal amplitude of the initial A signal and the B signal amplitude of the initial B signal.
[0066] Step S202: Divide the initial A signal by the A signal amplitude to obtain the amplitude A signal.
[0067] Step S203: Divide the initial B signal by the B signal amplitude to obtain an amplitude B signal.
[0068] The A signal amplitude is obtained by recording the maximum value of the initial A signal, or recording the minimum value of the initial A signal and negating the minimum value to obtain the A signal amplitude. And the B signal amplitude is obtained by recording the maximum value of the initial B signal, or recording the minimum value of the initial B signal and negating the minimum value to obtain the B signal amplitude. Then the initial A signal is divided by the A signal amplitude to obtain the amplitude A signal, so that the amplitude of the amplitude A signal is a value of one; the initial B signal is divided by the B signal amplitude to obtain the amplitude B signal, so that the amplitude of the amplitude B signal is a value of one. In this way, an amplitude A signal and an amplitude B signal with the same amplitude are obtained.
[0069] Among them, the initial A signal can be a sine wave signal, and the initial B signal can be a cosine wave signal; or the initial A signal can be a cosine wave signal, and the initial B signal can be a sine wave signal. This embodiment is described by taking the initial A signal as a cosine wave signal and the initial B signal as a sine wave signal as an example. When the magnet is not installed accurately, that is, the center point of the magnet does not coincide with the center point of the encoder chip, it will cause the two sets of orthogonal signals sensed by the Hall sensor to have a phase difference t1 and t2. In this way, the initial A signal is set to A=F1cos(x+t1), and the initial B signal is set to B=F2sin(x+t2); the amplitude of the A signal is F1, and the amplitude of the B signal is F2; the amplitude of the A signal is A'=A / F1=cos(x+t1), and the amplitude of the B signal is B'=B / F2=sin(x+t2).
[0070] Step S300: Based on the amplitude A signal and the amplitude B signal, determine the offset phase value required to offset the amplitude A signal and the amplitude B signal respectively so that the two signals sensed by the Hall sensor are in an orthogonal relationship.
[0071] Figure 5 The embodiment of the present application provides a block diagram of the offset phase value for determining the amplitude A signal and the amplitude B signal to be offset respectively in order to make the two signals sensed by the Hall sensor in an orthogonal relationship. Figure 5 As shown, determining the offset phase value required to offset the amplitude A signal and the amplitude B signal respectively so that the two signals sensed by the Hall sensor are in an orthogonal relationship includes the following steps:
[0072] Step S301, adjusting the amplitude A signal to a reference A signal without phase deviation, and adjusting the phase offset of the amplitude B signal based on the reference A signal, the amplitude A signal and the amplitude B signal to obtain a phase-delayed B signal.
[0073] Step S302, obtaining the actual amplitude of the reference A signal when the phase lag B signal is at an angle of zero, and determining the actual angle of the A signal corresponding to the actual amplitude in the reference A signal.
[0074] Step S303: determining the offset phase values of the amplitude A signal and the amplitude B signal based on the actual angle of the A signal.
[0075] First, take the amplitude A signal as the reference A signal A”=cos(x), then the phase lag B signal is B”=sin(x+t'), t'=t1+t2. That is, the phase of the B signal lags by t'=t1+t2. In this way, the phase difference binary method is adopted, that is, the phase difference is evenly divided into two Hall sensors, so that the amplitude A signal is adjusted to the reference A signal without phase deviation, and the phase offset of the amplitude B signal is adjusted based on the reference A signal, the amplitude A signal and the amplitude B signal to obtain the phase lag B signal.
[0076] Then, when x+t'=0, that is, B"=sin(0)=0, record the actual amplitude of the reference A signal, that is, the amplitude of A"=cos(-t'). Then, by looking up the table, we can get the actual angle 2t of the A signal corresponding to the reference A signal at that moment, that is, t'=2t. Finally, by allocating the actual angle of the A signal to the amplitude A signal and the amplitude B signal, we can determine the offset phase values of the amplitude A signal and the amplitude B signal.
[0077] Determining the offset phase values of the amplitude A signal and the amplitude B signal based on the actual angle of the A signal includes: averaging the actual angle of the A signal to obtain the offset phase value behind the amplitude A signal and the offset phase value ahead of the amplitude B signal.
[0078] The actual angle 2t of signal A is added to signal A and signal B respectively, so that signal A and signal B are offset by t in phase respectively, and the total offset is still 2t, that is, t1=t, t2=t. That is, the offset phase value of amplitude signal A and amplitude signal B is t.
[0079] Step S400: Substitute the offset phase value into two reference signals in an orthogonal relationship to obtain a correction A signal and a correction B signal, and obtain the angle value of the magnetic encoder based on the correction A signal and the correction B signal.
[0080] Substituting the offset phase value into the two reference signals in an orthogonal relationship includes: substituting the offset phase value of the amplitude A signal lagging into the cosine reference signal to obtain the correction A signal; substituting the offset phase value of the amplitude B signal leading into the sine reference signal to obtain the correction B signal. That is, the cosine reference signal is cos(x), and the sine reference signal is sin(x). The correction A signal is F1cos(x+t), and the correction B signal is F2sin(x+t).
[0081] Finally, after obtaining the correction A signal and the correction B signal, the angle value of the magnetic encoder is obtained based on the correction A signal and the correction B signal. The method of obtaining the angle value of the magnetic encoder based on the correction A signal and the correction B signal includes: forming a correction equation group with the correction A signal and the correction B signal, and solving the angle value of the magnetic encoder composed of the A signal amplitude, the B signal amplitude and the offset phase value according to the correction equation group, that is, the angle value of the magnetic encoder is arctan[(F1sint+F2cost) / (F1cost+F2sint)]. This realizes the correction of the phase difference between the two groups of signals sensed by the Hall sensor in the magnetic encoder, and improves the measurement accuracy of the magnetic encoder.
[0082] Figure 6 1 is a framework diagram of a phase correction system of a magnetic encoder provided in an embodiment of the present application. Figure 6 As shown, a phase correction system for a magnetic encoder includes: an acquisition module, a judgment module, a processing module and a correction module.
[0083] Among them, the acquisition module is used to acquire the initial A signal and the initial B signal sensed by the Hall sensor. The judgment module is used to judge whether the initial A signal and the initial B signal are in an orthogonal relationship. The correction module is used to generate an orthogonal signal indicating that no phase correction is required if the initial A signal and the initial B signal are in an orthogonal relationship. The processing module is used to adjust the amplitude of the initial A signal and the initial B signal if the initial A signal and the initial B signal are not in an orthogonal relationship, so as to obtain an amplitude A signal and an amplitude B signal with the same amplitude. The correction module is also used to determine, based on the amplitude A signal and the amplitude B signal, the offset phase value that needs to be offset for the amplitude A signal and the amplitude B signal to make the two signals sensed by the Hall sensor in an orthogonal relationship; substitute the offset phase value into the two reference signals in an orthogonal relationship to obtain the correction A signal and the correction B signal, and obtain the angle value of the magnetic encoder based on the correction A signal and the correction B signal.
[0084] In addition, the initial A signal and the initial B signal are signals sampled for at least one cycle, and the processing module adjusts the amplitude of the initial A signal and the initial B signal, including: obtaining the A signal amplitude of the initial A signal and the B signal amplitude of the initial B signal. Dividing the initial A signal by the A signal amplitude to obtain an amplitude A signal. Dividing the initial B signal by the B signal amplitude to obtain an amplitude B signal.
[0085] The other functions performed by the above-mentioned acquisition module, judgment module, processing module and correction module and the technical details of each function are the same or similar to the corresponding features in the phase correction method of a magnetic encoder described above, so they are not repeated here.
[0086] An embodiment of the present application further provides a computer storage medium on which a computer program is stored. When the computer program is run on a computer, the computer can execute the steps in the phase correction method of a magnetic encoder described above.
[0087] It should be understood that, although the steps in the flowchart of the accompanying drawings are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless explicitly stated in this document, the execution of these steps is not strictly limited in order and can be performed in other orders.
[0088] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A phase correction method for a magnetic encoder, characterized in that: The method comprises: Acquire the initial A signal and the initial B signal sensed by the Hall sensor, and determine whether the initial A signal and the initial B signal are in an orthogonal relationship without phase difference. When the initial A signal and the initial B signal are in an orthogonal relationship without phase difference, an orthogonal signal indicating that no phase correction is required is generated; When the initial A signal and the initial B signal are not in an orthogonal relationship without phase difference, the initial A signal and the initial B signal are amplitude-adjusted to obtain an amplitude A signal and an amplitude B signal having the same amplitude; Based on the amplitude A signal and the amplitude B signal, an offset phase value of each of the amplitude A signal and the amplitude B signal required to make the two signals sensed by the Hall sensor be in an orthogonal relationship is calculated; The offset phase value is substituted into two reference signals in an orthogonal relationship to obtain a correction A signal and a correction B signal, and the angle value of the magnetic encoder is obtained based on the correction A signal and the correction B signal.
2. The method according to claim 1, characterized in that The initial A signal and the initial B signal are signals sampled for at least one week. The amplitude adjustment of the initial A signal and the initial B signal includes: Acquire the A signal amplitude of the initial A signal and the B signal amplitude of the initial B signal; Dividing the initial A signal by the A signal amplitude to obtain the amplitude A signal; The initial B signal is divided by the B signal amplitude to obtain the amplitude B signal.
3. The method according to claim 2, characterized in that The initial A signal is a cosine wave signal, and the initial B signal is a sine wave signal. Calculating the offset phase values of the amplitude A signal and the amplitude B signal respectively offset to make the two signals sensed by the Hall sensor in an orthogonal relationship includes: The amplitude A signal is adjusted to a reference A signal without phase deviation, and based on the reference A signal, the amplitude A signal and the amplitude B signal, the phase offset of the amplitude B signal is adjusted to obtain a phase-delayed B signal; Acquire the actual amplitude of the reference A signal when the phase lag B signal has an angle of zero, and determine the actual angle of the A signal corresponding to the actual amplitude in the reference A signal; The offset phase values of the amplitude A signal and the amplitude B signal respectively offset are determined based on the actual angle of the A signal.
4. The method according to claim 3, characterized in that Determining the offset phase values of the amplitude A signal and the amplitude B signal respectively offset based on the actual angle of the A signal includes: The actual angles of the A signal are averaged to obtain the offset phase value of the lagging A signal and the offset phase value of the leading B signal.
5. The method according to claim 4, characterized in that Obtaining the angle value of the magnetic encoder based on the correction A signal and the correction B signal includes: The correction A signal and the correction B signal are combined into a correction equation group, and the angle value of the magnetic encoder composed of the A signal amplitude, the B signal amplitude and the offset phase value is solved according to the correction equation group.
6. The method according to claim 4, characterized in that Substituting the offset phase value into two reference signals in an orthogonal relationship comprises: Substituting the lagging offset phase value of the amplitude A signal into the cosine reference signal to obtain a correction A signal; The leading offset phase value of the amplitude B signal is substituted into the sinusoidal reference signal to obtain a corrected B signal.
7. The method according to claim 1, characterized in that Determining whether the initial A signal and the initial B signal are in an orthogonal relationship without phase difference includes: Acquire an initial A amplitude of the initial A signal and an initial B amplitude of the initial B signal when the angle of the initial A signal is zero; determining an initial amplitude difference between the initial A amplitude and the initial B amplitude, and determining whether the amplitude difference is one, When the amplitude difference is one, the initial A signal and the initial B signal are in an orthogonal relationship with no phase difference; When the amplitude difference is not one, the initial A signal and the initial B signal are not in an orthogonal relationship without a phase difference.
8. A phase correction system for a magnetic encoder, characterized in that: The system comprises: an acquisition module, a judgment module, a processing module and a correction module; The acquisition module is used to acquire the initial A signal and the initial B signal sensed by the Hall sensor; The judging module is used to judge whether the initial A signal and the initial B signal are in an orthogonal relationship; When the initial A signal and the initial B signal are in an orthogonal relationship, the correction module is used to generate an orthogonal signal indicating that no phase correction is required; When the initial A signal and the initial B signal are not in an orthogonal relationship, the correction module is used to adjust the amplitudes of the initial A signal and the initial B signal to obtain an amplitude A signal and an amplitude B signal with the same amplitude; The correction module is also used to calculate the offset phase values of the amplitude A signal and the amplitude B signal respectively offset, which are required to make the two signals sensed by the Hall sensor in an orthogonal relationship, based on the amplitude A signal and the amplitude B signal; substitute the offset phase value into the two reference signals in an orthogonal relationship to obtain the correction A signal and the correction B signal, and obtain the angle value of the magnetic encoder based on the correction A signal and the correction B signal.
9. The phase correction system according to claim 8, characterized in that: The initial A signal and the initial B signal are signals sampled for at least one week. The processing module adjusting the amplitude of the initial A signal and the initial B signal includes: Acquire the A signal amplitude of the initial A signal and the B signal amplitude of the initial B signal; Dividing the initial A signal by the A signal amplitude to obtain the amplitude A signal; The initial B signal is divided by the B signal amplitude to obtain the amplitude B signal.
10. A computer-readable storage medium having a computer program that can be run on a processor stored thereon, characterized in that: When the computer program is executed by the processor, the phase correction method of the magnetic encoder as claimed in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for correcting position error of permanent magnet synchronous motor rotor based on linear hall
CN104038134A
Encoder and method of calculating rotational angle position
CN105606019A