A multi-mode massager control method and device based on external angle feedback

By using external angle feedback and closed-loop control, the problems of insufficient drive strategies and trajectory deviation in existing massagers in multiple modes are solved, and the massager is made possible with precise control and stable operation.

CN121287477BActive Publication Date: 2026-04-21XIAMEN DELIUS INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAMEN DELIUS INTELLIGENT TECH CO LTD
Filing Date
2025-12-12
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing massagers lack differentiated drive strategies for different massage modes, resulting in insufficient intensity or jerky movements. Furthermore, they lack a closed-loop feedback mechanism, making it difficult to accurately match massage needs and trajectory control.

Method used

By combining external angle feedback with closed-loop control, the system receives user mode commands, generates hardware driver settings, starts the sensorless brushless motor, triggers external angle sensor sampling, processes initial motor operating information and real-time angle data, and generates PWM commands through PID or FOC vector control algorithms to adjust motor torque and speed, thereby achieving precise movement of the massage head.

Benefits of technology

It achieves precise control of the massager in multiple modes, avoiding insufficient intensity or jerky movements, improving massage accuracy and stability, and ensuring that the massage head movements conform to preset requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121287477B_ABST
    Figure CN121287477B_ABST
Patent Text Reader

Abstract

This invention provides a multi-mode massager control method and device based on external angle feedback, applicable to the field of data processing. This application receives user commands for three massage modes: high-frequency impact, rhythmic percussion, and deep kneading, along with pre-stored system configurations including target trajectory curve parameters for each massage mode and basic parameters for the sensorless brushless motor drive. It then generates startup and hardware driver settings. Next, it starts the motor and triggers the angle sensor to sample, obtaining initial and real-time angle data. The data is then processed using pre-stored algorithms and rules to generate a comparison benchmark between the actual trajectory and the target trajectory. Subsequently, error signals and PWM adjustment information are generated based on closed-loop control, and motor torque and speed control information is generated by combining the drive circuit status. Finally, the results are converted into massage head movements, and relevant classification information is extracted to generate adaptation parameters and calibration rules, achieving precise multi-mode massage control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and in particular to a multi-mode massager control method and device based on external angle feedback. Background Technology

[0002] Most existing massagers use fixed hardware driving parameters (such as motor starting current, speed, and angle sensor sampling period) to adapt to all massage modes, without designing differentiated driving strategies for the different motion characteristics of each mode (such as high-frequency impact requiring high-frequency, small-angle reciprocating motions, and deep kneading requiring low-speed, large-amplitude, smooth pressing). For example, using a uniform motor starting current to drive both high-frequency impact and deep kneading modes can easily lead to insufficient starting current and insufficient impact force in the high-frequency mode, or excessive starting current and jerky movements in the deep kneading mode, failing to accurately match the core experience requirements of each mode. At the same time, a fixed angle sensor sampling period makes it difficult to simultaneously meet the needs of capturing rapid angle changes in high-frequency mode and optimizing sampling resources in low-speed mode, easily resulting in trajectory monitoring deviations.

[0003] Existing massagers mostly rely on open-loop control to achieve the trajectory movement of the massage head, without establishing a closed-loop feedback mechanism of "target trajectory - actual trajectory". On the one hand, there is no pre-stored algorithm for precise target trajectory curves for different modes. The action is achieved only through simple motor on / off control, resulting in a large deviation between the massage head movement trajectory and the preset requirements. For example, in the deep kneading mode, it is impossible to stably maintain the dwell time and force of the deepest point of the press. On the other hand, there is a lack of effective processing rules for real-time angle data. It is impossible to accurately extract the actual movement trajectory information from the raw data collected by the sensor, and it is difficult to detect and correct trajectory deviations (such as the angle lag caused by mechanical clearance of the massage head), further reducing the accuracy of the massage action.

[0004] Existing massagers do not fully consider the impact of transmission mechanisms (such as the transmission ratio, mechanical backlash, and lever arm characteristics of the "motor rotation - massage head oscillation") on motor control. They simply output motor control operations directly without establishing a precise mapping mechanism between motor parameters (speed, torque) and the actual movements of the massage head (angular velocity, pressure). For example, when the motor speed is converted into the massage head angular velocity according to a fixed transmission ratio, the lag caused by the mechanical backlash of the transmission mechanism is not corrected, which easily leads to a deviation between the actual angular velocity of the massage head and the target value. At the same time, the motor torque is not converted into the massage head pressure based on the lever arm characteristics of the transmission mechanism, resulting in the pressure in different modes not matching the preset requirements. For example, in the rhythmic tapping mode, due to the torque-force mapping deviation, the tapping force may be too light or too heavy.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore includes information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] According to one aspect of this application, a multi-mode massager control method based on external angle feedback is provided, comprising: S101, receiving a user massage mode command and pre-stored system basic configuration information, generating mode start and hardware driver basic setting information, wherein the user massage mode command includes a high-frequency impact mode, a rhythmic percussion mode, and a deep kneading mode; the high-frequency impact mode refers to a massage mode in which the massager uses high-frequency small-angle reciprocating motion characteristics; the rhythmic percussion mode refers to a massage mode in which the massager uses fast percussion and slow withdrawal, large-amplitude asymmetrical reciprocating motion characteristics; and the deep kneading mode refers to a massage mode in which the massager uses low-speed, large-amplitude smooth pressing motion characteristics; the pre-stored system basic configuration information includes target trajectory curve parameters corresponding to various massage modes, basic driving parameters of the sensorless brushless motor, and sampling period and signal parsing rules of the external angle sensor; S102, based on the mode start command and hardware driver settings, starting the sensorless brushless motor and triggering external angle sensor sampling, generating initial motor operation information and real-time angle raw data; S103. Receive pre-stored target trajectory curve algorithm and angle data processing rules, process the initial motor operation information and real-time angle raw data, calculate the actual angular velocity through differential calculation, and generate actual motion trajectory information and target trajectory comparison benchmark information; S104. Process the actual motion trajectory information and target trajectory comparison benchmark information based on closed-loop control rules, calculate the difference between the actual angle / angular velocity and the target angle / angular velocity to generate an error signal, and generate PWM command adjustment information through a PID controller or FOC vector control algorithm; S105. Process the PWM command adjustment information and motor drive circuit status information to generate motor torque and speed control operation information; S106. Based on preset massage mode operation requirements and real-time trajectory feedback, convert the control operation information into actual massage head movement, extract and classify mode requirements, trajectory feedback, control operation information and transmission mechanism attributes, and generate mode adaptation parameters, trajectory calibration rules, torque adjustment threshold, and massage head and motor linkage mapping information.

[0007] Another aspect of this application discloses a multi-mode massager control device based on external angle feedback, comprising: a human-machine interface 201 for receiving user massage mode commands, wherein the user massage mode commands include a high-frequency impact mode, a rhythmic percussion mode, and a deep kneading mode; the high-frequency impact mode refers to a massage mode characterized by high-frequency, small-angle reciprocating motion; the rhythmic percussion mode refers to a massage mode characterized by fast-pounding, slow-retracting, large-amplitude asymmetrical reciprocating motion; and the deep kneading mode refers to a massage mode characterized by low-speed, large-amplitude, smooth pressing motion; and a flash memory storage unit 202 for reading pre-stored system basic configuration information and, based on the aforementioned commands and configuration information, generating a mode activation signal and hardware driver basic setting information. The system includes pre-stored basic configuration information such as target trajectory curve parameters corresponding to various massage modes, basic drive parameters of the sensorless brushless motor, and sampling period and signal parsing rules of the external angle sensor. The motor drive control interface 203 sends a start signal to the drive circuit of the sensorless brushless motor to initiate its operation and generate initial motor operation information. Simultaneously, it triggers the external angle sensor to sample according to a set sampling period via the sensor communication interface, reading the raw electrical signal output by the sensor to generate real-time angle raw data. The flash memory data reading interface 204 receives the pre-stored target trajectory curve algorithm and angle data processing rules, and combines the initial speed data in the initial motor operation information with the transmission... The mechanism's reduction ratio parameter is converted to obtain the initial movement speed of the massage head; the real-time angle raw data is converted according to the angle data processing rules to obtain the real-time actual angle value; the calculation unit 205 is used to calculate the real-time actual angular velocity using the M-method speed measurement; the real-time actual angle value and real-time actual angular velocity are integrated, and the actual angular velocity is calculated through differential calculation to generate the actual motion trajectory information; based on the target trajectory curve algorithm, the target angle and target angular velocity at the corresponding moment are calculated according to the current running time to generate the target trajectory comparison benchmark information; the closed-loop control calculation unit 206 is used to call the pre-stored closed-loop control rules and compare the real-time actual angle value and real-time actual angular velocity value in the actual motion trajectory information with the target angle in the target trajectory comparison benchmark information. The angle and target angular velocity values ​​are compared cycle by cycle, and the difference between the actual angle / angular velocity and the target angle / angular velocity is calculated to generate an error signal. Based on the error signal, PWM command adjustment information is generated through a PID controller or FOC vector control algorithm. The motor drive status detection interface 207 is used to read the status information of the motor drive circuit. The PWM command adjustment information and the motor drive circuit status information are fused to generate motor torque and speed control operation information. The transmission mechanism linkage control logic unit 208, based on the preset massage mode operation requirements and real-time trajectory feedback, converts the motor torque and speed control operation information into specific operation commands for the brushless motor, and drives the massage head to perform corresponding actions through the transmission mechanism.The parameter extraction and classification unit 209 extracts and classifies the operating requirements parameters of the preset massage mode, error fluctuation data in real-time trajectory feedback, PWM adjustment range in control operation information, and mechanical properties of the transmission mechanism, generating mode adaptation parameters, trajectory calibration rules, torque adjustment thresholds, and massage head and motor linkage mapping information.

[0008] According to another aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a second processor, implements the above-described multi-mode massager control method based on external angle feedback.

[0009] This application provides a multi-mode massager control method and device based on external angle feedback. For multi-mode massagers (supporting high-frequency impact, rhythmic percussion, and deep kneading), it uses external angle feedback as the core and combines it with closed-loop control to achieve precise control. First, it receives user mode commands and pre-stored configurations (including target trajectory parameters for each mode, sensorless brushless motor parameters, and angle sensor parameters), and generates hardware driver settings; then, it starts the motor and triggers sensor sampling to obtain initial motor operating information and real-time angle data.

[0010] The data is then processed using pre-stored algorithms and rules to generate a benchmark for comparing the actual trajectory with the target trajectory. Errors are calculated through closed-loop control to generate PWM adjustment information, which, combined with the drive circuit status (current, voltage, temperature), generates motor torque and speed control information. Finally, the control information is converted into massage head movements, and relevant classification information is extracted to generate adaptation parameters and calibration rules. Simultaneously, differentiated strategies are designed for different modes, such as a large-amplitude sinusoidal trajectory for deep kneading and an asymmetric trapezoidal wave trajectory for rhythmic tapping. Furthermore, transmission coordination adapts to the properties of the mechanism to ensure massage accuracy and stability.

