A signal adjustment method, system and medium based on rotary encoder

By optimizing the data acquisition and processing flow of the rotary encoder, the sensitivity and delay problems in the existing technology are solved, real-time user feedback and multi-function control are realized, and user experience is improved.

CN118567284BActive Publication Date: 2024-11-12SHENZHEN JOYAR TECH (GRP) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411036169.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-12
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

The existing rotary encoder technology has high sensitivity and accuracy requirements in Android systems but is susceptible to noise, has operation delays and insufficient support for multifunctional applications, which cannot meet user needs.

Method used

By optimizing the data acquisition, transmission and processing flow, obtaining rotary encoder parameter information, matching trigger signals, collecting and preprocessing data, adjusting trigger time nodes, generating correction information or control data, and improving the function mapping and configuration options of rotary encoder. Reduce operation delays and realize real-time user feedback and multi-device function control.

Benefits of technology

It improves the sensitivity and accuracy of the rotary encoder, reduces the impact of noise, realizes real-time user operation feedback and multi-function control, and improves user experience and convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567284B_ABST
    Figure CN118567284B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a signal adjustment method, system and medium based on a rotary encoder, the method comprising: acquiring parameter information of a rotary encoder, matching a trigger signal based on the parameter information; collecting data based on the trigger signal to obtain collected data, preprocessing the collected data to obtain collected information; comparing the collected information with set information to obtain a state deviation rate; judging whether the state deviation rate is greater than or equal to a set deviation rate threshold; if greater than or equal to, adjusting a trigger time node of the trigger signal based on correction information; if less than, generating control data of the rotary encoder based on an interrupt trigger time node; optimizing the process of data collection, transmission and processing, reducing operation delays, achieving real-time user operation feedback, increasing the function mapping and configuration options of the rotary encoder, achieving control and adjustment of multiple device functions, and improving user experience and convenience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of signal conditioning technology, and in particular to a signal conditioning method, system and medium based on a rotary encoder. Background Art

[0002] At present, Android system has a wide range of applications in the field of mobile devices. In order to improve the user experience, many IoT devices based on Android system use rotary encoder technology to control and adjust various functions of the device. A rotary encoder is a sensor used to detect rotational motion and convert it into an electrical signal. In the Android system, rotary encoders are usually used to adjust functions such as volume, screen brightness, and image rotation.

[0003] However, the current rotary encoder technology has some defects in the Android system. First, the existing technology has high requirements on the sensitivity and accuracy of the rotary encoder, which is easily affected by noise and interference, resulting in misoperation or misjudgment; second, the existing technology has a certain delay when processing the rotation speed and direction changes of the rotary encoder, affecting the real-time nature of the user's operation; in addition, the existing technology has little support for the multi-functional application of the rotary encoder and cannot meet the user's needs for multiple functions. In response to the above problems, effective technical solutions are urgently needed. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a signal adjustment method, system and medium based on a rotary encoder, which optimizes the process of data acquisition, transmission and processing, reduces operation delays, realizes real-time user operation feedback, increases the function mapping and configuration options of the rotary encoder, realizes control and adjustment of multiple device functions, and improves user experience and convenience.

[0005] The embodiment of the present application also provides a signal adjustment method based on a rotary encoder, comprising:

[0006] Obtain parameter information of the rotary encoder, and match the trigger signal based on the parameter information;

[0007] Collect data based on the trigger signal to obtain collected data, and pre-process the collected data to obtain collected information;

[0008] Compare the collected information with the set information to obtain a state deviation rate, and determine whether the state deviation rate is greater than or equal to a set deviation rate threshold;

[0009] If it is greater than or equal to, then generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal;

[0010] If it is less than, the interrupt trigger time node is obtained, and the control data of the rotary encoder is generated based on the interrupt trigger time node.

[0011] Optionally, in the signal adjustment method based on the rotary encoder described in the embodiment of the present application, obtaining parameter information of the rotary encoder and matching the trigger signal based on the parameter information specifically include:

[0012] Obtain parameter information of the rotary encoder, the parameter information of the encoder including the rotation angle, angular displacement, rotation angular velocity, working current and working voltage of the encoder;

[0013] The control step length and rotation direction are calculated based on the parameter information of the encoder, and the rotation direction includes forward rotation and reverse rotation;

