Robot motion range control system

Through the embedded system deployment module and dynamic action adjustment module, users' emotions and distance changes are monitored in real time, and robots' movement amplitude is dynamically adjusted, which solves the problem of expression distortion caused by fixed amplitude actions, realizes the naturalization and accuracy of emotional expression, and improves the naturalness and user experience of human-computer interaction.

CN120347754APending Publication Date: 2025-07-22深圳玄源科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510709609.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

When existing robots express emotions, the fixed amplitude of actions cannot adapt to the user's emotional state and distance changes, resulting in distortion of expression, making it difficult for users to clearly perceive the robot's emotions at different distances.

Method used

The embedded system deployment module is adopted, combining the emotional intensity recognition module, dynamic action adjustment module and distance detection module, and dynamically adjust the robot's movement amplitude by monitoring the user's emotional reactions and distance changes in real time, including the calculation of the emotional intensity index and the distance compensation factor to ensure the naturalization and accuracy of the movement.

Benefits of technology

It realizes the naturalization and accuracy of robot emotional expression, and users can clearly perceive the robot's emotions at different distances, improving the naturalness and user experience of human-computer interaction, and is suitable for a variety of application scenarios and user groups.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120347754A_ABST
    Figure CN120347754A_ABST
Patent Text Reader

Abstract

The invention discloses a robot motion range control system which comprises an embedded system deployment module, and an emotion intensity recognition module, a dynamic motion adjustment module, a distance detection module and a motion execution module are embedded in the embedded system deployment module. The method has the beneficial effects that the action amplitude is dynamically adjusted, so that the robot can flexibly adjust the action according to the emotion intensity of the user and the distance change, and the naturalization and the accuracy of emotion expression are realized. The innovation solves the problem of expression distortion caused by the traditional fixed amplitude action, ensures that the user can clearly perceive the emotional expression of the robot at different distances, and remarkably improves the naturalness of man-machine interaction and the user experience. The system has strong adaptability, can monitor the emotional state and distance change of the user in real time, and dynamically adjusts the motion amplitude, so that the system is suitable for various application scenes and different user groups.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of robots, and particularly to a robot motion amplitude control system. Background Art

[0002] In the prior art, when non-humanoid robots (such as table lamp robots) express emotions, they usually adopt fixed-amplitude motions. For example, the robot expresses happiness or sadness through the swinging of the lamp head, and the motion amplitude is preset and does not change with the user's emotional state or distance. Although this fixed-amplitude motion expression method is simple, it has obvious limitations in practical applications. When the user is far away from the robot, small-amplitude motions may not be clearly perceived by the user; while when the user is close, large-amplitude motions may seem overly exaggerated and even make the user feel uncomfortable.

[0003] Therefore, the inventor has invented a robot motion amplitude control system. Summary of the Invention

[0004] The purpose of this part is to outline some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this part, as well as in the abstract and title of the present application, to avoid obscuring the purpose of this part, the abstract, and the title, but such simplifications or omissions shall not be used to limit the scope of the present invention.

[0005] In view of the problems existing in the above or prior art, the present invention is proposed.

[0006] Therefore, the purpose of the present invention is to provide a robot motion amplitude control system, which can dynamically adjust the motion amplitude so that the robot can flexibly adjust its motion according to the user's emotional intensity and distance change, thereby realizing natural and accurate emotional expression.

[0007] To solve the above technical problems, the present invention provides the following technical solution: A robot motion amplitude control system, which includes an embedded system deployment module, and an emotional intensity recognition module, a dynamic motion adjustment module, a distance detection module, and an action execution module are embedded in the embedded system deployment module; The emotional intensity recognition module captures the user's facial micro-expressions through a facial recognition module and calculates the emotional intensity index through voice spectral features; The dynamic motion adjustment module dynamically adjusts the motion amplitude of the robot through the emotional intensity index; The distance detection module detects the distance between the user and the robot through a sensor and calculates the distance compensation factor; The action execution module executes corresponding actions according to the adjusted motion amplitude; The embedded system deployment module can ensure the delayed operation of the emotional intensity recognition module, the dynamic action adjustment module, the distance detection module, and the action execution module; The robot action amplitude control system can monitor the user's emotional reactions and distance changes in real time, and dynamically adjust the emotional intensity index and the action amplitude.

