Method and system for controlling a robot

By acquiring robot joint parameters through manual teaching and combining them with interpolation algorithms, a smooth, anthropomorphic effect of movements can be created by ordinary users without programming, solving the problems of diminishing fun and high technical barriers in existing robot motion control.

CN123156752APending Publication Date: 2026-11-24杭州全进科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611654273.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-26
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing motion control solutions for consumer-grade desktop entertainment and companion robots suffer from problems such as fixed motion content, high learning threshold, difficulty in precise control, and playback stuttering and jittering, which cannot meet the creative needs of ordinary users.

Method used

By acquiring the position parameters of movable joints through freehand teaching mode, and combining interpolation algorithms and smoothing techniques, smooth control of the servo motor is achieved, decoupling the model and rhythm, and ensuring smooth playback of the motion.

Benefits of technology

Users can create actions without programming, and the shape and rhythm are intuitively decoupled. Even inexpensive servos can achieve smooth humanoid movements, solving the problems of diminishing fun and high technical barriers in existing solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123156752A_ABST
    Figure CN123156752A_ABST
Patent Text Reader

Abstract

This invention relates to the field of robotics, and particularly to a method and a system for controlling a robot. The method for controlling a robot, wherein the robot has multiple servo motors, includes: manually moving a movable joint of the robot equipped with servo motors to a designated first position; acquiring and retaining first parameters of the position sensor of the servo motor of the movable joint at the designated first position; manually moving the movable joint at the first position to a designated second position; acquiring and retaining second parameters of the position sensor of the servo motor of the movable joint at the designated second position; initializing the movable joint of the robot, and sequentially changing the operating state of the servo motor of the movable joint according to the first and second parameters. Through manual force feedback teaching, users can create actions like manipulating a doll, achieving the movement of the movable joint as needed without any programming, modeling, or timeline manipulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robotics, and in particular to a method for controlling a robot and a system for controlling a robot. Background Technology

[0002] Currently, the motion control of consumer-grade desktop entertainment and companion robots mainly adopts the following technical solutions: (1) Manufacturer-preset fixed motion solution The vast majority of desktop entertainment robots on the market (such as various dancing robots and assembly programming robots) adopt a number of fixed motion sequences pre-set by the manufacturer before leaving the factory. Users can only call a limited number of preset motions through buttons or App. The motion content of this solution is completely fixed, and users cannot create their own motions. The fun of the product decays rapidly with the use time, and the repurchase and retention capabilities are weak. (2) Upper computer modeling and programming solution Some mid-to-high-end programmable robots (such as LEGO EV3 and some educational robots) provide upper computer modeling software. Users need to set the target angle and motion time of each joint on the computer in a graphical or textual way to arrange the motion. This type of solution requires users to have a certain spatial imagination ability and programming foundation. Ordinary consumers, especially children and the elderly, find it difficult to get started. The learning threshold is high and the creation efficiency is low. (3) Graphical timeline keyframe solution A few products provide a timeline-style keyframe editing interface. Users drag keyframes for each joint on the software. Although this scheme lowers the threshold to some extent, users still need to face the abstract multi-track timeline, making it difficult to intuitively predict the robot's real posture. Moreover, the transition between key frames mostly uses fixed interpolation, which cannot be smoothly optimized for the mechanical characteristics of inexpensive servos, and stuttering and jittering are easy to occur during playback. (4) Remote teaching scheme Some schemes support real-time control and recording of robot movement via remote control. This scheme has two inherent defects: First, the remote control freedom is limited, making it difficult to precisely control more than ten joints at the same time; second, the recorded remote control trajectory is continuous, with a large amount of data, which cannot be edited and cannot accurately control the rhythm of individual movements. Summary of the Invention

[0003] This invention addresses the technical problem of controlling the movable joints of a robot by providing a method for controlling a robot and a system for controlling a robot.