[0014] Generate the number of valid signal cycles obtained in each preset time unit based on the control step length to obtain a number of valid signals;

[0015] The effective signal is coefficient-adjusted based on the rotation direction to obtain a trigger signal with a control direction.

[0016] Optionally, in the signal adjustment method based on the rotary encoder described in the embodiment of the present application, the control step size and the rotation direction are calculated based on the parameter information of the encoder, and further includes:

[0017] Get the encoder's rotation speed and dwell time;

[0018] If the pause time is greater than the set time threshold, the number of pauses is increased by one, and the number of valid signals is generated;

[0019] If the pause time is less than the set time threshold, it is determined to be an invalid pause, and the rotation resistance value of the rotary encoder is analyzed, and the rotary encoder is repaired based on the rotation resistance value;

[0020] The switching time between adjacent valid signals is analyzed based on the rotation speed, and the control step size is dynamically adjusted based on the switching time.

[0021] Optionally, in the signal adjustment method based on the rotary encoder described in the embodiment of the present application, data is collected based on the trigger signal to obtain collected data, and the collected data is preprocessed to obtain collected information, which specifically includes:

[0022] Activate the acquisition signal based on the trigger signal to collect control data in real time;

[0023] Extract control data features, analyze control data features that are not within the set feature interval based on the set feature interval, and obtain noise data features;

[0024] The noise data feature is compensated to obtain a compensation result. If the compensation result does not meet the requirements, the noise data feature is eliminated;

[0025] If the requirements are met, the collected information is obtained.

[0026] Optionally, in the signal adjustment method based on the rotary encoder described in the embodiment of the present application, if it is greater than or equal to, then generating correction information, adjusting the trigger time node of the trigger signal based on the correction information, and generating a new trigger signal, specifically includes:

[0027] Get the current function mapping and configuration options of the rotary encoder, and obtain the configuration information of the rotary encoder and the device;

[0028] Analyze the trigger time node based on the trigger signal, and obtain the collected data matching the configuration information according to the trigger time node;

[0029] The error value of the collected data is analyzed to generate correction information, new function mapping and configuration options are added to the rotary encoder based on the correction information, and the trigger time node is adjusted according to the added result to obtain a new trigger signal.

[0030] Optionally, in the signal adjustment method based on the rotary encoder described in the embodiment of the present application, if is less than , obtaining the interrupt trigger time node, and generating the control data of the rotary encoder based on the interrupt trigger time node, specifically including:

[0031] Obtaining the deviation rate between the collected information and the set information, if the deviation rate is less than the set deviation rate threshold, establishing an interrupt trigger signal based on two adjacent valid signals;

[0032] The rotary encoder is interrupted based on the interrupt trigger signal, and the interrupt time is recorded;

[0033] The interrupt time is used as the interrupt trigger time node to obtain the control data corresponding to the valid signal of the encoder.

[0034] In a second aspect, an embodiment of the present application provides a signal adjustment system based on a rotary encoder, the system comprising: a memory and a processor, the memory comprising a program of a signal adjustment method based on a rotary encoder, and the program of the signal adjustment method based on a rotary encoder is executed by the processor to implement the following steps:

[0035] Obtain parameter information of the rotary encoder, and match the trigger signal based on the parameter information;

[0036] Collect data based on the trigger signal to obtain collected data, and pre-process the collected data to obtain collected information;

[0037] Compare the collected information with the set information to obtain a state deviation rate, and determine whether the state deviation rate is greater than or equal to a set deviation rate threshold;

[0038] If it is greater than or equal to, then generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal;

[0039] If it is less than, the interrupt trigger time node is obtained, and the control data of the rotary encoder is generated based on the interrupt trigger time node.

[0040] Optionally, in the signal adjustment system based on the rotary encoder described in the embodiment of the present application, obtaining parameter information of the rotary encoder and matching the trigger signal based on the parameter information specifically include:

[0041] Obtain parameter information of the rotary encoder, the parameter information of the encoder including the rotation angle, angular displacement, rotation angular velocity, working current and working voltage of the encoder;

[0042] The control step length and rotation direction are calculated based on the parameter information of the encoder, and the rotation direction includes forward rotation and reverse rotation;

[0043] Generate the number of valid signal cycles obtained in each preset time unit based on the control step length to obtain a number of valid signals;

