Encoder control method and system, intelligent terminal and storage medium

By aligning and fusing the incremental and absolute coordinate systems of the first and second detection heads, the problem that existing encoders cannot simultaneously achieve continuity and accurate positioning of absolute coordinates and incremental information is solved, thus realizing high-precision and continuous detection of the turntable position.

CN121409294APending Publication Date: 2026-01-27NINGBO EGGER MEASUREMENT & CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511743926.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-01-27

AI Technical Summary

Technical Problem

Existing encoders cannot simultaneously ensure the continuity and precise positioning of the absolute coordinates and incremental information of the turntable, resulting in insufficient continuity and precision in turntable position detection.

Method used

By initializing the sampling reference of the first and second detection heads, incremental and absolute information are received in real time, an incremental coordinate system is generated and aligned, and a unified fused absolute coordinate system is formed, outputting the turntable rotation information.

Benefits of technology

It achieves continuous, high-precision, and globally unique coordinate output of the turntable position, ensuring accurate acquisition of rotation speed, rotation angle, and real-time coordinates, thus improving the continuity and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121409294A_ABST
    Figure CN121409294A_ABST
Patent Text Reader

Abstract

The invention relates to an encoder control method and system, an intelligent terminal and a storage medium, and relates to the technical field of encoders, and the method comprises the steps: responding to a rotation signal of a rotating disc, and initializing sampling references of a first detection head and a second detection head; receiving first increment information and first absolute value information returned by the first detection head and second increment information and second absolute value information returned by the second detection head in real time; generating a first incremental coordinate system based on the first incremental information; generating a second incremental coordinate system based on the second incremental information; performing alignment operation on the first incremental coordinate system and the second incremental coordinate system to obtain a fusion coordinate system; adding the coordinates corresponding to the first absolute value information and the coordinates corresponding to the second absolute value information into a fused coordinate system to obtain a fused absolute value coordinate system; and outputting turntable rotation information in real time based on the fused absolute value coordinate system. The method and the device have the effect of improving the continuity and the accuracy of turntable position detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of encoder technology, and in particular to an encoder control method, system, smart terminal and storage medium. Background Technology

[0002] An encoder is a sensing device used to detect the position and motion state of rotating parts. It can output rotation angle, displacement or speed information and is commonly used in motor control, automation equipment and precision positioning systems. Existing encoders are generally divided into incremental and absolute types: Incremental encoders output relative displacement information by detecting changes in magnetic poles or scale. Although they have higher resolution, they cannot directly obtain absolute coordinates. Once the power is off or a pulse jump occurs, the zero reference will be lost. Absolute encoders can output the absolute coordinates of the corresponding angular position. Even if the power is off, the zero position will not be lost. However, due to the limitations of the encoding structure, the resolution is usually not as fine as that of incremental encoders, and the real-time performance and tracking accuracy are poor in high-speed rotation or continuous detection scenarios.

[0003] Regarding the aforementioned technologies, incremental information and absolute information are independent of each other, making it impossible to simultaneously ensure continuity and precise positioning, resulting in difficulties in uniformly outputting the absolute coordinates and precise increments of the turntable. Summary of the Invention

[0004] To improve the continuity and accuracy of turntable position detection, this application provides an encoder control method, system, intelligent terminal, and storage medium.

[0005] Firstly, this application provides an encoder control method, which adopts the following technical solution: An encoder control method, comprising: In response to the rotation signal of the turntable, the sampling reference of the first and second detection heads is initialized; Real-time reception of the first incremental information and the first absolute information returned by the first detection head, and the second incremental information and the second absolute information returned by the second detection head; A first incremental coordinate system is generated based on the first incremental information; A second incremental coordinate system is generated based on the second incremental information; Align the first incremental coordinate system and the second incremental coordinate system to obtain the fused coordinate system; Add the coordinates corresponding to the first absolute value information and the coordinates corresponding to the second absolute value information to the fused coordinate system to obtain the fused absolute value coordinate system; The turntable rotation information is output in real time based on the fused absolute coordinate system. The turntable rotation information includes the turntable speed, the turntable rotation angle, and the current coordinates of the turntable.

[0006] By adopting the above technical solution, incremental and absolute information from both the first and second detection heads can be acquired simultaneously. Incremental coordinate systems are then constructed separately, aligned, and fused. Finally, the absolute coordinates are superimposed to form a unified fused absolute coordinate system, thereby achieving continuous, high-precision, and globally unique coordinate output for the turntable position. This not only ensures the accurate acquisition of turntable rotation speed, rotation angle, and real-time coordinates, but also achieves unified fusion and output of incremental and absolute information, improving the continuity and accuracy of turntable position detection.

[0007] Optionally, after initializing the sampling references of the first and second detection heads in response to the rotation signal of the turntable, the method further includes: Determine whether the rotation signal is the initial rotation signal; If so, the first incremental information set corresponding to when the turntable completes at least one revolution is obtained through the first detection head; A detection information coordinate system is generated based on the first incremental information set; Determine whether there are missing segments of detection information based on the coordinate system of the detection information; If it exists, obtain the span of the missing segment corresponding to the missing segment of the detection information according to the preset method; The position of the second detection head is adjusted based on the span of the missing segment, so that the span of the second detection head relative to the turntable is greater than the span of the missing segment.

[0008] By adopting the above technical solution, the integrity of the incremental information collected by the first detection head can be verified during the initial rotation of the turntable. Based on the coordinate system of the detection information, the span of the missing segment of the detection information is identified and determined, and the installation position of the second detection head is adjusted accordingly, so that the circumferential distance between it and the first detection head is greater than the span of the missing segment. This avoids the simultaneous occurrence of detection blind spots by both detection heads, improves the compensation coverage capability of the dual detection head collaborative acquisition, and ensures that complete incremental information can be continuously acquired during subsequent operation.