[0004] Firstly, a method for controlling a robot is provided, the robot having multiple servo motors, including: In response to the operation of entering the teaching mode, the robot's main control chip sends a torque reduction command to all servos via the bus, so that all servos enter a compliant state that can be manually operated. The robot's movable joint with a servo motor is moved to a designated first position by hand; Acquire and retain the first parameters of the position sensor of the servo motor of the movable joint at the specified first position; The movable joint in the first position is moved to a designated second position by hand; Acquire and retain the second parameter of the position sensor of the servo motor at the specified second position; The robot's movable joints are initialized, and the working state of the servo motors of the movable joints is changed sequentially according to the first parameter and the second parameter to control the robot's movable joints.

[0005] Preferably, it further includes: recording a first time length for transitioning a first parameter of the robot's movable joint to a second parameter of the robot's movable joint.

[0006] Preferably, it further includes: specifying the operating state of the servo in the first parameter and the operating state of the servo in the second parameter. Inserting by step One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Second-rate.

[0007] Preferably, it further includes: inserting a servo motor operating state between the first parameter and the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is:

[0008]

[0009] in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; These are interpolation coefficients, with values ​​ranging from [0,1]. This is the current interpolation time. and The cumulative time between adjacent first and second parameters; where It is a natural number.

[0010] Preferably, it further includes: inserting a servo motor operating state between the first parameter and the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is:

[0011]

[0012]

[0013] in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; This is the current interpolation time. and The cumulative time between adjacent first and second parameters; where It is a natural number; These are interpolation coefficients, with values ​​ranging from [0,1]. For a smooth transition function, satisfying , Furthermore, the derivative is zero at the endpoints, thus ensuring zero-speed start-up or shutdown.

[0014] Secondly, a system for controlling a robot is also provided, the robot having multiple servo motors, including: Initial unit: In response to the operation of entering the teaching mode, the robot's main control chip sends a torque reduction command to all servos via the bus, so that all servos enter a compliant state that can be manually operated; First moving unit: used to move the robot's movable joint with servo motor to a designated first position; First acquisition unit: used to acquire and retain the first parameters of the position sensor of the servo motor of the movable joint at the specified first position; Second moving unit: used to move the movable joint in the first position to a designated second position; Second acquisition unit: used to acquire and retain the second parameters of the position sensor of the servo motor of the movable joint in the specified second position; Control unit: Used to initialize the movable joints of the robot, and sequentially change the working state of the servo motors of the movable joints according to the first parameter and the second parameter, so as to control the movable joints of the robot.

[0015] Preferably, it further includes: a duration recording unit: used to record the first time length for transitioning the first parameter of the robot's movable joint to the second parameter of the robot's movable joint.

[0016] Preferably, it further includes: a first interpolation unit: used to specify the servo operating state between the first parameter and the second parameter. Inserting by step One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Second-rate.

[0017] Preferably, it further includes: a second interpolation unit: used to interpolate between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is:

[0018]

[0019] in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; These are interpolation coefficients, with values ​​ranging from [0,1]. This is the current interpolation time. and The cumulative time between adjacent first and second parameters; where It is a natural number.

[0020] Preferably, it further includes: a third interpolation unit: used to interpolate between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is:

[0021]

[0022]

[0023] in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; This is the current interpolation time. and The cumulative time between adjacent first and second parameters; where It is a natural number; These are interpolation coefficients, with values ​​ranging from [0,1]. For a smooth transition function, satisfying , Furthermore, the derivative is zero at the endpoints, thus ensuring zero-speed start-up or shutdown.

[0024] Beneficial effects: (1) Through manual force feedback teaching, users can create movements like playing with a doll without any programming, modeling or timeline operation, and the movable joints can move as needed; (2) Decoupling of form and rhythm makes creation intuitive and expressive. By using variable duration keyframes, users can specify the duration of each action while posing by hand, intuitively giving the action a fast or slow rhythm and emotion, without having to understand any kinematic parameters, thus solving the shortcomings of existing solutions that couple form and rhythm and have a heavy cognitive burden.

[0025] (3) Through algorithmic smoothing, even inexpensive servos can achieve smooth, human-like motion playback. Through two-level smoothing of software-layer interpolation frame supplementation (ensuring multi-joint synchronous progressive) and servo-layer time-based intra-frame planning (ensuring no speed abrupt changes within the frame), even consumer-grade inexpensive servos can achieve smooth, gentle, and jitter-free motion playback, solving the defects of playback stuttering and jittering in existing solutions. Attached Figure Description