[0044] The effective signal is coefficient-adjusted based on the rotation direction to obtain a trigger signal with a control direction.

[0045] Optionally, in the signal adjustment system based on the rotary encoder described in the embodiment of the present application, the control step size and the rotation direction are calculated based on the parameter information of the encoder, and further includes:

[0046] Get the encoder's rotation speed and dwell time;

[0047] If the pause time is greater than the set time threshold, the number of pauses is increased by one, and the number of valid signals is generated;

[0048] If the pause time is less than the set time threshold, it is determined to be an invalid pause, and the rotation resistance value of the rotary encoder is analyzed, and the rotary encoder is repaired based on the rotation resistance value;

[0049] The switching time between adjacent valid signals is analyzed based on the rotation speed, and the control step size is dynamically adjusted based on the switching time.

[0050] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a signal adjustment method program based on a rotary encoder. When the signal adjustment method program based on a rotary encoder is executed by a processor, the steps of the signal adjustment method based on a rotary encoder as described in any one of the above items are implemented.

[0051] As can be seen from the above, the signal adjustment method, system and medium based on the rotary encoder provided in the embodiment of the present application obtain the parameter information of the rotary encoder, match the trigger signal based on the parameter information; collect data based on the trigger signal to obtain collected data, pre-process the collected data to obtain collected information; compare the collected information with the set information to obtain the state deviation rate; determine whether the state deviation rate is greater than or equal to the set deviation rate threshold; if greater than or equal to, generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal; if less than, obtain the interrupt trigger time node, and generate the control data of the rotary encoder based on the interrupt trigger time node; by optimizing the process of data collection, transmission and processing, reduce operation delay, realize real-time user operation feedback, increase the function mapping and configuration options of the rotary encoder, realize the control and adjustment of multiple device functions, and improve user experience and convenience. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0053] Figure 1 A flow chart of a signal adjustment method based on a rotary encoder provided in an embodiment of the present application;

[0054] Figure 2 A trigger signal analysis flow chart of a signal adjustment method based on a rotary encoder provided in an embodiment of the present application;

[0055] Figure 3 A flow chart of a method for dynamically adjusting the control step size of a signal adjustment method based on a rotary encoder provided in an embodiment of the present application;

[0056] Figure 4 A wiring diagram of the rotary encoder provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0058] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0059] Please refer to Figure 1 , Figure 1 1 is a flow chart of a signal adjustment method based on a rotary encoder in some embodiments of the present application. The signal adjustment method based on a rotary encoder is used in a terminal device, and the signal adjustment method based on a rotary encoder includes the following steps:

[0060] S101, obtaining parameter information of a rotary encoder, and matching a trigger signal based on the parameter information;

[0061] S102, collecting data based on the trigger signal to obtain collected data, and preprocessing the collected data to obtain collected information;

[0062] S103, comparing the collected information with the set information to obtain a state deviation rate, and determining whether the state deviation rate is greater than or equal to a set deviation rate threshold;

[0063] S104, if it is greater than or equal to, generating correction information, adjusting the trigger time node of the trigger signal based on the correction information, and generating a new trigger signal;

[0064] S105: If it is less than, obtaining the interrupt triggering time node, and generating the control data of the rotary encoder based on the interrupt triggering time node.

[0065] It should be noted that if Figure 4As shown, the present invention adopts a wiring method shared by ADC and GPIO, wherein ADC is used for sampling of rotational motion, and GPIO is used for interrupt triggering; this wiring method makes the sampling of rotational motion more accurate and stable, improves the accuracy and reliability of the rotary encoder, optimizes the interrupt triggering algorithm of GPIO, so that it can respond to changes in rotational motion more quickly, and reduces the sampling delay by increasing the priority of interrupt triggering, thereby achieving more real-time user operation feedback. By introducing ADC to sample rotational motion, the sampling accuracy is improved compared with the traditional GPIO method, and the ADC can more accurately convert rotational motion into electrical signals, avoiding misoperation or misjudgment caused by noise and interference. By analyzing the difference in collected information, the trigger signal is continuously corrected, thereby improving the sensitivity and accuracy of the rotary encoder, and the rotation operation can still be accurately identified in a noisy and interference environment.