[0011] The beneficial effect of this application lies in its precise adaptation to multiple mode requirements. It designs differentiated drive and trajectory strategies for high-frequency impact, rhythmic pounding, and deep kneading, avoiding insufficient force or jerky movements caused by single parameters and improving the accuracy of mode adaptation. Through external angle feedback and closed-loop control, combined with target trajectory algorithms and data processing rules, it corrects trajectory deviation and mechanical gap errors, making the massage head movement more closely match the preset requirements.

[0012] Establish a precise mapping between motor parameters and massage head movements, adapt to the transmission mechanism attributes, and resolve torque-force and speed-angular velocity mapping deviations to ensure pressure intensity and smoothness of movement. Monitor the drive circuit status (current, voltage, temperature) in real time, and through parameter verification, error correction, and anomaly handling, avoid risks such as overload and overheating, thereby improving equipment operational stability.

[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0014] Figure 1 This document shows a flowchart illustrating a multi-mode massager control method based on external angle feedback, according to an embodiment of this application.

[0015] Figure 2 A schematic diagram of the structure of a multi-mode massager control device based on external angle feedback provided in an embodiment of this application is shown. Detailed Implementation

[0016] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0017] The following is combined with Figure 1 This application describes a multi-mode massager control method based on external angle feedback according to an exemplary embodiment of the present application.

[0018] S101 receives the user's massage mode command and pre-stored system basic configuration information, and generates mode activation and hardware driver basic setting information. The user's massage mode command includes high-frequency impact mode, rhythmic percussion mode, and deep kneading mode. High-frequency impact mode refers to a massage mode in which the massager uses high-frequency small-angle reciprocating motion as its motion characteristic. Rhythmic percussion mode refers to a massage mode in which the massager uses fast percussion and slow withdrawal, large-amplitude asymmetrical reciprocating motion as its motion characteristic. Deep kneading mode refers to a massage mode in which the massager uses low-speed, large-amplitude smooth pressing motion as its motion characteristic. The pre-stored system basic configuration information includes the target trajectory curve parameters corresponding to various massage modes, the basic drive parameters of the sensorless brushless motor, and the sampling period and signal analysis rules of the external angle sensor.

[0019] In one implementation, the system receives the user's selected massage mode command (specifying three types of needs: high-frequency impact, rhythmic pounding, and deep kneading) and pre-stored basic system configuration information (including trajectory, motor, and sensor parameters). Then, it uses a "mode-parameter mapping algorithm" to associate the two types of information and generate a "mode start command" and "hardware driver basic setting information" that can directly drive the hardware, laying a precise control foundation for subsequent motor start-up and trajectory monitoring.

[0020] High-frequency impact mode refers to a massage mode in which the massager uses high-frequency, small-angle reciprocating motion as its characteristic. It needs to be adapted to a high-frequency sine wave trajectory algorithm, adopt a soft-start method to reduce the impact of the starting current, and be combined with an angle sensor sampling strategy adapted to high-frequency scenarios to achieve a massage effect through rapid, small-amplitude impact movements.

[0021] The rhythmic tapping mode refers to a massage mode characterized by fast tapping and slow retraction, with large-amplitude asymmetrical reciprocating motion. It is adapted to an asymmetrical trapezoidal wave trajectory algorithm (including a rapid downward tapping, a brief press at the lowest point, and a slow upward retraction phase). It adopts a pre-positioned open-loop start to ensure accurate initial position, and simulates the rhythmic tapping experience of human hands with "fast tapping and slow retraction" through millisecond-level angle sampling and closed-loop control.

[0022] The deep kneading mode refers to a massage mode characterized by low-speed, large-amplitude smooth pressing. It is adapted to a large-amplitude sine wave trajectory algorithm, which requires stable output of high torque at the deepest point of pressing. Cascade PID control is used to ensure smoothness of motion. Through transmission mechanism attribute adaptation and torque calibration, a slow, powerful, stable and deep kneading effect is achieved.

[0023] Users trigger commands via the massager's physical buttons, touchscreen, or app. The system parses the command type and matches it with the corresponding control target, identifying three modes that need to be converted into digital signals through preset interaction logic. When a user presses the "mode selection button" twice (preset interaction rules: 1 press = high-frequency impact, 2 presses = rhythmic percussion, 3 presses = deep kneading), the control panel converts the operation into the digital command "01," which is transmitted to the main controller (MCU) via the I2C bus. The MCU calls the "mode command mapping table" pre-stored in Flash, matches "01" to the "rhythmic percussion mode," and marks the core control target—simulating the "fast percussion, slow retraction" hand rhythm, requiring large-amplitude, asymmetrical reciprocating movements of the massage head.

[0024] The pre-stored information is the core basis for control and is stored in the MCU flash memory. It needs to be retrieved precisely according to the mode to ensure that it matches the movement requirements of the massage head. Among them, the target trajectory curve parameters corresponding to the rhythmic tapping mode are as follows: the target trajectory curve is an "asymmetric trapezoidal wave", defining the angle and speed changes over time, with the following parameters: the period is 700ms (including 100ms of downward movement, 50ms of holding the lowest point, and 500ms of upward movement); the angle range is 0°-180°; the speed parameters are 180° / 100ms=1.8° / ms (rapid tapping) in the downward phase, 180° / 500ms=0.36° / ms (slow retraction) in the upward phase, and 0° / ms (brief press, simulating the feeling of human hand pressure) in the lowest point holding phase; the storage format is pre-stored as a discrete data point sequence (e.g., one target angle value is recorded every 10ms, with a total of 70 data points in a 700ms period, which are read by the MCU according to the time axis).

[0025] The basic parameters for the sensorless brushless motor drive corresponding to the rhythmic tapping mode are as follows. These parameters must match the speed requirements of the trajectory curve and be combined with the motion conversion characteristics of the transmission mechanism. Specifically: The starting method is pre-positioning open-loop start (the sensorless brushless motor has no rotor position feedback during the start-up phase, and is set according to the drive rule of pre-positioning to enter the stable commutation range). Assume the transmission mechanism reduction ratio is 1:50 (50 motor rotations correspond to 1 massage head swing), the massage head downward speed is 1.8° / ms = 1080° / s, corresponding to a massage head rotation speed = 1080° / s ÷ 360° / rotation = 3 rotations / s = 180 rpm; motor speed = massage head rotation speed × transmission ratio = 180 rpm × 50 = 9000 rpm (meeting the trajectory downward speed requirement). The maximum current during the start-up phase is 8A (to avoid starting shock damage to the motor), and the rated current during operation is 5A. Sensorless commutation is based on back EMF detection (using the back EMF method to achieve brushless motor commutation control).

[0026] The external angle sensor parameters for the rhythmic tapping mode are as follows, and these parameters must meet the requirement of "millisecond-level precise monitoring," specifically: The sampling period is 0.1ms (data is collected once every 0.1ms to capture the angle change of the massage head at a downward speed of 1.8° / ms, avoiding trajectory deviation). The sensor type is an absolute encoder (model AS5600), communicating with the MCU via an SPI interface. The sensor outputs a 12-bit digital signal (value 0-4095), corresponding to an absolute angle of the massage head from 0° to 360°. The conversion formula is: actual angle θ = (sensor output value ÷ 4095) × 360°. When the sensor output is 2048, θ = (2048 ÷ 4095) × 360° ≈ 180° (the lowest position of the massage head, i.e., the tapping point); when the output is 0, θ = 0° (the highest position).

[0027] The MCU generates two types of executable information: startup mode and hardware driver basic settings. The MCU associates and integrates the parsed instructions with the retrieved parameters to ensure that the hardware starts according to the mode requirements.

[0028] The output settings for the rhythmic hammering mode are as follows: For the mode start command, it is marked "Current mode = rhythmic hammering mode, target trajectory = asymmetric trapezoidal wave (period 700ms, angle 0°-180°), control priority = medium (higher than static mode, lower than emergency stop)", stored in the MCU temporary register as the target identifier for subsequent trajectory control. The basic hardware driver settings are as follows: Motor drive: Startup mode = pre-positioning open loop, initial speed = 9000rpm, current limit = 8A for startup / 5A for operation, commutation logic = back EMF detection. Angle sensor: sampling period = 0.1ms, SPI communication rate = 1MHz (ensuring data transmission speed), signal conversion formula = θ = (output value ÷ 4095) × 360°, sampling data storage address = 0x0001 (MCU internal RAM address, used for temporary storage of real-time angle data).

[0029] Let the mode identifier after parsing the user command be M (M=00=high frequency impact, M=01=rhythmic pounding, M=10=deep kneading); in the pre-stored parameter library, the trajectory parameter index is T(M), the motor parameter index is D(M), and the sensor parameter index is S(M); the mapping rule is that after the MCU recognizes M, it calls the corresponding parameter through the index, and the formula is: target trajectory curve parameter = parameter library [T(M)]; motor drive basic parameter = parameter library [D(M)]; sensor parameter = parameter library [S(M)]. After calling, it checks whether the parameter contains "trajectory period / angle, motor speed / current, sensor sampling period / conversion formula". If it is complete, the setting information is output; if it is missing, the default parameter is triggered (such as the default sampling period of 0.1ms).

[0030] The rhythmic hammering mode algorithm is executed as follows: input M=01; index matching: T(01)=0x02 (address of rhythmic hammering trajectory parameter in parameter library), D(01)=0x05 (motor parameter address), S(01)=0x08 (sensor parameter address); retrieve the asymmetric trapezoidal wave parameter from 0x02, retrieve the 9000rpm motor parameter from 0x05, and retrieve the 0.1ms sampling parameter from 0x08; the verification output is as follows: the parameters are complete, and "rhythmic hammering mode start command + hardware driver setting information" is generated and sent to the motor drive circuit and angle sensor.

[0031] S102, based on the mode start command and hardware driver settings, starts the sensorless brushless motor and triggers the external angle sensor to sample, generating the initial running information of the motor and the real-time angle raw data.

[0032] In one implementation, the starting parameters of the sensorless brushless motor are grouped and categorized according to preset motor starting rules, generating starting modes and associated drive parameter information corresponding to each rule. Since the sensorless brushless motor lacks internal Hall sensors, specific rules such as "pre-positioning start" and "soft start" are needed to avoid starting failure during the starting phase. Therefore, starting parameters (such as starting current, pre-positioning angle, and acceleration time) need to be grouped according to preset rules to correspond to different starting modes, ensuring compatibility with the torque / speed requirements of the massage mode.