[0009] Optionally, obtaining the span of the missing segment corresponding to the missing segment of the detection information according to a preset method includes: While acquiring the first incremental information set corresponding to the turntable completing at least one rotation through the first detection head, the second detection information set corresponding to the turntable completing at least one rotation is simultaneously acquired through the second detection head. Obtain the start and end timestamps corresponding to the missing segments of the detection information in the detection information coordinate system; The target information set is extracted from the second detection information set based on the start and end timestamps; Obtain the number of target square waves in the target information set; The span of the missing segment is determined based on the number of target square waves.

[0010] By adopting the above technical solution, when the detection information of the first detection head is missing, the incremental information synchronously collected by the second detection head can be used to perform accurate positioning and span quantification of the missing segment: the corresponding target information set is extracted from the second detection information set by the start and end timestamps of the missing segment, and the actual span of the missing segment is determined based on the number of target square waves. This enables accurate measurement of the detection blind zone range and avoids errors caused by relying on empirical estimation or fixed compensation values.

[0011] Optionally, the starting and ending coordinates of the missing segments of the detected information can be obtained based on the detection information coordinate system; Update the absolute value end coordinates corresponding to the missing start coordinates; Update the absolute value starting coordinates corresponding to the missing end coordinates of the absolute value information.

[0012] By adopting the above technical solution, after identifying the missing segment of the detection information, the starting and ending coordinates of the missing segment in the detection information coordinate system can be mapped to the coordinate range corresponding to the absolute value information, and the starting and ending coordinates of the absolute value information can be updated. This enables boundary alignment and coordinate continuity correction of the absolute value information within the missing segment region.

[0013] Optionally, the first incremental information and the second incremental information are extracted from the historical records according to a preset detection cycle to obtain the first incremental detection segment and the second incremental detection segment. Determine whether the number of square waves corresponding to the first incremental detection segment is equal to the number of square waves corresponding to the second incremental detection segment; If so, repeat the above two steps; If not, obtain the target square wave number when the number of square waves corresponding to the first incremental detection segment and the second incremental detection segment within the preset detection period are equal; The first incremental information is extracted from the historical records using a preset detection cycle, and the detection segment set is obtained. Find the initial target detection segment from the detection segment set that satisfies the condition that the number of square waves is less than the target number of square waves; Find the end target detection segment from the detection segment set that satisfies the condition that the number of square waves equals the target number of square waves; The starting coordinates of the initial target detection segment are used as the starting coordinates of the target extension interval; The end coordinates of the target detection segment are used as the end coordinates of the target extension interval.

[0014] By employing the above technical solution, the number of square waves from the first and second detection heads can be compared based on historical incremental information within a preset detection cycle. This allows for the identification of any abnormally elongated intervals in the incremental information. Furthermore, by locating detection segments where the number of square waves is lower than or equal to the target number, the start and end coordinates of the target elongated interval can be accurately determined. This enables autonomous detection and interval localization of areas of incremental information distortion caused by magnetic strip stretching without relying on manual intervention or additional calibration signals.

[0015] Optionally, the number of preset detection cycles corresponding to the initial target detection segment to the end target detection segment can be obtained from the detection segment set; Multiply the number of cycles by the number of target square waves to obtain the total number of target square waves; The correction coefficient is obtained by obtaining the ratio of the number of square waves in the target elongated interval to the total number of square waves in the target interval. The incremental and absolute information corresponding to the target extended interval are corrected based on the correction coefficient.

[0016] By adopting the above technical solution, after determining the target elongated interval, the number of detection cycles spanned by the interval can be calculated based on the span of the detection section. Combined with the target square wave count, the theoretically expected total number of square waves can be calculated. Then, a correction coefficient is obtained by comparing this to the actual number of detected square waves. Based on this correction coefficient, the incremental and absolute information of the target elongated interval is synchronously corrected, ensuring that the square wave spacing in the elongated area remains consistent with that in the normal area.

[0017] Optionally, obtain the reference coordinate values ​​in the corrected fused absolute coordinate system; Determine whether the reference coordinate value deviates from the preset zero reference; If there is a deviation, the fused absolute coordinate system will be repositioned to zero reference, so that the corrected fused absolute coordinate system is realigned with the preset zero reference.

[0018] By adopting the above technical solution, after completing the incremental and absolute value information correction of the target extended interval, the corrected fused absolute value coordinate system can be zero-base verification. By judging whether the reference coordinate value deviates from the preset zero reference, if there is a deviation, zero-base repositioning is performed so that the fused absolute value coordinate system is re-aligned with the standard zero position.

[0019] Secondly, this application provides an encoder control system, which adopts the following technical solution: An encoder control system, comprising: The acquisition module is used to acquire the first incremental information, the first absolute value information, the second incremental information, and the second absolute value information; A memory for storing the program of the encoder control method described above; The processor can load and execute the program in the memory to implement the encoder control method described above.

[0020] By adopting the above technical solution, incremental and absolute information from both the first and second detection heads can be acquired simultaneously. Incremental coordinate systems are then constructed separately, aligned, and fused. Finally, the absolute coordinates are superimposed to form a unified fused absolute coordinate system, thereby achieving continuous, high-precision, and globally unique coordinate output for the turntable position. This not only ensures the accurate acquisition of turntable rotation speed, rotation angle, and real-time coordinates, but also achieves unified fusion and output of incremental and absolute information, improving the continuity and accuracy of turntable position detection.

[0021] Thirdly, this application provides a smart terminal, which adopts the following technical solution: A smart terminal includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the method described in any one of the above.

[0022] Fourthly, this application provides a computer storage medium capable of storing corresponding programs, which facilitates improving the continuity and accuracy of turntable position detection, and adopts the following technical solution: A computer-readable storage medium storing a computer program that can be loaded by a processor and executed by any of the encoder control methods described above.