[0066] Please refer to Figure 2 , Figure 2 The trigger signal analysis flow chart of a signal adjustment method based on a rotary encoder in some embodiments of the present application is as follows. According to an embodiment of the present invention, obtaining parameter information of the rotary encoder and matching the trigger signal based on the parameter information specifically include:

[0067] S201, obtaining parameter information of a rotary encoder, where the parameter information of the encoder includes a rotation angle, an angular displacement, a rotation angular velocity, a working current, and a working voltage of the encoder;

[0068] S202, calculating a control step length and a rotation direction based on the parameter information of the encoder, where the rotation direction includes forward rotation and reverse rotation;

[0069] S203, generating the number of valid signal cycles obtained in each preset time unit based on the control step length to obtain a plurality of valid signals;

[0070] S204, adjusting the coefficient of the effective signal based on the rotation direction to obtain a trigger signal with a control direction.

[0071] It should be noted that by analyzing the control step size and rotation direction, the rotary encoder will produce different control effects during forward and reverse rotation. Both forward and reverse rotations match the corresponding number of effective signal cycles. The number of effective signal cycles for forward and reverse rotations can be the same or different, thereby improving control flexibility.

[0072] Please refer to Figure 3 , Figure 3 The following is a flow chart of a method for dynamically adjusting the control step size of a signal adjustment method based on a rotary encoder in some embodiments of the present application. According to an embodiment of the present invention, the control step size and the rotation direction are calculated based on the parameter information of the encoder, and further includes:

[0073] S301, obtaining the rotation speed and dwell time of the encoder;

[0074] S302, if the pause time is greater than the set time threshold, the number of pauses is increased by one, and the number of valid signals is generated;

[0075] S303, if the pause time is less than the set time threshold, it is determined to be an invalid pause, and the rotation resistance value of the rotary encoder is analyzed, and the rotary encoder is repaired based on the rotation resistance value;

[0076] S304, analyzing the switching time between adjacent valid signals based on the rotation speed, and dynamically adjusting the control step size based on the switching time.

[0077] It should be noted that during the operation of the rotary encoder, the rotational resistance of the rotary encoder is obtained by analyzing the rotational pause time and the rotational speed, so as to accurately judge the abnormal state of the rotary encoder, and when the effective signal is switched, it is analyzed whether the effective signal switching time meets the requirements, so as to dynamically adjust the control step size and improve the control efficiency.

[0078] According to an embodiment of the present invention, data is collected based on a trigger signal to obtain collected data, and the collected data is preprocessed to obtain collected information, which specifically includes:

[0079] Activate the acquisition signal based on the trigger signal to collect control data in real time;

[0080] Extract control data features, analyze control data features that are not within the set feature interval based on the set feature interval, and obtain noise data features;

[0081] The noise data feature is compensated to obtain a compensation result. If the compensation result does not meet the requirements, the noise data feature is eliminated;

[0082] If the requirements are met, the collected information is obtained.

[0083] It should be noted that by performing noise analysis on the collected control data, noise compensation is performed on smaller noise to ensure data integrity, and larger noise is rotated and eliminated to reduce the impact of noise.

[0084] According to an embodiment of the present invention, if it is greater than or equal to, then generating correction information, adjusting the trigger time node of the trigger signal based on the correction information, and generating a new trigger signal, specifically includes:

[0085] Get the current function mapping and configuration options of the rotary encoder, and obtain the configuration information of the rotary encoder and the device;

[0086] Analyze the trigger time node based on the trigger signal, and obtain the collected data matching the configuration information according to the trigger time node;

[0087] The error value of the collected data is analyzed to generate correction information, new function mapping and configuration options are added to the rotary encoder based on the correction information, and the trigger time node is adjusted according to the added result to obtain a new trigger signal.

[0088] It should be noted that by analyzing the error values ​​between the collected data corresponding to the trigger time nodes, the function mapping and configuration options corresponding to different trigger signals of the rotary encoder are continuously updated and added, so as to improve the control accuracy of the rotary encoder and realize the control and adjustment of multiple device functions.

[0089] According to an embodiment of the present invention, if it is less than, obtaining the interrupt trigger time node, and generating the control data of the rotary encoder based on the interrupt trigger time node, specifically including:

[0090] Obtaining the deviation rate between the collected information and the set information, if the deviation rate is less than the set deviation rate threshold, establishing an interrupt trigger signal based on two adjacent valid signals;