[0033] The pre-stored "motor start rule library" in the MCU contains three core start modes, corresponding to the drive requirements of different massage modes. For pre-positioning open-loop start, suitable for modes requiring precise initial positioning such as "rhythmic pounding" and "deep kneading," the stator windings are energized to fix the rotor at a preset angle (avoiding commutation errors caused by random rotor position during startup), before entering the acceleration phase. For soft start, suitable for the "high-frequency impact" mode, the PWM duty cycle is gradually increased to reduce the starting current, avoiding current surges during high-frequency, high-speed startup. For emergency restart mode, suitable for retry scenarios after startup failure, the starting current threshold is reduced, and the pre-positioning time is extended.

[0034] Based on the requirement that "the rhythmic tapping mode needs to be started at medium speed and medium torque, and the initial position of the massage head needs to be precisely aligned with 0° (the highest position)," the "pre-positioning open-loop start" rule is matched, and the following information is generated in groups: the start mode is pre-positioning open-loop start (rule identifier: S02); the associated drive parameters are as follows: the pre-positioning parameters are stator winding energizing voltage of 12V, pre-positioning angle of 0° (corresponding to the highest position of the massage head), and pre-positioning holding time of 200ms (to ensure that the rotor is stably in place).

[0035] The starting current parameters are as follows: maximum current of 8A during the starting phase (to avoid impact), and current ramp-up time of 50ms (linearly increasing from 5A to 8A). The acceleration parameters are: target starting speed of 9000rpm (matching the motor speed in the previously mentioned rhythmic hammering mode), and acceleration time of 300ms (linearly increasing from 0rpm to 9000rpm to avoid sudden speed increases causing trajectory deviation). The commutation parameters are: back EMF detection threshold of 1.2V (the rotor position judgment standard for sensorless commutation), and initial commutation frequency of 500Hz (increasing synchronously with speed increase).

[0036] Based on sampling requirements, the sampling content of the external angle sensor is arranged and designed, obtaining sampling standards, data types, and acquisition range information to generate sensor sampling design information. The external angle sensor's sampling content needs to be designed according to the "trajectory accuracy requirements" of the massage mode, clearly defining "what to sample, how to sample, and the sampling range" to ensure that real-time angle data accurately reflects the massage head's movement state and avoids trajectory monitoring deviations due to sampling mismatch. Sampling requirements analysis (rhythmic percussion mode): The trajectory characteristics of the rhythmic percussion mode are "asymmetric trapezoidal wave (downward 100ms, hold 50ms, upward 500ms), angle range 0°-180°, downward speed 1.8° / ms," which must meet the following requirements: The downward phase is fast, requiring high-frequency sampling to capture rapid angle changes; specifically, the speed is 0 during the lowest point hold phase, requiring precise sampling to confirm position stability; the angle acquisition range must cover 0°-180°, and the data type must support absolute angle calculation.

[0037] Based on the above requirements, the sensor sampling design information for the rhythmic hammering mode is as follows: Sampling frequency is 10kHz (i.e., sampling period of 0.1ms, matching the control period of the M-method speed measurement mentioned earlier, ensuring that at a speed of 1.8° / ms during the downlink phase, data is collected once every 0.1ms, with an angle change of 0.18° and no data loss); sampling accuracy is 12 bits (consistent with the output accuracy of the absolute encoder AS5600, ensuring an angle resolution of 360° / 4095≈0.088°, meeting the trajectory accuracy requirements); the deviation between two consecutive sampling data is ≤0.5° (to filter out sensor noise and avoid misjudgment).

[0038] The raw data is a 12-bit digital signal (transmitted via SPI interface, value range 0-4095); the converted data is an absolute angle value (unit: degree, retained to 1 decimal place) and an angle change Δθ (unit: degree, retained to 2 decimal places); the acquisition range is as follows: physical angle range: 0°-180° (corresponding to the highest position of the massage head from 0° to the lowest position from 180°, consistent with the angle range of the trajectory curve); when the sampling angle is <0° or >180°, an "out-of-range warning" is triggered (to avoid damage to the transmission mechanism due to exceeding limits).

[0039] Based on the operational planning and trajectory monitoring requirements, corresponding sampling verification nodes are set for the sensor sampling design information of each startup rule. These sampling verification nodes are "critical time / position nodes during the motor startup phase," and must be set in conjunction with the motor startup steps (such as pre-positioning, acceleration, and stable operation) and key trajectory monitoring points (such as initial position and turning points) to ensure the validity of the sampling data is verified at critical nodes, preventing startup anomalies from causing subsequent trajectory deviations. The verification nodes for each startup mode must cover three stages: "before startup," "during startup," and "after startup," corresponding to the critical states of motor startup. Pre-start verification: confirms whether the initial sensor sampling values ​​match the pre-positioning angle; During startup verification: verifies whether the sampling frequency matches the angle change during the acceleration phase; After startup verification: verifies whether the sampling data conforms to the initial trajectory state during the stable operation phase.

[0040] The sampling verification nodes for the rhythmic tapping mode are set as follows: combining the "pre-positioning open-loop start" process and the trajectory monitoring requirements of the rhythmic tapping mode, three core verification nodes are set. Verification Node 1: Pre-positioning completion verification (time node: 200ms after start, i.e., when the pre-positioning hold ends); the verification requirement is to confirm whether the massage head accurately stops at the pre-positioning angle of 0° (initial trajectory position); the verification standard is that the angle values ​​of 5 consecutive samples are all within the range of 0°±0.2°, and the angular velocity is ≤0.1° / ms (confirming stable position and no drift); the abnormal handling is as follows: if the angle deviation is >0.2°, the MCU re-executes the pre-positioning process until the standard is met.

[0041] Verification Node 2: Acceleration Phase Verification (Time Node: 500ms after startup, i.e., at the end of the 300ms acceleration time); The verification requirement is to confirm whether the sampling frequency matches the angle change when the motor speed reaches 9000rpm (theoretically, 9000rpm corresponds to 25 revolutions per second for the motor, a transmission ratio of 1:50, 0.5 revolutions per second for the massage head, and an angular velocity of 180° / s = 0.18° / ms, which matches the sampling period of 0.1ms). The verification standard is that the angle change Δθ in 10 consecutive samples is within the range of 0.17°-0.19° (consistent with the theoretical value of 0.18°); if the Δθ deviation is >0.02°, the MCU adjusts the PWM duty cycle to correct the motor speed.

[0042] Verification Node 3: Stable Operation Startup Verification (Time Node: 800ms after startup, i.e., when entering the first cycle of the rhythmic tapping mode). The verification requirement is to confirm that the sampled data accurately reflects the initial state of the trajectory (massage head at 0°, ready to descend). The verification criteria are: sampling angle = 0° ± 0.1°, angular velocity = 0° / ms (initial stationary state), and no packet loss in sensor communication; if these conditions are not met, pause mode will be started, and a "sensor fault" message will be output.

[0043] The motor start-up grouping results, sensor sampling design information, and sampling verification nodes are processed to generate initial motor operation information and real-time angle raw data, including start-up rule grouping information, sampling schemes, and verification standards. The three types of information—"motor start-up grouping results," "sensor sampling design information," and "sampling verification nodes"—are integrated according to a preset format to generate structured data containing "start-up rules, sampling schemes, and verification standards." This data serves as both the driving basis for motor start-up and a template for storing / processing the raw data collected by the angle sensor. The integration adopts a "layered storage" structure, divided into "start-up rule layer," "sampling scheme layer," and "verification standard layer." Each layer contains identifiers, parameters, and exception handling strategies, ensuring that the MCU can access data layer by layer. Start-up rule layer: stores start-up mode identifiers and associated driving parameters; Sampling scheme layer: stores sampling standards, data types, and acquisition range; Verification standard layer: stores the time / location, verification standard, and exception handling method for each verification node.

[0044] The integrated data for the initial motor operation information and real-time angle raw data in the rhythmic hammering mode is as follows: Initial motor operation information is grouped according to starting rules: Starting mode = pre-positioning open-loop start (identified by S02), pre-positioning parameters (12V / 0° / 200ms), starting current parameters (8A / 50ms), acceleration parameters (9000rpm / 300ms), commutation parameters (1.2V / 500Hz). Sampling frequency: 10kHz (0.1ms), sampling precision: 12 bits, data type: (12-bit digital signal / absolute angle value), acquisition range: 0°-180°. Verification node 1 (200ms / 0°±0.2° / repositioning), verification node 2 (500ms / Δθ0.17°-0.19° / PWM adjustment), verification node 3 (800ms / 0°±0.1° / fault indication).

[0045] Real-time angle raw data (typical data example within 800ms after startup): Verification node 1 (200ms): Sampled raw value = 0 (corresponding angle 0°), 5 consecutive sampled values ​​= 0 / 0 / 0 / 0 / 0 → angle 0.0°, meeting the verification standard. Verification node 2 (500ms): Sampled raw values ​​are 7 / 9 / 8 / 10 / 9 (corresponding angles 0.62° / 0.79° / 0.71° / 0.88° / 0.79°), Δθ is 0.17° / 0.18° / 0.17° / 0.19° / 0.18°, meeting the verification standard. Verification node 3 (800ms): Sampled raw value = 0 (corresponding angle 0.0°), angular velocity = 0° / ms → meeting the verification standard, can enter the trajectory running stage of rhythmic hammering mode.

[0046] S103 receives the pre-stored target trajectory curve algorithm and angle data processing rules, processes the initial running information of the motor and the real-time angle raw data, calculates the actual angular velocity through differential calculation, and generates the actual motion trajectory information and the target trajectory comparison reference information.

[0047] In one implementation, pre-stored target trajectory curve algorithms are grouped and categorized according to preset mode-trajectory mapping rules, generating trajectory types and associated mathematical model information corresponding to each rule. The preset mode-trajectory mapping rules are as follows, with the core rule being the correspondence between "massage mode requirements → trajectory motion characteristics → algorithm type," pre-stored in a "mode-trajectory mapping table" (Flash storage). Key rules are as follows: For the high-frequency impact mode, the requirement is "high-frequency, small-amplitude impact" → trajectory characteristics are "high-frequency, small-angle reciprocating motion" → algorithm type is "high-frequency sine wave algorithm." For the rhythmic tapping mode, the requirement is "fast tapping, slow withdrawal, large amplitude" → trajectory characteristics are "asymmetric reciprocating motion" → algorithm type is "asymmetric trapezoidal wave algorithm." For the deep kneading mode, the requirement is "low-speed, large-amplitude smooth pressing" → trajectory characteristics are "low-speed, large-amplitude reciprocating motion" → algorithm type is "large-amplitude sine wave algorithm."