[0026] Figure 1 A diagram showing a first embodiment of a method for controlling a robot; Figure 2 A second embodiment of a method for controlling a robot is shown in the figure; Figure 3 A diagram illustrating a third embodiment of a method for controlling a robot; Figure 4 A first embodiment of a system for controlling a robot is shown in the figure; Figure 5 A second embodiment of a system for controlling a robot is shown in the figure; Figure 6 A third embodiment of a system for controlling a robot is shown in the figure; Figure 7 Figure 4 illustrates a system for controlling a robot. Figure 8 This is a schematic diagram of the angle-time waveform of a method for controlling a robot.

[0027] Explanation of reference numerals in the attached figures: 1. A system for controlling a robot; 11. A first moving unit; 12. A first acquiring unit; 13. A second moving unit; 14. A second acquiring unit; 151. A first interpolation unit; 152. A second interpolation unit; 153. A third interpolation unit; 16. A control unit. Detailed Implementation

[0028] This invention addresses the technical problem of controlling the movable joints of a robot by providing a method and a system for controlling a robot. The movable joints include, but are not limited to, head yaw joints, arm joints, leg joints, and ankle joints, typically configured with 15 degrees of freedom.

[0029] Firstly, such as Figure 1 As shown, a method for controlling a robot is provided, the robot having multiple servo motors, including: S0: In response to the operation of entering the teaching mode, the robot's main control chip sends a torque reduction command to all servos via the bus, so that all servos enter a compliant state that can be manually operated. S1: Manually move the robot's movable joints equipped with servos to a designated first position; by turning off all servo torque on the robot's movable joints with a single button, each joint enters a compliant state that can be freely moved by hand; thus enabling the controlled robot's movable joints to move freely. This can be done manually or with other tools; the ultimate goal is to move the movable joints and stabilize them to the designated first position.

[0030] S2: Acquire and retain the first parameters of the position sensor of the servo motor of the movable joint at the specified first position; after the user positions the robot into the target shape by hand or with tools, i.e., after specifying the first position, the system controlling the robot collects the current joint angle from the position sensor built into each of the multiple servos of the movable joint and records it as the first parameter, i.e., the first keyframe; the first parameter includes: torque, angle range, response speed and other parameters related to the motion of the servo motor; and save the above first parameters of each servo motor.

[0031] S3: Move the movable joint in the first position to the designated second position by hand; after recording the first parameter, move the movable joint in the first position to the second position by hand or by moving tool.

[0032] S4: Acquire and retain the second parameters of the position sensor of the servo motor of the movable joint at the specified second position; similar to the above technical solution, acquire and save the second parameters of each servo motor at the second position to obtain the second keyframe.

[0033] S6: Initialize the robot's movable joints and sequentially change the working state of the servo motors of the movable joints according to the first and second parameters to control the robot's movable joints. Initialization means restoring the robot's movable joints to their initial state, where they are powered on without control signals. Upon powering on, the robot's movable joints will move to a first position according to the first parameters or first keyframes of each servo motor stored in the control system; then, the robot's movable joints will move from the first position to a second position according to the second parameters or second keyframes of each servo motor stored in the control system. Repeating the above steps, the robot's movable joints can be moved W times beforehand using manual movement or tools, acquiring and saving W keyframes or W parameters respectively, so that the control system can control the movable joints to move at least W times, forming the required movement trajectory of the movable joints. W is a natural number.

[0034] Preferred, such as Figure 2 , Figure 8As shown, it also includes: S51: Recording the first time length for the transition from the first parameter of the robot's movable joint to the second parameter of the robot's movable joint. In actual use, if each parameter or each keyframe is directly used for the movement of the movable joint, it may cause the movement of the movable joint to be stiff; or it may cause the servo motor to be physically damaged due to the excessively rapid movement of the movable joint. Therefore, in this technical solution, a first time length is set between each parameter. When recording each keyframe, the transition time specified for that frame is also received, the transition time representing the time taken to move from the previous keyframe to the current keyframe; for example, when multiple servos of the movable joint move to the position of the first parameter or the first keyframe, the control system controls the multiple servos to reach the position of the second parameter or the second keyframe after rotating for X milliseconds. The time taken to transition from the previous model or keyframe to the current model or keyframe (transition duration); smaller (e.g., 300ms) produces rapid action, larger (e.g., 1500ms) to generate a smooth motion; by specifying for each frame The decoupling of form or keyframe (space) and rhythm (time).