[0091] The rotary encoder is interrupted based on the interrupt trigger signal, and the interrupt time is recorded;

[0092] The interrupt time is used as the interrupt trigger time node to obtain the control data corresponding to the valid signal of the encoder.

[0093] It should be noted that by analyzing the switching time of the effective signal during the rotation of the rotary encoder, the interrupt trigger signal of the effective signal is obtained, and the interrupt trigger time node is established according to the interrupt time of the interrupt trigger signal, which serves as the basis for the subsequent analysis of the data acquisition delay during the interruption process of the rotary encoder.

[0094] According to an embodiment of the present invention, the method further includes: acquiring a trigger time node of a valid signal and a switching time node of a valid signal;

[0095] Acquire the acquisition time node of the current valid signal of the acquisition data based on the trigger time node;

[0096] Acquire the acquisition time node of the next valid signal of the acquisition data based on the switching time node;

[0097] Calculate the difference between the trigger time node and the switch time node to obtain a first difference;

[0098] Calculate the difference between the acquisition time node of the current valid signal and the acquisition time node of the next valid signal to obtain a second difference;

[0099] generating a delay time for collecting data based on the first difference and the second difference;

[0100] Compare the delay time with the set delay time threshold to obtain the delay rate;

[0101] Determine whether the delay rate is greater than or equal to a set delay rate threshold;

[0102] If it is greater than or equal to, adjust the acquisition time node of the next valid signal to compensate for the delay rate;

[0103] If it is less than, it is determined that there is no delay in data collection.

[0104] It should be noted that by analyzing the time difference between the trigger signal and the corresponding acquisition data time node, it is determined whether there is a delay in data acquisition, thereby continuously compensating for the acquisition delay time and reducing the data acquisition delay time.

[0105] In a second aspect, an embodiment of the present application provides a signal adjustment system based on a rotary encoder, the system comprising: a memory and a processor, the memory comprising a program of a signal adjustment method based on a rotary encoder, and when the program of the signal adjustment method based on the rotary encoder is executed by the processor, the following steps are implemented:

[0106] Obtain parameter information of the rotary encoder, and match the trigger signal based on the parameter information;

[0107] Collect data based on the trigger signal to obtain collected data, and pre-process the collected data to obtain collected information;

[0108] Compare the collected information with the set information to obtain the state deviation rate, and determine whether the state deviation rate is greater than or equal to the set deviation rate threshold;

[0109] If it is greater than or equal to, then generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal;

[0110] If it is less than, the interrupt trigger time node is obtained, and the control data of the rotary encoder is generated based on the interrupt trigger time node.

[0111] It should be noted that if Figure 4As shown, the present invention adopts a wiring method shared by ADC and GPIO, wherein ADC is used for sampling of rotational motion, and GPIO is used for interrupt triggering; this wiring method makes the sampling of rotational motion more accurate and stable, improves the accuracy and reliability of the rotary encoder, optimizes the interrupt triggering algorithm of GPIO, so that it can respond to changes in rotational motion more quickly, and reduces the sampling delay by increasing the priority of interrupt triggering, thereby achieving more real-time user operation feedback. By introducing ADC to sample rotational motion, the sampling accuracy is improved compared with the traditional GPIO method, and the ADC can more accurately convert rotational motion into electrical signals, avoiding misoperation or misjudgment caused by noise and interference. By analyzing the difference in collected information, the trigger signal is continuously corrected, thereby improving the sensitivity and accuracy of the rotary encoder, and the rotation operation can still be accurately identified in a noisy and interference environment.

[0112] According to an embodiment of the present invention, obtaining parameter information of a rotary encoder and matching a trigger signal based on the parameter information specifically include:

[0113] Obtain parameter information of the rotary encoder, the parameter information of the encoder including the rotation angle, angular displacement, rotation angular velocity, working current and working voltage of the encoder;

[0114] The control step length and rotation direction are calculated based on the parameter information of the encoder, and the rotation direction includes forward rotation and reverse rotation;

[0115] Generate the number of valid signal cycles obtained in each preset time unit based on the control step length to obtain a number of valid signals;

[0116] The effective signal is coefficient-adjusted based on the rotation direction to obtain a trigger signal with a control direction.