[0048] The pre-stored "Mode-Trajectory Mapping Table" clearly states that the deep kneading mode must simulate the experience of "slow, deep kneading by hand," and the trajectory must meet the characteristics of "low-speed reciprocating motion, large amplitude, and stable high torque output at the deepest point of pressure," corresponding to the "large-amplitude sine wave trajectory algorithm." This algorithm uses a sine function to describe the smooth change of the massage head angle over time, ensuring a smooth, seamless movement. Based on the above rules, the grouping of the deep kneading mode generates the following information: the trajectory type is a large-amplitude sine wave trajectory (characteristics: long period, large amplitude, smooth speed change with angle, peaks / troughs corresponding to the deepest / highest point of pressure), and the sine wave formula θ_target(k)=A*sin(2π*f*t(k)+φ), where each parameter is defined as follows: amplitude A is 30° (corresponding to a massage head angle range of 30°~30°, 30° being the deepest point of pressure, and -30° being the highest point of upward movement); frequency... f is 0.5Hz (period T=1 / f=2 seconds); the initial phase φ is π / 2 (ensuring that when t=0, θ_{target}(0)=30°sin(π / 2)=30°, that is, the movement starts from the deepest point of the press, which meets the requirement of the mode "deep press first and then back and forth"); A=30°, f=0.5Hz, φ=π / 2 and the sine function expression are pre-stored in the MCU flash memory (address: 0x0020). When the user selects the deep kneading mode, the MCU directly calls the parameters and functions at this address.

[0049] Based on data analysis requirements, the calculation content of the angle data processing rules is arranged and designed, acquiring calculation standards, data types, and derivation range information to generate angle data processing design information. The deep kneading mode requires precise acquisition of the actual angle and angular velocity of the massage head through an angle sensor, especially the position and speed information of the deepest pressing point (30°). Angle data processing rules need to be designed based on this requirement to ensure that the processed data accurately reflects the motion state of the massage head, providing a basis for torque control. Low-speed movement (maximum angular velocity 0.314° / ms, calculated from the sine wave derivative): Under these conditions, it is necessary to accurately capture angle changes, especially the speed at the peak / trough (theoretically 0), to ensure that the motor can output maximum torque at the deepest point; a special requirement is to filter out sensor noise to avoid incorrect torque adjustment due to data fluctuations.

[0050] Based on the above requirements, the following processing design information is generated: Absolute angle calculation standard: Using a linear mapping method, the 12-bit raw value D (range 0-4095) output by the external angle sensor (absolute encoder, such as AS5600) is converted into an absolute angle of -30° to 30°. The formula is as follows: (Because the massage head's range of motion is -30° to 30°, corresponding to the sensor's original value range of 0-4095, such as when D=4095, =30°; when D=2048, =0°); Actual angular velocity calculation standard: using "M-method velocity measurement", with a fixed control period. =0.1ms, calculate the angle difference between adjacent cycles. Then through the formula Calculate angular velocity, such as When =0.00942°, =0.00942° / 0.1ms=0.0942° / ms; Noise filtering standard: Using moving average filtering, the angular velocity values ​​of 5 consecutive cycles are averaged, and the formula is: =[ ] / 5, to filter out instantaneous data deviations caused by sensor jitter.

[0051] The raw data is a 12-bit unsigned integer (transmitted by the sensor via the SPI interface and stored in the MCU's 16-bit data register). The processed data is as follows: absolute angle (single-precision floating-point number, unit °, rounded to 2 decimal places, e.g., 29.53°), actual angular velocity (single-precision floating-point number, unit ° / ms, rounded to 5 decimal places, e.g., 0.09420° / ms), and filtered angular velocity (single-precision floating-point number, unit ° / ms, rounded to 5 decimal places). The angle derivation range is -30° to 30° (if it exceeds this range, it is marked "angle out of bounds," triggering the motor emergency stop protection to prevent damage to the transmission mechanism); the angular velocity derivation range is 0° / ms to 0.1° / ms (if it exceeds this range, it is judged as "speed abnormal," and the PWM duty cycle is adjusted to reduce the speed to ensure it meets the low-speed requirements of the deep kneading mode).

[0052] Based on the operational requirements and trajectory accuracy requirements of each mode, corresponding trajectory calibration nodes are set for the angle data processing design information of each rule. The core of trajectory accuracy in the deep kneading mode lies in the "positional accuracy of the deepest point (30°) and the highest point (-30°)" and the "speed control at the peak / trough". Calibration nodes need to be set according to the mode operation stage (such as deep pressure, upward movement, shallow pressure, downward movement) to verify the deviation between actual data and target data at key positions and ensure that the trajectory is not deviated. According to the sinusoidal trajectory characteristics of the deep kneading mode, the calibration nodes need to cover three key positions: "peak (deepest point), trough (highest point), and trajectory midpoint". Each node corresponds to different accuracy requirements, as follows: For peak / trough nodes: extremely high positional accuracy (±0.15°) and speed accuracy (±0.005° / ms) are required to ensure that the deepest point can stably output high torque; for trajectory midpoint nodes: medium positional accuracy (±0.2°) is required to ensure smooth motion transition.

[0053] For the deep kneading mode, three core calibration nodes are set, as follows: Calibration node 1: Peak calibration (pressing the deepest point, time node t=0.5s, corresponding to a target angle of 30°). This ensures that when the massage head reaches the deepest point, the angle is accurate and the speed drops to the theoretical value of 0° / ms, preparing for high torque output; the calibration standard is the actual angle. Within a range of 30° ± 0.15°, the filtered angular velocity ≤0.005° / ms (close to 0, conforming to the peak speed characteristics of a sine wave); if the angle deviation is >0.15°, the MCU fine-tunes the PWM duty cycle through the PID algorithm (e.g., increasing the duty cycle by 0.5%) to drive the motor to rotate to the target angle; if the speed does not drop below 0.005° / ms, the deceleration PWM signal is increased to extend the deceleration time.

[0054] For calibration node 2: trajectory midpoint calibration (time node t=1.0s, corresponding to target angle 0°); confirm that when the massage head moves from the deepest point to the midpoint, the angle and speed conform to the sine wave target value, ensuring smooth movement. Actual angle Within the range of 0°±0.2°, the target angular velocity =0.0942° / ms (maximum velocity at the midpoint of the sine wave), the actual angular velocity deviates from the target value by ≤0.008° / ms. If the angle deviation is >0.2°, adjust the PWM frequency for the second half of the cycle; if the speed deviation exceeds the limit, correct the current-torque mapping coefficient.

[0055] For calibration node 3: trough calibration (highest point of upward movement, time node t=1.5s, corresponding to target angle -30°). Confirm that when the massage head reaches its highest point, the angle is accurate and the speed drops to 0° / ms, preparing for the downward deep massage; actual angle... Within the range of -30°±0.15°, the filtered angular velocity ≤0.005° / ms. If the angle deviation is >0.15°, trigger torque compensation (e.g., increase motor current by 0.3A); if the speed does not meet the standard, adjust the PWM duty cycle in the upward phase to reduce the upward speed.

[0056] The trajectory algorithm grouping results, angle data processing design information, and trajectory calibration nodes are processed to generate actual motion trajectory information and target trajectory comparison benchmark information, which include algorithm grouping information, data processing schemes, and calibration standards. The "trajectory algorithm grouping results of the deep kneading mode," "angle data processing design information," and "trajectory calibration nodes" are integrated according to the logic of "target benchmark - actual processing - calibration assurance" to generate structured data: the target trajectory comparison benchmark information is used to clarify the ideal trajectory parameters, and the actual motion trajectory information is used to guide actual data processing; the combination of the two provides the basis for error calculation in closed-loop control. A "three-layer structured storage" is adopted, with each layer associated with the deep kneading mode identifier (M03) to ensure accurate MCU access. For the target trajectory benchmark layer, the trajectory type, mathematical model, and target parameters (such as period and amplitude) are stored; for the actual trajectory processing layer, the angle calculation standard, data type, derivation range, and filtering rules are stored; for the calibration execution layer, the time, standard, and anomaly handling strategy for each calibration node are stored.

[0057] The generated "actual motion trajectory information and target trajectory comparison benchmark information" are as follows: Target trajectory comparison benchmark information is as follows: Trajectory type = large amplitude sine wave, mathematical model... Target parameters (period 2s, amplitude 30°, initial phase) The deviation comparison thresholds are as follows: position deviation ≤ 0.2°, speed deviation ≤ 0.008° / ms (if these values ​​are exceeded, it is determined that PID adjustment is required).

[0058] The actual motion trajectory information is as follows, angle calculation Angular velocity calculation Five-times moving average filtering. The calibration criteria are as follows: three calibration nodes (t=0.5s: 30°±0.15°; t=1.0s: 0°±0.2°; t=1.5s: -30°±0.15°), and anomaly handling strategies (PWM fine-tuning, torque compensation).

[0059] At t=0.5s (peak node), the MCU calculates the actual angle as 29.87° and the filtered angular velocity as 0.003° / ms according to the data processing scheme. Compared with the target angle of 30° and the target velocity of 0° / ms, the position error is 0.13° (≤0.15°) and the velocity error is 0.003° / ms (≤0.005° / ms). The calibration is successful. Subsequently, the MCU outputs a high duty cycle PWM signal (80% duty cycle) to instruct the motor to output the maximum static torque, thereby achieving a deep kneading "top pressure" sensation.

[0060] S104 processes the reference information by comparing the actual motion trajectory information with the target trajectory based on the closed-loop control rules, calculates the difference between the actual angle / angular velocity and the target angle / angular velocity to generate an error signal, and generates PWM command adjustment information through a PID controller or FOC vector control algorithm.

[0061] In one implementation, based on preset mode-error calculation rules, the actual motion trajectory information and the target trajectory comparison reference information are grouped and categorized to generate error types and associated calculation parameter information corresponding to each rule. The error of the deep kneading mode originates from the "deviation between the actual angle / angular velocity and the target trajectory." The error needs to be grouped according to preset rules, and the definition, calculation method, and associated parameters of each error need to be clearly defined to ensure that the error classification matches the mode's requirement of "low-speed deep kneading and high torque stability." The "mode-error calculation rule library" pre-stored in the MCU clearly states that the deep kneading mode needs to focus on monitoring two types of errors: position error (affecting the accuracy of pressing depth) and speed error (affecting the smoothness of motion and the timing of torque output). Both types of errors need to be calculated based on the instantaneous algebraic difference between the target trajectory and the actual feedback, and the associated parameters need to match the characteristics of a sinusoidal trajectory.

[0062] Based on the above rules, the following information is generated for grouping: For error type 1: position error The deviation between the actual angle and the target angle of the massage head directly affects the accuracy of the deepest pressure point (30°), and is a core criterion for determining high torque output. Related calculation parameters, target angle... (A=30°, f=0.5Hz) = / 2); Actual angle (D is the 12-bit raw value of the sensor). Based on the instantaneous algebra difference rule, it can be calculated that... When t=0.5s, =30°, =29.87°, then =+0.13°, a positive error indicates that the actual position is behind the target; the error threshold is ±0.15° (deepest / highest point of pressure) and ±0.2° (midpoint of the trajectory), exceeding which will trigger PWM adjustment.