[0035] Repeating the above steps ensures that the movement of each servo in the movable joint is not too rapid. Instead, a transition time is required when moving from position Y to position Y+1, which helps prevent damage to each servo during the movement of the movable joint. When recording each keyframe, the user simultaneously specifies a transition duration for that keyframe. This represents the time it takes for the robot to move from the previous keyframe to the current keyframe. Smaller... (e.g., 300ms) enables the robot to complete the action quickly and powerfully, with a larger [response time]. (e.g., 1500ms) to allow the robot to complete the movement smoothly and gently.

[0036] By specifying the transition duration for each keyframe individually, users can directly choreograph the speed and rhythm of the movements (determining the temporal rhythm) while posing (determining spatial posture) freehand, thus decoupling pose and rhythm. For example, the user recorded three keyframes: the first frame was "arms raised" and specified... =300ms, the second frame is "arms extended to the sides" and specified =500ms, the third frame is "both arms down" and specified =1500ms. During playback, the robot will quickly raise its arms in 300ms, extend its arms to the sides at a medium speed in 500ms, and then slowly lower its arms in 1500ms, forming a fast-medium-slow rhythm change to make the movements expressive and emotional. If the transition duration mechanism is not used, and sparse keyframes are directly sent to the servos in sequence, multiple servos will move to the next pose at uncontrolled maximum speed, resulting in stiff, jittery movements, inconsistent arrival times of each servo, and failure to reflect the rhythm changes expected by the user. By combining transition duration with interpolation frames (see S52 for details), even using consumer-grade inexpensive servos, smooth, synchronized, and rhythmic motion playback can be achieved.

[0037] like Figure 8 As shown, in sparse keyframes, the user teaches the robot manually, arranging it into M poses. Each pose is recorded as a keyframe (P, d), and each τ represents the pose of a keyframe. P represents the angle vector of all joints, and d represents the duration of the frame (ms). Sparse keyframes are smoothed through the first level (cumulative time axis interpolation to fill frames) to obtain dense frames. In the dense frames, software interpolation is used, with all joints synchronously progressing progressively for a total of N frames. The step size Δt = 1 / frame rate, and frames are filled by uniform interpolation according to the step size Δt. All joints use the same interpolation coefficient α for synchronous progressive progress. After the dense frames are smoothed through the second level (servo time-based intra-frame trajectory planning), servo execution is performed. The servo execution carries the target position + arrival time Δt in each frame. After receiving (target position, Δt), the servo autonomously plans an S-shaped trajectory within the frame to ensure zero-speed start and stop without jitter.

[0038] Preferred, such as Figure 3 , Figure 8 As shown, it also includes: S52: between the operating state of the servo in the first parameter and the operating state of the servo in the second parameter, to specify Inserting by step One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Second-rate.

[0039] In practical use, because there are only two parameters or keyframes between the first and second positions—a phenomenon known as sparse keyframes—the servos of multiple movable joints will move to the next position at uncontrolled speeds, resulting in stiff movements, jitter, and inconsistent arrival times for each servo, thus affecting the performance of the movable joints. Therefore, this technical solution uses interpolation to process the sparse keyframes. That is, using a specified... Inserting by step Between each control frame and each keyframe; thus... A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. This technical solution makes the movement of each servo motor smoother, reduces vibration in the movable joints, and makes the movement more coordinated.

[0040] Preferred, such as Figure 8 As shown, it also includes S53: inserting between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is:

[0041]

[0042] in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; These are interpolation coefficients, with values ​​ranging from [0,1]. This is the current interpolation time. and The cumulative time between adjacent first and second parameters; where For natural numbers. Construct a cumulative timeline: =0, , ,in For the first The cumulative time of each keyframe This represents the total number of keyframes.