[0117] It should be noted that by analyzing the control step size and rotation direction, the rotary encoder will produce different control effects during forward and reverse rotation. Both forward and reverse rotations match the corresponding number of effective signal cycles. The number of effective signal cycles for forward and reverse rotations can be the same or different, thereby improving control flexibility.

[0118] According to an embodiment of the present invention, the control step size and the rotation direction are calculated based on the parameter information of the encoder, and further includes:

[0119] Get the encoder's rotation speed and dwell time;

[0120] If the pause time is greater than the set time threshold, the number of pauses is increased by one, and the number of valid signals is generated;

[0121] If the pause time is less than the set time threshold, it is determined to be an invalid pause, and the rotation resistance value of the rotary encoder is analyzed, and the rotary encoder is repaired based on the rotation resistance value;

[0122] The switching time between adjacent valid signals is analyzed based on the rotation speed, and the control step size is dynamically adjusted based on the switching time.

[0123] It should be noted that during the operation of the rotary encoder, the rotational resistance of the rotary encoder is obtained by analyzing the rotational pause time and the rotational speed, so as to accurately judge the abnormal state of the rotary encoder, and when the effective signal is switched, it is analyzed whether the effective signal switching time meets the requirements, so as to dynamically adjust the control step size and improve the control efficiency.

[0124] According to an embodiment of the present invention, data is collected based on a trigger signal to obtain collected data, and the collected data is preprocessed to obtain collected information, which specifically includes:

[0125] Activate the acquisition signal based on the trigger signal to collect control data in real time;

[0126] Extract control data features, analyze control data features that are not within the set feature interval based on the set feature interval, and obtain noise data features;

[0127] The noise data feature is compensated to obtain a compensation result. If the compensation result does not meet the requirements, the noise data feature is eliminated;

[0128] If the requirements are met, the collected information is obtained.

[0129] It should be noted that by performing noise analysis on the collected control data, noise compensation is performed on smaller noise to ensure data integrity, and larger noise is rotated and eliminated to reduce the impact of noise.

[0130] According to an embodiment of the present invention, if it is greater than or equal to, then generating correction information, adjusting the trigger time node of the trigger signal based on the correction information, and generating a new trigger signal, specifically includes:

[0131] Get the current function mapping and configuration options of the rotary encoder, and obtain the configuration information of the rotary encoder and the device;

[0132] Analyze the trigger time node based on the trigger signal, and obtain the collected data matching the configuration information according to the trigger time node;

[0133] The error value of the collected data is analyzed to generate correction information, new function mapping and configuration options are added to the rotary encoder based on the correction information, and the trigger time node is adjusted according to the added result to obtain a new trigger signal.

[0134] It should be noted that by analyzing the error values ​​between the collected data corresponding to the trigger time nodes, the function mapping and configuration options corresponding to different trigger signals of the rotary encoder are continuously updated and added, so as to improve the control accuracy of the rotary encoder and realize the control and adjustment of multiple device functions.

[0135] According to an embodiment of the present invention, if it is less than, obtaining the interrupt trigger time node, and generating the control data of the rotary encoder based on the interrupt trigger time node, specifically including:

[0136] Obtaining the deviation rate between the collected information and the set information, if the deviation rate is less than the set deviation rate threshold, establishing an interrupt trigger signal based on two adjacent valid signals;

[0137] The rotary encoder is interrupted based on the interrupt trigger signal, and the interrupt time is recorded;

[0138] The interrupt time is used as the interrupt trigger time node to obtain the control data corresponding to the valid signal of the encoder.

[0139] It should be noted that by analyzing the switching time of the effective signal during the rotation of the rotary encoder, the interrupt trigger signal of the effective signal is obtained, and the interrupt trigger time node is established according to the interrupt time of the interrupt trigger signal, which serves as the basis for the subsequent analysis of the data acquisition delay during the interruption process of the rotary encoder.

[0140] According to an embodiment of the present invention, the method further includes: acquiring a trigger time node of a valid signal and a switching time node of a valid signal;

[0141] Acquire the acquisition time node of the current valid signal of the acquisition data based on the trigger time node;

[0142] Acquire the acquisition time node of the next valid signal of the acquisition data based on the switching time node;

[0143] Calculate the difference between the trigger time node and the switch time node to obtain a first difference;

[0144] Calculate the difference between the acquisition time node of the current valid signal and the acquisition time node of the next valid signal to obtain a second difference;