[0008] As a preferred embodiment of the robot action amplitude control system of the present invention, wherein: the emotional intensity recognition module captures the user's facial expressions through a camera, extracts the micro-expression features of the upward curvature of the mouth corners and the activities of the glabella muscles, collects the user's voice signals through a microphone, extracts the fundamental frequency and energy voice spectrum features, and inputs the above features into the LSTM network to calculate the emotional intensity index.

[0009] As a preferred embodiment of the robot action amplitude control system of the present invention, wherein: the calculation formula of the emotional intensity index is: Wherein, EI represents the emotional index, FEF represents the facial expression features; VF represents the voice spectrum features, represents the Sigmoid activation function, which is used to map the output value to the interval (0~1); are weight parameters, which are adjusted according to experimental data to balance the contributions of facial expressions and voice features; the range of the emotional intensity index is from 0 to 1, where 0 represents no emotion and 1 represents the highest emotional intensity.

[0010] As a preferred embodiment of the robot action amplitude control system of the present invention, wherein: the LSTM network contains two hidden layers, each layer having 128 neurons; the input layer receives the facial expression features and the voice spectrum features, and the output layer outputs the emotional intensity index through the Sigmoid activation function.

[0011] As a preferred embodiment of the robot action amplitude control system of the present invention, wherein: according to the calculated emotional intensity index, the robot action amplitude is dynamically adjusted; when the emotional intensity index is greater than 0.7, a large-angle swing action is triggered; when the emotional intensity index is less than 0.3, micro-actions are adopted.

[0012] As a preferred embodiment of the robot action amplitude control system of the present invention, wherein: the adjustment formula of the action amplitude is: Wherein, Max A represents the maximum amplitude, Min A represents the minimum amplitude, and I A represents the intermediate amplitude; Max A and Min A are parameters preset according to the robot design; I A is calculated by linear interpolation according to the emotional intensity.

[0013] As a preferred embodiment of the robot motion amplitude control system of the present invention, the following steps are included: detecting the distance between the user and the robot through an infrared sensor or an ultrasonic sensor on the robot; when the user's distance is greater than 1 meter, automatically increasing the motion amplitude by 20% to ensure visibility at a long distance.

[0014] As a preferred embodiment of the robot motion amplitude control system of the present invention, the calculation formula for the distance compensation factor is: According to the detected distance, calculate the compensation factor using the above formula; if the distance is greater than 1 meter, the compensation factor is 1.2; otherwise, it is 1; The adjusted motion amplitude is: Multiply the calculated compensation factor by the original motion amplitude to obtain the adjusted motion amplitude.

[0015] As a preferred embodiment of the robot motion amplitude control system of the present invention, the motion execution module controls the rotation angle of the motor using a PWM signal; calculates the PWM value of the motor according to the adjusted motion amplitude, and sends it to the motor driver through the control module; the motor driver drives the motor according to the received PWM signal, causing the target part to swing according to the set amplitude.

[0016] As a preferred embodiment of the robot motion amplitude control system of the present invention, the robot motion amplitude control system recaptures the user's facial expression and voice signal every first preset time interval seconds, recalculates the emotional intensity index, and at the same time, measures the distance between the user and the robot every second preset time interval seconds, and recalculates the distance compensation factor; According to the new emotional intensity index and distance compensation factor, recalculate the motion amplitude and adjust the PWM value of the motor to ensure the real-time performance and adaptability of the motion.