[0063] For error type 2: speed error The deviation between the actual angular velocity and the target angular velocity of the massage head affects the smoothness of the motion, especially at peaks / troughs where the velocity needs to approach zero to stably output high torque. Target angular velocity It is obtained by differentiating the sine wave trajectory. When t=1.0s, =0.0942° / ms; actual angular velocity Speed ​​calculation based on the M method ,in, =0.1ms. , specifically 0.0092° / ms, then Based on error calculation logic, , 0.0942° / ms =0.092° / ms, then =+0.0022° / ms, a positive error indicates that the actual speed is lagging behind the target; the error threshold is ±0.005° / ms (peak / trough) and ±0.008° / ms (midpoint of the trajectory). If these values ​​are exceeded, the PWM frequency / duty cycle adjustment will be triggered.

[0064] Based on the closed-loop control requirements, the processing content of the error signal is arranged and designed. The calculation standard, error correction method, and adjustment range information are obtained to generate error signal processing design information. The closed-loop control of the deep kneading mode needs to "precisely correct errors and avoid torque fluctuations." Therefore, the calculation standard, correction method, and adjustment range of the error signal must be designed based on this requirement to ensure that the processed error signal can directly guide PWM adjustment and conforms to the low-speed, high-torque operating characteristics of the mode.

[0065] For the deep kneading mode, positional errors need to be corrected first (to ensure pressing depth), while speed errors need to be corrected smoothly (to avoid jerky movements). Furthermore, the motor torque must be kept stable during the correction process (especially at the deepest point of pressure). In addition, error correction must be combined with the current-torque mapping relationship to avoid over-adjustment that could overload the motor.

[0066] Based on the above requirements, the processing design information is generated as follows: instantaneous algebraic difference is used, curve fitting is not performed, and calculation is performed once per control cycle (0.1ms). The result should be rounded to two decimal places (e.g., +0.13°) and subjected to five moving average filters (to remove sensor noise, the formula is...). The speed error calculation standard also uses the "instantaneous algebraic difference" for calculation. The result should be rounded to 5 decimal places (e.g., +0.00220° / ms) and then compared with the filtered angular velocity. Correlation calculations ensure that the error value reflects the true speed deviation.

[0067] For position error correction, the outer loop (position loop) of cascade PID control is used, based on the formula... The position error is converted into a new target speed, driving the motor to track the target position. =+0.13°), then For speed error correction, the inner loop (speed loop) of cascaded PID control is used. The PWM duty cycle adjustment is calculated based on the PI algorithm, with the formula Output(k) = ,in, = , ( =0.5 (the proportional term provides a fast response). , 。

[0068] The adjustment range information is as follows: Position error adjustment range: -0.3°~+0.3° (if exceeded, it is judged as "serious deviation", triggering emergency stop protection to avoid damage to the transmission mechanism). Speed ​​error adjustment range is as follows: -0.02° / ms~+0.02° / ms (if exceeded, it is judged as "speed abnormality", reducing the PWM frequency to below 500Hz to limit the motor speed); PWM duty cycle adjustment range is as follows: 20%~80% (corresponding to motor current 2A~8A, matching the torque requirement of 2A~8A for deep kneading mode, avoiding excessive current causing motor overheating).

[0069] Based on the operating conditions and motor control requirements of each mode, corresponding PWM adjustment confirmation nodes are set for the error signal processing design information of each rule. The operating conditions of the deep kneading mode are divided into four stages: "deep pressure (peak), upward movement, shallow pressure (trough), and downward movement." The motor torque requirements and error sensitivity differ in different stages, so PWM adjustment confirmation nodes need to be set for each stage to ensure accurate adjustment timing without affecting the massage experience. For the deep kneading mode, in the peak / trough stage: high torque stability is required, and PWM adjustment is only confirmed when the error exceeds the limit (to avoid torque fluctuations). In the midpoint stage of the trajectory: smooth movement is required, and adjustment is confirmed when the error exceeds the threshold (to ensure speed matches the target). The confirmation node must include "time / position trigger conditions, error verification standards, and post-adjustment confirmation logic" to ensure the adjustment is effective.

[0070] Specifically, the PWM adjustment confirmation nodes for the deep kneading mode are set as follows. Based on the above logic, three core confirmation nodes are set. Confirmation Node 1: Peak PWM Adjustment Confirmation (press the deepest point, time node t=0.5s, target angle 30°); the trigger condition is position error. The deviation must be greater than +0.15° or less than -0.15°, and last for two control cycles (0.2ms). The verification criteria are as follows: confirm that the error is not caused by sensor noise (the error exceeds the limit after two consecutive filtering cycles), and that the current motor current is ≤8A (not reaching the overload threshold). If the conditions are met, confirm that the PWM duty cycle adjustment amount Output(k) is superimposed on the current duty cycle (e.g., if the current duty cycle is 60% and Output=+5, then the adjusted duty cycle is 65%), and verify whether the angle deviation has decreased one cycle (0.1ms) after the adjustment.

[0071] Confirmation Node 2: Confirmation of PWM adjustment at the midpoint of the trajectory (time node t=1.0s, target angle 0°). Trigger condition is speed error. >+0.008° / ms or <-0.008° / ms; the verification standard is as follows: the deviation between the actual angular velocity and the target value lasts for one control cycle, and the current PWM frequency is 1000Hz (default frequency at the midpoint stage). Confirm that the PWM frequency is adjusted to 800Hz~1200Hz (corresponding to a speed adjustment range of 0.08° / ms~0.1° / ms), and after adjustment, verify whether the speed deviation is ≤0.005° / ms.

[0072] Confirmation Node 3: PWM Adjustment Confirmation at the Valley (Highest point of upward movement, time node t=1.5s, target angle -30°). Trigger condition is position error. > +0.15° or < -0.15°, or speed error > +0.005° / ms; the verification standard is that the error exceeds the limit and the current motor torque is < 5N. m (maximum static torque not reached). Confirm that increasing the PWM duty cycle (e.g., +3%) will improve torque, while reducing the PWM frequency to 600Hz to ensure the massage head descends smoothly. After adjustment, check if the angle returns to -30°±0.1°.

[0073] The error grouping results, error signal processing design information, and PWM adjustment confirmation nodes are processed to generate error signal and PWM command adjustment information containing error grouping information, processing schemes, and confirmation standards. The "error grouping results of deep kneading mode," "error signal processing design information," and "PWM adjustment confirmation nodes" are integrated according to the logic of "error definition - processing method - adjustment confirmation" to generate structured data. This clarifies the basis for error signal calculation and correction, and defines the adjustment standards for PWM commands, providing precise guidance for motor drive. A "three-layer associated storage" approach is adopted, with each layer bound to a deep kneading mode identifier (M03) to ensure that the MCU can call it according to operating conditions. Error grouping layer: stores error type, calculation parameters, and threshold; processing design layer: stores calculation standards, correction methods, and adjustment range; confirmation node layer: stores trigger conditions, verification standards, and adjustment logic. The generated "error signal and PWM command adjustment information" is as follows: Error grouping information is as follows... Threshold ±0.15° (peak / trough) / ±0.2° (midpoint), associated parameters A=30°, f=0.5Hz. Velocity error. Threshold ±0.005° / ms (peak / trough) / ±0.008° / ms (midpoint), associated parameters t=0.1ms, filtering times: 5.

[0074] The processing solution information is as follows: Position error correction: Convert position error into target velocity; velocity error correction: Output= Calculate the PWM duty cycle adjustment; the adjustment range is PWM duty cycle 20%~80%, frequency 500Hz~1200Hz. The following standard information is used for confirmation: Peak confirmation: if the error exceeds ±0.15° and lasts for 0.2ms, adjust the duty cycle to ±5%, and verify the angle after one cycle; Midpoint confirmation: if the speed error exceeds ±0.008° / ms, adjust the frequency to ±200Hz, and verify the speed deviation ≤0.005° / ms; Trough confirmation: if the angle exceeds ±0.15° or the speed exceeds ±0.005° / ms, adjust the duty cycle +3%, increase the frequency to 600Hz, and verify the angle returns to -30°±0.1°.

[0075] At t=0.5s (peak phase): Error signal =30°, =29.87° =+0.13° (after filtering) =+0.12°); PWM adjustment calculation is as follows, 0.36° / ms; =0.36° / ms-0.003° / ms=0.357° / ms, Output=0.5 0.357 + 0.1 0.357 0.001≈0.1785; The node triggering is confirmed as follows: if the error does not exceed ±0.15°, no adjustment is triggered, maintaining the current PWM duty cycle of 70% (outputting 6A current, corresponding to 6N). (m torque) to ensure a stable "top pressure" sensation at the deepest point of pressure.

[0076] S105 processes the PWM command adjustment information and the motor drive circuit status information to generate motor torque and speed control operation information.

[0077] In one implementation, PWM command adjustment information and motor drive circuit status information are obtained based on motor control commands, and the integrity of PWM parameters, stability of drive circuit operation, and current-torque correlation characteristics are extracted. Motor control in deep kneading mode relies on "PWM command adjustment information" (to guide motor action) and "motor drive circuit status information" (to ensure operational safety). Key features need to be extracted from these two types of information to provide a basis for subsequent verification and control. The PWM command adjustment information comes from the "error signal and PWM command adjustment information" generated by the preceding closed-loop control, including parameters such as the PWM duty cycle adjustment amount (e.g., +3%), target frequency (e.g., 800Hz), and phase timing in deep kneading mode. The motor drive circuit status information is collected in real time by current sensors, voltage sensors, and temperature sensors in the drive circuit, including data such as circuit output current, bus voltage, and MOSFET device temperature.

[0078] Based on the above information, three types of features are extracted as follows: Regarding the PWM parameter completeness feature: whether the key parameters included in the PWM instruction are complete and standardized, specifically the current duty cycle is 45% (before adjustment), the target duty cycle is 48% (adjustment amount +3%), the target frequency is 800Hz, and the phase timing is "high-level first edge aligned," with no missing parameters, but further verification is needed to check for any anomalies. Regarding the drive circuit operating condition stability feature: whether the current operating state of the circuit is stable, specifically the output current is 6.2A (the current corresponding to the typical torque in deep kneading mode), the bus voltage is 12.1V (rated voltage 12V), and the MOSFET device temperature is 42℃ (safety threshold 60℃), with no significant fluctuations found so far. Regarding the current-torque correlation feature: the matching relationship between the circuit output current and the actual torque of the motor, and whether the torque meets the mode requirements, specifically the theoretical torque of 6.2N corresponding to the current current of 6.2A. m (based on a pre-stored "current-torque mapping table"), the deep kneading mode requires a torque of 6N to press the deepest point. m, it is necessary to confirm whether the mapping matches and whether the torque meets the standard.