[0145] generating a delay time for collecting data based on the first difference and the second difference;

[0146] Compare the delay time with the set delay time threshold to obtain the delay rate;

[0147] Determine whether the delay rate is greater than or equal to a set delay rate threshold;

[0148] If it is greater than or equal to, adjust the acquisition time node of the next valid signal to compensate for the delay rate;

[0149] If it is less than, it is determined that there is no delay in data collection.

[0150] It should be noted that by analyzing the time difference between the trigger signal and the corresponding acquisition data time node, it is determined whether there is a delay in data acquisition, thereby continuously compensating for the acquisition delay time and reducing the data acquisition delay time.

[0151] A third aspect of the present invention provides a computer-readable storage medium, which includes a signal adjustment method program based on a rotary encoder. When the signal adjustment method program based on a rotary encoder is executed by a processor, the steps of the signal adjustment method based on a rotary encoder as described above are implemented.

[0152] The present invention discloses a signal adjustment method, system and medium based on a rotary encoder, which obtain parameter information of the rotary encoder and match a trigger signal based on the parameter information; collect data based on the trigger signal to obtain collected data, and pre-process the collected data to obtain collected information; compare the collected information with set information to obtain a state deviation rate; determine whether the state deviation rate is greater than or equal to a set deviation rate threshold; if greater than or equal to, generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal; if less than, obtain an interrupt trigger time node, and generate control data of the rotary encoder based on the interrupt trigger time node; optimize the process of data collection, transmission and processing, reduce operation delay, realize real-time user operation feedback, increase the function mapping and configuration options of the rotary encoder, realize control and adjustment of multiple device functions, and improve user experience and convenience.

[0153] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0154] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0155] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0156] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, the aforementioned program can be stored in a readable storage medium, and when the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0157] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A signal adjustment method based on a rotary encoder, characterized in that: include: Obtain parameter information of the rotary encoder, and match the trigger signal based on the parameter information; Collect data based on the trigger signal to obtain collected data, and pre-process the collected data to obtain collected information; Compare the collected information with the set information to obtain a state deviation rate, and determine whether the state deviation rate is greater than or equal to a set deviation rate threshold; If it is greater than or equal to, then generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal; If it is less than, the interrupt trigger time node is obtained, and the control data of the rotary encoder is generated based on the interrupt trigger time node; Obtain the parameter information of the rotary encoder and match the trigger signal based on the parameter information, including: Obtain parameter information of the rotary encoder, the parameter information of the encoder including the rotation angle, angular displacement, rotation angular velocity, working current and working voltage of the encoder; The control step length and rotation direction are calculated based on the parameter information of the encoder, and the rotation direction includes forward rotation and reverse rotation; Generate the number of valid signal cycles obtained in each preset time unit based on the control step length to obtain a number of valid signals; The effective signal is coefficient-adjusted based on the rotation direction to obtain a trigger signal with a control direction; The data is collected based on the trigger signal to obtain the collected data, and the collected data is preprocessed to obtain the collected information, which specifically includes: Activate the acquisition signal based on the trigger signal to collect control data in real time; Extract control data features, analyze control data features that are not within the set feature interval based on the set feature interval, and obtain noise data features; The noise data feature is compensated to obtain a compensation result. If the compensation result does not meet the requirements, the noise data feature is eliminated; If the requirements are met, the collected information is obtained; If it is greater than or equal to, then generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal, specifically including: Get the current function mapping and configuration options of the rotary encoder, and obtain the configuration information of the rotary encoder and the device; Analyze the trigger time node based on the trigger signal, and obtain the collected data matching the configuration information according to the trigger time node; Analyze the error value of the collected data to generate correction information, add new function mapping and configuration options to the rotary encoder based on the correction information, and adjust the trigger time node according to the added result to obtain a new trigger signal; If it is less than, the interrupt trigger time node is obtained, and the control data of the rotary encoder is generated based on the interrupt trigger time node, specifically including: Obtaining the deviation rate between the collected information and the set information, if the deviation rate is less than the set deviation rate threshold, establishing an interrupt trigger signal based on two adjacent valid signals; The rotary encoder is interrupted based on the interrupt trigger signal, and the interrupt time is recorded; The interrupt time is used as the interrupt trigger time node to obtain the control data corresponding to the valid signal of the encoder.

