Magnetoelectric encoder angle value jump point suppression method based on SWO principle and related device
Through the magnetoelectric encoder angle value jump suppression method based on SWO principle, combined with Clarke transformation and SWO algorithm, the problem of jumping when the magnetoelectric encoder outputs angle value is solved, significantly improving the resolution and accuracy, ensuring the mechanical system efficient operation.
Patent Information
- Application Number
- CN202411140308.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-12-17
AI Technical Summary
Magnetoelectric encoders are prone to jump points when outputting multiple pairs of pole angle values, which affects the accuracy and is difficult to improve the resolution.
Using the magnetoelectric encoder angle value jump suppression method based on SWO principle, the efficient locking of jump points is achieved through Clarke transformation, analog-to-digital conversion, arctangent algorithm, data sorting and window division, etc., combined with spider web and wasp algorithm, the efficient locking of jump points is achieved and inhibition.
It significantly improves the resolution and accuracy of the magnetoelectric encoder, ensures more accurate and reliable signal recording and transmission, and ensures high-precision control and efficient operation of the mechanical system.
Smart Images

Figure CN119147015A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of magnetoelectric encoders, and in particular to a method for suppressing angle value jump points of a magnetoelectric encoder based on the SWO principle and a related device. Background Art
[0002] A magnetoelectric encoder is a sensor installed on a servo motor to measure the magnetic pole position, the servo motor's rotation angle, and the speed. It is usually composed of a stator, a rotor, a Hall element, a magnet, a signal acquisition board, etc. Permanent magnets and magnetic sensors are the core of magnetoelectric encoder technology. When a magnetic sensor is placed in a magnetic field environment, it can sense changes in the magnetic field, especially through physical mechanisms such as the Hall effect and the magnetoresistance effect to detect changes in the spatial magnetic field. These sensors convert the detected magnetic field information into corresponding voltage signals, which can accurately capture the angular displacement of rotating or moving parts after being processed by a sophisticated signal processing system.
[0003] Compared with other encoders, magnetoelectric encoders have the characteristics of anti-vibration, anti-corrosion, anti-pollution, anti-interference and wide temperature range, but the resolution is always difficult to improve. At present, the combined magnetoelectric encoders that combine single-pole and multi-pole magnets can improve the resolution, but because the magnetoelectric encoder is affected by noise, temperature drift, etc., when outputting multi-pole angle values, there will be jump points, affecting the accuracy of the magnetoelectric encoder. Summary of the invention
[0004] In view of the above-mentioned problems, the present application provides a method and a related device for suppressing angle value jump points of a magnetoelectric encoder based on the SWO principle, which can effectively suppress the angle jump points and enhance the accuracy of the magnetoelectric encoder.
[0005] To achieve the above object, the technical solution of the present invention is:
[0006] The method for suppressing angle jump of a magnetoelectric encoder based on the SWO principle provided by the present invention comprises the following steps:
[0007] S1: Power the motor, the motor rotates, and the single-pole Hall and multi-pole Hall output signals of the magnetoelectric encoder are collected. The output signals of the single-pole Hall group and the multi-pole Hall group are respectively subjected to Clarke transformation. The specific formula for the Clarke transformation of the output signal of the single-pole Hall group is:
[0008]
[0009] Wherein, A+ is the unipolar Hall signal output by the first unipolar Hall, A is the unipolar Hall signal output by the second unipolar Hall, A- is the unipolar Hall signal output by the third unipolar Hall, α+ is the unipolar angle value sine signal, α- is the unipolar angle value cosine signal;
[0010] The specific formula for Clarke transformation of the output signal of the multi-pole Hall group is:
[0011]
[0012] Wherein, B+ is a single-pole Hall signal output by the first multi-pole Hall, B is a multi-pole Hall signal output by the second multi-pole Hall, B- is a multi-pole Hall signal output by the third multi-pole Hall, β+ is a multi-pole angle value sine signal, β- is a multi-pole angle value cosine signal;
[0013] S2: The encoder signal solver performs analog-to-digital conversion on the single-pole angle value sine signal α+ and the single-pole angle value cosine signal α- to obtain the single-pole angle value digital sine signal H α+ , single polar angle value digital cosine signal H α- , the arc tangent algorithm built into the microcontroller is used to calculate the single pole angle value. The calculation formula is:
[0014]
[0015] θ1 is the single pole angle value after proportional enlargement, and its value range is [0,65535];
[0016] The encoder signal solver performs analog-to-digital conversion on the multi-pole angle value sine signal β+ and the multi-pole angle value cosine signal β- to obtain the multi-pole angle value digital sine signal H β+ , multiple pairs of pole angle value digital cosine signal H β- , and then use the built-in inverse tangent algorithm in the microcontroller to solve it, and get multiple pairs of pole angle values. The solution formula is:
[0017]
[0018] θ1 is the multiple pole angle values after proportional amplification, and the value range is [0,65535];
[0019] S3: Repeat steps S1 and S2, and obtain a set of single-pole angle values θ1 and multiple-pole angle values θ2 each time, and enter the single-pole angle value θ1 into the single-pole angle value data set θ 1i , enter the multiple pole angle values θ2 into the multiple pole angle value data set θ 2i After the input is completed, θ 1i and θ 2i Rearrange from smallest to largest;
[0020] f(θ 3i ,θ 4i )=order(θ 1i ,θ 2i ) (1.5)
[0021] Among them, order is sorted from small to large to make the data look clearer. 3i is a data set of single-pole angle values in ascending order, θ 4i It is a data set of multiple pairs of pole angle values in ascending order;
[0022] S4: Extract single-pair-of-epipolar angle data set θ 1i The high 11 bits of the single-pole angle value and the corresponding number are as follows:
[0023]
[0024] Among them, floor is the rounding function, f end is the screening function, h note is a recording function. s_ang_sel_x is the single-pole angle value of the upper 11 bits selected, and s_ang_j is the reordering number corresponding to the single-pole angle value of the upper 11 bits selected;
[0025] S5: Find multiple pairs of pole angle values one by one according to the numbers, and divide these multiple pole angle values into three intervals.
[0026] They are interval I1 = [0, 4096), interval I2 = [4096, 61440), interval I3 = [61440, 65535), and the three intervals are used as a table lookup basis to set a window width window_x, set the front window, current window and lower window, and the specific formula is:
[0027]
[0028] Among them, window_x is the window width, θ 3i is a data set of single-pair angle values in ascending order, is the angle value of the front window, is the angle value of the back window, and M_angle is the angle value of the current window;
[0029] When a jump point occurs, the corresponding extreme value is determined by judging the difference between two adjacent window angle values of each layer. The specific formula is:
[0030] yy=abs(diff(xx))>40000? k:k+1 (1.8)
[0031] abs is the rounding function, diff is the function for calculating the difference between two adjacent window angle values at each layer, and N is the set threshold;
[0032] When the number of poles of the previous window is greater than that of the current window, and the angle value of the current window is in interval I1, the number of poles of the current window is increased by 1;
[0033] When the number of poles of the front window is greater than that of the lower window, and the current window angle value is in interval I3, the number of poles of the current window is reduced by 1;
[0034] S6: When the motor rotates, the angle value data of the current magnetoelectric encoder is collected through the single-chip microcomputer, and the number of multi-pole pairs corresponding to the front window, the current window, and the back window and the interval of the multi-pole angle value are found out by the table lookup method. The specific formula is:
[0035]
[0036] Among them, check is a table lookup function, Y act It is a table lookup function, specifically it refers to the table lookup function. Get M_p_x (k) and M_ang_act (k) The value of M_p_x (k) is the number of multiple pole pairs obtained by table lookup, M_ang_act (k) are multiple pairs of pole angle values obtained by table lookup method, is θ 3i Substitute k to get the single polar angle value;
[0037] Then, the angle values of multiple pairs of poles after subdivision can be solved, and the solution formula is:
[0038] θ 细分 =65535×M_p_x (k) +M_ang_act (k) (1.10)
[0039] Among them, θ 细分 are multiple pairs of pole angle values after subdivision;
[0040] S7: Define function:
[0041] Y 记 =TD(window_x) (1.11)
[0042] Among them, Y 记 To record the number of jump points, TD represents the mapping relationship of the function, which is specifically manifested as the execution process from S1 to S6, and window_x is the set window width;
[0043] The SWO algorithm is used. The SWO algorithm includes the spider web algorithm and the wasp algorithm. The spider web algorithm is a method of simulating a spider weaving a web in the air. The wasp algorithm is designed to imitate the foraging behavior of bees in a bee colony. This method takes a wasp as a solution, randomly selects a target point in the search space, and obtains the optimal solution by comparing the fitness values of the target points. The SWO algorithm includes a predation step and a nesting step. The predation step includes three stages: searching, tracking and escaping.
[0044] The formula for the search phase is:
[0045]
[0046] in is a set of window widths window_x, t is an index, i is a natural number between 0 and N, μ1 indicates the specified moving direction, a and b are two indices randomly selected from the population for direction specification, r1 is a random number between the interval [0, 1], and r n A random number that satisfies a normal distribution;
[0047] The search phase The value of is the spider population generated between the set maximum and minimum values, and its value range is set to [1,65535]. The search area is expanded to ensure the comprehensiveness of the search. The specific formula is:
[0048]
[0049] After calculation and integration, it is:
[0050]
[0051] in is the upper bound of the initial parameters, is the lower bound of the initial parameter, r2 is a random number in the interval [0, 1], c is an exponent randomly selected from the population, and l is a randomly generated number in the interval [-2, 1];
[0052] The specific formula for the tracking phase is:
[0053]
[0054] where α is the index of random selection in the population, t and t max represents the current index and the maximum index, r5 and r6 are randomly generated values between [0, 1], and C is the distance control factor that determines the speed of the wasp;
[0055] The specific formula for the escape phase is:
[0056]
[0057] in, is a vector generated between k and -k according to the normal distribution;
[0058] After the predation step is completed, the nesting step begins, as shown in the formula:
[0059]
[0060] in, Indicates the optimal filter window width value;
[0061]
[0062] Among them, r3, r4, and r5 are random numbers between 0 and 1, γ is a number generated based on the flight, and a, b, and c are the indices of randomly selected solutions in the population; The main purpose of is to avoid performing secondary calculations at the same location.
[0063] In the method for suppressing angle value jump points of a magnetoelectric encoder based on the SWO principle provided by the present invention, preferably, the threshold value N in S5 is set to 30000-45000.
[0064] In the method for suppressing angle value jump points of a magnetoelectric encoder based on the SWO principle provided by the present invention, preferably, the number of wasps in S7 is set to 30-200, and the maximum number of iterations is set to 30-200.
[0065] The device for suppressing the angle value jump of a magnetoelectric encoder based on the SWO principle provided by the present invention can apply the method for suppressing the angle value jump of a magnetoelectric encoder based on the SWO principle, and is characterized in that it comprises a magnetoelectric encoder, wherein the magnetoelectric encoder comprises a motor flange, a bearing, a single-pole magnetic steel of radial magnetization, a magnetic conductive ring, a magnetic isolation ring, a support plate, a multi-pole magnetic steel of axial magnetization, an encoder signal solution board, an encoder end cover, and a motor shaft; the encoder signal solution board is soldered with a first single-pole Hall, a second single-pole Hall, a third single-pole Hall and a first multi-pole Hall of patch type on one side close to the magnetic conductive ring. A Hall, a second multi-pole Hall, a third multi-pole Hall and a single-chip computer, wherein the first single-pole Hall, the second single-pole Hall and the third single-pole Hall are equidistantly distributed along the same circumference, the center angle between the first single-pole Hall and the second single-pole Hall is 120°, and the center angle between the second single-pole Hall and the third single-pole Hall is 120°; the first multi-pole Hall, the second multi-pole Hall and the third multi-pole Hall are equidistantly distributed along the same circumference, the center angle between the first multi-pole Hall and the second multi-pole Hall is 35°, and the center angle between the second multi-pole Hall and the third multi-pole Hall is 35°. The central angle is 35°; the side of the magnetic conductor close to the encoder signal solution board is provided with a first single-pole Hall slot, a second single-pole Hall slot and a third single-pole Hall slot corresponding to the first single-pole Hall, the second single-pole Hall and the third single-pole Hall, and the first single-pole Hall, the second single-pole Hall and the third single-pole Hall are inserted into the first single-pole Hall slot, the second single-pole Hall slot and the third single-pole Hall slot according to the corresponding relationship; the support plate is glued to the motor shaft, the multi-pole magnetic steel is glued to the support plate, the magnetic isolation ring is glued to the support plate, the single-pole magnetic steel is glued to the motor shaft, and the magnetic conductor is glued to the encoder The encoder signal solution board is glued, the encoder signal solution board is glued to the encoder end cover, and the encoder end cover is connected to the flange by bolts and nuts; when the motor main shaft rotates, it can drive the support plate, the multi-pole magnetic steel, the magnetic isolation ring, and the single-pole magnetic steel to rotate together; the radial magnetic field of the single-pole magnetic steel changes the direction of the magnetic field through the magnetic conductor glued to the encoder signal solution board, and the single-pole magnetic field signal is received by the first single-pole Hall, the second single-pole Hall, and the third single-pole Hall; the first multi-pole Hall, the second multi-pole Hall, and the third multi-pole Hall are located directly above the multi-pole magnetic steel and can receive multi-pole magnetic field signals.
[0066] The present invention provides a device for suppressing angle jumps of a magnetoelectric encoder based on the SWO principle, and preferably, the plurality of pairs of poles of magnetic steel are 24 pairs of poles of magnetic steel.
[0067] The above technical solution has the following advantages or beneficial effects:
[0068] 1. Divide the angle values of multiple pairs of poles into three intervals, increase the window width window_x, set the front window, current window and lower window, and judge whether the difference between the two adjacent angle values of each window exceeds the set threshold. If it exceeds, it proves that there is a jump point. The above method can effectively lock the jump point; further combined with the SWO algorithm, the purpose of efficiently suppressing the jump point is achieved, and the resolution and accuracy of the magnetoelectric encoder are significantly enhanced. This improvement not only enables the encoder to record and interpret signals more accurately, but also provides more reliable and accurate data.
[0069] 2. The SWO algorithm used in the present invention enables the magnetoelectric encoder to more accurately and reliably record and transmit the rotation information of the motor through searching, tracking and escaping, thereby ensuring high-precision control and efficient operation of the mechanical system.
[0070] 3. When the threshold N is set to 30000-45000, the screening of extreme values can be more accurate.
[0071] 4. When the number of wasps is set to 30-200 and the maximum number of iterations is set to 30-200, the optimal solution can be found accurately, thereby suppressing the generation of jump points.
[0072] 5. Using three single-pole Hall sensors arranged at specific angles and three multi-pole Hall sensors arranged at specific angles, it is possible to collect multi-angle values and combine them with Clarke transformation to improve the accuracy of angle values.
[0073] 6. The magnetoelectric encoder of the present invention uses 24 pairs of pole magnets. After the SWO algorithm, the angle resolution is increased by 24 times, effectively improving the accuracy of the magnetoelectric encoder. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 This is a schematic diagram of the overall structure of a device related to the angle value jump point suppression of a magnetoelectric encoder based on the SWO principle provided in Example 1 of the present invention.
[0075] Figure 2 A schematic diagram of the structural disassembly of a device related to the angle value jump point suppression of a magnetoelectric encoder based on the SWO principle provided in Example 1 of the present invention.
[0076] Figure 3 This is a schematic diagram of the structure of the encoder signal solution board provided in Example 1 of the present invention.
[0077] Figure 4 This is a schematic diagram of the structure of the magnetic conductive ring provided in Example 1 of the present invention.
[0078] Figure 5 These are the single-pair-of-epipolar angle value images and multi-pair-of-epipolar angle value images collected in Example 1 of the present invention.
[0079] Figure 6 These are the reordered single-pair-of-episodes angle value images and multi-pair-of-episodes angle value images involved in Embodiment 1 of the present invention.
[0080] Figure 7 These are the upper boundary, current boundary and lower boundary images of multiple pairs of epipolar angle values involved in Embodiment 1 of the present invention.
[0081] Figure 8 These are multiple pairs of epipolar angle value jump point images involved in Embodiment 1 of the present invention.
[0082] Fig. 9 This is the pole logarithmic image involved in Example 1 of the present invention.
[0083] Fig.10 These are the multiple pairs of epipolar angle values and the magnified images of the multiple pairs of epipolar angle values involved in Example 1 of the present invention.
[0084] Fig.11 It is the iterative calculation image involved in Example 1 of the present invention.
[0085] Fig.12 This is the jump point suppression image involved in Embodiment 1 of the present invention. DETAILED DESCRIPTION
[0086] The following will be combined with the drawings of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described in the present application are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0087] Embodiment 1:
[0088] The method for suppressing angle value jump points of a magnetoelectric encoder based on the SWO principle provided in Example 1 of the present application includes the following steps:
[0089] S1: Power the motor, the motor rotates, and the single-pole Hall and multi-pole Hall output signals of the magnetoelectric encoder are collected. The output signals of the single-pole Hall group and the multi-pole Hall group are respectively subjected to Clarke transformation. The specific formula for the Clarke transformation of the output signal of the single-pole Hall group is:
[0090]
[0091] Wherein, A+ is the unipolar Hall signal output by the first unipolar Hall, A is the unipolar Hall signal output by the second unipolar Hall, A- is the unipolar Hall signal output by the third unipolar Hall, α+ is the unipolar angle value sine signal, α- is the unipolar angle value cosine signal;
[0092] The specific formula for Clarke transformation of the output signal of the multi-pole Hall group is:
[0093]
[0094] Wherein, B+ is a single-pole Hall signal output by the first multi-pole Hall, B is a multi-pole Hall signal output by the second multi-pole Hall, B- is a multi-pole Hall signal output by the third multi-pole Hall, β+ is a multi-pole angle value sine signal, β- is a multi-pole angle value cosine signal;
[0095] S2: The encoder signal solver performs analog-to-digital conversion on the single-pole angle value sine signal α+ and the single-pole angle value cosine signal α- to obtain the single-pole angle value digital sine signal H α+ , single polar angle value digital cosine signal H α- , the arc tangent algorithm built into the microcontroller is used to calculate the single pole angle value. The calculation formula is:
[0096]
[0097] θ1 is the single pole angle value after proportional enlargement, and its value range is [0,65535];
[0098] The encoder signal solver performs analog-to-digital conversion on the multi-pole angle value sine signal β+ and the multi-pole angle value cosine signal β- to obtain the multi-pole angle value digital sine signal H β+ , multiple pairs of polar angle value digital cosine signal H β- , and then use the built-in inverse tangent algorithm in the microcontroller to solve it, and get multiple pairs of pole angle values. The solution formula is:
[0099]
[0100] θ1 is the multiple pole angle values after proportional amplification, and the value range is [0,65535];
[0101] S3: Repeat steps S1 and S2, and obtain a set of single-pole angle values θ1 and multiple-pole angle values θ2 each time, and enter the single-pole angle value θ1 into the single-pole angle value data set θ 1i , enter the multiple pole angle values θ2 into the multiple pole angle value data set θ 2i After the input is completed, θ 1i and θ 2i Rearrange from smallest to largest;
[0102] f(θ 3i ,θ 4i )=order(θ 1i ,θ 2i ) (1.5)
[0103] Among them, order is sorted from small to large to make the data look clearer. 3i is a data set of single-pole angle values in ascending order, θ 4i is a data set of multiple pairs of pole angle values in ascending order. In this embodiment, θ 3i and θ 4i ,like Figure 6 As shown;
[0104] S4: Extract single-pair-of-epipolar angle data set θ 1i The single-pole angle value of the high 11 bits and the corresponding number are as follows:
[0105]
[0106] Among them, floor is the rounding function, f end is the screening function, h note is a recording function. s_ang_sel_x is the single-pole angle value of the upper 11 bits selected, and s_ang_j is the reordering number corresponding to the single-pole angle value of the upper 11 bits selected;
[0107] S5: Find multiple pairs of pole angle values one by one according to the numbers, and divide these multiple pole angle values into three intervals.
[0108] They are interval I1 = [0, 4096), interval I2 = [4096, 61440), interval I3 = [61440, 65535), and the three intervals are used as a table lookup basis to set a window width window_x, set the front window, current window and lower window, and the specific formula is:
[0109]
[0110] Among them, window_x is the window width, θ 3i is a data set of single-pair angle values in ascending order, is the angle value of the front window, is the angle value of the back window, and M_angle is the angle value of the current window, such as Figure 7 As shown, the upper boundary, current boundary and lower boundary images of multiple pairs of pole angle values recorded after the front window, current window and lower window are opened in this embodiment;
[0111] like Figure 8 As shown in the figure, since the magnetoelectric encoder is affected by noise, temperature drift, etc., jump points will appear when outputting multiple pairs of pole angle values. When jump points appear, the corresponding pole value is determined by judging the difference between the two adjacent angle values of each layer window. The specific formula is:
[0112] yy=abs(diff(xx))>N? k:k+1 (1.8)
[0113] abs is the rounding function, diff is the function for calculating the difference between two adjacent window angle values at each layer, and N is the set threshold;
[0114] Each layer of windows includes the front layer window, the current window and the lower layer window; the difference between two adjacent angle values can be understood as the difference between the angle value corresponding to k and the angle value corresponding to k+1.
[0115] Once the window width is determined, the number of pole pairs where the angle values of multiple pairs of pole numbers are located can be found in turn according to formulas (1.6) to (1.8).
[0116] But there are special cases:
[0117] Case 1: The number of poles in the previous window is greater than the number of poles in the current window;
[0118] Case 2: The number of poles in the current window is greater than the number of poles in the lower window.
[0119] The reason for this is that the angle values of multiple pairs of poles will jump abnormally when the number of poles changes. The value jumps back and forth between 0 and 65535, and it is impossible to accurately determine the number of poles it is in.
[0120] like Fig. 9 As shown, the processing method is that when the number of poles of the front window is greater than the number of poles of the current window and the angle value of the current window is in the interval I1, the number of poles of the current window is increased by 1; when the number of poles of the front window is greater than the number of poles of the lower window and the angle value of the current window is in the interval I3, the number of poles of the current window is reduced by 1.
[0121] S6: When the motor rotates, the angle value data of the current magnetoelectric encoder is collected through the single-chip microcomputer, and the number of multi-pole pairs corresponding to the front window, the current window, and the back window and the interval of the multi-pole angle value are found out by the table lookup method. The specific formula is:
[0122]
[0123] Among them, check is a table lookup function, Y act is a table lookup function, M_p_x (k) is the number of multiple pole pairs obtained by table lookup, M_ang_act (k) are multiple pairs of pole angle values obtained by table lookup method, is θ 3i Substitute k to get a single specific single pair of pole angle values;
[0124] According to the above solution method, the number of pole pairs of the magnetoelectric encoder can be solved, and then the angle value of the subdivided pole pairs can be solved. The solution formula is:
[0125] θ 细分 =65535×M_p_x (k) +M_ang_act (k) (1.10)
[0126] Among them, θ 细分 are multiple pairs of pole angle values after subdivision, such as Fig.10 As shown, the subdivided multiple pairs of pole angle values and the magnified multiple pairs of pole angle value images recorded in the experiment of this embodiment;
[0127] S7: Define function:
[0128] Y 记 =TD(window_x)(1.11)
[0129] Among them, Y 记 To record the number of jump points, TD represents the mapping relationship of the function, which is specifically manifested as the execution process from S1 to S6, and window_x is the set window width;
[0130] The SWO method is based on the predation, nesting, mating and other behaviors of female wasps in nature to adapt to the complex and changeable search and development needs. The SWO algorithm includes the spider web algorithm and the wasp algorithm. The spider web algorithm is a method of simulating a spider weaving a web in the air. The wasp algorithm is designed to imitate the foraging behavior of bees in a bee colony. This method uses a wasp as a solution, randomly selects a target point in the search space, and obtains the optimal solution by comparing the fitness values of the target points. The SWO algorithm includes a predation step and a nesting step. The predation step includes three stages: searching, tracking and escaping.
[0131] The formula for the search phase is:
[0132]
[0133] in is a set of window widths window_x, t is an index, i is a natural number between 0 and N, μ1 indicates the specified moving direction, a and b are two indices randomly selected from the population for direction specification, r1 is a random number between the interval [0, 1], and r n A random number that satisfies a normal distribution;
[0134] The search phase The value of is the spider population generated between the set maximum and minimum values, and its value range is set to [1,65535]. The search area is expanded to ensure the comprehensiveness of the search. The specific formula is:
[0135]
[0136] After calculation and integration, we can get:
[0137]
[0138] in is the upper bound of the initial parameters, is the lower bound of the initial parameter, r2 is a random number in the interval [0, 1], c is an exponent randomly selected from the population, and l is a randomly generated number in the interval [-2, 1];
[0139] The specific formula for the tracking phase is:
[0140]
[0141] where α is the index of random selection in the population, t and t max represents the current index and the maximum index, r5 and r6 are randomly generated values between [0, 1], and C is the distance control factor that determines the speed of the wasp;
[0142] The specific formula for the escape phase is:
[0143]
[0144] in, is a vector generated between k and -k according to the normal distribution;
[0145] After the predation step is completed, the nesting step begins, as shown in the formula:
[0146]
[0147] in, Indicates the optimal filter window width value;
[0148]
[0149] Among them, r3, r4, and r5 are random numbers between 0 and 1, γ is a number generated based on the flight, and a, b, and c are the indices of randomly selected solutions in the population; The main purpose of is to avoid performing secondary calculations at the same location.
[0150] Specifically, the threshold N in S5 is set to 30000-45000. In this embodiment, the threshold N is set to 45000.
[0151] Specifically, in S7, the number of wasps is set to 30-200, and the maximum number of iterations is set to 30-200. In this embodiment, the number of wasps is set to 200, and the maximum number of iterations is set to 200, and then iterative calculation is performed. The iterative calculation result is as follows: Fig.11 As shown in , the calculation results satisfy the requirement that the number of jump points is 0. The calculation results are verified experimentally, as shown in Fig.12 As shown, the effect of eliminating jump points can be stably achieved.
[0152] The device for suppressing the angle value jump point of a magnetoelectric encoder based on the SWO principle provided in Embodiment 1 of the present invention can apply the method for suppressing the angle value jump point of a magnetoelectric encoder based on the SWO principle. Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5As shown, the device includes a magnetoelectric encoder, which includes a motor flange 1, a bearing 2, a single-pole magnetic steel 3 of radial magnetization, a magnetic conductive ring 4, a magnetic isolation ring 5, a support plate 6, a multi-pole magnetic steel 7 of axial magnetization, an encoder signal solution board 8, an encoder end cover 9, and a motor shaft 10; the encoder signal solution board 8 is soldered with a first single-pole Hall 81, a second single-pole Hall 82, a third single-pole Hall 83 of direct insertion type and a first multi-pole Hall 84, a second multi-pole Hall 85, a third multi-pole Hall 86 of patch type and a single-chip microcomputer 87 on one side close to the magnetic conductive ring 4, and the first single-pole Hall 81, the second single-pole Hall 82 and the third single-pole Hall 83 of direct insertion type and a first multi-pole Hall 84, a second multi-pole Hall 85, a third multi-pole Hall 86 of patch type and a single-chip microcomputer 87. The three single-pole Halls 83 are equidistantly distributed along the same circumference, the center angle between the first single-pole Hall 81 and the second single-pole Hall 82 is 120°, and the center angle between the second single-pole Hall 82 and the third single-pole Hall 83 is 120°; the first multi-pole Hall 84, the second multi-pole Hall 85 and the third multi-pole Hall 86 are equidistantly distributed along the same circumference, the center angle between the first multi-pole Hall 84 and the second multi-pole Hall 85 is 35°, and the center angle between the second multi-pole Hall 85 and the third multi-pole Hall 86 is 35°; the magnetic conductor 4 is provided with a first magnetic conductor 8 on the side close to the encoder signal solution board 8. A single-pole Hall 81, a second single-pole Hall 82, and a third single-pole Hall 83 correspond to the first single-pole Hall slot 41, the second single-pole Hall slot 42, and the third single-pole Hall slot 43 one by one. The first single-pole Hall 81, the second single-pole Hall 82, and the third single-pole Hall 83 are inserted into the first single-pole Hall slot 41, the second single-pole Hall slot 42, and the third single-pole Hall slot 43 according to the corresponding relationship; the support plate 6 is glued to the motor shaft 10, the multi-pole magnetic steel 7 is glued to the support plate 6, the magnetic isolation ring 5 is glued to the support plate 6, the single-pole magnetic steel 3 is glued to the motor shaft 10, the magnetic conductor 4 is glued to the encoder signal solution board 8, and the The encoder signal solution board 8 is glued to the encoder end cover 9, and the encoder end cover 9 is connected to the flange 1 by bolts and nuts; when the motor main shaft 10 rotates, it can drive the support plate 6, the multi-pole magnetic steel 7, the magnetic isolation ring 5, and the single-pole magnetic steel 3 to rotate together; the radial magnetic field of the single-pole magnetic steel 3 is changed in direction by the magnetic conductor 4 glued to the encoder signal solution board 8, and the single-pole magnetic field signal is received by the first single-pole Hall 81, the second single-pole Hall 82, and the third single-pole Hall 83; the first multi-pole Hall 84, the second multi-pole Hall 85, and the third multi-pole Hall 86 are located directly above the multi-pole magnetic steel 7 and can receive multi-pole magnetic field signals.
[0153] Specifically, the plurality of pole pairs of magnetic steel 7 is 24 pole pairs of magnetic steel. After the SWO algorithm is applied, the angle resolution can be increased by 24 times, thereby effectively improving the accuracy of the magnetoelectric encoder.
[0154] In this embodiment, the angle values of multiple pairs of poles are divided into three intervals, and the window width window_x is increased, and the front window, the current window and the lower window are set. It is judged whether the difference between the two adjacent angle values of each window exceeds the set threshold value of 40000. If it exceeds 40000, it proves that there is a jump point. The above method can efficiently lock the jump point. Further combined with the SWO algorithm, the jump point can be efficiently suppressed, and the resolution and accuracy of the magnetoelectric encoder are significantly enhanced. This improvement not only enables the encoder to record and interpret signals more accurately, but also provides more reliable and accurate data. The SWO algorithm used in this embodiment enables the magnetoelectric encoder to record and transmit the rotation information of the motor more accurately and reliably through searching, tracking and escaping, thereby ensuring high-precision control and efficient operation of the mechanical system. In summary, the magnetoelectric encoder angle value jump point suppression method and related device based on the SWO principle in this embodiment have the effect of effectively suppressing jump points and enhancing the accuracy of the magnetoelectric encoder.
Claims
1. A method for suppressing angle jump of a magnetoelectric encoder based on the SWO principle, comprising the following steps: S1: Power the motor, the motor rotates, and the single-pole Hall and multi-pole Hall output signals of the magnetoelectric encoder are collected. The output signals of the single-pole Hall group and the multi-pole Hall group are respectively subjected to Clarke transformation. The specific formula for the Clarke transformation of the output signal of the single-pole Hall group is: in, A+ is the unipolar Hall signal output by the first unipolar Hall, A is the unipolar Hall signal output by the second unipolar Hall, A- is the unipolar Hall signal output by the third unipolar Hall, α+ is the unipolar angle value sine signal, α- is the unipolar angle value cosine signal; The specific formula for Clarke transformation of the output signal of the multi-pole Hall group is: Wherein, B+ is a single-pole Hall signal output by the first multi-pole Hall, B is a multi-pole Hall signal output by the second multi-pole Hall, B- is a multi-pole Hall signal output by the third multi-pole Hall, β+ is a multi-pole angle value sine signal, β- is a multi-pole angle value cosine signal; S2: The encoder signal solver performs analog-to-digital conversion on the single-pole angle value sine signal α+ and the single-pole angle value cosine signal α- to obtain the single-pole angle value digital sine signal H α+ , single polar angle value digital cosine signal H α- , the arc tangent algorithm built into the microcontroller is used to calculate the single pole angle value. The calculation formula is: θ1 is the single pole angle value after proportional enlargement, and its value range is [0,65535]; The encoder signal solver performs analog-to-digital conversion on the multi-pole angle value sine signal β+ and the multi-pole angle value cosine signal β- to obtain the multi-pole angle value digital sine signal H β+ , multiple pairs of polar angle value digital cosine signal H β- , and then use the built-in inverse tangent algorithm in the microcontroller to solve it, and get multiple pairs of pole angle values. The solution formula is: θ1 is the multiple pole angle values after proportional amplification, and the value range is [0,65535]; S3: Repeat steps S1 and S2, and obtain a set of single-pole angle values θ1 and multiple-pole angle values θ2 each time, and enter the single-pole angle value θ1 into the single-pole angle value data set θ 1i , enter the multiple pole angle values θ2 into the multiple pole angle value data set θ 2i After the input is completed, θ 1i and θ 2i Rearrange from smallest to largest; f(θ 3i ,i 4i )=order(θ 1i ,i 2i (1.5) Among them, order is to sort from small to large, θ 3i is a data set of single-pole angle values in ascending order, θ 4i A data set of multiple pairs of pole angle values in ascending order S4: Extract single-pair-of-epipolar angle data set θ 1i The high 11 bits of the single-pole angle value and the corresponding number are as follows: Among them, floor is the rounding function, f end is the screening function, h note is a recording function. s_ang_sel_x is the single-pole angle value of the upper 11 bits selected, and s_ang_j is the reordering number corresponding to the single-pole angle value of the upper 11 bits selected; S5: Find multiple pairs of pole angle values one by one according to the numbers, and divide these multiple pole angle values into three intervals. They are interval I1 = [0, 4096), interval I2 = [4096, 61440), interval I3 = [61440, 65535), and the three intervals are used as a table lookup basis to set a window width window_x, set the front window, current window and lower window, and the specific formula is: Among them, window_x is the window width, θ 3i is a data set of single-pair angle values in ascending order, is the angle value of the front window, is the angle value of the back window, and M_angle is the angle value of the current window; When a jump point occurs, the corresponding extreme value is determined by judging the difference between two adjacent window angle values of each layer. The specific formula is: yy=abs(diff(xx))>N? k:k+1 (1.8) abs is the rounding function, diff is the function for calculating the difference between two adjacent window angle values at each layer, and N is the set threshold; When the number of poles of the previous window is greater than that of the current window, and the angle value of the current window is in interval I1, the number of poles of the current window is increased by 1; When the number of poles of the front window is greater than that of the lower window, and the current window angle value is in interval I3, the number of poles of the current window is reduced by 1; S6: When the motor rotates, the angle value data of the current magnetoelectric encoder is collected through the single-chip microcomputer, and the number of multi-pole pairs corresponding to the front window, the current window, and the back window and the interval of the multi-pole angle value are found out by the table lookup method. The specific formula is: Among them, check is a table lookup function, Y act is a table lookup function, M_p_x (k) is the number of multiple pole pairs obtained by table lookup, M_ang_act (k) These are the multiple pairs of pole angle values obtained by the table lookup method; Then, the angle values of multiple pairs of poles after subdivision can be solved, and the solution formula is: θ 细分 =65535×M_p_x (k) +M_ang_act (k) (1.10) Among them, θ 细分 are multiple pairs of pole angle values after subdivision; S7: Define function: Y 记 =TD(window_x)(1.11) Among them, Y 记 To record the number of jump points, TD represents the mapping relationship of the function, which is specifically manifested as the execution process from S1 to S6, and window_x is the set window width; The SWO algorithm is used. The SWO algorithm includes the spider web algorithm and the wasp algorithm. The spider web algorithm is a method of simulating a spider weaving a web in the air. The wasp algorithm is designed to imitate the foraging behavior of bees in a bee colony. This method takes a wasp as a solution, randomly selects a target point in the search space, and obtains the optimal solution by comparing the fitness values of the target points. The SWO algorithm includes a predation step and a nesting step. The predation step includes three stages: searching, tracking and escaping. The formula for the search phase is: in is a set of window widths window_x, t is an index, i is a natural number between 0 and N, μ1 indicates the specified moving direction, a and b are two indices randomly selected from the population for direction specification, r1 is a random number between the interval [0, 1], and r n A random number that satisfies a normal distribution; The search phase The value of is the spider population generated between the set maximum and minimum values, and its value range is set to [1,65535]. The search area is expanded to ensure the comprehensiveness of the search. The specific formula is: in is the upper bound of the initial parameters, is the lower bound of the initial parameter, r2 is a random number in the interval [0, 1], c is an exponent randomly selected from the population, and l is a randomly generated number in the interval [-2, 1]; The specific formula for the tracking phase is: where α is the index of random selection in the population, t and t max represents the current index and the maximum index, r5 and r6 are randomly generated values between [0, 1], and C is the distance control factor that determines the speed of the wasp; The specific formula for the escape phase is: in, is a vector generated between k and -k according to the normal distribution; After the predation step is completed, the nesting step begins, as shown in the formula: in, Indicates the optimal filter window width value; Among them, r3, r4, and r5 are random numbers between 0 and 1, γ is a number generated based on the flight, and a, b, and c are the indices of randomly selected solutions in the population; The main purpose of is to avoid performing secondary calculations at the same location.
2. The method for suppressing angle jump of a magnetoelectric encoder based on the SWO principle as claimed in claim 1, characterized in that: In S5, the threshold N is set to 30000-45000.
3. The method for suppressing angle jump of a magnetoelectric encoder based on the SWO principle as claimed in claim 1 or 2, characterized in that: In S7, the number of wasps is set to 30-200, and the maximum number of iterations is set to 30-200.
4. A device for suppressing angle value jump of a magnetoelectric encoder based on the SWO principle, which can apply a method for suppressing angle value jump of a magnetoelectric encoder based on the SWO principle, characterized in that: The invention comprises a magnetoelectric encoder, wherein the magnetoelectric encoder comprises a motor flange (1), a bearing (2), a single-pole magnetic steel of radial magnetization mode (3), a magnetic guide ring (4), a magnetic isolation ring (5), a support plate (6), a multi-pole magnetic steel of axial magnetization mode (7), an encoder signal solution board (8), an encoder end cover (9), and a motor shaft (10); The encoder signal calculation board (8) is soldered with a first single-pole Hall (81), a second single-pole Hall (82), a third single-pole Hall (83) of direct-insertion type, a first multi-pole Hall (84), a second multi-pole Hall (85), a third multi-pole Hall (86) of patch type, and a single-chip microcomputer (87) on one side close to the magnetic conductive ring (4). The first single-pole Hall (81), the second single-pole Hall (82) and the third single-pole Hall (83) are equidistantly distributed along the same circumference, the center angle between the first single-pole Hall (81) and the second single-pole Hall (82) is 120°, and the center angle between the second single-pole Hall (82) and the third single-pole Hall (83) is 120°; The first multi-pole pair Hall (84), the second multi-pole pair Hall (85) and the third multi-pole pair Hall (86) are equidistantly distributed along the same circumference, the center angle between the first multi-pole pair Hall (84) and the second multi-pole pair Hall (85) is 35°, and the center angle between the second multi-pole pair Hall (85) and the third multi-pole pair Hall (86) is 35°; The magnetic conductor (4) is provided with a first single-pole Hall slot (41), a second single-pole Hall slot (42) and a third single-pole Hall slot (43) corresponding to the first single-pole Hall (81), the second single-pole Hall (82) and the third single-pole Hall (83) on one side close to the encoder signal solution board (8); the first single-pole Hall (81), the second single-pole Hall (82) and the third single-pole Hall (83) are inserted into the first single-pole Hall slot (41), the second single-pole Hall slot (42) and the third single-pole Hall slot (43) according to the corresponding relationship; The support plate (6) is glued to the motor shaft (10), the multi-pole magnetic steel (7) is glued to the support plate (6), the magnetic isolation ring (5) is glued to the support plate (6), the single-pole magnetic steel (3) is glued to the motor shaft (10), the magnetic conductor (4) is glued to the encoder signal solution board (8), the encoder signal solution board (8) is glued to the encoder end cover (9), and the encoder end cover (9) is connected to the flange (1) by bolts and nuts; When the motor main shaft (10) rotates, it can drive the support plate (6), the multi-pole magnetic steel (7), the magnetic isolation ring (5), and the single-pole magnetic steel (3) to rotate together; The radial magnetic field of the single-pole magnet (3) is changed in direction by the magnetic conductor (4) glued to the encoder signal solution board (8), and the single-pole magnetic field signal is received by the first single-pole Hall (81), the second single-pole Hall (82), and the third single-pole Hall (83). The first multi-pole Hall (84), the second multi-pole Hall (85), and the third multi-pole Hall (86) are located directly above the multi-pole magnet (7) and are capable of receiving multi-pole magnetic field signals.
5. The device for suppressing angle jump of a magnetoelectric encoder based on the SWO principle as claimed in claim 4, characterized in that: The multiple pairs of pole magnetic steel (7) are 24 pairs of pole magnetic steel.