[0023] In summary, this application includes at least one of the following beneficial technical effects: 1. It can simultaneously acquire incremental and absolute information from both the first and second detection heads, construct incremental coordinate systems separately, align and fuse them, and then superimpose the absolute coordinates to form a unified fused absolute coordinate system. This achieves continuous, high-precision, and globally unique coordinate output for the turntable position. Therefore, it not only ensures the accurate acquisition of turntable rotation speed, rotation angle, and real-time coordinates, but also achieves unified fusion output of incremental and absolute information, improving the continuity and accuracy of turntable position detection. 2. The system can perform integrity verification on the incremental information collected by the first detection head during the initial rotation of the turntable. Based on the coordinate system of the detection information, it identifies and determines the span of the missing segment of the detection information and adjusts the installation position of the second detection head accordingly, ensuring that the circumferential distance between it and the first detection head is greater than the span of the missing segment. This avoids blind spots in the detection by both detection heads simultaneously, improves the compensation coverage capability of the dual-detection-head collaborative acquisition, and ensures that complete incremental information can be continuously acquired during subsequent operation. 3. Based on historical incremental information, it can compare the number of square waves from the first and second detection heads within a preset detection cycle to identify whether there are abnormally elongated intervals in the incremental information. By finding detection segments where the number of square waves is lower than or equal to the target number, it accurately determines the start and end coordinates of the target elongated interval. This allows for autonomous detection and interval localization of incremental information distortion areas caused by magnetic strip stretching without relying on manual intervention or additional calibration signals. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the encoder control method in an embodiment of this application.

[0025] Figure 2 This is a flowchart illustrating a detection head position adjustment method in an embodiment of this application.

[0026] Figure 3 This is a flowchart illustrating the process of obtaining the span of the missing segment corresponding to the missing segment of the detection information according to a preset method in an embodiment of this application.

[0027] Figure 4 This is a flowchart illustrating a coordinate update method in an embodiment of this application.

[0028] Figure 5 This is a flowchart illustrating a method for detecting the elongated region of a magnetic strip in an embodiment of this application.

[0029] Figure 6 This is a flowchart illustrating a method for lengthening interval correction in an embodiment of this application.

[0030] Figure 7 This is a flowchart illustrating a reference coordinate update method in an embodiment of this application. Detailed Implementation

[0031] To make the purpose, technical solution, and advantages of this application clearer, the following description is provided in conjunction with the appendix. Figure 1 -Appendix Figure 7 The present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the application.

[0032] This application discloses an encoder control method. (Refer to...) Figure 1 The encoder control methods include: Step S101: In response to the rotation signal of the turntable, initialize the sampling reference of the first detection head and the second detection head.

[0033] The turntable has a magnetic strip attached to its outer circumference. This magnetic strip consists of a double-layered magnetic track structure. The upper layer is an incremental magnetic block layer, composed of several evenly spaced magnetic blocks. The lower layer is an absolute magnetic block layer, composed of several magnetic blocks of varying sizes arranged according to a preset encoding rule. This layer provides a magnetic pole combination signal corresponding to displacement at any angle, outputting the absolute positioning signal of the magnetic strip to indicate the current absolute angular position of the turntable.

[0034] A rotation signal is a signal used to control the rotation of a turntable.

[0035] The sampling reference point refers to the reference point set when the detection head begins to participate in signal acquisition.

[0036] After detecting a rotation signal from the turntable, initial reference benchmarks are established for the first and second detection heads for subsequent signal acquisition and coordinate generation, respectively. During benchmark establishment, it is ensured that the signal outputs of the two detection heads form a phase difference with a preset phase period. The preset phase period can be set to 1 / 4 period.

[0037] Step S102: Receive the first incremental information and the first absolute information returned by the first detection head and the second incremental information and the second absolute information returned by the second detection head in real time.

[0038] Incremental information refers to the pulse signal sequence output by the detection head after magnetic induction of the incremental magnetic block layer, based on the change of adjacent magnetic poles. It is used to reflect the change in the relative position of the turntable, and the cumulative number of pulse signals is used to represent the relative rotation of the turntable.

[0039] Absolute value information refers to the absolute positioning data output by the detection head after magnetic encoding identification of the absolute value magnetic block layer, which can uniquely correspond to the current turntable angle position and can be used to determine the current rotation coordinates or angle value.

[0040] The detection head is equipped with an incremental magnetic induction sensor opposite to the incremental magnetic block layer in the magnetic strip and an absolute magnetic induction sensor opposite to the absolute magnetic block layer in the magnetic strip. When the turntable rotates, the incremental magnetic induction sensor senses the changes in magnetic poles on the incremental magnetic block layer and converts the magnetic pole transformation process into corresponding electrical signal pulses. The absolute magnetic induction sensor samples the magnetic field of the magnetic pole combinations in the absolute magnetic block layer and converts the sampling results into electrical signals reflecting the current magnetic encoding state. Then, signal shaping and encoding parsing processing are performed on the two types of electrical signals respectively. The electrical signal output by the incremental magnetic induction sensor is converted into incremental information representing the number of adjacent magnetic pole transitions, and the electrical signal output by the absolute magnetic induction sensor is converted into absolute information uniquely indicating the current position of the turntable. Furthermore, both the incremental and absolute information include a timestamp of the sampling time. The first detection head and the second detection head have the same structure. The incremental information detected by the first detection head is the first incremental information, and the absolute value information detected by the first detection head is the first absolute value information. The incremental information detected by the second detection head is the second incremental information, and the absolute value information detected by the second detection head is the second absolute value information.

[0041] Step S103: Generate a first incremental coordinate system based on the first incremental information.