[0017] Advantages of the present invention: By dynamically adjusting the motion amplitude, the present invention enables the robot to flexibly adjust its motion according to the changes in the user's emotional intensity and distance, thereby realizing the naturalization and accuracy of emotional expression. This innovation solves the problem of expression distortion caused by traditional fixed-amplitude motions, ensuring that users can clearly perceive the robot's emotional expression at different distances, significantly improving the naturalness of human-robot interaction and the user experience. The system has strong adaptability, can real-time monitor the user's emotional state and distance changes, and dynamically adjust the motion amplitude to make it applicable to a variety of application scenarios and different user groups. In addition, the algorithm is deployed in the robot's embedded system to ensure low-latency operation, can real-time respond to the user's emotional changes, and further improves the interactivity and real-time performance of the system. Brief Description of the Drawings

[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. Among them: Figure 1 It is a working flowchart of the robot motion amplitude control system. Specific embodiments

[0019] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will make a detailed description of the specific embodiments of the present invention in conjunction with the drawings in the specification.

[0020] In the following description, many specific details are set forth to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar generalizations without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0021] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that can be included in at least one implementation manner of the present invention. The "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments.

[0022] Embodiment 1 Referring to Figure 1 , this is the first embodiment of the present invention. This embodiment provides a robot motion amplitude control system, which includes an embedded system deployment module. An emotion intensity recognition module, a dynamic motion adjustment module, a distance detection module, and an action execution module are embedded in the embedded system deployment module; The emotion intensity recognition module captures the user's facial micro-expressions through the facial recognition module and calculates the emotion intensity index through the voice spectrum characteristics; The dynamic motion adjustment module dynamically adjusts the motion amplitude of the robot through the emotion intensity index; The distance detection module detects the distance between the user and the robot through the sensor and calculates the distance compensation factor; The action execution module executes corresponding actions according to the adjusted motion amplitude; The embedded system deployment module can ensure the delayed operation of the emotion intensity recognition module, the dynamic motion adjustment module, the distance detection module, and the action execution module; The robot motion amplitude control system can monitor the user's emotional reactions and distance changes in real time, and dynamically adjust the emotional intensity index and motion amplitude.

[0023] Preferably, the face recognition module can be a camera or other recognition components; the algorithm is built into the system.

[0024] The detailed implementation steps are as follows: 1. Emotional intensity recognition Furthermore, the emotional intensity recognition module captures the user's facial expressions through a camera, extracts the micro-expression features of the upward curvature of the mouth corners and the activity of the glabella muscles, collects the user's voice signals through a microphone, extracts the fundamental frequency and energy voice spectrum features, and inputs the above features into the LSTM network to calculate the emotional intensity index.

[0025] Furthermore, the calculation formula for the emotional intensity index is: where EI is the abbreviation of Emotion Index, Emotion Index represents the emotion index, FEF is the abbreviation of Facial Expression Feature, Facial Expression Feature represents the facial expression feature; VF is the abbreviation of Voice Feature, Voice Feature represents the voice spectrum feature, represents the Sigmoid activation function, which is used to map the output value to the interval (0~1); are weight parameters, which are adjusted according to experimental data to balance the contributions of facial expressions and voice features; the range of the emotional intensity index is from 0 to 1, where 0 represents no emotion and 1 represents the highest emotional intensity.

[0026] Preferably, for example, assume = 0.6 and = 0.4, the facial expression feature value is 0.7, and the voice feature value is 0.5, then the emotional intensity index is calculated as follows: ; It indicates that the user's emotional intensity is 0.65, belonging to medium-intensity emotion.

[0027] Preferably, for facial expression feature extraction: Use the OpenCV library to detect faces in the images captured by the camera, and extract the upward curvature of the mouth corners and the activity of the glabella muscles. The upward curvature of the mouth corners is calculated by detecting the vertical displacement of the key points of the mouth corners, and the activity of the glabella muscles is calculated by detecting the texture changes in the glabella area.

[0028] Preferably, for voice spectral feature extraction: Use the `librosa` library in Python to extract the fundamental frequency and energy from the audio signal captured by the microphone. The fundamental frequency is calculated by the autocorrelation method, and the energy is calculated by short-time energy.

[0029] Furthermore, for the LSTM network structure: The LSTM network contains two hidden layers, each with 128 neurons; the input layer receives facial expression features and voice spectral features, and the output layer outputs the emotional intensity index through the Sigmoid activation function.