2. The signal adjustment method based on the rotary encoder according to claim 1, characterized in that: The control step size and rotation direction are calculated based on the encoder parameter information, including: Get the rotation speed and dwell time of the encoder; If the pause time is greater than the set time threshold, the number of pauses is increased by one, and the number of valid signals is generated; If the pause time is less than the set time threshold, it is determined to be an invalid pause, and the rotation resistance value of the rotary encoder is analyzed, and the rotary encoder is repaired based on the rotation resistance value; The switching time between adjacent valid signals is analyzed based on the rotation speed, and the control step size is dynamically adjusted based on the switching time.

3. A signal conditioning system based on a rotary encoder, characterized in that: The system includes: a memory and a processor, wherein the memory includes a program of a signal adjustment method based on a rotary encoder, and when the program of the signal adjustment method based on a rotary encoder is executed by the processor, the following steps are implemented: Obtain parameter information of the rotary encoder, and match the trigger signal based on the parameter information; Collect data based on the trigger signal to obtain collected data, and pre-process the collected data to obtain collected information; Compare the collected information with the set information to obtain a state deviation rate, and determine whether the state deviation rate is greater than or equal to a set deviation rate threshold; If it is greater than or equal to, then generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal; If it is less than, the interrupt trigger time node is obtained, and the control data of the rotary encoder is generated based on the interrupt trigger time node; Obtain the parameter information of the rotary encoder and match the trigger signal based on the parameter information, including: Obtain parameter information of the rotary encoder, the parameter information of the encoder including the rotation angle, angular displacement, rotation angular velocity, working current and working voltage of the encoder; The control step length and rotation direction are calculated based on the parameter information of the encoder, and the rotation direction includes forward rotation and reverse rotation; Generate the number of valid signal cycles obtained in each preset time unit based on the control step length to obtain a number of valid signals; The effective signal is coefficient-adjusted based on the rotation direction to obtain a trigger signal with a control direction; The data is collected based on the trigger signal to obtain the collected data, and the collected data is preprocessed to obtain the collected information, which specifically includes: Activate the acquisition signal based on the trigger signal to collect control data in real time; Extract control data features, analyze control data features that are not within the set feature interval based on the set feature interval, and obtain noise data features; The noise data feature is compensated to obtain a compensation result. If the compensation result does not meet the requirements, the noise data feature is eliminated; If the requirements are met, the collected information is obtained; If it is greater than or equal to, then generate correction information, adjust the trigger time node of the trigger signal based on the correction information, and generate a new trigger signal, specifically including: Get the current function mapping and configuration options of the rotary encoder, and obtain the configuration information of the rotary encoder and the device; Analyze the trigger time node based on the trigger signal, and obtain the collected data matching the configuration information according to the trigger time node; Analyze the error value of the collected data to generate correction information, add new function mapping and configuration options to the rotary encoder based on the correction information, and adjust the trigger time node according to the added result to obtain a new trigger signal; If it is less than, the interrupt trigger time node is obtained, and the control data of the rotary encoder is generated based on the interrupt trigger time node, specifically including: Obtaining the deviation rate between the collected information and the set information, if the deviation rate is less than the set deviation rate threshold, establishing an interrupt trigger signal based on two adjacent valid signals; The rotary encoder is interrupted based on the interrupt trigger signal, and the interrupt time is recorded; The interrupt time is used as the interrupt trigger time node to obtain the control data corresponding to the valid signal of the encoder.

4. The signal conditioning system based on a rotary encoder according to claim 3, characterized in that: The control step size and rotation direction are calculated based on the encoder parameter information, including: Get the rotation speed and dwell time of the encoder; If the pause time is greater than the set time threshold, the number of pauses is increased by one, and the number of valid signals is generated; If the pause time is less than the set time threshold, it is determined to be an invalid pause, and the rotation resistance value of the rotary encoder is analyzed, and the rotary encoder is repaired based on the rotation resistance value; The switching time between adjacent valid signals is analyzed based on the rotation speed, and the control step size is dynamically adjusted based on the switching time.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a signal adjustment method program based on a rotary encoder. When the signal adjustment method program based on a rotary encoder is executed by a processor, the steps of the signal adjustment method based on a rotary encoder as described in any one of claims 1 to 2 are implemented.