[0042] The incremental coordinate system refers to a relative position coordinate system established with time as the horizontal axis and the square wave signal corresponding to the incremental information output by the detection head as the vertical axis. The high and low levels of each square wave represent changes in magnetic field polarity. When the incremental magnetic induction sensor detects a magnetic signal, it outputs a high-level square wave as an effective scale; when no magnetic signal is detected, it outputs a low-level signal, indicating that the corresponding position is at zero scale.

[0043] This step establishes an incremental coordinate system based on the square wave signal corresponding to the incremental information output by the detection head, following the sequence of signal changes over time. Using the sampling reference time point as the origin, the rising edge, falling edge, and level changes of the square wave on the time axis are used as the basis for coordinate scale changes. As time progresses, the continuous changes of the square wave form a discrete scale sequence, thereby constructing a time-calibrated incremental position coordinate system and realizing the time-series recording of the relative displacement of the turntable.

[0044] The first incremental coordinate system is generated based on the first incremental information.

[0045] Step S104: Generate a second incremental coordinate system based on the second incremental information.

[0046] The second incremental coordinate system is generated based on the second incremental information, as can be found in step S103.

[0047] Step S105: Align the first incremental coordinate system and the second incremental coordinate system to obtain the fused coordinate system.

[0048] A fused coordinate system refers to a coordinate system that simultaneously presents a square wave sequence in both a first incremental coordinate system and a second incremental coordinate system under a unified horizontal axis scale, while maintaining a fixed phase difference of 1 / 4 period between the two.

[0049] In one feasible embodiment, the square wave sequence of the first incremental coordinate system is used as the horizontal axis reference, and the square wave sequence of the second incremental coordinate system is calibrated and mapped using this reference, so that the two coordinate sequences are synchronously unfolded at the same time resolution. Based on the 1 / 4 cycle phase difference determined in the initialization phase, the second incremental coordinate system is positioned at a position that lags behind or leads the first incremental coordinate system by 1 / 4 cycle.

[0050] After the fused coordinate system is established, the first incremental coordinate system and the second incremental coordinate system maintain the same time scale, the same square wave period unit, and a constant phase difference of 1 / 4 period, thereby realizing the parallel fusion of the two coordinate systems.

[0051] Step S106: Add the coordinates corresponding to the first absolute value information and the coordinates corresponding to the second absolute value information to the fused coordinate system to obtain the fused absolute value coordinate system.

[0052] The fused absolute coordinate system refers to an absolute position coordinate system formed by mapping the absolute value information acquired by the first and second detection heads to a unified time scale, based on the fused coordinate system. This coordinate system not only includes the dual-track square wave information of the incremental coordinates of phase A and phase B, but also superimposes absolute coordinates to indicate the unique absolute position of the turntable under the fused coordinate system.

[0053] Step S107: Output turntable rotation information in real time based on the fused absolute coordinate system. The turntable rotation information includes the turntable speed, the turntable rotation angle, and the current coordinates of the turntable.

[0054] In one feasible embodiment, based on a fused absolute value coordinate system, the turntable rotation information is output in real time in the following manner: Turntable rotation angle: The angle value corresponding to the absolute value of the current scale is obtained directly from the fused absolute value coordinate system; Current coordinates of the turntable: The current scale is located based on the fused incremental coordinates and the absolute value coordinate anchor point. Turntable rotation speed: This is obtained by calculating the duration of a single square wave per unit time. Each magnetic block in the incremental magnetic block layer has a preset physical width. When the magnetic induction sensor detects the passage of a magnetic block, it outputs a complete square wave. The duration of the square wave represents the time required for the magnetic block to pass the sensor. By dividing the width of the magnetic block by the duration of the square wave, the current linear or angular velocity of the turntable is obtained.

[0055] In response to the rotation signal of the turntable, after initializing the sampling references of the first and second detection heads, the process also includes: Step S201: Determine whether the rotation signal is the initial rotation signal.

[0056] The initial rotation signal refers to the first valid rotation trigger signal generated by the turntable after power-on or startup, which is used to identify the starting moment when the turntable enters the valid rotation detection from a stationary state.

[0057] Step S202: If so, obtain the first incremental information set corresponding to when the turntable completes at least one revolution through the first detection head.

[0058] On the other hand, if the rotation signal is not the initial rotation signal, no operation is performed.

[0059] The first incremental information set refers to the collection of the first incremental information continuously collected by the first detection head during the process of the turntable completing at least one full revolution.

[0060] Step S203: Generate a detection information coordinate system based on the first incremental information set.

[0061] The detection information coordinate system refers to a coordinate system constructed based on the first incremental information set to detect the integrity and continuity of incremental information. The horizontal axis is the time axis, and the vertical axis is the square wave signal state. This coordinate system is used to present the complete detection trajectory of the first detection head within one revolution, thereby identifying whether there are signal interruptions or missing segments.

[0062] Step S204: Determine whether there are missing detection information segments based on the detection information coordinate system.

[0063] The missing detection information segment refers to the interruption area of ​​the square wave signal in the detection information coordinate system. That is, the segment in which no square wave transition is detected or the signal remains at a low level within a certain time interval, indicating that the first detection head failed to identify the incremental magnetic signal within that angle range.

[0064] Step S205: If it exists, obtain the span of the missing segment corresponding to the missing segment of the detection information according to the preset method.

[0065] On the other hand, if it does not exist, no action is taken.

[0066] The missing segment span refers to the actual range covered by the magnetic strip length corresponding to the missing segment of the detected information in the circumferential direction of the turntable, and is used to quantify the size of the missing magnetic strip area. The missing segment span corresponding to the missing signal segment can be obtained according to a preset method, as shown in the following reference. Figure 3 The steps in the embodiments.

[0067] Step S206: Adjust the position of the second detection head based on the span of the missing segment, so that the span of the second detection head relative to the turntable is greater than the span of the missing segment.