[0030] 2. Dynamic action adjustment Furthermore, according to the calculated emotional intensity index, dynamically adjust the amplitude of the robot's actions; when the emotional intensity index is greater than 0.7, trigger a large-angle swinging action, for example, the lamp head swings left and right by ±30°; when the emotional intensity index is less than 0.3, use micro-actions.

[0031] Furthermore, the formula for adjusting the action amplitude is: where Max A represents Max Amplitude (the maximum amplitude), Min A represents Min Amplitude (the minimum amplitude), and IA represents Intermediate Amplitude (the intermediate amplitude); Max A and Min A are parameters preset according to the robot design; IA is calculated by linear interpolation according to the emotional intensity.

[0032] Assume the maximum amplitude is ±30° and the minimum amplitude is ±5°, and the intermediate amplitude is calculated by linear interpolation according to the emotional intensity. For an emotional intensity index of 0.65, the action amplitude is calculated as follows: Therefore, the action amplitude of the robot's lamp head is adjusted to ±15.625°.

[0033] Specific implementation details: Action amplitude calculation: According to the emotional intensity index, use the above formula to calculate the action amplitude. If the emotional intensity index is 0.65, the action amplitude is 15.625°.

[0034] Action control: Send instructions to the motor driver through the robot control module (such as Arduino or Raspberry Pi) to control the motor of the lamp head to swing with the calculated amplitude.

[0035] 3. Distance detection and compensation factor Furthermore, detect the distance between the user and the robot through the infrared sensor or ultrasonic sensor on the robot; when the user's distance is greater than 1 meter, automatically increase the action amplitude by 20% to ensure visibility at a long distance.

[0036] Furthermore, the calculation formula for the distance compensation factor is as follows: Based on the detected distance, the compensation factor is calculated using the above formula; if the distance ( represented) is greater than 1 meter, the compensation factor is 1.2; otherwise, it is 1; The adjusted motion amplitude (denoted as ADA) is: Multiply the calculated compensation factor (CF represents the compensation factor) by the original motion amplitude (MA represents the original motion amplitude) to obtain the adjusted motion amplitude.

[0037] Assume the user's distance is 1.2 meters, which is greater than 1 meter, and the distance compensation factor is 1.2. Therefore, the adjusted motion amplitude is: The motion amplitude of the robot's lamp head is finally adjusted to ±18.75°.

[0038] Specific implementation details: Distance detection: Use an ultrasonic sensor to measure the distance between the user and the robot. The sensor sends an ultrasonic signal every 0.5 seconds, measures the time of the echo, and calculates the distance.

[0039] Compensation factor calculation: Based on the detected distance, calculate the compensation factor using the above formula. If the distance is greater than 1 meter, the compensation factor is 1.2, otherwise it is 1.

[0040] Motion amplitude adjustment: Multiply the calculated compensation factor by the original motion amplitude to obtain the adjusted motion amplitude.

[0041] 4. Motion execution According to the adjusted motion amplitude, the motion execution module controls the robot to perform corresponding actions. For example, the robot's lamp head swings at an amplitude of ±18.75° to ensure that the action is clearly visible and in line with the user's emotional state. During the motion execution, the robot precisely controls the movement angle of the lamp head through the motor control module to ensure the accuracy and stability of the action.

[0042] Specifically: Motor control: Use a PWM (pulse width modulation) signal to control the rotation angle of the motor. According to the adjusted motion amplitude, calculate the PWM value of the motor and send it to the motor driver through the control module.

[0043] Action execution: The motor driver drives the motor according to the received PWM signal, causing the lamp head to swing according to the set amplitude. For example, if the adjusted action amplitude is 18.75°, the motor driver will swing the lamp head 18.75° to the left from the initial position and then 18.75° to the right.