[0043] In practical use, because there are only two parameters or keyframes between the first and second positions—the so-called sparse keyframes—the servos of multiple movable joints will move to the next position at uncontrolled speeds, resulting in stiff movements, jitter, and inconsistent arrival times for each servo, affecting the working performance of the movable joint. In this technical solution, the method of inserting sparse keyframes differs from the above-mentioned solutions. The inserted frames in the above-mentioned solutions are of equal step length. Due to the different parameters such as the movement amplitude of each servo in the movable joint, in some environments, equal step length sparse keyframes can be detrimental to the movement of the movable joint, for example, making the movements of the movable joint uncoordinated or appearing stiff. In this technical solution, based on interpolation coefficients… The angle of the keyframe is assigned based on the previous angular position of the servo and the cumulative time of the previous rotation. Repeating these steps results in the robot's movable joints rotating M+1 times, making the rotation process more natural and smooth, and eliminating any servo motor stuttering.

[0044] Preferred, such as Figure 8 As shown, it also includes S54: inserting between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is:

[0045]

[0046]

[0047] in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; This is the current interpolation time. and The cumulative time between adjacent first and second parameters; where It is a natural number; These are interpolation coefficients, with values ​​ranging from [0,1]. For a smooth transition function, satisfying , Furthermore, the derivative is zero at the endpoints, thus ensuring zero-speed start-up or shutdown.

[0048] In practical use, because there are only two parameters or keyframes between the first and second positions—the so-called sparse keyframes—the servos of multiple movable joints will move to the next position at uncontrolled speeds, resulting in stiff movements, jitter, and inconsistent arrival times for each servo, affecting the working performance of the movable joint. In this technical solution, the method of inserting sparse keyframes differs from the above-mentioned solutions. The inserted frames in the above-mentioned solutions are of equal step length. Due to the different parameters such as the movement amplitude of each servo in the movable joint, in some environments, equal step length sparse keyframes can be detrimental to the movement of the movable joint, for example, making the movements of the movable joint uncoordinated or appearing stiff. In this technical solution, based on interpolation coefficients… Smooth transition function The keyframe angle is assigned based on the previous angular position of the servo motor and the cumulative time of previous rotations. Repeating these steps results in the robot's movable joints rotating L+1 times, making the rotation process more natural and smooth, and eliminating servo motor stuttering.

[0049] Secondly, such as Figure 4 As shown, a system 1 for controlling a robot is also provided, the robot having multiple servo motors, including: Initial unit 10: In response to the operation of entering the teaching mode, the robot's main control chip sends a torque reduction command to all servos via the bus, so that all servos enter a compliant state that can be manually operated. First moving unit 11: used to move the movable joint of the robot with a servo motor to a designated first position; First acquisition unit 12: used to acquire and retain the first parameters of the position sensor of the servo motor of the movable joint at the specified first position; Second moving unit 13: used to move the movable joint in the first position to a designated second position; Second acquisition unit 14: used to acquire and retain the second parameters of the position sensor of the servo motor of the movable joint in the specified second position; Control unit 16: Used to initialize the movable joints of the robot, and sequentially change the working state of the servo motors of the movable joints according to the first parameter and the second parameter, so as to control the movable joints of the robot.

[0050] Preferably, it further includes: a duration recording unit: used to record the first time length for transitioning the first parameter of the robot's movable joint to the second parameter of the robot's movable joint.

[0051] Preferred, such as Figure 5As shown, it also includes a first interpolation unit 151: used to specify the servo operating state between the first parameter and the second parameter. Inserting by step One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Second-rate..

[0052] Preferred, such as Figure 6 As shown, it also includes a second interpolation unit 152: used to insert an interpolation between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is:

[0053]

[0054] in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; These are interpolation coefficients, with values ​​ranging from [0,1]. This is the current interpolation time. and The cumulative time between adjacent first and second parameters; where It is a natural number.

[0055] Preferred, such as Figure 7 As shown, it also includes a third interpolation unit 153: interpolating between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is:

[0056]

[0057]