[0068] Based on the obtained span of the missing segment, the installation position or sampling reference position of the second detection head is adjusted to ensure that the effective detection coverage of the two detection heads in the circumferential direction of the turntable does not overlap in detecting the missing information segment. By ensuring that the span of the detection head is greater than the span of the missing segment, the following objectives can be achieved: when the first detection head has a signal missing segment, the second detection head can still detect that area; and synchronous failure of the two detection heads is avoided, ensuring that at least one incremental signal is continuously available.

[0069] For example, if the calculated span of the missing segment of the first detection head is 4 square wave cycles, the position of the second detection head is adjusted so that its span relative to the first detection head is at least 5 square wave cycles, corresponding to the length on the magnetic strip. Here, the length corresponding to one square wave is the width corresponding to one magnetic block in the incremental magnetic block layer of the magnetic strip. After adjustment, when the first detection head detects the missing segment, the second detection head can still output a normal square wave signal, thereby ensuring that at least one incremental information chain is complete and effective.

[0070] The span of the missing segment corresponding to the missing segment of the detection information is obtained according to a preset method, including: Step S301: While acquiring the first incremental information set corresponding to the turntable completing at least one revolution through the first detection head, the second detection information set corresponding to the turntable completing at least one revolution is acquired simultaneously through the second detection head. Specifically, the second detection head is activated simultaneously with the first detection head to achieve synchronous acquisition of detection information.

[0071] The second detection information set refers to the collection of the second incremental information continuously collected by the second detection head during the process of the turntable completing at least one full revolution.

[0072] Step S302: Obtain the start and end timestamps corresponding to the missing segments of the detection information in the detection information coordinate system.

[0073] The start timestamp and end timestamp refer to the corresponding time points in the detection information coordinate system when the missing information segment begins to show no square wave output and resumes output square wave signal, and are used to define the range of the missing information segment on the time axis.

[0074] Step S303: Extract the target information set from the second detection information set based on the start timestamp and end timestamp.

[0075] The target information set refers to the detection information segment within the same time interval as the missing detection information segment detected by the first detection head in the second detection information set.

[0076] Based on the start and end timestamps of the missing segment of detection information corresponding to the first detection head, data within the same time interval are located in the second detection information set, and a complete square wave signal within that interval is extracted as the target information set. Since the second detection head outputs normally within this time interval, its corresponding square wave signal segment can be extracted to compensate for the missing effective reference signal of the first detection head.

[0077] In one feasible embodiment, the start timestamp t_start and end timestamp t_end of the missing detection information segment are read to determine the data index range corresponding to the time interval in the second detection information set, and square wave data within the time interval are extracted from the second detection information set to form a target information set.

[0078] Step S304: Obtain the number of target square waves in the target information set.

[0079] The target square wave count refers to the number of square waves contained in the target information set. It is used to represent the number of square waves corresponding to the incremental information actually detected by the second detection head within the missing time interval corresponding to the missing detection information segment detected by the first detection head.

[0080] Step S305: Determine the span of the missing segment based on the number of target square waves.

[0081] The target square wave count represents the number of square wave cycles that the first detection head "should have detected but did not." Since each magnetic block in the incremental magnetic block layer has a preset physical width, a complete square wave is output when the magnetic induction sensor detects the passage of a magnetic block. Therefore, the target square wave count is multiplied by the width of the magnetic block corresponding to one square wave to obtain the missing segment span. Furthermore, the missing segment span can be converted into the span corresponding to the central angle based on the turntable radius.

[0082] This application provides a coordinate update method, referring to... Figure 4 The method includes: Step S401: Obtain the starting and ending coordinates of the missing segment of the detection information based on the detection information coordinate system.

[0083] The missing start coordinates represent the absolute coordinates corresponding to the first occurrence of the missing segment in the detection information coordinate system. Specifically, the first detection head acquires the corresponding first absolute value information while acquiring the first incremental information set, adds this information to the detection information coordinate system, and then searches for the coordinates of the first occurrence of the missing segment in the detection information coordinate system. Based on these coordinates, it finds the corresponding absolute coordinates to obtain the missing start coordinates.

[0084] The starting coordinate of the missing information represents the absolute coordinate of the first disappearance of the missing information segment in the detection information coordinate system. The method for obtaining the ending coordinate of the missing information can refer to the method for obtaining the starting coordinate of the missing information, which will not be repeated here.

[0085] Step S402: Update the absolute value end coordinates corresponding to the missing start coordinates.

[0086] If the magnetic strip can completely surround the side of the turntable, the starting coordinates corresponding to the absolute value information can be selected from any point on the magnetic strip. However, if the magnetic strip cannot completely surround the side of the turntable, the absolute value coordinates corresponding to the beginning and end of the measuring strip need to be calibrated.

[0087] The absolute value end coordinates refer to the reference coordinates used in the fused absolute value coordinate system to represent the position of the end of the absolute value encoding cycle, i.e., the coordinates of the end of the magnetic strip.

[0088] The absolute coordinate system is corrected using the missing start coordinates, updating the absolute coordinate position of the missing start coordinate to the absolute end coordinate. This adjustment eliminates the absolute coordinate offset problem caused by the missing segment, allowing the endpoint of the absolute coordinate to be realigned with the end position of the actual magnetic stripe encoding interval.

[0089] Step S403: Update the absolute value starting coordinates corresponding to the missing end coordinates of the absolute value information.

[0090] The absolute value starting coordinates refer to the reference coordinates used in the fused absolute value coordinate system to represent the starting position of the absolute value encoding cycle, i.e., the coordinates of the starting end of the magnetic strip.

[0091] The absolute value coordinate system is corrected using the missing end coordinate, updating the absolute value coordinate position of the missing end coordinate to the absolute value start coordinate. This adjustment eliminates the absolute value coordinate offset problem caused by the missing segment, allowing the starting point of the absolute value coordinate to be realigned with the beginning position of the actual magnetic stripe encoding interval.