[0044] 5. Real-time feedback and optimization During the action execution, the system monitors the user's emotional reaction and distance change in real time, and dynamically adjusts the emotional intensity index and action amplitude. By continuously optimizing the LSTM network parameters and distance compensation factor, the system can better adapt to different users and scenarios, improving the naturalness and accuracy of emotional expression. For example, if the user's emotional intensity changes (such as from 0.65 to 0.8), the system will recalculate the emotional intensity index and adjust the action amplitude according to the new index value. At the same time, if the user's distance changes (such as from 1.2 meters to 0.8 meters), the system will recalculate the distance compensation factor and adjust the action amplitude to adapt to the new distance condition.

[0045] In one embodiment, the value range of the first preset time interval is 0.4 - 0.6 seconds, and the value range of the second preset time interval is 0.4 - 0.6 seconds.

[0046] The system recaptures the user's facial expression and voice signal every 0.5 seconds (the first preset time interval) and recalculates the emotional intensity index; at the same time, it measures the distance between the user and the robot every 0.5 (the second preset time interval) seconds and recalculates the distance compensation factor.

[0047] According to the new emotional intensity index and distance compensation factor, recalculate the action amplitude and adjust the PWM value of the motor to ensure the real-time performance and adaptability of the action.

[0048] Optimize the weight parameters of the LSTM network through machine learning algorithms (gradient descent) to improve the accuracy of the emotional intensity index. At the same time, adjust the threshold of the distance compensation factor (such as 1 meter) according to the actual usage scenario to optimize the adjustment effect of the action amplitude.

[0049] In summary, the present invention enables the robot to flexibly adjust its actions according to the user's emotional intensity and distance changes by dynamically adjusting the action amplitude, thereby achieving natural and accurate emotional expression. This innovation solves the problem of expression distortion caused by traditional fixed-amplitude actions, ensuring that users can clearly perceive the robot's emotional expression at different distances, and significantly improving the naturalness of human-robot interaction and the user experience. The system has strong adaptability, can real-time monitor the user's emotional state and distance changes, and dynamically adjust the action amplitude to be applicable to a variety of application scenarios and different user groups. In addition, the algorithm is deployed in the robot's embedded system to ensure low-latency operation and can respond to the user's emotional changes in real time, further enhancing the interactivity and real-time performance of the system.

[0050] It is important to note that the construction and arrangement of the present application shown in multiple different exemplary embodiments are merely illustrative. Although only a few embodiments are described in detail in this disclosure, those who refer to this disclosure should easily understand that many modifications are possible without substantially departing from the novel teachings and advantages of the subject matter described in this application (for example, the dimensions, scales, structures, shapes and proportions of various elements, and parameter values (such as temperature, pressure, etc.), installation arrangements, use of materials, color, orientation changes, etc.). For example, an element shown as integrally formed may be composed of multiple parts or elements, the position of the element may be inverted or otherwise changed, and the nature, number or position of discrete elements may be changed or altered. Therefore, all such modifications are intended to be included within the scope of the present invention. The order or sequence of any process or method steps may be changed or reordered according to alternative embodiments. In the claims, any "means-plus-function" clause is intended to cover the structures that perform the recited function described herein, and not only structural equivalents but also equivalent structures. Other substitutions, modifications, changes and omissions may be made in the design, operating conditions and arrangement of the exemplary embodiments without departing from the scope of the present invention. Therefore, the present invention is not limited to a specific embodiment, but extends to a variety of modifications that still fall within the scope of the appended claims.

[0051] In addition, in order to provide a concise description of the exemplary embodiments, not all features of the actual embodiments may be described (i.e., those features that are not relevant to the currently considered best mode of implementing the present invention or those features that are not relevant to the implementation of the present invention).

[0052] It should be understood that in the development of any actual implementation, such as in any engineering or design project, a large number of specific implementation decisions may be made. Such development efforts may be complex and time-consuming, but for those of ordinary skill in the art who benefit from this disclosure, without excessive experimentation, such development efforts will be a routine task of design, manufacturing and production.

[0053] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and all of them should be covered by the scope of the claims of the present invention.

Claims

