Mouse roller damping adjusting method, device and equipment
Through the nonlinear variable damping integral controller and Kalman filtering processing technology, the mouse roller damping coefficient is dynamically adjusted, which solves the problem of incoherence in scrolling in traditional control systems, and achieves better user control experience and system robustness.
Patent Information
- Application Number
- CN202510153366.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional mouse roller damping control system has problems such as difficult to control the response speed, complex parameter setting and incoherent scrolling. It is impossible to dynamically adjust the damping parameters according to the user's usage habits and operating characteristics.
A nonlinear variable damping integral controller is used to sample the roller motion characteristic data at high frequency and perform segmented function mapping. Combined with Kalman filtering and proportional integral control, the integral coefficient is dynamically adjusted to achieve a smooth transition of the damping coefficient.
The smooth transition of damping coefficient is achieved, the problem of incoherence of rolling feel inconsistent in traditional controllers is solved, the robustness and anti-interference ability of the control system are improved, and the user's control experience is enhanced.
Smart Images

Figure CN120066294A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of damping adjustment, and particularly to a method, device and equipment for adjusting the damping of a mouse scroll wheel. Background Art
[0002] With the rapid development of computer technology, the mouse, as an important input device for human-computer interaction, the manipulation experience of its scroll wheel has an important impact on the user's work efficiency and comfort. Traditional mouse scroll wheels mainly adopt a fixed damping scheme, generating a constant damping torque through a mechanical structure. This scheme is difficult to meet the operation requirements of different users in different usage scenarios.
[0003] Currently, the mouse scroll wheel damping control systems on the market generally have problems such as difficulty in controlling the response speed, complex parameter tuning, and discontinuous scrolling feeling. Due to its simple control logic, the traditional fixed damping controller cannot dynamically adjust the damping parameters according to the user's usage habits and operation characteristics, resulting in poor manipulation experience in different scenarios such as fast scrolling and precise positioning. In addition, existing damping control schemes often require complex acceleration parameters as control inputs, which not only increases the computational burden of the system but also makes the parameter tuning process of the controller cumbersome. At the same time, the inherent friction and external interference in the mechanical structure will also affect the motion characteristics of the scroll wheel, resulting in unstable control effects and difficult to obtain an ideal damping effect in practical applications. Summary of the Invention
[0004] This application provides a method, device and equipment for adjusting the damping of a mouse scroll wheel, thereby realizing a smooth transition of the damping coefficient and solving the problem of discontinuous scrolling feeling of the traditional controller.
[0005] In the first aspect of this application, a method for adjusting the damping of a mouse scroll wheel is provided. The method for adjusting the damping of a mouse scroll wheel includes: Performing high-frequency sampling on the rotation of the scroll wheel to obtain a data stream of the scroll wheel motion characteristics; Performing piecewise function mapping on the damping characteristics according to the data stream of the scroll wheel motion characteristics to obtain a piecewise continuous damping coefficient mapping relationship; Inputting the data stream of the scroll wheel motion characteristics into a state prediction equation and a measurement update equation for Kalman filtering processing to obtain a mechanical damping coefficient compensation amount and an interference torque compensation amount; Performing proportional-integral calculation on the control parameters according to the mechanical damping coefficient compensation amount and the interference torque compensation amount to obtain a target damping control amount; Performing PWM signal transformation according to the target damping control amount to obtain the drive current parameter of the electromagnetic damper, and calculating the deviation between the drive current parameter and the actual output torque to obtain a control deviation amount; Perform gradient descent iterative optimization on the control deviation amount to obtain the optimal proportional coefficient and the optimal integral coefficient, and update the optimal proportional coefficient and the optimal integral coefficient to the controller.
[0006] The second aspect of the present application provides a mouse wheel damping adjustment device, and the mouse wheel damping adjustment device includes: A sampling module, configured to perform high-frequency sampling on the rotation of the roller to obtain a roller motion feature data stream; A mapping module, configured to perform piecewise function mapping on the damping characteristic according to the roller motion feature data stream to obtain a piecewise continuous damping coefficient mapping relationship; A processing module, configured to input the roller motion feature data stream into a state prediction equation and a measurement update equation for Kalman filtering processing to obtain a mechanical damping coefficient compensation amount and a disturbance torque compensation amount; A calculation module, configured to perform proportional-integral calculation on the control parameters according to the mechanical damping coefficient compensation amount and the disturbance torque compensation amount to obtain a target damping control amount; A transformation module, configured to perform PWM signal transformation according to the target damping control amount to obtain a drive current parameter of the electromagnetic damper, and calculate a deviation between the drive current parameter and the actual output torque to obtain a control deviation amount; An optimization module, configured to perform gradient descent iterative optimization on the control deviation amount to obtain the optimal proportional coefficient and the optimal integral coefficient, and update the optimal proportional coefficient and the optimal integral coefficient to the controller.
[0007] The third aspect of the present application provides an electronic device, including: a memory and at least one processor, where instructions are stored in the memory; the at least one processor calls the instructions in the memory so that the electronic device executes the above-mentioned mouse wheel damping adjustment method.
[0008] The fourth aspect of the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions run on a computer, the computer is enabled to execute the above-mentioned mouse wheel damping adjustment method.
[0009] Compared with the prior art, the present application has the following beneficial effects: By adopting a non-linear variable damping integral controller, the damping characteristics are divided into a light damping region and a heavy damping region, realizing a smooth transition of the damping coefficient and solving the problem of discontinuous rolling feeling of traditional controllers; An estimator based on a Kalman filter is introduced to compensate for mechanical damping coefficients and external disturbances in real time, improving the robustness and anti-interference ability of the control system; A proportional-integral control structure is designed, and by dynamically adjusting the integral coefficient, the system can automatically switch control strategies according to user operation characteristics, and good control experiences can be obtained in both fast-rolling and precise-positioning scenarios; An electromagnetic damper driven by a PWM signal is used to replace the traditional mechanical damping structure, improving the system response speed and ensuring the accuracy of torque output through closed-loop control; A parameter optimization method based on the gradient descent algorithm simplifies the parameter tuning process of the controller by constructing a comprehensive performance index including response speed, control accuracy, and steady-state error. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0011] The structures, proportions, sizes, etc. shown in the drawings of this specification are only used to cooperate with the content disclosed in the specification for those skilled in this technology to understand and read, and are not used to limit the limiting conditions under which the present invention can be implemented. Therefore, they do not have substantial technical significance. Any modification of the structure, change in the proportional relationship, or adjustment of the size should still fall within the scope that can be covered by the technical content disclosed in the present invention without affecting the effects that the present invention can produce and the purposes that can be achieved.
[0012] Figure 1 It is a schematic flowchart of the mouse wheel damping adjustment method provided by the embodiment of the present invention; Figure 2 It is a schematic block diagram of the structure of the mouse wheel damping adjustment device provided by the embodiment of the present invention; Figure 3 It is a schematic block diagram of the structure of the electronic device provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0013] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0014] The flowchart shown in the accompanying drawings is only an example for illustration, and does not necessarily include all the contents and operations / steps, nor does it necessarily execute in the described order. For example, some operations / steps can also be decomposed, combined or partially merged, so the actual execution order may be changed according to the actual situation.
[0015] It should also be understood that the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. As used in the specification of this application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0016] It should be further understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination and all possible combinations of one or more of the related listed items, and includes these combinations. Please refer to Figure 1 , an embodiment of the mouse wheel damping adjustment method in the embodiments of this application includes: Step 100: Perform high-frequency sampling on the rotation of the scroll wheel to obtain a data stream of the scroll wheel motion characteristics; It can be understood that the execution subject of this application can be a mouse wheel damping adjustment device, or a terminal or a server. Specifically, it is not limited here. The embodiments of this application are described by taking the server as the execution subject as an example.
[0017] Specifically, the rotation of the mouse wheel is sampled in real time by an angle sensor to obtain an instantaneous angle sampling signal. The angle sensor converts the physical rotation displacement of the wheel into an electronic signal, reflecting the angular change of the wheel. The instantaneous angle sampling signal is amplified by the amplification unit in the signal conditioning circuit to enhance the signal strength and ensure the effectiveness and accuracy of subsequent signal processing, resulting in an amplified angle signal. The amplified angle signal is filtered by the low-pass filter unit in the signal conditioning circuit to eliminate high-frequency interference, generating a filtered angle signal. Based on the filtered angle signal, data transmission is performed to form a continuous angle-time data sequence. The angle-time data sequence is the basic data format for describing the rotation state of the wheel, reflecting the dynamic change process of the wheel by recording the angular position of the wheel at each moment. Numerical differentiation is performed on the angle-time data sequence to obtain an instantaneous angular velocity signal. By using the discrete difference algorithm in the central processing unit, the angular difference between adjacent time points is divided by the time interval to calculate the instantaneous angular velocity. The frequency band signal of the instantaneous angular velocity signal is extracted. By introducing a band-pass filter in signal processing, only the angular velocity components within a predetermined frequency band are extracted, effectively removing the noise interference in the non-target frequency band, resulting in a filtered angular velocity signal. The filtered angular velocity signal is cached in real time. By establishing a high-speed cache area in the memory, the angular velocity signal is stored in chronological order to generate an angular velocity-time data sequence. The angular velocity-time data sequence and the angle-time data sequence together form a complete feature description of the wheel movement, reflecting the displacement characteristics and velocity characteristics of the wheel respectively. The angle-time data sequence and the angular velocity-time data sequence are transmitted to the historical data cache area of the central processing unit through the data bus for storage. The transmission function of the data bus ensures that the sampled data can be quickly and stably transferred from the signal acquisition module to the central processing unit, while the role of the historical data cache area is to centrally store and manage the sampled data. By storing these data in the cache area in the form of a time series, the central processing unit can retrieve these data at any time for subsequent analysis and processing, forming a data stream of wheel movement characteristics.
[0018] Step 200: Perform a piecewise function mapping on the damping characteristics according to the data stream of the wheel movement characteristics to obtain a piecewise continuous damping coefficient mapping relationship; Specifically, the rolling motion characteristic data stream is input into the piecewise function processing unit of the non-linear variable damping integral controller to divide the characteristic intervals of the data stream, effectively distinguishing the angular velocity data in the light damping region and the heavy damping region. The light damping region corresponds to the state when the roller rotates slowly, and its angular velocity is small; while the heavy damping region corresponds to the state when the roller rotates rapidly or changes violently, and its angular velocity is large. The damping characteristic modeling is carried out on the angular velocity data in the light damping region and the angular velocity data in the heavy damping region respectively. For the light damping region, since its angular velocity data usually shows a relatively linear distribution characteristic, the linear coefficient calibration is carried out on it through the damping characteristic modeling unit to obtain the linear mapping function of the light damping region, describing the damping characteristic of the light damping region. At the same time, for the angular velocity data in the heavy damping region, its change shows a non-linear characteristic, especially showing a significant exponential growth trend when rotating rapidly or fluctuating greatly. The exponential curve fitting is carried out on the data in the heavy damping region through the damping characteristic modeling unit to obtain the exponential mapping function of the heavy damping region. In order to ensure the overall continuity of the piecewise function, the linear mapping function of the light damping region and the exponential mapping function of the heavy damping region are matched in function values, and the continuity constraint equation set is constructed through the matching results. This constraint equation requires that the function values of the two functions are equal at the interval junction, and requires that their first-order derivatives (i.e., slopes) are consistent at the junction point, so as to ensure the smooth transition of the function. Through the mathematical processing of these constraint equation sets, the key parameter solution conditions are obtained. The least square method is used to solve the parameters of the continuity constraint equation set to obtain the optimal damping linear gain coefficient, the basic damping coefficient, the amplitude coefficient and the exponential growth coefficient. The least square method ensures the robustness and optimization effect of parameter solution by minimizing the sum of the squares of the errors between the model predicted value and the actual value. Substitute the optimal damping linear gain coefficient, the basic damping coefficient, the amplitude coefficient and the exponential growth coefficient into the piecewise function for coefficient update, generate the complete piecewise damping characteristic function, and refine the damping characteristic in each region through the interval mapping of the complete piecewise damping characteristic function to obtain the final piecewise continuous damping coefficient mapping relationship.
[0019] Step 300: Input the rolling motion characteristic data stream into the state prediction equation and the measurement update equation for Kalman filtering processing to obtain the mechanical damping coefficient compensation amount and the disturbance torque compensation amount; It should be noted that the data stream of the roller motion characteristics is input into the state vector modeling unit of the Kalman filtering system. The initial state is set through the state vector modeling unit. Using the mechanical damping coefficient and the disturbance torque as state variables, a state equation describing the dynamic behavior of the system is constructed. This state equation adopts a discrete-time form, expressing how the system state evolves over time, while taking into account the influence of the input control signal and system noise. The state transition matrix of the state equation is constructed to clarify the law of state change of the roller system at each discrete time step. The construction of the state transition matrix is related to the physical characteristics of the system, such as the inertia and damping characteristics of the roller and the influence of external disturbance torque. After the construction of the state transition matrix is completed, a state prediction equation is generated. This equation predicts the state at the next moment through the combination of the current state and the input control signal. The output of the state prediction equation needs to be combined with the covariance matrix at the same time to calculate the prediction error covariance matrix, quantifying the uncertainty in state prediction. The prediction error covariance matrix is input into the Kalman gain calculation unit for optimal gain calculation. The calculation of the Kalman gain depends on the ratio of the prediction error covariance matrix and the observation noise covariance matrix, which can balance the weight distribution between the system state prediction and the actual observation value. The magnitude of the Kalman gain directly affects the sensitivity of the filter to the observed data. When the prediction accuracy is low or the noise of the observed data is small, the Kalman gain is large, making the influence of the observed data on the state estimation more significant. The residual calculation is performed on the angular velocity observation value and the state prediction value in the data stream of the roller motion characteristics to obtain the observation residual. The observation residual is the difference between the observation value and the prediction value, reflecting the error of the system state or the uncaught dynamic change. The magnitude of the residual determines the amplitude of the state correction, and its calculation result is an important input in the measurement update equation. By substituting the observation residual and the Kalman gain into the measurement update equation, the dynamic correction of the state is realized, and the optimal state estimation value at the current moment is obtained. The role of the measurement update equation is to combine the prediction value and the actual observation value, use the Kalman gain to weight and update the state estimation, and output a result closer to the true system state. Component extraction is performed on the optimal state estimation value to obtain the mechanical damping coefficient compensation amount and the disturbance torque compensation amount respectively. The mechanical damping coefficient component in the optimal state estimation value is directly used to adjust the damping characteristics of the roller system to achieve the optimization of damping control; while the disturbance torque component reflects the influence of external disturbances on the system, and the extraction of the compensation amount provides a basis for the active compensation of the disturbance torque.
[0020] Step 400: Perform proportional-integral calculation on the control parameters according to the mechanical damping coefficient compensation amount and the disturbance torque compensation amount to obtain the target damping control amount; Specifically, the mechanical damping coefficient compensation amount is input into the proportional control unit, and a linear proportional control term is obtained through linear gain transformation. During the linear gain transformation process, the compensation amount is multiplied by a set proportional coefficient. The selection of the proportional coefficient directly affects the amplitude of the linear proportional control term, thereby determining the weight of this term in the final target damping control amount. The proportional control term can provide an immediate response to the dynamic changes of the roller system. At the same time, to enhance the control effect, the mechanical damping coefficient compensation amount and the angular velocity signal are input into the integral control unit for integral accumulation to obtain an integral control term. The integral control term can reflect the trend of the long-term deviation of the roller system by calculating the historical cumulative amount of the mechanical damping coefficient and the angular velocity signal, and effectively correct it. To ensure the real-time and accuracy of the integral calculation, the integral control unit needs to continuously record and update the historical data of the roller movement. While calculating the integral control term, a fast rolling feature analysis is performed on the angular velocity signal to extract the operating state of the roller. By analyzing the change pattern of the angular velocity signal, it is identified whether the user is performing a continuous rolling operation. A continuous operation flag signal is generated based on this analysis result. The flag signal is used as a reference input to the control system to determine whether the current operation of the roller is in a high-frequency state or a low-frequency state. The integral coefficient is adaptively adjusted according to the continuous operation flag signal to dynamically adjust the weight of the integral control term. When the roller is in a high-frequency continuous rolling state, the system automatically increases the integral coefficient to enhance the sensitivity of the integral control to the system response; while when the roller is operating at a low frequency or stopped, the system decreases the integral coefficient to prevent excessive accumulation of the integral effect. At the same time, a compensation control calculation is performed on the disturbance torque compensation amount to generate a compensation control term. The role of the compensation control term is to perform real-time correction on external disturbances, thereby improving the system stability and response ability. The calculation of the disturbance torque compensation amount is based on the filtered disturbance torque data, and the compensation intensity is dynamically adjusted in combination with the real-time roller movement state to ensure the accuracy of the compensation control. The linear proportional control term, the integral control term, and the compensation control term are superimposed to generate an initial damping control amount. During the superimposition process, the contributions of each control term are dynamically adjusted according to the actual operating environment to achieve the best damping effect under different rolling states. To prevent the initial damping control amount from exceeding the physical limit range of the system, the non-linear variable damping integral controller performs saturation limiting processing on it, limiting the initial damping control amount within the range allowed by the system, and avoiding abnormal roller movement or impaired user experience caused by too large or too small control output. The limited control amount is input into the torque conversion unit for torque mapping. The torque mapping unit converts the control amount into a specific target damping torque output according to the actual physical parameters of the mouse roller (such as inertia, damping characteristics, etc.).
[0021] Step 500: Perform PWM signal transformation according to the target damping control amount to obtain the drive current parameters of the electromagnetic damper, and calculate the deviation between the drive current parameters and the actual output torque to obtain a control deviation amount; Specifically, the target damping control quantity is input into the PWM signal conversion unit. The PWM signal conversion unit maps the target damping control quantity into a duty cycle parameter through duty cycle mapping. The magnitude of the duty cycle determines the proportion of the high-level duration of the PWM signal, thereby affecting the amplitude of the output current. The mapping relationship is calibrated according to the characteristics of the electromagnetic damper to ensure that the linear or non-linear relationship between the damping control quantity and the actual torque output is accurately restored. Pulse width modulation is performed on the duty cycle parameter to obtain a PWM waveform signal. During the pulse width modulation process, the duty cycle parameter controls the high and low level periods of the PWM signal, so that the generated PWM signal can be represented as an efficient voltage modulation method in the time domain. The PWM waveform signal is input into the electromagnetic drive circuit for current modulation. The electromagnetic drive circuit demodulates the PWM signal, converts the signal into a continuous drive current, and generates a drive current parameter corresponding to the target damping control quantity. The magnitude and change rate of the drive current directly determine the working state and output torque of the electromagnetic damper. The drive current parameter is converted into a damping torque through the electromagnetic conversion unit of the electromagnetic damper, realizing precise physical adjustment of the mouse scroll wheel. In this process, the electromagnetic conversion unit converts electrical energy into mechanical damping torque output through the interaction of coil energization and magnetic field. The generated output torque is a direct manifestation of the actual control effect, and its value reflects the adjustment intensity of the electromagnetic damper on the scroll wheel movement. To monitor and evaluate this output effect in real time, the output torque is input into the torque sampling unit for sampling, and the torque sampling unit accurately records the real-time torque sampling value through a sensor. The difference between the real-time torque sampling value and the theoretically calculated output torque is calculated to generate a torque error sequence, which reflects the difference between the actual output torque and the expected control target. These differences are due to model inaccuracies, energy losses in electromagnetic drive, or external random disturbances. The torque error sequence is input into a moving average filter for noise smoothing processing. By averaging multiple consecutive values in the error sequence, high-frequency noise is effectively eliminated while retaining the low-frequency characteristics of the error, obtaining the filtered torque error. The filtered torque error is normalized by absolute value through a deviation calculation unit, converting the error value into a positive value on a unified scale, thereby simplifying the subsequent calculation process and making errors of different magnitudes have a consistent comparison standard. The normalized torque error is input into an error analysis unit. By comparing it with a set threshold, it is judged whether the error exceeds the acceptable range. The error analysis unit performs a threshold judgment operation and determines whether the control system needs further adjustment based on the magnitude of the threshold. The error analysis unit outputs a control deviation quantity, which is a quantitative evaluation of the system adjustment accuracy and is used to guide subsequent control parameter optimization and adjustment.
[0022] Step 600: Perform gradient descent iteration optimization on the control deviation quantity to obtain the optimal proportional coefficient and the optimal integral coefficient, and update the optimal proportional coefficient and the optimal integral coefficient to the controller.
[0023] Specifically, the control deviation amount is input into the optimization unit, and the objective function is constructed through a comprehensive evaluation of the system response characteristics . In this objective function, represents the damping response speed term, which is used to quantify the dynamic response ability of the system to the input signal; represents the control accuracy term, which evaluates the deviation degree between the actual output of the system and the target value; and is the steady-state error term, which reflects the error accumulation of the system during steady-state operation. The weight coefficients , and are used to adjust the relative importance of each index in the objective function, and the specific values need to be set according to the performance requirements of the roller application scenario. After the objective function is constructed, the gradient calculation unit takes the derivative of the objective function to calculate the gradient descent directions of the proportional coefficient and the integral coefficient respectively. The calculation of the gradient is based on the sensitivity analysis of the performance index to the proportional coefficient and the integral coefficient. In the specific process, the partial derivative formula is used to find the change rate of each parameter to the objective function, so as to determine the direction of optimal improvement of the system performance. Based on the gradient descent direction, the step size update calculation is performed on the parameters to generate the parameter iteration formula. The calculation of the step size update needs to combine the preset learning rate (also called the step size factor). The parameter iteration formula is substituted into the current parameters for update operation to obtain a new parameter combination. The new parameter combination is substituted into the controller for closed-loop simulation calculation after each iteration to evaluate the actual performance of the current parameter combination. The result of the simulation calculation is presented in the form of a new performance index value, which reflects the improvement degree of the updated parameters on the system performance. At the same time, this performance index value is compared with the preset convergence threshold to judge whether the current iteration meets the termination condition. The selection of the convergence threshold is based on the specific requirements of the application scenario, for example, the change of the objective function value is less than a certain small range, or the number of iterations reaches the set upper limit. Through this comparison process, it is dynamically judged whether to continue iterative optimization. If the iteration termination condition is met, the current parameter combination is recognized as the optimal solution, and the optimal proportional coefficient and the optimal integral coefficient are output. The optimal parameters are input into the controller parameter configuration unit to update the internal parameter configuration of the controller, so that the system can operate with the optimal proportional and integral control effects. Through this optimization process, the damping characteristics of the roller can dynamically adapt to the changes in the user operation behavior, achieving higher response speed, higher control accuracy, and lower steady-state error.
[0024] In the embodiments of the present application, by adopting a non-linear variable damping integral controller, the damping characteristics are divided into light damping and heavy damping regions, realizing a smooth transition of the damping coefficient and solving the problem of the discontinuous rolling feeling of the traditional controller; a parameter estimator based on a Kalman filter is introduced to perform real-time compensation on the mechanical damping coefficient and external interference, improving the robustness and anti-interference ability of the control system; a proportional-integral control structure is designed, and by dynamically adjusting the integral coefficient, the system can automatically switch the control strategy according to the user operation characteristics, and a good control experience can be obtained in both fast rolling and precise positioning scenarios; an electromagnetic damper driven by a PWM signal is used to replace the traditional mechanical damping structure, improving the system response speed, and at the same time ensuring the accuracy of the torque output through closed-loop control; a parameter optimization method based on the gradient descent algorithm simplifies the parameter tuning process of the controller by constructing a comprehensive performance index including response speed, control accuracy, and steady-state error.
[0025] In a specific embodiment, the process of executing step 100 may specifically include the following steps: Sample the rotation of the mouse wheel through an angle sensor to obtain an instantaneous angle sampling signal, and perform signal amplification processing on the instantaneous angle sampling signal through an amplification unit in the signal conditioning circuit to obtain an amplified angle signal; Eliminate high-frequency interference from the amplified angle signal through a low-pass filtering unit in the signal conditioning circuit to obtain a filtered angle signal, and perform data transmission based on the filtered angle signal to obtain an angle-time data sequence; Perform numerical differentiation on the angle-time data sequence to obtain an instantaneous angular velocity signal, and extract the frequency band signal from the instantaneous angular velocity signal to obtain a filtered angular velocity signal; Perform real-time data caching on the filtered angular velocity signal to obtain an angular velocity-time data sequence; Transmit the angle-time data sequence and the angular velocity-time data sequence to the historical data buffer of the central processing unit through the data bus for data storage to obtain the roller movement feature data stream.
[0026] Specifically, capture the real-time rotation information of the roller through an angle sensor. The angle sensor converts the mechanical displacement of the roller into an electronic signal proportional to the angle change and outputs an instantaneous angle sampling signal. Assume the instantaneous angle of the roller is , where represents time the rotation angle of the roller at the moment, in radians or degrees. Perform signal amplification processing on the instantaneous angle sampling signal through an amplification unit in the signal conditioning circuit to enhance the signal strength. The amplified angle signal is expressed as: ; where, is the gain factor of the amplification unit. The amplified signal is filtered for high-frequency interference by the low-pass filter unit in the signal conditioning circuit. The low-pass filter allows signals below the cut-off frequency to pass through, while suppressing frequency components higher than . The filtered angular signal is expressed as: ; where is the filtered angular signal, and represents the transfer function of the low-pass filter. Based on the filtered angular signal , through the high-speed data sampling module, the signal is discretized to generate an angle-time data sequence. Assuming the sampling frequency is , and the time interval between sampling points is , then the angle-time data sequence is expressed as: ; where represents the index of the sampling point. The angle-time data sequence is numerically differentiated to calculate the instantaneous angular velocity signal. Numerical differentiation calculates the angular velocity through the angular change between discrete time points, and its formula is: ; where is the instantaneous angular velocity at the th time point, and and are the angular values at the th and th time points respectively. The signal quality is further optimized through band signal extraction. A band-pass filter is used to extract the signal within the target frequency band to obtain the filtered angular velocity signal . The transfer function of the band-pass filter is , and the filtered angular velocity signal is expressed as: ; The filtered angular velocity signal is cached in real time to the data storage module to generate an angular velocity-time data sequence. Similar to the angle-time data sequence, the angular velocity-time data sequence is expressed as: ; The angle-time data sequence and the angular velocity-time data sequence are transmitted through the data bus to the historical data buffer of the central processing unit (CPU) for data storage. In the CPU, these data are sorted and analyzed to form a complete rolling motion characteristic data stream, recording the angle and angular velocity information of the roller at each time point.
[0027] In a specific embodiment, the process of executing step 200 may specifically include the following steps: Input the roller motion characteristic data stream into the piecewise function processing unit in the non-linear variable damping integral controller to perform characteristic interval division, obtaining the angular velocity data in the light damping region and the angular velocity data in the heavy damping region; Calibrate the linear coefficient of the angular velocity data in the light damping region through the damping characteristic modeling unit to obtain the linear mapping function in the light damping region, and perform exponential curve fitting on the angular velocity data in the heavy damping region through the damping characteristic modeling unit to obtain the exponential mapping function in the heavy damping region; Match the function values of the linear mapping function in the light damping region and the exponential mapping function in the heavy damping region to obtain the continuity constraint equations of the piecewise function; Solve the parameters based on the continuity constraint equations by the least squares method to obtain the optimal damping linear gain coefficient and the basic damping coefficient, and calculate the derivative of the piecewise function to obtain the amplitude coefficient and the exponential growth coefficient; Substitute the optimal damping linear gain coefficient, the basic damping coefficient, the amplitude coefficient, and the exponential growth coefficient into the piecewise function for coefficient update to obtain the complete piecewise damping characteristic function, and perform interval mapping on the complete piecewise damping characteristic function to obtain the piecewise continuous damping coefficient mapping relationship.
[0028] Specifically, input the roller motion characteristic data stream into the piecewise function processing unit in the non-linear variable damping integral controller to perform characteristic interval division on the angular velocity data of the roller. Assume the angular velocity data is , that is, the instantaneous angular velocity of the roller rotation at time . According to the predefined threshold , divide the angular velocity data into the light damping region ([[]] ) and the heavy damping region ). The light damping region corresponds to the state when the roller rotates slowly, while the heavy damping region reflects the behavior when the roller rotates rapidly. After completing the characteristic interval division, input the data in the light damping region into the damping characteristic modeling unit for linear coefficient calibration. The goal of the modeling is to find the linear mapping relationship between the angular velocity and the damping coefficient in the light damping region. Let the damping coefficient in the light damping region be , then its linear mapping function is expressed as: ; Among them, is the linear gain coefficient in the light damping region, indicating the influence intensity of the angular velocity change on the damping coefficient; is the basic damping coefficient, indicating the damping value at zero angular velocity. At the same time, input the data in the heavy damping region into the damping characteristic modeling unit for exponential curve fitting to capture the non-linear damping characteristics when the high-speed roller rotates. Let the damping coefficient in the heavy damping region be , and its exponential mapping function is expressed by the formula: ; Among them, is the amplitude coefficient, representing the initial amplitude of the exponential function; is the exponential growth coefficient, representing the sensitivity of the angular velocity to the growth of the damping coefficient; is the basic damping offset, used to adjust the zero damping value of the exponential function. To ensure the continuity and smoothness of the piecewise function at the boundary between the light damping and heavy damping regions, the function values and derivatives of and are matched. At the boundary point , the function value matching requirement is: ; The derivative matching requirement is: ; Combining these matching conditions forms a continuity constraint equation system to constrain the parameters of the piecewise function. The parameters of the continuity constraint equation system are solved by the least squares method, minimizing the sum of squared errors to obtain the optimal parameter combination. These parameters include the optimal linear gain coefficient in the light damping region, the basic damping coefficient , the amplitude coefficient in the heavy damping region, the exponential growth coefficient and the basic damping offset . The optimization objective of the least squares method is expressed as: ; Among them, is the actually measured damping coefficient, is the damping coefficient predicted by the model. After obtaining the optimal parameters, the piecewise function is differentiated to verify the correctness of the parameters and optimize the control model. The derivative in the light damping region is: ; The derivative in the heavy damping region is: ; Substituting all the optimized parameters into the piecewise function, a complete piecewise damping characteristic function is generated. The complete function is in the light damping region and in the heavy damping region. By performing interval mapping on the complete piecewise damping characteristic function, the corresponding damping coefficient is determined according to the angular velocity value of the roller, and a piecewise continuous damping coefficient mapping relationship is obtained.
[0029] In a specific embodiment, the process of executing step 300 may specifically include the following steps: Input the data stream of the roller motion characteristics into the state vector modeling unit of the Kalman filter system for initial state setting, and obtain the state equation with the mechanical damping coefficient and the disturbance torque as state variables; Perform state transition matrix construction processing on the state equation to obtain the state prediction equation, and calculate the prediction error of the covariance matrix based on the state prediction equation to obtain the predicted error covariance matrix; Input the predicted error covariance matrix into the Kalman gain calculation unit for optimal gain calculation processing to obtain the Kalman gain, and calculate the residual between the angular velocity observation value and the state prediction value in the data stream of the roller motion characteristics to obtain the observation residual; Substitute the observation residual and the Kalman gain into the measurement update equation for state correction to obtain the optimal state estimate value; Extract the compensation amount for the mechanical damping coefficient component in the optimal state estimate value to obtain the mechanical damping coefficient compensation amount, and extract the compensation amount for the disturbance torque component in the optimal state estimate value to obtain the disturbance torque compensation amount.
[0030] Specifically, input the data stream of the roller motion characteristics into the state vector modeling unit of the Kalman filter system to establish a state model describing the dynamic behavior of the system. Assume that the state vector of the system is , where represents the mechanical damping coefficient; represents the disturbance torque. The dynamic change of the state vector is described by the state equation, in discrete time form: ; where, is the state transition matrix, describing the internal change relationship of the system state; is the input control matrix, indicating the influence of the control input on the system state; is the input control quantity, such as the angular velocity or acceleration of the roller; is the process noise, usually assumed to be a zero-mean Gaussian distribution, and its covariance is . The construction of the state transition matrix needs to be derived according to the physical characteristics of the system. For example, in the roller system, assume that the change of the mechanical damping coefficient is mainly caused by the change of the angular velocity of the roller, and the disturbance torque is affected by both external disturbances and internal damping. Let the state transition matrix be: ; where, is the discrete time step. The input control matrix is set as: ; where, and is the control gain coefficient, which is used to map the input control quantity to the change of the state variable. After completing the construction of the state transfer matrix and the input control matrix, the state prediction equation is generated to calculate the state prediction value at the next moment. : ; At the same time, the prediction error covariance matrix is updated, and its update formula is: ; in, is the covariance matrix of the current state, quantifying the uncertainty of the state. Input the Kalman gain calculation unit to calculate the optimal gain. The formula of Kalman gain is: ; in, is the observation matrix, which represents the mapping relationship between observation values and state variables; is the covariance matrix of the observation noise, which quantifies the uncertainty of the observation data. The residual between the observation value and the predicted value is used for state correction through the Kalman gain. Angular velocity observation value in the characteristic data stream of the roller motion With the predicted value The residual calculation formula is: ; The state correction formula is: ; The corrected state vector is the optimal state estimate at the current moment. The mechanical damping coefficient component and the disturbance torque component in the optimal state estimate correspond to and ,The mechanical damping coefficient compensation and disturbance torque compensation are obtained through extraction operations, which are used for real-time adjustment of subsequent controllers.
[0031] In a specific embodiment, the process of executing step 400 may specifically include the following steps: Inputting the mechanical damping coefficient compensation amount into the proportional control unit for linear gain transformation to obtain a linear proportional control term; The mechanical damping coefficient compensation amount and the angular velocity signal are input into the integral control unit for integration and accumulation to obtain an integral control item, and the angular velocity signal is subjected to a fast rolling characteristic analysis to obtain a continuous operation flag signal; Adaptively adjust the integral coefficient based on the continuous operation flag signal to obtain a dynamic integral coefficient, and perform compensation control calculation on the interference torque compensation amount to obtain a compensation control item; Superpose the linear proportional control term, the integral control term, and the compensation control term to obtain the initial damping control quantity, and perform saturation limiting on the initial damping control quantity through a non-linear variable damping integral controller to obtain the limited control quantity; Input the limited control quantity into the torque conversion unit for torque mapping to obtain the target damping control quantity.
[0032] Specifically, input the mechanical damping coefficient compensation quantity into the proportional control unit, and generate a linear proportional control term through linear gain transformation. Assume that the mechanical damping coefficient compensation quantity is and the gain coefficient of the proportional control unit is . The calculation formula of the linear proportional control term is: ; where is the linear proportional control term. The function of this control term is to quickly respond to the change of the mechanical damping coefficient compensation quantity and provide timely adjustment force for the system. At the same time, to enhance the controller's ability to correct the cumulative deviation, input the mechanical damping coefficient compensation quantity and the angular velocity signal into the integral control unit for integral accumulation to generate the integral control term. Assume that the angular velocity signal is and the gain coefficient of the integral controller is . The formula of the integral control term is: ; where is the integral control term. The core of this integral calculation is to combine the historical change trends of the mechanical damping coefficient compensation quantity and the angular velocity signal to generate a correction for the long-term deviation of the roller dynamic characteristics. To improve the system's adaptability to the user's operation state, perform fast rolling feature analysis on the angular velocity signal, and extract the continuous operation flag signal. The fast rolling feature analysis generates a binary flag signal by judging the change mode of the angular velocity signal , such as the continuous increase or high-frequency oscillation of the angular velocity. Its value of 1 indicates continuous rolling operation, and its value of 0 indicates non-continuous rolling operation. The generation formula of the flag signal is based on threshold judgment: ; where is the angular velocity change rate or the set threshold of the angular velocity. Based on the continuous operation flag signal , adaptively adjust the integral coefficient to generate the dynamic integral coefficient . The adjustment rule is to increase the integral coefficient to improve the sensitivity of the integral response when the continuous rolling flag signal is 1; when the flag signal is 0, decrease the integral coefficient to prevent excessive integral accumulation. The adaptive adjustment formula is: ; Among them, is the adjustment gain, which is used to control the dynamic adjustment range of the integral coefficient. To offset the influence of external disturbances on the roller system, the compensation amount of the disturbance torque is used for compensation control calculation. Assume that the compensation control coefficient is , and the formula for the compensation control term: ; Among them, is the compensation control term. The linear proportional control term , the integral control term and the compensation control term are superimposed to generate the initial damping control quantity , and the formula is: ; The initial damping control quantity is saturated and limited by a non-linear variable damping integral controller. Assume that the limiting range of the controller is , and the limited control quantity is expressed as: ; The limited control quantity is input into the torque conversion unit to generate the target damping control quantity . The torque conversion unit maps the control quantity to the actual damping torque output according to the physical characteristics of the roller (such as inertia and angular velocity ), and the formula is: ; Among them, is the target damping control quantity; is the moment of inertia of the roller.
[0033] In a specific embodiment, the process of executing step 500 may specifically include the following steps: Input the target damping control quantity into the PWM signal conversion unit for duty cycle mapping to obtain the duty cycle parameter; Perform pulse width modulation on the duty cycle parameter to obtain the PWM waveform signal, and input the PWM waveform signal into the electromagnetic drive circuit for current modulation to obtain the drive current parameter; Based on the drive current parameter, generate the damping torque through the electromagnetic conversion unit of the electromagnetic damper to obtain the output torque, and input the output torque into the torque sampling unit for sampling to obtain the real-time torque sampling value; Calculate the difference between the real-time torque sampling value and the output torque to obtain the torque error sequence, and input the torque error sequence into the moving average filter for noise smoothing to obtain the filtered torque error; The filtered torque error is normalized by the deviation calculation unit to obtain the normalized torque error, and the normalized torque error is input to the error analysis unit for threshold judgment to obtain the control deviation amount.
[0034] Specifically, the target damping control amount is input to the PWM signal conversion unit, and the corresponding duty cycle parameter is generated through the duty cycle mapping relationship. The target damping control amount represents the damping torque generated by the desired electromagnetic damper. The duty cycle parameter is calculated by the formula: ; where is the maximum torque that the electromagnetic damper can generate. The duty cycle is a dimensionless parameter, and its value range is between [0, 1], indicating the proportion of the high-level duration of the PWM signal in one cycle. Pulse width modulation is performed on the duty cycle parameter to generate a PWM waveform signal. Assume that the frequency of the PWM signal is , and the signal period is . The high-level duration of the PWM signal is , and the low-level duration is . The generated PWM waveform signal is a square wave, and its high and low level ratio is determined by the duty cycle, and the specific shape is dynamically adjusted according to the change of the target damping control amount. The generated PWM waveform signal is input to the electromagnetic drive circuit for current modulation to generate the drive current parameter . The function of the electromagnetic drive circuit is to convert the PWM signal into a continuous current to drive the electromagnetic damper to generate the corresponding torque. Assume that the coil resistance of the electromagnetic damper is , and the input voltage amplitude is , then the drive current parameter is expressed as: ; The drive current parameter is input to the electromagnetic conversion unit of the electromagnetic damper, and the damping torque is generated through the electromagnetic effect. The relationship between the damping torque and the drive current is expressed as: ; where is the torque coefficient of the electromagnetic conversion unit. Through this process, the target damping control amount is converted into the actual output torque. The output torque is input to the torque sampling unit, and sampling is performed through the sensor to obtain the real-time torque sampling value . The sampling unit discretizes the output torque at a high frequency to form a sequence of data of torque over time. The real-time torque sampling value and the theoretical value of the output torque There are differences, which mainly come from sensor noise, the non-linear characteristics of the electromagnetic damper or external disturbances. To quantify this difference, the real-time torque sampling value is subtracted from the theoretical output torque to calculate the torque error sequence , and the formula is: ; where represents the torque error at the th sampling point. The error sequence is input into a moving average filter for noise smoothing. The moving average filter filters out high-frequency components by weighted averaging of consecutive points in the error sequence, and the formula is: ; where is the filtered torque error, and is the size of the moving window. The absolute value normalization process is performed on the filtered torque error to generate the normalized torque error . The purpose of normalization is to scale the error to a unified range for subsequent analysis, and the formula is: ; where is the absolute value of the filtered torque error. The normalized torque error is input into an error analysis unit, and by comparing with the preset threshold , it is judged whether the current error is within an acceptable range. If , the system considers that the control deviation amount is 0; otherwise, the value of the deviation amount is proportional to the normalized error, and the formula is: ; where is the deviation gain coefficient, which is used to amplify the deviation amount.
[0035] In this embodiment, before performing gradient descent iteration optimization on the control deviation amount, it further includes: inputting the control deviation amount into the global proxy layer of the double-layer proxy model for rough modeling to obtain the global feature mapping function G(x), and based on the global feature mapping function, dividing the control parameter space into N sub-parameter spaces; performing fine modeling on each sub-parameter space through the local proxy layer to obtain the local feature mapping function Li(x), where i = 1, 2,..., N, and inputting the local feature mapping function into the error evaluation unit to calculate the prediction error, obtaining the local modeling error εi; based on the local modeling error εi, rating the pros and cons of each sub-parameter space to obtain the space weight coefficient wi, and allocating the parameter search resources according to the space weight coefficient to obtain the calculation budget bi for each subspace; inputting the calculation budget bi into the hierarchical control optimization unit for parallel optimization calculation to obtain the optimal parameter combination Pi and the corresponding performance index value Ji for each subspace; comparing and screening the performance index values Ji to obtain the global optimal solution candidate set , where Jth is the performance threshold; inputting the global optimal solution candidate set S into the fine evaluation unit for simulation verification to obtain the actual performance value Vi of each candidate solution; sorting the actual performance values Vi and selecting the parameter combination with the best performance as the initial value to obtain the initial parameter P0 of the gradient descent algorithm; starting local gradient descent optimization based on the initial parameter P0 to obtain the local optimal solution , as the initial values of the optimal proportional coefficient and the optimal integral coefficient.
[0036] In a specific embodiment, the process of executing step 600 may specifically include the following steps: Input the control deviation amount into the parameter optimization unit to construct the objective function and obtain the performance evaluation index , where R s is the damping response speed term, C p is the control accuracy term, S e is the steady-state error term, w 1 , w 2 , w 3 are the weight coefficients; Derive the parameters of the performance evaluation index J(k) through the gradient calculation unit to obtain the gradient descent directions of the proportional coefficient and the integral coefficient; Based on the gradient descent directions, perform step size update calculation on the parameters to obtain the parameter iteration formula, and substitute the parameter iteration formula into the current parameters for update operation to obtain a new parameter combination; Substitute the new parameter combination into the controller for closed-loop simulation calculation to obtain a new performance index value, and compare the new performance index value with the preset convergence threshold to obtain the iteration termination condition; Judge the iteration termination condition. If the condition is met, output the current parameter value as the optimal solution, obtain the optimal proportional coefficient and the optimal integral coefficient, and input the optimal proportional coefficient and the optimal integral coefficient into the controller parameter configuration unit for parameter update to obtain a new controller parameter configuration.
[0037] Specifically, input the control deviation into the parameter optimization unit, and combine the dynamic and steady-state performance requirements of the system to construct a performance evaluation index. The performance evaluation index has the following expression: ; where is the damping response speed term, reflecting the dynamic response ability of the system to the input signal; is the control accuracy term quantifying the deviation between the output value and the target value; is the steady-state error term, indicating the long-term deviation of the system after reaching the steady state; is the weight coefficient, used to balance the importance of different performance indicators. The optimization goal is to minimize to achieve an overall improvement in system performance. Through the gradient calculation unit, take the derivative of the performance evaluation index with respect to the parameters, and calculate the gradient descent directions of the proportional coefficient and the integral coefficient respectively. Assume that the proportional coefficient and the integral coefficient at the current iteration step are and respectively. Then the calculation formulas for the gradient descent directions are: ; ; The calculation of these partial derivatives depends on the sensitivity analysis of the system model to the proportional coefficient and the integral coefficient, and is calculated through numerical methods or analytical methods. Based on the gradient descent directions, perform step size update calculations on the parameters to generate parameter iteration formulas. The update formulas are: ; ; where is the learning rate or step size factor, used to control the size of the update step to avoid overly large or small adjustments. Through this formula, the proportional coefficient and the integral coefficient can be gradually optimized in the direction of reducing . Substitute the updated parameter combination into the controller for closed-loop simulation calculation to verify its performance. The results of the simulation calculation include the new performance index values , this value reflects the control effect of the new parameter combination in the current system. During the simulation process, the controller adjusts the output in real time according to the new parameters to achieve the comprehensive optimization of dynamic and steady-state performance. After the simulation is completed, the new performance index value is compared with the preset convergence threshold to determine whether the iteration meets the termination condition. If the change amount of the performance index is less than the convergence threshold, it indicates that the optimization process has converged, and the current parameter combination is output as the optimal solution; otherwise, continue the iterative optimization until the termination condition is met or the maximum number of iterations is reached. When the iteration termination condition is met, the current proportional coefficient and integral coefficient are identified as the optimal parameters and input into the controller parameter configuration unit to update the internal parameters of the controller. The updated controller can achieve faster response, higher precision, and smaller steady-state error during actual operation.
[0038] The above describes the mouse wheel damping adjustment method in the embodiments of the present application. Next, the mouse wheel damping adjustment device 10 in the embodiments of the present application will be described. Please refer to Figure 2 , an embodiment of the mouse wheel damping adjustment device 10 in the embodiments of the present application includes: A sampling module 11, configured to perform high-frequency sampling on the rotation of the roller to obtain a roller motion feature data stream; A mapping module 12, configured to perform piecewise function mapping on the damping characteristics according to the roller motion feature data stream to obtain a piecewise continuous damping coefficient mapping relationship; A processing module 13, configured to input the roller motion feature data stream into a state prediction equation and a measurement update equation for Kalman filtering processing to obtain a mechanical damping coefficient compensation amount and a disturbance torque compensation amount; A calculation module 14, configured to perform proportional integral calculation on the control parameters according to the mechanical damping coefficient compensation amount and the disturbance torque compensation amount to obtain a target damping control amount; A transformation module 15, configured to perform PWM signal transformation according to the target damping control amount to obtain the drive current parameter of the electromagnetic damper, and calculate the deviation between the drive current parameter and the actual output torque to obtain a control deviation amount; An optimization module 16, configured to perform gradient descent iterative optimization on the control deviation amount to obtain an optimal proportional coefficient and an optimal integral coefficient, and update the optimal proportional coefficient and the optimal integral coefficient to the controller.
[0039] Through the collaborative cooperation of the above-mentioned various components, by adopting a non-linear variable damping integral controller, the damping characteristics are divided into light damping and heavy damping regions, realizing a smooth transition of the damping coefficient and solving the problem of the discontinuous rolling feeling of the traditional controller; introducing a parameter estimator based on a Kalman filter to compensate for the mechanical damping coefficient and external interference in real time, improving the robustness and anti-interference ability of the control system; designing a proportional-integral control structure, and by dynamically adjusting the integral coefficient, enabling the system to automatically switch the control strategy according to the user operation characteristics, and obtaining a good control experience in both fast rolling and precise positioning scenarios; using an electromagnetic damper driven by a PWM signal to replace the traditional mechanical damping structure, improving the system response speed, and at the same time ensuring the accuracy of the torque output through closed-loop control; a parameter optimization method based on the gradient descent algorithm, by constructing a comprehensive performance index including response speed, control accuracy and steady-state error, simplifies the parameter tuning process of the controller.
[0040] Please refer to Figure 3 , Figure 3 FIG. is a schematic block diagram of the structure of the electronic device 300 provided by an embodiment of the present application. The electronic device 300 includes a processor 301 and a memory 302. The processor 301 and the memory 302 are connected through a device bus 303. Among them, the memory 302 may include a non-volatile storage medium and an internal memory.
[0041] The non-volatile storage medium can store a computer program. The computer program includes program instructions. When the program instructions are executed by the processor 301, the processor 301 can be enabled to execute any of the above-mentioned mouse wheel damping adjustment methods.
[0042] The processor 301 is used to provide computing and control capabilities to support the operation of the entire electronic device 300.
[0043] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor 301, the processor 301 can be enabled to execute any of the above-mentioned mouse wheel damping adjustment methods.
[0044] Those skilled in the art can understand that Figure 3 the structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the electronic device 300 involved in the solution of the present application. The specific electronic device 300 may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0045] It should be understood that the processor 301 may be a central processing unit (CPU), and the processor 301 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0046] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described electronic device 300 can refer to the corresponding process of the foregoing mouse wheel damping adjustment method, which will not be elaborated herein.
[0047] The embodiment of the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by one or more processors, the one or more processors are caused to implement the mouse wheel damping adjustment method provided by the embodiment of the present application.
[0048] Among them, the computer-readable storage medium may be an internal storage unit of the foregoing embodiment of the electronic device 300, such as the hard disk or memory of the electronic device 300. The computer-readable storage medium may also be an external storage device of the electronic device 300, such as a plug-in hard disk equipped with the electronic device 300, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.
[0049] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described system, device, and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated herein.
[0050] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0051] As described above, the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of various embodiments of this application.
Claims
1. A mouse wheel damping adjustment method, characterized in that: The method comprises: Perform high-frequency sampling on the rotation of the roller to obtain a data stream of roller motion characteristics; Performing piecewise function mapping on the damping characteristics according to the roller motion characteristic data stream to obtain a piecewise continuous damping coefficient mapping relationship; Input the roller motion characteristic data stream into the state prediction equation and the measurement update equation for Kalman filtering to obtain the mechanical damping coefficient compensation amount and the interference torque compensation amount; Performing proportional integral calculation on the control parameter according to the mechanical damping coefficient compensation amount and the disturbance torque compensation amount to obtain a target damping control amount; Performing PWM signal conversion according to the target damping control amount to obtain a driving current parameter of the electromagnetic damper, and performing deviation calculation between the driving current parameter and the actual output torque to obtain a control deviation amount; The control deviation is iteratively optimized by gradient descent to obtain an optimal proportional coefficient and an optimal integral coefficient, and the optimal proportional coefficient and the optimal integral coefficient are updated to a controller.
2. The mouse wheel damping adjustment method according to claim 1, characterized in that: The high-frequency sampling of the roller rotation to obtain the roller motion characteristic data stream includes: The rotation of the mouse wheel is sampled by an angle sensor to obtain an instantaneous angle sampling signal, and the instantaneous angle sampling signal is amplified by an amplifying unit in a signal conditioning circuit to obtain an amplified angle signal; Eliminating high-frequency interference of the amplified angle signal through a low-pass filter unit in a signal conditioning circuit to obtain a filtered angle signal, and performing data transmission based on the filtered angle signal to obtain an angle-time data sequence; Numerically differentiating the angle-time data sequence to obtain an instantaneous angular velocity signal, and performing frequency band signal extraction on the instantaneous angular velocity signal to obtain a filtered angular velocity signal; Performing real-time data caching on the filtered angular velocity signal to obtain an angular velocity-time data sequence; The angle-time data sequence and the angular velocity-time data sequence are transmitted to the historical data buffer of the central processing unit through the data bus for data storage, so as to obtain the roller motion characteristic data stream.
3. The mouse wheel damping adjustment method according to claim 2, characterized in that: The step of performing piecewise function mapping on the damping characteristic according to the roller motion characteristic data stream to obtain a piecewise continuous damping coefficient mapping relationship includes: Inputting the roller motion characteristic data stream into a piecewise function processing unit in a nonlinear variable damping integral controller to divide the characteristic interval, thereby obtaining angular velocity data in a light damping area and angular velocity data in a heavy damping area; The angular velocity data in the light damping region is calibrated with a linear coefficient by a damping characteristic modeling unit to obtain a linear mapping function in the light damping region, and the angular velocity data in the heavy damping region is fitted with an exponential curve by a damping characteristic modeling unit to obtain an exponential mapping function in the heavy damping region; Matching the linear mapping function of the lightly damped region with the exponential mapping function of the heavily damped region to obtain a continuity constraint equation group of the piecewise function; Solving the parameters based on the continuity constraint equations by the least square method to obtain the optimal damping linear gain coefficient and the basic damping coefficient, and performing derivative calculation on the piecewise function to obtain the amplitude coefficient and the exponential growth coefficient; The optimal damping linear gain coefficient, the basic damping coefficient, the amplitude coefficient and the exponential growth coefficient are substituted into the piecewise function to update the coefficients to obtain a complete piecewise damping characteristic function, and the complete piecewise damping characteristic function is interval mapped to obtain a piecewise continuous damping coefficient mapping relationship.
4. The mouse wheel damping adjustment method according to claim 3, characterized in that: The step of inputting the roller motion characteristic data stream into the state prediction equation and the measurement update equation for Kalman filtering to obtain the mechanical damping coefficient compensation amount and the interference torque compensation amount includes: Inputting the roller motion characteristic data stream into the state vector modeling unit of the Kalman filter system for initial state setting, and obtaining a state equation with the mechanical damping coefficient and the interference torque as state variables; Performing state transfer matrix construction processing on the state equation to obtain a state prediction equation, and performing prediction error calculation on the covariance matrix based on the state prediction equation to obtain a prediction error covariance matrix; The prediction error covariance matrix is input into the Kalman gain calculation unit for optimal gain calculation processing to obtain the Kalman gain, and the angular velocity observation value and the state prediction value in the roller motion characteristic data stream are subjected to residual calculation to obtain the observation residual; Substituting the observation residual and the Kalman gain into the measurement update equation to perform state correction to obtain an optimal state estimate; A compensation amount is extracted from a mechanical damping coefficient component in the optimal state estimation value to obtain a mechanical damping coefficient compensation amount, and a compensation amount is extracted from a disturbance torque component in the optimal state estimation value to obtain a disturbance torque compensation amount.
5. The mouse wheel damping adjustment method according to claim 4, characterized in that: The proportional integral calculation of the control parameter according to the mechanical damping coefficient compensation amount and the disturbance torque compensation amount to obtain the target damping control amount includes: Inputting the mechanical damping coefficient compensation amount into a proportional control unit for linear gain conversion to obtain a linear proportional control term; Inputting the mechanical damping coefficient compensation amount and the angular velocity signal into an integral control unit for integration and accumulation to obtain an integral control item, and performing fast rolling characteristic analysis on the angular velocity signal to obtain a continuous operation flag signal; Adaptively adjusting the integral coefficient based on the continuous operation flag signal to obtain a dynamic integral coefficient, and performing compensation control calculation on the interference torque compensation amount to obtain a compensation control item; The linear proportional control term, the integral control term and the compensation control term are superimposed to obtain an initial damping control amount, and the initial damping control amount is saturated and limited by a nonlinear variable damping integral controller to obtain a limited control amount; The limited control amount is input into the torque conversion unit for torque mapping to obtain the target damping control amount.
6. The mouse wheel damping adjustment method according to claim 5, characterized in that: The step of performing PWM signal conversion according to the target damping control amount to obtain a driving current parameter of the electromagnetic damper, and performing deviation calculation between the driving current parameter and the actual output torque to obtain a control deviation amount includes: Inputting the target damping control amount into a PWM signal conversion unit for duty cycle mapping to obtain a duty cycle parameter; Performing pulse width modulation on the duty cycle parameter to obtain a PWM waveform signal, and inputting the PWM waveform signal into an electromagnetic drive circuit for current modulation to obtain a drive current parameter; Based on the driving current parameter, a damping torque is generated by an electromagnetic conversion unit of the electromagnetic damper to obtain an output torque, and the output torque is input into a torque sampling unit for sampling to obtain a real-time torque sampling value; Performing difference calculation on the real-time torque sampling value and the output torque to obtain a torque error sequence, and inputting the torque error sequence into a sliding average filter for noise smoothing to obtain a filtered torque error; The absolute value of the filtered torque error is normalized by a deviation calculation unit to obtain a normalized torque error, and the normalized torque error is input into an error analysis unit for threshold judgment to obtain a control deviation.
7. The mouse wheel damping adjustment method according to claim 6, characterized in that: The step of performing gradient descent iterative optimization on the control deviation to obtain an optimal proportional coefficient and an optimal integral coefficient, and updating the optimal proportional coefficient and the optimal integral coefficient to a controller includes: The control deviation is input into the parameter optimization unit to construct the objective function and obtain the performance evaluation index. , where R s is the damping response speed term, C p is the control accuracy term, S e is the steady-state error term, w1, w2, w3 are weight coefficients; The performance evaluation index J(k) is parameter-derived by a gradient calculation unit to obtain the gradient descent direction of the proportional coefficient and the integral coefficient; Performing step-size update calculation on the parameters based on the gradient descent direction to obtain a parameter iteration formula, and substituting the parameter iteration formula into the current parameters to perform an update operation to obtain a new parameter combination; Substituting the new parameter combination into the controller for closed-loop simulation calculation to obtain a new performance index value, and comparing the new performance index value with a preset convergence threshold to obtain an iteration termination condition; The iteration termination condition is judged, and if the condition is met, the current parameter value is output as the optimal solution to obtain the optimal proportional coefficient and the optimal integral coefficient, and the optimal proportional coefficient and the optimal integral coefficient are input into the controller parameter configuration unit for parameter update to obtain a new controller parameter configuration.
8. A mouse wheel damping adjustment device, characterized in that: Used to perform the mouse wheel damping adjustment method according to any one of claims 1 to 7, the mouse wheel damping adjustment device comprising: The sampling module is used to perform high-frequency sampling on the rotation of the roller to obtain a data stream of the roller motion characteristics; A mapping module, used for performing piecewise function mapping on the damping characteristic according to the roller motion characteristic data stream to obtain a piecewise continuous damping coefficient mapping relationship; A processing module, used for inputting the roller motion characteristic data stream into a state prediction equation and a measurement update equation for Kalman filtering processing to obtain a mechanical damping coefficient compensation amount and an interference torque compensation amount; A calculation module, used for performing proportional integral calculation on a control parameter according to the mechanical damping coefficient compensation amount and the interference torque compensation amount to obtain a target damping control amount; A conversion module, used for performing PWM signal conversion according to the target damping control amount to obtain a driving current parameter of the electromagnetic damper, and performing deviation calculation between the driving current parameter and the actual output torque to obtain a control deviation amount; The optimization module is used to perform gradient descent iterative optimization on the control deviation to obtain an optimal proportional coefficient and an optimal integral coefficient, and update the optimal proportional coefficient and the optimal integral coefficient to the controller.
9. An electronic device, characterized in that: The electronic device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the electronic device to execute the mouse wheel damping adjustment method according to any one of claims 1 to 7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the mouse wheel damping adjustment method according to any one of claims 1 to 7 is implemented.