[0092] This application provides a method for detecting the elongation region of a magnetic stripe, referring to... Figure 5 The method includes: Step S501: Extract the first incremental information and the second incremental information from the historical records according to the preset detection cycle to obtain the first incremental detection segment and the second incremental detection segment.

[0093] The preset detection period is a constant that can be adjusted according to actual needs. A continuous incremental data segment is extracted from historical incremental information according to the preset detection period, representing the incremental data collection within a fixed time period.

[0094] For example, according to a preset detection period, the square wave corresponding to the incremental information detected by the first detection head is truncated from the historical records to obtain the first incremental detection segment A1. At the same time, according to the preset detection period, the square wave corresponding to the incremental information detected by the second detection head is truncated from the historical records to obtain the second incremental detection segment B1.

[0095] Step S502: Determine whether the number of square waves corresponding to the first incremental detection segment is equal to the number of square waves corresponding to the second incremental detection segment.

[0096] The magnetic strip is attached to the side of the turntable. During the attachment process, the magnetic strip may be stretched, which will lengthen the gap between the magnetic blocks in the incremental magnetic block layer in the stretched part, resulting in a deviation in the incremental information during measurement.

[0097] By comparing the number of square waves in the first incremental detection section with the number of square waves in the second incremental detection section, it is possible to identify whether the magnetic strip has been stretched.

[0098] Step S503: If so, repeat the above two steps.

[0099] If so, it means that no situation has been detected where the number of square waves corresponding to the first incremental detection segment is not equal to the number of square waves corresponding to the second incremental detection segment, which means that no elongated area of ​​the magnetic strip has appeared at the current moment. Therefore, by repeatedly executing steps S501 and S502, the existence of an elongated area is continuously detected. If, after completing the detection of at least one rotation of the turntable, there is still no situation where the number of square waves corresponding to the first incremental detection segment is not equal to the number of square waves corresponding to the second incremental detection segment, it means that no elongated area of ​​the magnetic strip exists, and the loop of this step is exited and this embodiment ends.

[0100] Step S504: If not, obtain the target square wave number when the number of square waves corresponding to the first incremental detection segment and the second incremental detection segment within the preset detection period are equal.

[0101] When the number of square waves corresponding to the first incremental detection segment and the second incremental detection segment are equal, it indicates that neither the first detection head nor the second detection head detected the magnetic strip being stretched after a preset detection cycle. Therefore, the number of square waves when the number of square waves corresponding to the first incremental detection segment and the second incremental detection segment are equal is marked as the target number of square waves, used to represent the standard number of square waves under this preset detection cycle. By determining the target number of square waves, it can be used as a reference benchmark for subsequent identification of the initial target detection segment and the end target detection segment, thereby determining the target stretching interval that needs to be corrected.

[0102] Step S505: Extract the first incremental information from the historical records using a preset detection period to obtain the detection segment set.

[0103] Based on a preset detection cycle, the historical incremental information of the first detection head is continuously and periodically split, forming multiple adjacent detection segments by square wave extraction. All detection segments are then aggregated to form a detection segment set. By obtaining the detection segment set, the number of square waves in different segments can be compared in subsequent steps to select the starting and ending segments that meet the target number of square waves.

[0104] For example, the first incremental information in the historical record is S1{s1, s2, s3, s4, s5...sn}. The preset detection period is the time corresponding to the number of target square waves detected. If the number of target square waves is 10, then the preset detection period is the duration corresponding to 10 square waves. In S1, starting from s1, the first segment is performed to obtain the detection segment {s1, s2...s10}. Then, starting from s2, the second segment is performed to obtain the detection segment {s2, s3...s11}, and so on, until {sn-9, sn-8...sn} is reached.

[0105] Step S506: Find an initial target detection segment from the detection segment set that satisfies the condition that the number of square waves is less than the target number of square waves.

[0106] The initial target detection segment refers to the detection segment in the detection segment set where the number of square waves first appears to be less than the target number of square waves. This segment is used to mark the starting position where the magnetic strip may be stretched, and serves as the basis for locating the starting point of the stretching interval.

[0107] The first detection segment with a square wave count lower than the target square wave count is selected from the detection segments and designated as the initial target detection segment. A square wave count lower than the target square wave count indicates that the number of square waves detected in this detection cycle is less than the normal expected number. This is because the magnetic strip is stretched, resulting in a larger spacing between the magnetic blocks. Consequently, the number of magnetic blocks detected by the detection head is reduced within the same rotation time, i.e., the number of square waves is reduced.

[0108] Step S507: Find the end target detection segment from the detection segment set that satisfies the requirement that the number of square waves equals the number of target square waves.

[0109] The end of the target detection segment refers to the detection segment in which the number of square waves first recovers to equal the target number of square waves within the detection segment set. This segment is used to mark the end position of the elongated area of ​​the magnetic strip and is the basis for determining the end point of the elongated interval.

[0110] The detection segments with the number of square waves equal to the target number of square waves are selected from the detection segments and designated as the end target detection segments. The return of the number of square waves to the target number of square waves indicates that the number of square waves detected within the detection cycle has returned to normal levels. This means that the rotation angle position corresponding to this detection segment is no longer located in the elongated area of ​​the magnetic strip, and thus this segment can be regarded as the end segment of the elongation interval.

[0111] Step S508: Use the starting coordinates of the initial target detection segment as the starting coordinates of the target extension interval.

[0112] The target elongation range refers to the section on the turntable magnetic strip where the spacing between the incremental magnetic blocks in the magnetic block layer increases compared to the normal area due to local elongation, stretching, or deformation. Because of the change in the magnetic block spacing, the number of square waves that the detection head can detect at the same rotation angle within this range will be less than the normal expected number, causing a deviation in the incremental information.