1. A robot motion amplitude control system, characterized in that: It includes an embedded system deployment module, in which an emotional intensity recognition module, a dynamic action adjustment module, a distance detection module, and an action execution module are embedded; The emotional intensity recognition module captures the user's facial micro-expressions through a face recognition module and calculates the emotional intensity index through voice spectrum features; The dynamic action adjustment module dynamically adjusts the action amplitude of the robot according to the emotional intensity index; The distance detection module detects the distance between the user and the robot through a sensor and calculates the distance compensation factor; The action execution module performs corresponding actions according to the adjusted action amplitude; The embedded system deployment module can ensure the delayed operation of the emotional intensity recognition module, the dynamic action adjustment module, the distance detection module, and the action execution module; The robot action amplitude control system can monitor the user's emotional reaction and distance change in real time and dynamically adjust the emotional intensity index and action amplitude.

2. The robot motion amplitude control system according to claim 1, characterized in that: The emotional intensity recognition module captures the user's facial expressions through a camera, extracts the micro-expression features of the upward arc of the mouth corner and the activity of the glabellar muscle, collects the user's voice signal through a microphone, extracts the fundamental frequency and energy voice spectrum features, and inputs the above features into the LSTM network to calculate the emotional intensity index.

3. The robot motion amplitude control system according to claim 2, characterized in that: The calculation formula of the emotional intensity index is as follows: Among them, EI represents the emotion index, FEF represents the facial expression feature; VF represents the voice spectrum feature, represents the Sigmoid activation function, which is used to map the output value to the interval (0~1); is the weight parameter, which is adjusted according to the experimental data to balance the contributions of facial expressions and voice features; the range of the emotion intensity index is from 0 to 1, where 0 represents no emotion and 1 represents the highest emotion intensity.

4. The robot motion amplitude control system according to claim 2, wherein: The LSTM network contains two hidden layers, each with 128 neurons; the input layer receives the facial expression features and voice spectrum features, and the output layer outputs the emotional intensity index through the Sigmoid activation function.

5. The robot motion amplitude control system according to claim 1, characterized in that: Dynamically adjust the robot action amplitude according to the calculated emotional intensity index; when the emotional intensity index is greater than 0.7, trigger a large-angle swing action; when the emotional intensity index is less than 0.3, adopt micro-actions.

6. The robot motion amplitude control system according to claim 5, characterized in that: The adjustment formula for the action amplitude is: Among them, Max A represents the maximum amplitude, Min A represents the minimum amplitude, and I A represents the intermediate amplitude; Max A and Min A are parameters preset according to the robot design; I A is calculated by linear interpolation according to the emotional intensity.

7. The robot motion amplitude control system according to any one of claims 1 to 6, characterized in that: Detect the distance between the user and the robot through the infrared sensor or ultrasonic sensor on the robot; when the user's distance is greater than 1 meter, automatically amplify the action amplitude by 20% to ensure visibility at a long distance.

8. The robot motion amplitude control system according to claim 7, wherein: The calculation formula for the distance compensation factor is: Calculate the compensation factor using the above formula according to the detected distance; if the distance is greater than 1 meter, the compensation factor is 1.2; otherwise, it is 1; The adjusted action amplitude is: Multiply the calculated compensation factor by the original action amplitude to obtain the adjusted action amplitude. ADA represents the adjusted action amplitude, MA represents the original total action amplitude, and CF represents the compensation factor.

9. The robot motion amplitude control system according to claim 8, wherein: The action execution module controls the rotation angle of the motor using a PWM signal; calculates the PWM value of the motor according to the adjusted action amplitude and sends it to the motor driver through the control module; the motor driver drives the motor according to the received PWM signal to make the target part swing according to the set amplitude.

10. The robot motion amplitude control system according to claim 9, wherein: The robot motion amplitude control system recaptures the user's facial expressions and voice signals every first preset time interval in seconds, recalculates the emotional intensity index. At the same time, it re-measures the distance between the user and the robot every second preset time interval in seconds and recalculates the distance compensation factor; Based on the new emotional intensity index and distance compensation factor, it recalculates the motion amplitude and adjusts the PWM value of the motor to ensure the real-time performance and adaptability of the motion.