[0058] in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; This is the current interpolation time. and The cumulative time between adjacent first and second parameters; where It is a natural number; These are interpolation coefficients, with values ​​ranging from [0,1]. For a smooth transition function, satisfying , Furthermore, the derivative is zero at the endpoints, thus ensuring zero-speed start-up or shutdown.

[0059] Use Case: A family user wants their robot to perform a self-created dance at a family birthday party. The user has no programming experience. Device: A desktop companion robot integrating this invention, with 15 degrees of freedom, a servo motor bus speed of 1Mbps, and accompanying mobile phone software as the host computer.

[0060] Implementation process: Step T1: The user clicks "Enter Teach Mode" on the mobile software. The main control chip broadcasts a torque shutdown command to the bus (broadcast address 0xFE, sent 3 times consecutively). The 15 servos enter a low holding torque compliant state (torque drops to about 15% of the rated value). At this time, each joint of the robot can be easily moved by hand and can stop at the current position after being released.

[0061] Step T2: The user manually positions the robot into the first pose (arms raised, head centered) and clicks "Record". The main control chip sequentially reads the current angles of the 15 servos and retrieves the attitude vector. =[1500,2100,1900,1500,900,1100,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500] (unit: servo position value). The system verifies that all 15 servos have successfully read back, prompting the user to input the duration of this frame. The user inputs 300ms (quick start), and this is recorded as (…). ,300).

[0062] Step T3: The user strikes poses 2 through 8 in sequence and records each pose, assigning a different duration to each frame: Frame 2, right arm waving. =500ms, 3rd frame, left arm waving =500ms, 4th frame: Turns head to act cute =800ms, crouching in the 5th frame =1200ms (relaxation), 6th frame: stand up and extend arms. =600ms, turning around in the 7th frame =1000ms, 8th frame, return to center, freeze frame. =400ms. During the readback of the 5th frame, the servo with ID 0x0A lost a packet, but the system automatically reread it and successfully completed the packet without interrupting the user's creation.

[0063] Step T4: The user clicks "Save," and the 8 keyframes, along with their respective durations, are stored as a CSV file. The app interpolates and pads the sparse sequence at a target frame rate of 10fps, constructing a cumulative timeline (total duration). =300+500+500+800+1200+600+1000+400=5300ms), in steps Approximately 53 dense frames are generated in 100ms. The 15 joints in each frame are calculated using synchronous linear interpolation (with optional S-shaped smoothing).

[0064] Step T5: The user clicks "Play," and the main control chip sends out dense frames frame by frame in time-based mode, with each frame carrying a 100ms arrival time. The servo motors complete trajectory planning within the frame. The robot smoothly completes the entire birthday dance, with multi-joint synchronous and progressive movements, without any stuttering or jitter.

[0065] Implementation Results: A home user with no programming experience created a 5.3-second personalized dance piece by hand in about 5 minutes, with smooth and human-like movements. Compared to existing solutions that require modeling and programming (which ordinary users often cannot complete), this invention lowers the barrier to motion creation to zero, and allows users to intuitively give the dance a rhythm of fast and slow fluctuations through variable-duration keyframes.

[0066] Beneficial effects: (1) Through manual force feedback teaching, users can create movements like playing with a doll without any programming, modeling or timeline operation, and the movable joints can move as needed; (2) Decoupling of form and rhythm makes creation intuitive and expressive. By using variable duration keyframes, users can specify the duration of each action while posing by hand, intuitively giving the action a fast or slow rhythm and emotion, without having to understand any kinematic parameters, thus solving the shortcomings of existing solutions that couple form and rhythm and have a heavy cognitive burden.

[0067] (3) Through algorithmic smoothing, even inexpensive servos can achieve smooth, human-like motion playback. Through two-level smoothing of software-layer interpolation frame supplementation (ensuring multi-joint synchronous progressive) and servo-layer time-based intra-frame planning (ensuring no speed abrupt changes within the frame), even consumer-grade inexpensive servos can achieve smooth, gentle, and jitter-free motion playback, solving the defects of playback stuttering and jittering in existing solutions.

[0068] Finally, it should be noted that any modification or equivalent substitution of some or all of the technical features based on the device structure and the technical solutions of the embodiments of the present invention, without departing from the corresponding technical solutions of the present invention, shall fall within the patent scope of the device structure and the embodiments of the present invention.