[0079] The integrity of PWM parameters is verified to identify duty cycle / frequency anomalies and phase deviations, generating effective coefficients for the PWM parameters. The integrity of PWM parameters directly affects the accuracy of motor operation; therefore, it is necessary to verify whether the duty cycle, frequency, and phase meet the control requirements of the deep kneading mode. Parameter effectiveness is quantified using effective coefficients (coefficient range 0-1, 1 for fully effective). The verification logic and standards (for deep kneading mode adaptation) are as follows: For duty cycle anomaly verification: the normal range for the PWM duty cycle in deep kneading mode is 20%-80% (corresponding to a current of 2A-8A); exceeding this range indicates an anomaly. For frequency anomaly verification: the required frequency for the mode is 500Hz-1200Hz (matching low-speed motion); deviation from this range indicates an anomaly. For phase deviation verification: the phase timing must be synchronized with the motor commutation logic (commutation time based on back EMF detection); a deviation > 5° indicates an anomaly.

[0080] Taking the extracted PWM parameters (current duty cycle 45%, target duty cycle 48%, frequency 800Hz, phase deviation 3°) as an example: For duty cycle verification: the target duty cycle of 48% is within the 20%-80% range, with no abnormalities, and a duty cycle validity score of 0.95. For frequency verification: 800Hz is within the 500Hz-1200Hz range, meeting the mode requirements, and a frequency validity score of 1.0. For phase verification: the phase deviation of 3° < 5°, indicating good commutation synchronization, and a phase validity score of 0.98. The effective coefficients of the PWM parameters are calculated using a weighted average method, with duty cycle, frequency, and phase weights of 0.4, 0.3, and 0.3 respectively. The coefficient = 0.95 × 0.4 + 1.0 × 0.3 + 0.98 × 0.3 = 0.974 (close to 1, indicating good parameter integrity).

[0081] The stability characteristics of the drive circuit under operating conditions are verified, checking for current / voltage fluctuations and temperature exceeding limits, and generating a stability factor. The stability of the drive circuit determines the safety and reliability of motor operation. It is necessary to check whether current, voltage fluctuations, and temperature exceed limits, quantifying the operating conditions using the stability factor (factor range 0-1, 1 being fully stable). The deep kneading mode adaptation is as follows: For current fluctuation verification: the mode requires current fluctuation ≤ ±0.3A (to avoid sudden torque changes); exceeding this indicates instability. For voltage fluctuation verification: bus voltage fluctuation ≤ ±0.5V (to ensure stable motor power supply); exceeding this indicates instability. For temperature exceeding limits verification: MOSFET device temperature ≤ 60℃ (safety threshold); exceeding this triggers protection and indicates instability.

[0082] Taking the extracted circuit state (current 6.2A, voltage 12.1V, temperature 42℃) as an example, continuous monitoring was performed for 5 control cycles (0.5ms). For current fluctuation verification: the current for the 5 cycles was 6.2A, 6.3A, 6.1A, 6.2A, and 6.2A respectively, with a maximum fluctuation of 0.2A ≤ ±0.3A, resulting in a current stability score of 1.0. For voltage fluctuation verification: the voltage for the 5 cycles was 12.1V, 12.0V, 12.2V, 12.1V, and 12.1V respectively, with a maximum fluctuation of 0.2V ≤ ±0.5V, resulting in a voltage stability score of 1.0. For temperature verification: 42℃ < 60℃, no exceedances, resulting in a temperature stability score of 1.0. The operating condition stability factor was calculated using the arithmetic mean method: factor = (1.0 + 1.0 + 1.0) / 3 = 1.0 (completely stable operating condition).

[0083] The current-torque correlation characteristics are checked to confirm the mapping matching between current and torque, and the consistency between torque output and mode requirements, generating a torque matching coefficient. The current-torque correlation directly affects the accuracy of massage intensity; it is necessary to confirm whether the current-torque mapping is accurate and whether the torque meets the mode requirements. The correlation is quantified using a matching coefficient (coefficient range 0-1, 1 for perfect match). For deep kneading mode adaptation, the mapping matching is checked as follows: a pre-stored "current-torque mapping table" (e.g., 2A→2N) is used. m、5A→5N m、8A→8N (m), the deviation between the theoretical torque corresponding to the actual current and the motor output torque is ≤ ±0.2N. If m is the match, then it is determined. Mode requirement consistency check: The actual output torque of the motor must meet the requirements of the current stage of the mode (e.g., 5-7N is required for the deepest press). m), deviation ≤ ±0.3N m is considered consistent.

[0084] Taking the "press the deepest point" stage of the deep kneading mode as an example: Regarding the mapping matching check, the current is 6.2A, and the theoretical torque is 6.2N according to the mapping table. The measured motor output torque was 6.1 N, determined by a torque sensor. m, deviation 0.1N m≤±0.2N m, mapping matching score 0.98. For pattern requirement consistency verification, the required torque for pressing the deepest point is 6N. m, measured torque 6.1N m, deviation 0.1N m≤±0.3N m, demand consistency score 0.99. For the torque matching coefficient calculation, the weighted average method is used, with mapping matching and demand consistency weights of 0.6 and 0.4 respectively, and coefficient = 0.98×0.6+0.99×0.4=0.984 (high matching degree).

[0085] Based on preset motor control rules, the effective coefficients of PWM parameters, operating condition stability factors, and torque matching coefficients are processed. A PWM parameter repair mechanism is used to improve the signal structure, current closed-loop regulation technology stabilizes the drive conditions, and a torque calibration algorithm corrects output deviations, generating pre-processed motor control results. In conjunction with the control requirements of the deep kneading mode, coefficients are processed through three mechanisms: PWM parameter repair, current closed-loop regulation, and torque calibration, to ensure accurate and stable motor output. For the PWM parameter repair mechanism, if the effective coefficient is <0.9, abnormal parameters are repaired (e.g., truncation to the threshold when the duty cycle exceeds the limit, fine-tuning the clock signal when there is frequency deviation). For the current closed-loop regulation technology, if the operating condition stability factor is <0.95, the circuit current is adjusted using a PI algorithm (e.g., adding a filtering stage when current fluctuations exceed the limit). For the torque calibration algorithm, if the torque matching coefficient is <0.95, the current-torque mapping relationship is corrected based on the deviation (e.g., adding current compensation if the measured torque is too low).

[0086] Based on the aforementioned coefficients (effective coefficient 0.974, stability factor 1.0, matching coefficient 0.984), the processing procedure is as follows: For PWM parameter repair: the effective coefficient 0.974 ≥ 0.9, no repair is needed; maintain the target duty cycle of 48% and frequency of 800Hz. For current closed-loop regulation: the stability factor 1.0 ≥ 0.95, current fluctuation of 0.2A is within the allowable range, no additional adjustment is needed; maintain the current of 6.2A. For torque calibration: the matching coefficient 0.984 ≥ 0.95, the measured torque is 6.1N. m and demand 6N m deviation 0.1N The torque value corresponding to 6.2A in the torque map needs only a minor adjustment, requiring no major correction. m, to ensure more accurate subsequent matching. The preprocessing results are as follows: PWM parameters (duty cycle 48%, frequency 800Hz), current setting 6.2A, and calibrated current-torque mapping (6.2A→6.1N). m).

[0087] Integrate the motor control preprocessing results to generate motor torque and speed control operation information that meets the requirements of multiple massage modes. The preprocessed PWM parameters, current settings, torque mapping, and other information need to be integrated and transformed into a "torque-speed" control operation that the motor can execute, ensuring compliance with the motion requirements of the deep kneading mode. For torque control, based on the calibrated current-torque mapping, determine the target torque corresponding to the current and the torque holding time (e.g., maintaining the deepest pressure point for 0.5 seconds). For speed control, based on the PWM frequency and motor characteristics, calculate the target speed (e.g., 800Hz corresponds to a motor speed of 900rpm, a transmission ratio of 1:50, and a massage head speed of 18rpm), ensuring match with the sinusoidal trajectory speed. For the associated transmission mechanism attributes, combined with the "rotation to oscillation" characteristics of the transmission mechanism, determine the mapping relationship between motor speed and massage head angular velocity (e.g., 900rpm motor → 0.0942° / ms massage head angular velocity).

[0088] Integrating the preprocessing results, control operation information for the "pressing the deepest point and then moving upwards" stage of the deep kneading mode is generated. For torque control operation, the target current is 6.2A, and the target torque is 6.1N. The torque is maintained at m for 0.3s (to ensure a "top pressure" feel), then as the current drops to 5.8A, the torque simultaneously decreases to 5.7N. m (adapting to the requirements of the upward movement phase). For speed control operation, PWM frequency 800Hz → motor target speed 900rpm, transmission ratio 1:50 → massage head target speed 18rpm → target angular velocity 0.0942° / ms (consistent with the midpoint velocity of the sine wave), with an allowable speed fluctuation range of ±5rpm. The MCU writes the above operation information into the motor drive circuit register, and the drive chip outputs signals according to the PWM parameters, while simultaneously monitoring current and temperature in real time to ensure stable torque and speed output, adapting to the smooth upward movement of the deep kneading mode.

[0089] S106, based on the preset massage mode operation requirements and real-time trajectory feedback, transforms the control operation information into the actual movement of the massage head, extracts and classifies the mode requirements, trajectory feedback, control operation information and transmission mechanism attributes, and generates mode adaptation parameters, trajectory calibration rules, torque adjustment thresholds, and massage head and motor linkage mapping information.

[0090] In one implementation, control operation information is processed based on preset massage mode operation requirements and real-time trajectory feedback. A motion mapping mechanism is used to convert this information into actual massage head movements. A transmission coordination module adapts the transmission mechanism attributes, and extracts and processes mode requirements, trajectory feedback, control operation information, and transmission mechanism attributes according to classification rules. This generates mode adaptation parameters, trajectory calibration rules, torque adjustment thresholds, massage head and motor linkage mapping information, and action execution evaluation information. The core of the deep kneading mode is to convert the motor's "torque-speed" control operation into the massage head's "angle-speed" reciprocating motion. This requires associating the motor and massage head movements through a motion mapping mechanism, adapting the transmission mechanism attributes, and extracting key information to generate basic control parameters. The motion mapping mechanism, based on the motion conversion relationship of "motor rotation → massage head oscillation" (e.g., a transmission ratio of 1:50, 50 motor rotations correspond to 1 massage head oscillation), converts motor speed into massage head angular velocity and motor torque into massage head pressure. The transmission coordination module adapts to the mechanical characteristics of the transmission mechanism (e.g., swing arm length, linkage stroke) to correct motion mapping deviations and ensure accurate action conversion. Information is extracted from four dimensions: “mode requirements, trajectory feedback, control operation, and transmission attributes”, and corresponding basic parameters are generated.

[0091] Motor control operation information during the "press the deepest point and then move upward" phase of the deep kneading mode (target current 6.2A → torque 6.1N). For example, (m, motor speed 900rpm, PWM frequency 800Hz).