[0113] The starting coordinates of the target elongation interval refer to the coordinate points used to identify the starting position of the area where the magnetic strip is elongated. These coordinates are determined by the starting coordinates corresponding to the initial target detection segment and are used to characterize the starting position of the elongation interval in the coordinate system.

[0114] Step S509: Use the end coordinates of the target detection segment as the end coordinates of the target extension interval.

[0115] The end coordinates of the target elongation interval refer to the coordinate points used to identify the end position of the elongated area of ​​the magnetic strip. These coordinates are determined by the end coordinates corresponding to the end target detection segment and are used to characterize the termination position of the elongation interval in the coordinate system.

[0116] The end coordinates recorded in the end target detection section are used as the end point of the elongated area of ​​the magnetic stripe. Since the end target detection section is the section where the number of square waves first recovers to equal the number of square waves in the target, its end coordinates can accurately reflect the position where the effect of the elongated area disappears and the magnetic stripe returns to normal spacing. Therefore, these coordinates can be set as the end coordinates of the target elongation interval.

[0117] This application provides a method for correcting extended intervals, referring to... Figure 6 The method includes: Step S601: Obtain the number of preset detection cycles from the initial target detection segment to the end target detection segment from the detection segment set.

[0118] The number of cycles refers to the number of preset detection cycles spanned in the detection segment set from the initial target detection segment to the end target detection segment. It is used to represent the total number of detection cycles covered by the extended target interval. Since the detection segment set is obtained by wavelet extraction, when the preset detection cycle is used to truncate the detection segment set, the initial target detection segment and the end target detection segment may each occupy only a portion of the detection cycle, which may result in the number of cycles being non-integer. Therefore, the number of cycles is not necessarily an integer.

[0119] Step S602: Multiply the number of cycles by the number of target square waves to obtain the total number of target square waves.

[0120] The total number of target square waves refers to the number of square waves that should be detected under normal circumstances within the extended target range. It is a theoretical standard value obtained by multiplying the number of cycles by the total number of target square waves, and is used as a reference benchmark for subsequent incremental correction information. Step S603: Obtain the ratio of the number of square waves in the target elongated interval to the total number of square waves in the target interval, and obtain the correction coefficient.

[0121] The correction factor is the ratio between the number of square waves actually detected in the extended target interval and the total number of target square waves that should be detected under normal circumstances. It is used to characterize the degree of deviation of the incremental information in the extended interval.

[0122] In one feasible embodiment, after counting the actual number of square waves detected within the target extended interval, the ratio of this number to the total number of target square waves is calculated, and the resulting value is used as a correction coefficient. For example: Correction factor = Actual number of detected square waves ÷ Total number of target square waves.

[0123] If the actual number of detected square waves is less than the total number of target square waves, the correction coefficient is less than 1, indicating that the incremental data in this interval is compressed and needs to be corrected in reverse according to this coefficient.

[0124] Step S604: Correct the incremental and absolute information corresponding to the target lengthening interval according to the correction coefficient.

[0125] This step is used to proportionally correct the incremental and absolute information of the target extended interval based on the correction coefficient.

[0126] When the correction coefficient is less than 1, it means that the number of square waves actually detected is less than the expected number. At this time, the incremental information of this interval needs to be amplified and compensated, and the coordinate mapping of the absolute value information is adjusted simultaneously to make the coordinate spacing of the extended interval consistent with the normal magnetic strip area, so as to eliminate the deviation caused by the extended area to the overall positioning accuracy.

[0127] In one feasible embodiment, each incremental scale mark within the target elongation interval is adjusted inversely proportionally by a correction factor to restore the standard scale interval. For example: For incremental information, perform the following: Corrected incremental value = Original incremental value ÷ Correction coefficient For absolute value information, perform the following: Corrected absolute value coordinates = Original absolute value coordinates ÷ Correction coefficient The above corrections restore the continuity and accuracy of incremental and absolute information within the extended target range, and maintain a consistent coordinate ratio with the unextended range.

[0128] This application provides a reference coordinate update method, referring to... Figure 7 The method includes: Step S701: Obtain the reference coordinate values ​​in the corrected fused absolute coordinate system.

[0129] The reference coordinate value refers to the reference coordinate value that can represent the zero reference position of the fused absolute value coordinate system. It is used to determine whether the corrected fused absolute value coordinate system is consistent with the preset zero reference.

[0130] After correcting the incremental and absolute value information of the target extended interval, the reference coordinate value for zero-point verification is extracted from the corrected fused absolute value coordinate system. By obtaining this reference coordinate value, it can be compared with the preset zero reference to provide a basis for subsequent zero reference repositioning.

[0131] Step S702: Determine whether the reference coordinate value deviates from the preset zero reference.

[0132] The purpose of this step is to determine whether the elongated section is located at the beginning of the magnetic strip.

[0133] The preset zero reference refers to the standard zero coordinate set during the calibration stage, which is used as the reference starting point for the fusion of the absolute value coordinate system to ensure that the output absolute angle information is consistent with the mechanical zero position of the turntable.

[0134] The reference coordinate values ​​obtained from the corrected fused absolute coordinate system are compared with the preset zero reference to determine if there is a deviation. If the reference coordinate values ​​are not equal to the preset zero reference, it indicates that the corrected fused absolute coordinate system has an overall offset, and zero reference repositioning is required; if they are consistent, it is considered that no offset correction is needed.

[0135] Step S703: If there is a deviation, the fused absolute coordinate system is repositioned to zero reference so that the corrected fused absolute coordinate system is realigned with the preset zero reference.

[0136] Zero reference repositioning refers to the process of restoring the zero position of the coordinate system to the preset zero reference position by offset compensation of the entire fused absolute coordinate system when the reference coordinate value in the fused absolute coordinate system is detected to deviate from the preset zero reference.