Claims

1. A method for controlling a robot, the robot having a plurality of servo motors, characterized in that, include: In response to the operation of entering the teaching mode, the robot's main control chip sends a torque reduction command to all servos via the bus, so that all servos enter a compliant state that can be manually operated. The robot's movable joint with a servo motor is moved to a designated first position by hand; Acquire and retain the first parameters of the position sensor of the servo motor of the movable joint at the specified first position; The movable joint in the first position is moved to a designated second position by hand; Acquire and retain the second parameter of the position sensor of the servo motor at the specified second position; The robot's movable joints are initialized, and the working state of the servo motors of the movable joints is changed sequentially according to the first parameter and the second parameter to control the robot's movable joints.

2. The method for controlling a robot according to claim 1, characterized in that, Also includes: Record the first time length during which the first parameter of the robot's movable joint is transitioned to the second parameter of the robot's movable joint.

3. The method for controlling a robot according to claim 1, characterized in that, Also includes: Between the servo's operating state of the first parameter and the servo's operating state of the second parameter, to specify Inserting by step One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Second-rate.

4. The method for controlling a robot according to claim 3, characterized in that, Also includes: Insert between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is: in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; These are interpolation coefficients, with values ​​ranging from [0,1]. This is the current interpolation time. and This is the cumulative time between adjacent first and second parameters; in It is a natural number.

5. The method for controlling a robot according to claim 3, characterized in that, Also includes: Insert between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is: in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; This is the current interpolation time. and This is the cumulative time between adjacent first and second parameters; in It is a natural number; These are interpolation coefficients, with values ​​ranging from [0,1]. For a smooth transition function, satisfying , Furthermore, the derivative is zero at the endpoints, thus ensuring zero-speed start-up or shutdown.

6. A system for controlling a robot, the robot having multiple servo motors, characterized in that, include: Initial unit: In response to the operation of entering the teaching mode, the robot's main control chip sends a torque reduction command to all servos via the bus, so that all servos enter a compliant state that can be manually operated; First moving unit: used to move the robot's movable joint with servo motor to a designated first position; First acquisition unit: used to acquire and retain the first parameters of the position sensor of the servo motor of the movable joint at the specified first position; Second moving unit: used to move the movable joint in the first position to a designated second position; Second acquisition unit: used to acquire and retain the second parameters of the position sensor of the servo motor of the movable joint in the specified second position; Control unit: Used to initialize the movable joints of the robot, and sequentially change the working state of the servo motors of the movable joints according to the first parameter and the second parameter, so as to control the movable joints of the robot.

7. The robot control system according to claim 6, characterized in that, Also includes: Duration recording unit: used to record the first time length during which the first parameter of the robot's movable joint is transitioned to the second parameter of the robot's movable joint.

8. The system for controlling a robot according to claim 6, characterized in that, Also includes: First interpolation unit: used to specify the servo operating state between the first parameter and the second parameter. Inserting by step One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Second-rate.

9. The system for controlling a robot according to claim 8, characterized in that, Also includes: The second interpolation unit is used to interpolate between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is: in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; These are interpolation coefficients, with values ​​ranging from [0,1]. This is the current interpolation time. and This is the cumulative time between adjacent first and second parameters; in It is a natural number.

10. The system for controlling a robot according to claim 8, characterized in that, Also includes: The third interpolation unit is used to interpolate between the servo operating state of the first parameter and the servo operating state of the second parameter. One control frame; the A control frame causes the servo motor to rotate between the operating state of the first parameter and the operating state of the second parameter. Furthermore, the angle of each rotation of the servo motor is: in, For a moment The Interpolation angle of each servo motor; For the first The first parameter The angle of the servo motor; For the first The first parameter The angle of the servo motor; This is the current interpolation time. and This is the cumulative time between adjacent first and second parameters; in It is a natural number; These are interpolation coefficients, with values ​​ranging from [0,1]. For a smooth transition function, satisfying , Furthermore, the derivative is zero at the endpoints, thus ensuring zero-speed start-up or shutdown.