[0092] Step 1: Motion mapping is converted into massage head movements based on a transmission ratio of 1:50. Motor speed 900 rpm → Massage head speed = 900 ÷ 50 = 18 rpm → Massage head angular velocity = 18 revolutions / 60s × 360° / revolution = 10.8° / s = 0.09° / ms; Motor torque 6.1 N. m → Massage head pressure = 6.1N m ÷ transmission mechanism lever arm (e.g., 0.1m) = 61N (meets the deep kneading mode's deep pressing requirements), which is ultimately converted into the massage head's movement of "smoothly moving upwards from 30° (deepest point) to 0° at an angular velocity of 0.09° / ms".

[0093] Step 2: The transmission coordination module adapts to the transmission mechanism where there is a small mechanical gap (such as 0.2°). The transmission coordination module corrects the mapping relationship and fine-tunes the target speed of the motor to 905 rpm, ensuring that the actual angular velocity of the massage head reaches 0.0942° / ms, thus eliminating the motion lag caused by the gap.

[0094] Step 3: Extract Information and Generate Basic Parameters. Based on classification rules, extract four categories of information and generate parameters: Mode Adaptation Parameters: For the deep kneading mode, the pressure range is 50N-70N, and the upward angular velocity range is 0.08° / ms-0.1° / ms. Trajectory Calibration Rules: PID fine-tuning is triggered when the massage head angle deviation exceeds ±0.15°, and the PWM frequency is adjusted when the speed deviation exceeds ±0.005° / ms. Torque Adjustment Threshold: The lower limit of torque at the deepest pressing point is 5N. m (compensation is triggered if the torque is below this value), maximum torque limit during upward movement: 6.5N. m (if higher, reduce current); Massage head and motor linkage mapping information: Motor speed 900rpm Massage head angular velocity: 0.09° / ms; motor current: 6A. The massage head pressure is 60N; the action execution evaluation information is that the current actual angle of the massage head is 29.87° (target 30°), the actual angular velocity is 0.088° / ms (target 0.0942° / ms), and the action deviation level is "slight deviation".

[0095] Based on motion execution evaluation information, various generated information is verified in multiple dimensions. A calibration mechanism is initiated for motion deviations, a dynamic adjustment service is invoked for parameter mismatch scenarios to perform secondary parameter adaptation, and a torque compensation process is triggered for insufficient torque scenarios. An optimized motion control scheme including anomaly handling strategies and calibration time windows is generated. The deep kneading mode has high requirements for motion stability and pressure accuracy. It is necessary to verify basic parameters in multiple dimensions through motion execution evaluation information (such as angle deviation, speed deviation, and force deviation), and to initiate corresponding optimization mechanisms for different problems to generate a complete control scheme.

[0096] The verification dimensions are as follows: angle deviation (the difference between the actual angle of the massage head and the target angle), speed deviation (the difference between the actual angular velocity and the target angular velocity), and force deviation (the difference between the actual pressing force and the required force). The optimization mechanism is as follows: For motion deviation (angle / speed deviation exceeding the threshold): the trajectory calibration mechanism is activated, and the motor control parameters are fine-tuned based on the PID algorithm. For parameter mismatches (such as linkage mapping deviation), the dynamic adjustment service is called to correct the motor-massage head mapping relationship. For insufficient torque (pressing force not meeting the standard), the torque compensation process is triggered to increase the motor current and improve torque.

[0097] Based on the above motion execution evaluation information (angle deviation +0.13°, speed deviation -0.0062° / ms, force deviation -1N), the following verification and optimization are performed. Step 1: Multi-dimensional verification: Angle deviation: +0.13° (≤ threshold ±0.15°, acceptable); Speed ​​deviation: -0.0062° / ms (absolute value > threshold ±0.005° / ms, unacceptable, requires calibration); Force deviation: -1N (≤ threshold ±2N, acceptable, but subsequent changes need to be monitored). Step 2: Activate the corresponding optimization mechanism. For speed deviation: activate the trajectory calibration mechanism, based on the PID algorithm, calculate the PWM duty cycle adjustment amount: speed error. =-0.0062° / ms, proportionality coefficient =0.5, then the PWM duty cycle adjustment ΔD= ×| |=0.5×0.0062=0.0031, which means increasing the PWM duty cycle by 0.31%, increasing the motor speed from 900rpm to 903rpm, and correcting the massage head angular velocity from 0.088° / ms to 0.0942° / ms. There are no parameter mismatch or insufficient torque issues, and no other mechanisms need to be activated.

[0098] Step 3: Generate the optimized motion control scheme, including optimized parameters and anomaly handling strategies. Optimized parameters are: target motor speed 903 rpm, PWM duty cycle 48.31%, and current maintenance 6.2A. The anomaly handling strategies are as follows: if the angle deviation exceeds 0.15°, increase the PWM duty cycle by 0.5%; if the torque is insufficient (force < 50N), increase the current to 6.5A. The calibration time window is every 0.1ms (control cycle), and optimization is triggered if the deviation persists for two cycles.

[0099] The optimized motion control scheme is integrated and executed to respond to massage motion commands and generate the final execution result of the massage head precisely executing the target massage mode motion. The optimized motion control scheme (including parameters and exception handling strategies) needs to be integrated into executable commands and sent to the motor drive circuit and transmission mechanism to drive the massage head to perform the motion. Simultaneously, the execution process is monitored in real time to ensure accuracy in meeting the requirements of the deep kneading mode. The optimized motor parameters (speed, current, PWM parameters), massage head motion parameters (angle range, angular velocity), and exception handling strategies are integrated along a "time axis" to form a continuous motion execution sequence. Massage head angle data is collected in real time using an external angle sensor to verify whether the motion conforms to the target trajectory; if an exception handling strategy is triggered, adjustments are made in real time.

[0100] Taking the optimized "pressing the deepest point and then moving upwards" stage control scheme as an example, step 1: integrate the optimized scheme's time axis execution sequence. For 0-0.3s: the massage head moves upwards from 30° (deepest point) at an angular velocity of 0.0942° / ms, the motor speed is 903rpm, the current is 6.2A, and the PWM duty cycle is 48.31%. For after 0.3s: the massage head reaches 0° (midpoint of the trajectory), the motor speed drops to 850rpm, the current drops to 5.8A, and it enters a smooth upward movement stage; if the angle deviation exceeds 0.15°, the PWM duty cycle is immediately increased by 0.5%.

[0101] Step 2: The MCU executes and monitors the program by writing the execution sequence into the motor drive register. The drive chip outputs a PWM signal, and the transmission mechanism drives the massage head upward. At the same time, the angle sensor collects angle data every 0.1ms (e.g., angle 29.906° at t=0.1s, angle 29.812° at t=0.2s), and verifies in real time that the deviation from the target trajectory (29.9058° at t=0.1s, 29.8116° at t=0.2s) is ≤0.0002°, indicating no abnormalities.

[0102] Step 3: Generate final execution result. The massage head accurately executes the action of "smoothly moving upward from the deepest point of 30° to 0° at an angular velocity of 0.0942° / ms". The pressure is stable at 60N (±1N) with no jerking. This meets the experience requirements of the deep kneading mode of "slow and powerful, smooth and deep kneading". The action execution accuracy is over 99.9%.

[0103] In one implementation, such as Figure 2 As shown, this application also provides a multi-mode massager control device based on external angle feedback, comprising:

[0104] The human-computer interaction interface 201 is used to receive user massage mode commands, which include high-frequency impact mode, rhythmic percussion mode, and deep kneading mode. The high-frequency impact mode refers to a massage mode in which the massager uses high-frequency small-angle reciprocating motion as its motion characteristic. The rhythmic percussion mode refers to a massage mode in which the massager uses fast percussion and slow withdrawal, large-amplitude asymmetrical reciprocating motion as its motion characteristic. The deep kneading mode refers to a massage mode in which the massager uses low-speed, large-amplitude smooth pressing motion as its motion characteristic.

[0105] Flash memory unit 202 is used to read pre-stored system basic configuration information, and generate mode start signal and hardware driver basic setting information based on the above instructions and configuration information. The pre-stored system basic configuration information includes target trajectory curve parameters corresponding to various massage modes, drive basic parameters of sensorless brushless motor, sampling period and signal parsing rules of external angle sensor.

[0106] The motor drive control interface 203 is used to send a start signal to the drive circuit of the sensorless brushless motor to start the operation of the sensorless brushless motor and generate the initial running information of the motor; at the same time, it triggers the external angle sensor to sample according to the set sampling period through the sensor communication interface, reads the original electrical signal output by the sensor, and generates real-time angle raw data.

[0107] The flash memory data read interface 204 is used to receive pre-stored target trajectory curve algorithms and angle data processing rules; to convert the initial speed data in the initial motor running information with the transmission mechanism reduction ratio parameters to obtain the initial movement speed of the massage head; and to convert the real-time angle raw data according to the angle data processing rules to obtain the real-time actual angle value.

[0108] The computing unit 205 is used to calculate the real-time actual angular velocity using the M-method velocity measurement; integrate the real-time actual angle value and the real-time actual angular velocity to generate actual motion trajectory information; and calculate the target angle and target angular velocity at the corresponding moment based on the target trajectory curve algorithm and the current running time to generate target trajectory comparison benchmark information.

[0109] The closed-loop control calculation unit 206 is used to call the pre-stored closed-loop control rules, compare the real-time actual angle value and real-time actual angular velocity value in the actual motion trajectory information with the target angle value and target angular velocity value in the target trajectory comparison reference information cycle by cycle, and generate an error signal; based on the error signal, it performs calculations according to the closed-loop control rules to generate PWM instruction adjustment information;

[0110] The motor drive status detection interface 207 is used to read the status information of the motor drive circuit; it fuses the PWM command adjustment information with the status information of the motor drive circuit to generate motor torque and speed control operation information.

[0111] The transmission mechanism linkage control logic unit 208, based on the preset massage mode operation requirements and real-time trajectory feedback, converts the motor torque and speed control operation information into specific operation instructions for the brushless motor, and drives the massage head to perform corresponding actions through the transmission mechanism;

[0112] The parameter extraction and classification unit 209 extracts and classifies the operating requirements parameters of the preset massage mode, the error fluctuation data in the real-time trajectory feedback, the PWM adjustment range in the control operation information, and the mechanical properties of the transmission mechanism, and generates mode adaptation parameters, trajectory calibration rules, torque adjustment thresholds, and massage head and motor linkage mapping information.

[0113] The various embodiments in this application are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for evaluating the multi-mode massager control method, electronic device, electronic device, and readable storage medium based on external angle feedback are basically similar to the above-described embodiments of the multi-mode massager control method based on external angle feedback, and therefore are described simply. Relevant parts can be referred to in the descriptions of the above-described embodiments of the multi-mode massager control method based on external angle feedback.

Claims

1. A multi-mode massager control method based on external angle feedback, characterized in that, include: S101. Receive user massage mode commands and pre-stored system basic configuration information, and generate mode start and hardware driver basic setting information. Among them, the user massage mode commands include high-frequency impact mode, rhythmic percussion mode, and deep kneading mode. High-frequency impact mode refers to a massage mode in which the massager uses high-frequency small-angle reciprocating motion as its motion characteristic. Rhythmic percussion mode refers to a massage mode in which the massager uses fast percussion and slow withdrawal, large amplitude asymmetrical reciprocating motion as its motion characteristic. Deep kneading mode refers to a massage mode in which the massager uses low-speed, large-amplitude smooth pressing motion as its motion characteristic. The pre-stored system basic configuration information includes target trajectory curve parameters corresponding to various massage modes, basic drive parameters of sensorless brushless motors, sampling period and signal parsing rules of external angle sensors. S102. Based on the mode start command and hardware driver settings, start the sensorless brushless motor and trigger the external angle sensor to sample, generating the initial running information of the motor and the real-time angle raw data. S103: Receive the pre-stored target trajectory curve algorithm and angle data processing rules, process the initial running information of the motor and the real-time angle raw data, calculate the actual angular velocity through differential calculation, and generate the actual motion trajectory information and the target trajectory comparison benchmark information. S104. Based on the closed-loop control rules, the actual motion trajectory information is compared with the target trajectory reference information. The difference between the actual angle / angular velocity and the target angle / angular velocity is calculated to generate an error signal. The PWM command adjustment information is generated by the PID controller or FOC vector control algorithm. S105. Process the PWM command adjustment information and motor drive circuit status information to generate motor torque and speed control operation information. This includes obtaining PWM command adjustment information and motor drive circuit status information based on motor control commands, extracting PWM parameter integrity, drive circuit operating condition stability, and current-torque correlation characteristics; verifying the PWM parameter integrity characteristics, identifying duty cycle / frequency anomalies and phase deviations, and generating PWM parameter effective coefficients; verifying the drive circuit operating condition stability characteristics, checking for current / voltage fluctuations and temperature exceeding limits, and generating operating condition stability factors; verifying the current-torque correlation characteristics, controlling the motor current by adjusting the PWM duty cycle, confirming the mapping matching of current and torque, and the consistency between torque output and mode requirements, and generating torque matching coefficients; processing the PWM parameter effective coefficients, operating condition stability factors, and torque matching coefficients based on preset motor control rules, using a PWM parameter repair mechanism to improve the signal structure, current closed-loop regulation technology to stabilize the drive condition, and a torque calibration algorithm to correct output deviations, generating motor control preprocessing results; integrating the motor control preprocessing results to generate motor torque and speed control operation information that meets the requirements of multiple massage modes. S106. Based on the preset massage mode operation requirements and real-time trajectory feedback, the control operation information is transformed into the actual movement of the massage head. The mode requirements, trajectory feedback, control operation information and transmission mechanism attributes are extracted and classified to generate mode adaptation parameters, trajectory calibration rules, torque adjustment thresholds and massage head and motor linkage mapping information.

2. The method as described in claim 1, characterized in that, Step S102 includes: The starting parameters of the sensorless brushless motor are grouped and classified according to the preset motor starting rules, and the starting mode and associated drive parameter information corresponding to each rule are generated. Based on sampling requirements, the sampling content of the external angle sensor is arranged and designed, and the sampling standard, data type and acquisition range information are obtained to generate sensor sampling design information. Based on the requirements of mode operation planning and trajectory monitoring, corresponding sampling verification nodes are set for the sensor sampling design information of each startup rule; The motor start-up grouping results, sensor sampling design information, and sampling verification nodes are processed to generate initial motor operation information and real-time angle raw data, which include start-up rule grouping information, sampling scheme, and verification standards.

3. The method as described in claim 1, characterized in that, Step S103 includes: The pre-stored target trajectory curve algorithms are grouped and classified according to the preset mode-trajectory mapping rules, and the trajectory type and associated mathematical model information corresponding to each rule are generated. Based on the data parsing requirements, the calculation content of the angle data processing rules is arranged and designed, the calculation standard, data type and derivation range information are obtained, and the angle data processing design information is generated. Among them, the actual angular velocity is obtained through differential calculation. Based on the operational requirements of the mode and the trajectory accuracy requirements, corresponding trajectory calibration nodes are set for the angle data processing design information of each rule; The trajectory algorithm grouping results, angle data processing design information, and trajectory calibration nodes are processed to generate actual motion trajectory information and target trajectory comparison benchmark information, which include algorithm grouping information, data processing scheme, and calibration standards.

4. The method as described in claim 1, characterized in that, Step S104 includes: Based on the preset pattern-error calculation rules, the actual motion trajectory information is compared with the target trajectory and the benchmark information to group and classify them, and generate the error type and associated calculation parameter information corresponding to each rule. Based on the closed-loop control requirements, the processing content of the error signal is arranged and designed, and the calculation standard, error correction method and adjustment range information are obtained to generate error signal processing design information. Based on the operating conditions of the mode and the motor control requirements, corresponding PWM adjustment confirmation nodes are set for the error signal processing design information of each rule; The error grouping results, error signal processing design information, and PWM adjustment confirmation nodes are processed to generate error signals and PWM command adjustment information containing error grouping information, processing schemes, and confirmation standards. Specifically, the error signal is generated by subtracting the actual angle / angular velocity from the target angle / angular velocity, and the PWM command adjustment information is generated through a PID controller or FOC vector control algorithm.

5. The method as described in claim 1, characterized in that, Step S106 includes: Based on the preset massage mode operation requirements and real-time trajectory feedback, the control operation information is processed and converted into actual massage head movements using a motion mapping mechanism. The transmission mechanism attributes are adapted through the transmission coordination module. According to the classification rules, the mode requirements, trajectory feedback, control operation information and transmission mechanism attributes are extracted and processed to generate mode adaptation parameters, trajectory calibration rules, torque adjustment thresholds, massage head and motor linkage mapping information and action execution evaluation information. Based on the action execution evaluation information, the generated information is verified in multiple dimensions. A calibration mechanism is initiated for action deviations. For scenarios with parameter mismatch, a dynamic adjustment service is called to perform secondary parameter adaptation. For scenarios with insufficient torque, a torque compensation process is triggered to generate an optimized action control scheme that includes anomaly handling strategies and calibration time windows. The optimized motion control scheme is integrated and executed to respond to massage motion commands and generate the final execution result of the massage head accurately executing the target massage mode motion.

6. A multi-mode massager control device based on external angle feedback, used to implement the method of claim 1, characterized in that, The device includes: The human-computer interaction interface (201) is used to receive user massage mode commands, including high-frequency impact mode, rhythmic percussion mode, and deep kneading mode. The high-frequency impact mode refers to a massage mode in which the massager uses high-frequency small-angle reciprocating motion as its motion characteristic. The rhythmic percussion mode refers to a massage mode in which the massager uses fast percussion and slow withdrawal, large amplitude asymmetrical reciprocating motion as its motion characteristic. The deep kneading mode refers to a massage mode in which the massager uses low-speed, large amplitude smooth pressing motion as its motion characteristic. The flash memory storage unit (202) is used to read the pre-stored system basic configuration information, and generate the mode start signal and hardware driver basic setting information based on the above instructions and configuration information. The pre-stored system basic configuration information includes the target trajectory curve parameters corresponding to various massage modes, the driving basic parameters of the sensorless brushless motor, and the sampling period and signal parsing rules of the external angle sensor. The motor drive control interface (203) is used to send a start signal to the drive circuit of the sensorless brushless motor to start the operation of the sensorless brushless motor and generate the initial running information of the motor; at the same time, it triggers the external angle sensor to sample according to the set sampling period through the sensor communication interface, reads the original electrical signal output by the sensor, and generates real-time angle raw data. The flash memory data reading interface (204) is used to receive the pre-stored target trajectory curve algorithm and angle data processing rules; to convert the initial speed data in the initial running information of the motor into the reduction ratio parameters of the transmission mechanism to obtain the initial movement speed of the massage head; and to convert the real-time angle raw data according to the angle data processing rules to obtain the real-time actual angle value. The computing unit (205) is used to calculate the real-time actual angular velocity using the M-method velocity measurement; integrate the real-time actual angle value and the real-time actual angular velocity, and generate the actual motion trajectory information by calculating the actual angular velocity through differential calculation; based on the target trajectory curve algorithm, calculate the target angle and target angular velocity at the corresponding moment according to the current running time, and generate the target trajectory comparison benchmark information; The closed-loop control operation unit (206) is used to call the pre-stored closed-loop control rules, compare the real-time actual angle value and real-time actual angular velocity value in the actual motion trajectory information with the target angle value and target angular velocity value in the target trajectory comparison reference information cycle by cycle, calculate the difference between the actual angle / angular velocity and the target angle / angular velocity, and generate an error signal; based on the error signal, PWM instruction adjustment information is generated by the PID controller or FOC vector control algorithm. The motor drive status detection interface (207) is used to read the status information of the motor drive circuit; to fuse the PWM command adjustment information and the motor drive circuit status information to generate motor torque and speed control operation information, including obtaining the PWM command adjustment information and the motor drive circuit status information based on the motor control command, extracting the integrity of PWM parameters, the stability of the drive circuit operation condition, and the current-torque correlation characteristics; to verify the integrity characteristics of PWM parameters, identify duty cycle / frequency abnormalities and phase deviations, and generate effective coefficients of PWM parameters; and to verify the stability characteristics of the drive circuit operation condition, checking for current / voltage fluctuations and temperature exceeding limits. The process involves generating a stable operating condition factor; verifying the current-torque correlation characteristics; controlling the motor current by adjusting the PWM duty cycle to confirm the mapping and matching of current and torque, and the consistency between torque output and mode requirements, thus generating a torque matching coefficient; processing the effective coefficients of PWM parameters, the stable operating condition factor, and the torque matching coefficient based on preset motor control rules; using a PWM parameter repair mechanism to improve the signal structure, current closed-loop regulation technology to stabilize the drive conditions, and a torque calibration algorithm to correct output deviations, thus generating motor control preprocessing results; and integrating the motor control preprocessing results to generate motor torque and speed control operation information that meets the requirements of multiple massage modes. The transmission mechanism linkage control logic unit (208) converts the motor torque and speed control operation information into specific operating instructions for the brushless motor based on the preset massage mode operation requirements and real-time trajectory feedback, and drives the massage head to perform corresponding actions through the transmission mechanism. The parameter extraction and classification unit (209) extracts and classifies the operation requirement parameters of the preset massage mode, the error fluctuation data in the real-time trajectory feedback, the PWM adjustment range in the control operation information, and the mechanical properties of the transmission mechanism, and generates mode adaptation parameters, trajectory calibration rules, torque adjustment threshold, and massage head and motor linkage mapping information.

7. An electronic device, characterized in that, include: First processor; The processor also includes a memory for storing executable instructions of the first processor; wherein the first processor is configured to execute the multi-mode massager control method based on external angle feedback as described in any one of claims 1 to 5 by executing the executable instructions.

Citation Information

Patent Citations

  • Massage control method and massage chair

    CN120837307A