[0137] When the reference coordinate values ​​are inconsistent with the preset zero reference, a global repositioning process is performed on the fused absolute coordinate system. By translating the fused absolute coordinate system by the offset, the corrected absolute coordinates are realigned with the preset zero reference, thereby ensuring that the subsequent output absolute angle information accurately reflects the true mechanical zero position of the turntable and avoiding overall offset caused by accumulated errors.

[0138] In one feasible embodiment, the offset can be calculated based on the difference between the reference coordinate value and the preset zero reference, for example: offset = reference coordinate value − preset zero reference. Then, the offset is subtracted from all absolute coordinates in the fused absolute coordinate system, so that the entire coordinate system is synchronously translated and returns to the zero reference.

[0139] Based on the same inventive concept, embodiments of this application provide an encoder control system, including: The acquisition module is used to acquire the first incremental information, the first absolute value information, the second incremental information, and the second absolute value information; A memory for storing the program of the encoder control method described above; The processor can load and execute the program in the memory to implement the encoder control method described above.

[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0141] This application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as an encoder control method.

[0142] Computer storage media include, for example, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media that can store program code.

[0143] Based on the same inventive concept, embodiments of this application provide a smart terminal, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as an encoder control method.

[0144] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0145] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.

Claims

1. An encoder control method, characterized in that, include: In response to the rotation signal of the turntable, the sampling reference of the first and second detection heads is initialized; Real-time reception of the first incremental information and the first absolute information returned by the first detection head, and the second incremental information and the second absolute information returned by the second detection head; A first incremental coordinate system is generated based on the first incremental information; A second incremental coordinate system is generated based on the second incremental information; Align the first incremental coordinate system and the second incremental coordinate system to obtain the fused coordinate system; Add the coordinates corresponding to the first absolute value information and the coordinates corresponding to the second absolute value information to the fused coordinate system to obtain the fused absolute value coordinate system; The turntable rotation information is output in real time based on the fused absolute coordinate system. The turntable rotation information includes the turntable speed, the turntable rotation angle, and the current coordinates of the turntable.

2. The encoder control method according to claim 1, characterized in that, After initializing the sampling references of the first and second detection heads in response to the rotation signal of the turntable, the method further includes: Determine whether the rotation signal is the initial rotation signal; If so, the first incremental information set corresponding to when the turntable completes at least one revolution is obtained through the first detection head; A detection information coordinate system is generated based on the first incremental information set; Determine whether there are missing segments of detection information based on the coordinate system of the detection information; If it exists, obtain the span of the missing segment corresponding to the missing segment of the detection information according to the preset method; The position of the second detection head is adjusted based on the span of the missing segment, so that the span of the second detection head relative to the turntable is greater than the span of the missing segment.

3. The encoder control method according to claim 2, characterized in that, The step of obtaining the span of the missing segment corresponding to the missing segment of the detection information according to the preset method includes: While acquiring the first incremental information set corresponding to the turntable completing at least one rotation through the first detection head, the second detection information set corresponding to the turntable completing at least one rotation is simultaneously acquired through the second detection head. Obtain the start and end timestamps corresponding to the missing segments of the detection information in the detection information coordinate system; The target information set is extracted from the second detection information set based on the start and end timestamps; Obtain the number of target square waves in the target information set; The span of the missing segment is determined based on the number of target square waves.

4. The encoder control method according to claim 3, characterized in that, The method further includes: Based on the detection information coordinate system, obtain the starting and ending coordinates of the missing segment of the detection information; Update the absolute value end coordinates corresponding to the missing start coordinates; Update the absolute value starting coordinates corresponding to the missing end coordinates of the absolute value information.

5. The encoder control method according to claim 4, characterized in that, The method further includes: According to the preset detection cycle, the first incremental information and the second incremental information are extracted from the historical records respectively to obtain the first incremental detection segment and the second incremental detection segment; Determine whether the number of square waves corresponding to the first incremental detection segment is equal to the number of square waves corresponding to the second incremental detection segment; If so, repeat the above two steps; If not, obtain the target square wave number when the number of square waves corresponding to the first incremental detection segment and the second incremental detection segment within the preset detection period are equal; The first incremental information is extracted from the historical records using a preset detection cycle, and the detection segment set is obtained. Find the initial target detection segment from the detection segment set that satisfies the condition that the number of square waves is less than the target number of square waves; Find the end target detection segment from the detection segment set that satisfies the condition that the number of square waves equals the target number of square waves; The starting coordinates of the initial target detection segment are used as the starting coordinates of the target extension interval; The end coordinates of the target detection segment are used as the end coordinates of the target extension interval.

6. The encoder control method according to claim 5, characterized in that, The method further includes: The number of preset detection cycles corresponding to the initial target detection segment to the end target detection segment is obtained from the detection segment set; Multiply the number of cycles by the number of target square waves to obtain the total number of target square waves; The correction coefficient is obtained by comparing the number of square waves in the target elongated interval with the total number of square waves in the target interval. The incremental and absolute information corresponding to the target extended interval are corrected based on the correction coefficient.

7. The encoder control method according to claim 6, characterized in that, The method further includes: Obtain the reference coordinate values ​​in the corrected fused absolute coordinate system; Determine whether the reference coordinate value deviates from the preset zero reference; If there is a deviation, the fused absolute coordinate system will be repositioned to zero reference, so that the corrected fused absolute coordinate system is realigned with the preset zero reference.

8. An encoder control system, characterized in that, The system is used to execute the encoder control method as described in any one of claims 1 to 7, including: The acquisition module is used to acquire the first incremental information, the first absolute value information, the second incremental information, and the second absolute value information; A memory for storing the program of the encoder control method; The processor and the program in the memory can be loaded and executed by the processor to implement the encoder control method.

9. A smart terminal, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and execute the method as described in any one of claims 1 to 7.