A motion control method and electronic device
Patent Information
- Application Number
- CN202610966264.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]为了驱动运动部件运动,电子设备的电源需要输出相应电流以提供驱动力,当输出电流过大时,电源可能无法驱动运动部件
Smart Images

Figure CN122569468A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of motion control technology, and in particular to a motion control method and electronic device. Background Technology
[0002] Some electronic devices have movable parts that can be controlled to perform specific actions.
[0003] In order to drive the movement of moving parts, the power supply of electronic devices needs to output a corresponding current to provide driving force. When the output current is too large, the power supply may not be able to drive the moving parts. Summary of the Invention
[0004] Therefore, this application discloses the following technical solution:
[0005] The first aspect of this application provides a motion control method, comprising:
[0006] Obtain motion commands to trigger target actions;
[0007] Based on the motion command, a motion control signal is generated;
[0008] Based on the motion control signal, multiple moving parts are controlled to swing at an angle, forming a continuously superimposed driving force over a target time period, thereby driving the electronic device to perform the target action;
[0009] During the target time period, the output current of the power supply does not exceed the current threshold.
[0010] A second aspect of this application provides an electronic device, including a device body and a plurality of moving parts;
[0011] Each moving component includes a swing arm, which is rotatably connected to the device body, and the device body drives the swing arm to swing via a servo motor;
[0012] The device body is equipped with a processor for controlling the moving parts;
[0013] The processor is used for:
[0014] Obtain motion commands to trigger target actions;
[0015] Based on the motion command, a motion control signal is generated;
[0016] Based on the motion control signal, multiple moving parts are controlled to swing at an angle, forming a continuously superimposed driving force over a target time period, thereby driving the electronic device to perform the target action; during the target time period, the output current of the power supply does not exceed the current threshold. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 This is a flowchart of a motion control method provided in an embodiment of this application;
[0019] Figure 2 This is a schematic diagram of a circuit structure for driving a moving component, provided in an embodiment of this application.
[0020] Figure 3 This is a schematic diagram of a motion control signal provided in an embodiment of this application;
[0021] Figure 4 This is a schematic diagram of a moving part of an electronic device provided in an embodiment of this application;
[0022] Figure 5 This is a schematic diagram of a moving part of another electronic device provided in an embodiment of this application;
[0023] Figure 6 This is a schematic diagram illustrating an electronic device performing a target action according to an embodiment of this application;
[0024] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application;
[0025] Figure 8 This is a schematic diagram of another electronic device provided in an embodiment of this application. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] This application provides a motion control method. Please refer to [link to relevant documentation]. Figure 1 The method may include the following steps.
[0028] S101, obtain the motion command used to trigger the target action.
[0029] S102 generates motion control signals based on motion commands.
[0030] S103, based on motion control signals, controls multiple moving parts to swing at an angle, forming a continuously superimposed driving force over a target time period, driving electronic devices to perform target actions, and the output current of the power supply does not exceed the current threshold during the target time period.
[0031] The execution subject of the method in this embodiment can be any electronic device with multiple moving parts. By controlling the movement of these moving parts, such as swinging at a certain angle, the electronic device can perform several actions. As an example, the electronic device in this embodiment can be a quadrupedal device (such as a robot dog device) that has four swing arms supporting the device body and driving the device body to move. The multiple moving parts include the four swing arms of the robot dog device (equivalent to the robot dog's feet), or it can be a robot device, and the multiple moving parts include the robot device's two feet and two hands.
[0032] The beneficial effect of this embodiment is that when the electronic device needs to perform a target action, multiple moving parts are controlled to swing at a certain angle based on the motion control signal, thereby forming a continuously superimposed driving force that can drive the electronic device to perform the target action over the target time period. In other words, after applying this solution, the way the electronic device outputs the driving force required for the target action is changed from instantaneous output over a short period of time to continuous superimposed output over the target time period. This can reduce the peak value of the power supply output current during the target time period, thereby enabling the target action to be performed while controlling the power supply output current to not exceed the current threshold, ensuring sufficient voltage to drive the moving parts.
[0033] The following section uses the circuit structure of a moving part in an electronic device to illustrate the beneficial effects of this solution compared to related technologies. Figure 2 This is a typical circuit structure for driving moving parts. The dashed lines represent control signal lines, and the solid lines represent current paths. The power supply is used to output current, and the boost module is used to boost the output voltage of the power supply to a specific value to meet the voltage requirements of the drive module. For example, if the drive module requires an input voltage of 5 volts (V) to work, the boost module will boost the output voltage of the power supply from 3.7V to 5V. The regulator is used to convert the voltage output by the boost module into the voltage required by the microcontroller (such as 3.3V) to drive the microcontroller to work.
[0034] There can be multiple drive modules, and each drive module corresponds to a moving part. The moving parts are installed on the drive modules so that the drive modules can drive the moving parts to move when they are running. For example, the drive module can be a servo motor, and the moving parts are installed on the shaft of the drive module. When the shaft of the drive module rotates, it can drive the moving parts to swing or rotate.
[0035] The microcontroller controls the electronic switch to turn on or off according to the motion command, so that the drive module is powered on and running or powered off and stopping. It also outputs motion control signals to the drive module according to the motion command, so that the drive module runs according to the motion control signal, such as rotating a certain angle according to the motion control signal, thereby controlling the moving parts to move according to the motion control signal. When the drive module is a servo, the motion control signal can be, for example, a pulse width modulation signal.
[0036] Due to the influence of the power supply's internal resistance and the circuit's internal resistance, the larger the power supply's output current I, the smaller the input voltage Ui of the boost module. Therefore, the boost module's voltage boosting capability is limited. When Ui is less than the boost module's allowable range, the boost module cannot output the voltage required by the drive module. For example, the relationship between Ui and I can be expressed as Ui = U0 - I * R, where U0 is the standard output voltage of the power supply, such as 3.7V, and R is the sum of the internal resistances of the power supply, circuitry, connectors, and circuit board, for example, 0.3 ohms. When the output current reaches 3.9 amperes (A), Ui will drop to approximately 2.53V, which is less than the lower limit of the allowable range (2.7V to 5.5V). Therefore, the boost module cannot output a 5V voltage, and the drive module will stop working because the input voltage is insufficient to 5V.
[0037] When performing a specific action, related technologies typically control multiple moving parts to move simultaneously, thereby concentrating the output of the driving force required to perform the action in a short period of time. This control method requires the power supply to output a large amount of power in a short period of time, which can easily cause the power supply's output current to reach a large peak value in a short period of time. For example, when controlling the four legs of a robot dog device to swing simultaneously, the peak value of the power supply's output current may reach 3.9A, which will cause the drive module to stop working due to insufficient input voltage, making it impossible for the moving parts to continue moving and the electronic device to complete the specific action.
[0038] After applying the control method of this embodiment, the electronic device reduces the maximum power that the power supply needs to output during the target time period by outputting continuously superimposed driving forces during the target time period, thereby reducing the peak value of the power supply's output current during the target time period, so that the power supply's output current does not exceed the current threshold during the target time period. In this way, the input voltage of the boost module is always maintained within its allowable range during the target time period, and the input voltage of the drive module can always meet its requirements (for example, the input voltage is fixed at 5V), thereby ensuring that there is enough voltage to drive the moving parts.
[0039] The motion commands of S101 can be generated by the processor built into the electronic device, or obtained through interaction between the electronic device and other devices. For example, the processor of the electronic device may identify an obstacle in the direction of travel based on an image captured by a camera, and then generate motion commands to trigger the execution of a target action to overcome the obstacle, such as jumping over the obstacle; or, for example, the electronic device and a remote control may be connected, and the user may perform an operation to control the electronic device to jump using the remote control, in which case the remote control may send a motion command to the electronic device to trigger the jump action.
[0040] The motion control signal generated in S102 is related to the type of drive module that drives the moving part to swing. The signal parameters of the motion control signal are related to the angle that the corresponding moving part needs to swing. The correspondence between the signal parameters and the angle can be pre-configured in the electronic device. When generating the motion control signal, it is only necessary to determine the angle that the moving part needs to swing to, and then generate the motion control signal with the corresponding signal parameters according to that angle.
[0041] For example, if the drive module is a servo motor, the motion control signal can be a pulse width modulation signal with a fixed signal period and adjustable pulse width. The pulse width of this signal can control the servo motor's shaft (also called the output shaft) to rotate to and maintain a specified angle. See also, as an example... Figure 3 The signal period of the pulse width modulation signal is 20 milliseconds (ms). When the pulse width is 0.5ms, the servo shaft remains at its initial angle, denoted as 0 degrees. When the pulse width is 1ms, the servo shaft rotates to 45 degrees, at 1.5ms it rotates to 90 degrees, at 2ms it rotates to 145 degrees, and at 2.5ms it rotates to 180 degrees.
[0042] When generating control signals, the electronic device can determine the angle to which the servo of each moving part should swing, and then generate a pulse width modulation signal with a corresponding pulse width for the servo of that moving part. For example, if the servo of the first moving part needs to rotate to 90 degrees, a motion control signal with a pulse width of 1.5ms is generated and output to the servo of the first moving part.
[0043] The formation of a continuously superimposed driving force over a target time period refers to the fact that multiple moving parts do not swing simultaneously within the target time period, but the driving forces generated by the swinging of multiple moving parts are superimposed on each other on the time axis. In other words, among the multiple controlled moving parts, before the driving force generated by one moving part disappears, another moving part begins to swing to generate a new driving force. For example, if one moving part starts to swing at time T0 and generates a driving force during the time period from T0 to T2, another moving part can start to swing at time T1, which is after T0 and before T2, so as to generate a new driving force before the driving force of the former disappears, thereby achieving the effect of forming a continuously superimposed driving force over the target time period.
[0044] The current threshold of S103 is related to parameters such as the output voltage of the power supply, the internal resistance of the power supply and related circuitry, and the lower limit of the input voltage tolerance of the boost module. For example, the current threshold can be set such that, given a certain internal resistance and power supply output voltage, when the power supply output current reaches the threshold, the input voltage of the boost module should be greater than or equal to its lower limit of tolerance, i.e.: (output voltage of the power supply - lower limit of tolerance) / internal resistance ≥ current threshold. Taking an output voltage of 3.7V, an internal resistance of 0.3 ohms, and a lower limit of tolerance of 2.7V as an example, the current threshold could be 3.33A.
[0045] Optionally, multiple moving parts are controlled to form a continuously superimposed driving force over a target time period by angular oscillation, including at least one of the following control strategies:
[0046] Control strategy one: control at least two moving parts to swing at different times within the target time period. The driving force generated by each moving part at different times is continuously distributed in time and superimposed on each other to form a continuous driving force.
[0047] Control strategy two involves controlling multiple moving parts to swing sequentially at multiple amplitudes within a target time period. The driving force generated by each moving part at its corresponding amplitude is continuously distributed over time and superimposed on each other to form a continuous driving force.
[0048] In control strategy one, the times when multiple moving parts start to swing are different, the amplitude of the swing of multiple moving parts can be the same or different, and the time when each moving part starts to swing is within the duration of the driving force generated by at least one other moving part. That is, before the driving force generated by one moving part disappears, another moving part starts to swing and generate driving force, thus forming a driving force that is continuously distributed in time and superimposed on each other.
[0049] From the start of the swing to the end of the swing, the input current of the drive module of the moving part will rapidly increase to the current peak and then drop from the current peak to 0. The time of the current peak is related to the time when the moving part starts to swing. The moving part that starts to swing first will have the current peak first, and the moving part that starts to swing later will have the current peak later.
[0050] The advantage of controlling the moving parts according to control strategy one is that by controlling the four moving parts to swing sequentially at different times in the target time period, the current peaks of the drive modules input to the four moving parts can be prevented from occurring at the same time. This prevents multiple current peaks from superimposing and causing the power supply output current to exceed the current threshold, thereby controlling the power supply output current to not exceed the current threshold during the target time period.
[0051] For example, when a moving part swings, the peak current input to its drive module is 0.975A. If four moving parts start swinging simultaneously, the power supply needs to output a peak current of 0.975A to all four drive modules at a certain moment, resulting in a power supply output current of 4 * 0.975A, or 3.9A, which exceeds the current threshold of 3.33A. However, if the four moving parts swing sequentially but not simultaneously, the power supply does not need to output a peak current of 0.975A to all four drive modules at the same time. The maximum output current within the target time period can be significantly reduced from 3.9A, for example, to approximately 2.9A, which is less than the current threshold.
[0052] In control strategy two, some moving parts can begin oscillating simultaneously, and the amplitude of some oscillations can be the same. However, at least two of the multiple moving parts begin oscillating at different times, and at least two of the moving parts have different oscillation amplitudes. For example, with four moving parts, two of them begin oscillating simultaneously at an amplitude of 45 degrees, and after a period of time, the other two parts simultaneously oscillate at an amplitude of 10 degrees. The moment each moving part begins oscillating is within the duration of the driving force generated by at least one other moving part.
[0053] The advantage of controlling the moving parts according to control strategy two is that by controlling different moving parts to swing at different amplitudes, the swing amplitude of some moving parts can be appropriately reduced. The swing amplitude is related to the peak current of the input drive module during the swing of the moving parts. Therefore, the peak current of the input drive module can be appropriately reduced, thereby further reducing the output current of the power supply during the target time period.
[0054] In addition, multiple components swing without varying amplitudes, and the driving forces they generate are also different. This can generate torques acting on the electronic device, thereby enabling control over the direction of the electronic device's action when performing a target action, such as the direction of a jump.
[0055] Optionally, one implementation of controlling at least two moving parts to oscillate at different times within a target time period (i.e., control strategy one) may include:
[0056] Control the first moving part to swing at a first moment, control the second moving part to swing at a second moment, control the third moving part to swing at a third moment, and control the fourth moving part to swing at a fourth moment;
[0057] The second moment is after the first moment, the third moment is after the second moment, and the fourth moment is after the third moment. The interval between the second moment and the first moment is less than the interval between the third moment and the second moment, and the interval between the fourth moment and the third moment is less than the interval between the third moment and the second moment.
[0058] In this embodiment, the first moment can be regarded as the start moment of the target time period, and the fourth moment can be the end moment of the target time period, or the moment before the end moment.
[0059] In this embodiment, the electronic device can be a quadrupedal device with four swing arms supporting its movement. The electronic device can have a second body, and the first to fourth moving parts are mounted on the second body and are all rotatably connected to the second body. The first and second moving parts can be arranged opposite to each other on the second body, and the third and fourth moving parts can be arranged opposite to each other on the second body. The first and second moving parts can be located at one end of the second body, and the third and fourth moving parts can be located at the other end of the second body. The above four moving parts can be equivalent to four swing arms on the second body.
[0060] by Figure 4 For example, Figure 4 (1) is the front view of the electronic device. Figure 4 (2) is Figure 4 The top view of (1) shows the four swing arms of the electronic device, namely the first to fourth moving parts mentioned above. For easy distinction, one end of the second body is taken as the front end and the other end as the rear end. Thus, the four swing arms are referred to as the rear left swing arm, the rear right swing arm, the front right swing arm and the front left swing arm.
[0061] The swinging of the first to fourth moving parts can be controlled by swinging these parts from their current angle in a first direction to a second angle. Before the moving parts begin to swing within the target time period, the angles of the moving parts are all greater than the second angle. The second angle can be the initial angle of the moving parts when the electronic device is powered on.
[0062] Taking a quadrupedal electronic device as an example, when a quadrupedal device is powered on, its four moving parts are generally perpendicular to the supporting surface, making the quadrupedal device stand upright. At this time, the angles of these moving parts can be recorded as the initial angles. For ease of explanation, the initial angles can be used as a reference, i.e., set to 0 degrees. When the moving parts swing in any direction, the angle after the swing is equivalent to 0 degrees.
[0063] During the target time period, the first direction of the swing of the moving part is opposite to the direction of the target action to be performed. For example, when the electronic device jumps forward, the first direction is towards the rear of the electronic device, and when the electronic device jumps backward, the first direction is towards the front of the electronic device.
[0064] To prevent the electronic device from tipping over when the moving parts are controlled to swing in the manner described above, the interval between the first and second moments can be less than or equal to a preset interval threshold, and the interval between the third and fourth moments can be less than or equal to a preset interval threshold. The interval threshold can be determined based on the balance performance of the electronic device. The easier the electronic device is to tip over, the smaller the interval threshold should be; the less likely the electronic device is to tip over, the larger the interval threshold can be. For example, the above interval threshold can be 5ms.
[0065] The advantages of executing the target action based on the above control strategy are:
[0066] The first to fourth moving parts of the electronic device start oscillating sequentially within the target time period. This allows for better staggering of the peak current during the oscillation of each moving part when performing the target action involving the four moving parts. This reduces the maximum output current of the power supply within the target time period, preventing it from exceeding the current threshold. Furthermore, controlling the first and second moving parts to start oscillating at two similar times, and the third and fourth moving parts to start oscillating at two similar times, helps improve the continuity of the oscillation of each moving part while ensuring that the output current does not exceed the current threshold, making the process of performing the target action smoother.
[0067] Optionally, the relative orientation of the first and second moving parts can be opposite to that of the third and fourth moving parts. For example, the first moving part corresponds to the rear left swing arm, the second moving part corresponds to the rear right swing arm, the third moving part corresponds to the front right swing arm, and the fourth moving part corresponds to the front left swing arm.
[0068] The advantage of controlling the swing in this way is that multiple moving parts swing at different times, which will generate a torque acting on the second body. The direction of the torque is related to the relative position of the moving parts that swing in sequence. For example, the swing of the rear left swing arm and the rear right swing arm in sequence will generate a torque that makes the second body move to the right.
[0069] By controlling the sequential movement of components with opposite relative orientations, it helps to cancel out the torques generated by the sequential movements to a certain extent. For example, the rear left swing arm and the rear right swing arm swing in sequence to generate a rightward torque, while the front right swing arm and the front left swing arm swing in sequence to generate a leftward torque. The two cancel each other out, which helps to maintain the balance of the electronic device after the target action is performed.
[0070] In another alternative implementation, the two moving parts can be controlled to move sequentially based on control strategy one within a target time period to perform the target action.
[0071] Taking an electronic device as a robotic device, and the target action as the throwing action of a thrown object as an example, see [link to relevant documentation]. Figure 5 , Figure 5 (1) is the front view of the robot device. Figure 5 (2) is a side view of the robot device. Figure 5 The arrow in (2) indicates the throwing direction of the throwing action, denoted as forward.
[0072] After receiving the motion command, the robot first controls the first moving part to swing forward to the second angle through the motion control signal at the first moment. In this embodiment, the value of the second angle can be calculated by the electronic device as needed. For example, it can be an angle of 45 degrees with the vertical direction. Then, the first moment can be taken as the starting moment of the target time period, and any moment within the target time period can be taken as the second moment. At the second moment, the second moving part is controlled to swing forward to the second angle as well. Thus, the driving force formed by the forward swing of the first and second moving parts is continuously superimposed, so that the electronic device throws the object forward.
[0073] In this embodiment, the target time period can be the time period from the first moment to the moment when the thrown object is about to leave the second moving part, that is, the second moving part starts to swing after the first moving part starts to swing and before the thrown object leaves the second moving part.
[0074] Optionally, one implementation of controlling multiple moving parts to oscillate sequentially with multiple amplitudes within a target time period (i.e., control strategy two) may include:
[0075] Control the first and second moving parts to swing from the first angle to the second angle in the first direction; control the third and fourth moving parts to swing from the third angle to the second angle in the first direction; the first angle is greater than the second angle, the third angle is greater than the second angle, and the first angle and the third angle are different.
[0076] The first angle can be greater than or less than the third angle, depending on the direction of the target action indicated in the motion command.
[0077] For example, the end containing the first and second moving parts can be designated as the rear end of the electronic device, and the end containing the third and fourth moving parts can be designated as the front end. If the target action is a jumping motion, and the motion command instructs the electronic device to jump forward, to generate a forward torque, the first and second moving parts at the rear end should swing with a larger amplitude, while the third and fourth moving parts at the front end should swing with a smaller amplitude; therefore, the first angle is greater than the third angle. Conversely, if the motion command instructs the electronic device to jump backward, to generate a backward torque, the first and second moving parts at the rear end should swing with a smaller amplitude, while the third and fourth moving parts at the front end should swing with a larger amplitude; therefore, the first angle is less than the third angle. The larger of the first and third angles can vary according to the required swing amplitude. For example, when the first angle is greater than the third angle, the first angle can be 45 degrees, 30 degrees, or 20 degrees, while the third angle can be fixed at 10 degrees.
[0078] When a motion command is received, the first and second moving parts may be at or not at the first angle, and the third and fourth moving parts may be at or not at the third angle.
[0079] If the components are not at the corresponding angle, the electronic device can first control the moving parts to swing to the corresponding angle, and then control each moving part to swing to the second angle in the manner described above.
[0080] In this embodiment, the first and second moving parts start to swing simultaneously, and the moment when these two moving parts start to swing can be recorded as the fifth moment; the third and fourth moving parts start to swing simultaneously, and the moment when these two moving parts start to swing can be recorded as the sixth moment. The sixth moment is after the fifth moment. The fifth moment and the sixth moment can be any two moments within the target time period. For example, the fifth moment is the start moment of the target time period, and the sixth moment is the end moment of the target time period.
[0081] The advantages of controlling the moving parts in the above manner are as follows: controlling the first and second moving parts to swing at the same amplitude simultaneously, as well as controlling the third and fourth moving parts to swing at the same amplitude simultaneously, can reduce the torque generated by the sequential movement of different moving parts, preventing the electronic equipment from tipping over. At the same time, staggering the swing times of the first and second moving parts with the swing times of the third and fourth moving parts can also stagger the peak current during the swing of the moving parts, ensuring that the output current does not exceed the current threshold within the target time period.
[0082] In any of the foregoing embodiments, controlling the moving component to swing to any angle can be achieved by generating a motion control signal with a corresponding pulse width and sending the motion control signal to the drive module corresponding to the moving component. For example, generating a motion control signal with a pulse width corresponding to the second angle and sending the motion control signal to the drive module (servo) of the first moving component at the first moment can control the first moving component to start swinging to the second angle at the first moment.
[0083] Optionally, when controlling the swing of moving parts according to any control strategy, in order to meet the condition of forming a continuously superimposed driving force, the duration of the target time period should not be too long. In this embodiment, the upper limit of the duration of the target time period can be determined by ensuring that the swing of each moving part meets the condition of action continuity and that the target action is formed.
[0084] Taking a jumping motion as an example, and the electronic device as the aforementioned quadruped device, the quadruped device is in the aforementioned pre-jump state before entering the target time period to begin executing the jumping motion. In this state, the second body will tilt at a certain angle relative to the support surface of the quadruped device, such as... Figure 4 shown in (1).
[0085] From the moment the first moving part of the quadruped device begins to swing until the second body returns to a horizontal position (parallel to the support surface), if other moving parts do not swing successively during this period, the motion of multiple moving parts will not meet the motion continuity condition. Therefore, the time elapsed from the moment the first moving part of the quadruped device begins to swing to the moment the second body returns to a horizontal position can be used as the upper limit of the target time period. In some application scenarios, this upper limit can be 60ms. The horizontal position of the second body can be, for example,... Figure 6 The pose of the subject in (1) or (5).
[0086] On the other hand, this solution controls the sequential swinging of moving parts within the target time period to stagger the peak currents occurring during the swinging of each moving part, thereby reducing the maximum output current of the power supply within the target time period. Therefore, the duration of the target time period should be sufficient to stagger at least two peak currents. When a moving part swings, the peak current of its drive module will persist for a time window. Within this time window, the current input to the drive module is equal to or close to the peak current. Therefore, the duration of the target time period should be at least longer than the duration of a time window to achieve the staggering of peak currents. In some application scenarios, the duration of the time window can be 20ms, meaning the lower limit of the target time period can be 20ms.
[0087] Furthermore, in order to achieve staggered peak currents, the interval between the times when different moving parts begin to swing within the target time period can also be greater than or equal to the aforementioned lower limit of duration. For example, the interval between the first and fourth times is greater than or equal to 20ms, and the interval between the fifth and sixth times is greater than or equal to 20ms.
[0088] In summary, the target time period in this embodiment can be a time period between 20ms and 60ms, starting from the moment the first moving part begins to swing. For example, it can be a time period within 55ms starting from the moment the first moving part begins to swing.
[0089] Control strategies one and two can also work together, meaning that the implementation of S103 can also include:
[0090] At the first moment, the first moving part is controlled to swing from the first angle in the first direction to the second angle;
[0091] At the second moment, the second moving component is controlled to swing from the first angle in the first direction to the second angle;
[0092] At the third moment, the third moving component is controlled to swing from the third angle toward the first direction to the second angle;
[0093] At the fourth moment, the fourth moving component is controlled to swing from the third angle to the first direction to the second angle.
[0094] The above control methods are examples of control strategies one and two mentioned above. Depending on the type of electronic device and the target action to be performed, the electronic device may also implement control strategies one and two in other ways, and is not limited to the examples above.
[0095] In any embodiment of this application, the first moment when the first moving part begins to swing can be any moment after the electronic device receives the motion command.
[0096] Optionally, after receiving a motion command, the electronic device may not be able to perform the target action in its current state. Therefore, the electronic device can first perform a preparatory action to put itself in a state where it can perform the target action. Furthermore, after performing the target action (i.e., after the target time period ends), the electronic device can also perform other subsequent actions to adjust its own posture. In the case of performing a preparatory action, the aforementioned first moment can be any moment after the preparatory action ends.
[0097] As an example of a preparatory action and a subsequent action, before controlling the moving parts to swing to the second angle, the action further includes: controlling the first moving parts and the second moving parts to swing to the first angle, and controlling the third moving parts and the fourth moving parts to swing to the third angle;
[0098] After controlling multiple moving parts to swing sequentially at multiple amplitudes within a target time period, the process also includes:
[0099] In response to the movement component leaving the support surface, each movement component is controlled to swing from the second angle toward the first direction to the fourth angle, and the third and fourth movement components are controlled to swing from the fourth angle toward the second direction to the fifth angle; the first direction is opposite to the second direction.
[0100] In response to the moving parts re-contacting the support surface, control each moving part to return to its initial angle.
[0101] In this embodiment, the process of the first and second moving parts swinging to the first angle, and the third and fourth moving parts swinging to the third angle, can be regarded as a preparatory action before the electronic device starts to execute the target action; the movement of the moving parts after leaving the support surface and the movement of the moving parts returning to the initial angle when they re-contact the support surface are equivalent to the subsequent actions after the target action ends.
[0102] The departure of a moving part from the support surface can be confirmed in several ways. For example, the electronic device can detect its own position and attitude using built-in sensors (including but not limited to accelerometers and gyroscopes). When a change in its height is detected, it can be confirmed that the moving part has left the support surface. Alternatively, the sensor built into the drive module can detect whether the drive module has rotated the moving part to a specified angle (such as a second angle). If all moving parts have rotated to the angle specified in the aforementioned control strategy, it can be confirmed that the moving part has left the support surface.
[0103] The second direction is opposite to the first direction. The first direction is the direction opposite to the direction of the target action specified in the motion command. For example, if the target action is a jumping action, the first direction is opposite to the specified jumping direction, while the second direction is the same as the direction of the action.
[0104] In order to perform the target action, when the control moving part swings during the target time period, a torque is generated in the direction of action (i.e., the second direction) to make the electronic device move in the direction of action. This torque may cause the electronic device to tilt at a certain angle in the direction of action after leaving the support surface.
[0105] The purpose of controlling each moving part to swing from the second angle to the first direction to the fourth angle is to make the electronic device experience a torque in the first direction under the action of gravity, thereby driving the electronic device, which has tilted in the second direction due to the torque, to return to a horizontal posture parallel to the support surface, so that the electronic device can fall back onto the support surface more smoothly.
[0106] After swinging to the fourth angle, the function of controlling the third and fourth moving parts to swing to the fifth angle in the second direction is to, after the electronic device returns to a horizontal position, cancel the torque in the first direction generated by gravity by swinging the first and second moving parts, as well as the third and fourth moving parts, in opposite directions respectively, so that the electronic device can maintain a horizontal position as much as possible before falling back to the support surface, so as to fall back to the support surface more smoothly.
[0107] The re-contact of a moving part with the support surface can be confirmed in several ways. For example, if the pressure sensor built into the electronic device detects that at least one moving part has been subjected to an external impact force, it is determined that the moving part has re-contacted the support surface. Alternatively, if the height of the moving part no longer changes based on its own position and posture, it is determined that the moving part has re-contacted the support surface.
[0108] In response to the moving parts re-contacting the support surface, the electronic device can control each moving part to return to its initial angle from its current angle. This includes controlling the first and second moving parts to swing from the fourth angle in the first direction to the initial angle, and controlling the third and fourth moving parts to swing from the fifth angle to the initial angle. The purpose of controlling the moving parts to return to their initial angle only upon re-contacting the support surface is that before re-contacting the support surface, the first to fourth moving parts are at the fourth and fifth angles respectively. At this time, the axes of these moving parts are inclined relative to the support surface. When the moving parts contact the support surface in this state, the impact force at contact can be converted into an impact torque. The drive module that drives the moving parts to swing contains gears, which can absorb part of the impact torque. Therefore, maintaining the fourth and fifth angles before contacting the support surface and then returning to the initial angle after re-contact helps to reduce the actual impact force acting on the electronic device body by absorbing torque through gears, thus preventing damage to the internal components of the electronic device.
[0109] Optionally, the method in this embodiment further includes:
[0110] The swing angle, swing direction, or swing time of each moving part is determined based on the motion command or the position of the moving part.
[0111] The methods for determining the swing angle include: determining the amplitude of the target action to be performed based on the motion command; the amplitude of the swing of the moving part determines the driving force it generates, and the driving force determines the amplitude of the action; therefore, the amplitude of the swing required to achieve the action can be determined based on the amplitude of the target action.
[0112] Taking jumping as an example, the motion command can indicate the jump height (i.e. the amplitude of the movement). The electronic device can store the correspondence between the jump height and the swing amplitude that has been determined in advance through experiments. After obtaining the jump height, the swing amplitude can be determined based on this correspondence.
[0113] Once the swing amplitude is determined, the swing angle can be determined based on the current position of the moving parts, so that the moving parts can swing at the corresponding swing amplitude within the target time period. For example, if it is determined that the swing amplitude of the first and second moving parts needs to reach 45 degrees, and the first and second moving parts are currently at the initial angle (denoted as 0 degrees), then when performing the preparatory action, it can be determined that the first and second moving parts should swing to the first angle of 45 degrees, and within the target time period, the first and second moving parts should swing from the first angle to the second angle of 0 degrees, thereby achieving a swing amplitude of 45 degrees.
[0114] The methods for determining the swing direction include: determining the direction of the target action based on the motion command, such as determining the jump direction corresponding to the jump action, determining the direction opposite to the action direction as the swing direction of the moving part within the target time period, and determining the action direction as the swing direction of the moving part when performing the preparatory action; for example, if the target action is a forward jump, when performing the preparatory action, control the moving part to swing forward from the initial angle to the aforementioned first / third angle, and when performing the target action within the target time period, control the moving part to swing backward from the first / third angle to the second angle (i.e., the initial angle).
[0115] Methods for determining the timing of the swing can include:
[0116] If the motion command specifies the time to start executing the target action, then the time specified by the motion command is taken as the time when the moving part starts to swing (i.e., the swing time). From that time, the moving part is controlled to swing within the target time period according to the aforementioned control strategy. The swing time is equivalent to the start time of the target time period. For example, if the motion command specifies that the jump will start after 1 second, then the time 1 second after the current time is determined as the swing time.
[0117] If the motion command specifies the time to start executing the target action, and the moving part is currently in a position where it can immediately start swinging according to the aforementioned control strategy, the current time can be determined as the swinging time, and the swinging of the moving part can be controlled immediately according to the aforementioned control strategy within the target time period; for example, if the moving part is already in the aforementioned first / third angle position when the motion command is received, the swinging of the moving part to the second angle can be controlled immediately according to the control strategy.
[0118] If the motion command specifies the time to start executing the target action, and the moving part is not currently in a position where it can immediately start swinging according to the aforementioned control strategy (e.g., not in the first / third angle position), a preparatory action can be performed first in the aforementioned manner. Once the preparatory action is completed, the moment when all moving parts have swung to the corresponding angle is determined as the swing moment. For example, when the first to fourth parts have all swung to the corresponding first / third angle, the control strategy can be immediately started to control the moving parts to swing to the second angle.
[0119] Optionally, based on motion commands, motion control signals are generated, including at least one of the following:
[0120] In response to the power supply's output voltage exceeding a voltage threshold, a motion control signal is generated based on the motion command and the output voltage.
[0121] In response to the condition that the action type of the target action meets the requirement, a motion control signal is generated based on the motion command.
[0122] In this embodiment, before generating a motion control signal, the electronic device can confirm whether the output voltage of the power supply is higher than a voltage threshold. If it is higher than the voltage threshold, the swing angle of the moving part is determined according to the aforementioned method, and then a corresponding motion control signal is generated based on the swing angle. If it is not higher than (less than or equal to) the voltage threshold, no motion control signal is generated, the target action is not executed, or the aforementioned preparatory actions are not performed. In this case, the electronic device can output a prompt message indicating that the voltage is too low to perform the action, for example, by outputting a low battery warning message that jumping is not possible via voice playback.
[0123] The voltage threshold represents the minimum voltage required to execute the target action. If the output voltage is not higher than the voltage threshold, the input voltage of the boost module may be too low when controlling the moving parts during the target time period, causing the boost module to be unable to provide sufficient voltage to the drive module, resulting in the failure of the target action. The actual value of the voltage threshold can be determined experimentally and is not limited; for example, it could be 3.1V.
[0124] By setting a voltage threshold and generating motion control signals only when the output voltage is above the threshold, it is possible to prevent electronic equipment from malfunctioning due to forced execution of target actions when the output voltage is too low.
[0125] The condition for a target action to satisfy the action type is that when the electronic device performs the action of that type, the instantaneous peak value of the power supply's output current may exceed the current threshold. Conversely, if the power supply's output current changes relatively smoothly and does not exceed the current threshold during the execution of a certain action type, then the action type does not satisfy the condition. Action types that satisfy the condition may include, but are not limited to, jumping and throwing objects; action types that do not satisfy the condition may include, for example, walking and running. In this embodiment, the electronic device can obtain the action types that satisfy the condition in advance by pre-writing them during the manufacturing stage or updating them online and record these action types in its local memory. After receiving a motion command, the electronic device can identify the action type indicated in the motion command, confirm whether it belongs to the action type that satisfies the condition, and thus determine whether the target action's action type satisfies or does not satisfy the condition.
[0126] If the action type of the target action does not meet the conditions, the control method of this application may not be executed. In this case, the moving parts can be controlled according to the relevant motion control technology in the field of robot equipment, which will not be elaborated here.
[0127] The advantage of controlling the target action according to the method of this application when the action type of the target action meets the conditions is that when the action type of the target action meets the conditions, the method of this embodiment can ensure that the moving parts are smoothly driven to complete the target action. When the action type of the target action does not meet the conditions, the moving parts can be controlled according to the control methods commonly used in related technologies, thus simplifying the control process.
[0128] Optionally, motion control signals are generated based on motion commands and output voltage, including:
[0129] The swing amplitude of each moving part is determined based on the output voltage; the swing amplitude is positively correlated with the output voltage.
[0130] Motion control signals are generated based on the swing amplitude and motion commands.
[0131] The aforementioned output voltage refers to the current output voltage that the power supply of the electronic device can output, and the swing amplitude of the moving part refers to the maximum swing amplitude that the moving part can be allowed under the current output voltage.
[0132] During the operation of electronic devices, the power supply continuously decreases, and its actual output voltage also continuously decreases. The voltage drop (voltage drop) of the boost module's input voltage caused by the output current is always present. Furthermore, the larger the swing amplitude, the larger the output current and the greater the corresponding voltage drop. To meet tolerances, the lower the power supply's output voltage, the smaller the acceptable voltage drop, and the weaker its ability to drive moving parts. Therefore, different swing amplitudes can be set for different output voltages to avoid excessive swing amplitude at low output voltages, which could prevent the moving parts from moving.
[0133] In this embodiment, the angle to which the moving component swings can be determined based on the swing amplitude and the motion command. Then, a motion control signal with a pulse width corresponding to that angle is generated, thereby using the motion control signal to control the moving component to swing to the corresponding angle.
[0134] The method for determining the swing amplitude of each moving part based on the output voltage can be as follows: based on the correspondence between output voltage, motion amplitude, and swing amplitude, determine the allowable motion amplitude (e.g., jump height) under the current output voltage, and then determine the corresponding swing amplitude based on that motion amplitude; the correspondence between output voltage, motion amplitude, and swing amplitude can be determined in advance through experiments and recorded in the memory of the electronic device.
[0135] As an example, the correspondence between output voltage, movement amplitude, and swing amplitude can include: 3.5V ≤ output voltage < 3.7V, which corresponds to a jump height of 3 cm and a swing amplitude of 45 degrees; 3.3V ≤ output voltage < 3.5V, which corresponds to a jump height of 2 cm and a swing amplitude of 30 degrees; and 3.1V ≤ output voltage < 3.3V, which corresponds to a jump height of 1 cm and a swing amplitude of 20 degrees.
[0136] The method for generating motion control signals based on swing amplitude and motion commands is as follows: determine which moving parts need to be controlled to swing based on the motion commands, and then determine the swing angle of these moving parts to be controlled according to the method of determining the swing angle based on the swing amplitude mentioned above, thereby generating motion control signals with pulse widths corresponding to the swing angles.
[0137] By determining the swing amplitude and generating the corresponding motion control signal using the above method, it is possible to prevent the output current from exceeding the current threshold when the output voltage is low, thus ensuring that the electronic equipment can successfully execute the target action.
[0138] Optionally, the amplitude of the target action can also be specified by the motion command, and it should be less than the amplitude of the action corresponding to the output voltage. For example, if the output voltage corresponds to a jump height of 3cm, the motion command can specify a jump height of 2cm or 3cm.
[0139] The following is combined with Figure 6 The examples illustrate the implementation process of the motion control method of this application.
[0140] The electronic device is a quadruped, consisting of a main body and four moving parts, including a rear left swing arm, a rear right swing arm, a front right swing arm, and a front left swing arm. When powered on, the electronic device is in a [position missing]. Figure 6 The standing posture shown in (1) is recorded as the initial angle, which is 0 degrees.
[0141] In response to receiving a jump command to jump forward (i.e., the aforementioned motion command), and confirming that the current power supply output voltage is 3.6V, corresponding to a swing amplitude of 45 degrees, the electronic device performs a preparatory action, controlling the rear left and rear right swing arms to swing forward (i.e., swing in the second direction) to the first angle of 45 degrees, and controlling the front right and front left swing arms to swing forward to the smaller third angle of 10 degrees. After completing the preparatory action, the posture of the electronic device is as follows: Figure 6 shown in (2).
[0142] Upon completion of the preparatory actions, the electronic device generates a motion control signal and enters the target time period. At the beginning of the target time period (equivalent to the first moment), based on the motion control signal, it controls the left swing arm (the first moving part) to swing backward (equivalent to the first direction) to the second angle of 0 degrees. At the second moment, it controls the right swing arm (the second moving part) to swing backward to 0 degrees, with the second moment delayed by 5ms relative to the first moment. At the third moment, delayed by 50ms relative to the first moment, it controls the right swing arm (the third moving part) to swing backward to 0 degrees. At the fourth moment, delayed by 5ms relative to the third moment, it controls the left swing arm (the third moving part) to swing backward to 0 degrees. The above process is as follows: Figure 6 shown in (3).
[0143] Optionally, the left front swing arm can be controlled to swing at the third moment, and the right front swing arm can be controlled to swing at the fourth moment.
[0144] In response to the above swing arms all leaving the support surface, the electronic device controls each swing arm to swing backward to a fourth angle, for example, to swing backward to 50 degrees, in order to restore itself to a horizontal posture. At this time, the posture of the electronic device is as follows: Figure 6 shown in (4);
[0145] After all the swing arms have swung to the fourth angle, the electronic device controls the front right swing arm and the front left swing arm to swing forward to the fifth angle, for example, to swing forward 50 degrees, so that the electronic device maintains a horizontal attitude. At this time, the attitude of the electronic device is as follows: Figure 6 shown in (5);
[0146] Stay Figure 6 During the posture shown in (5), the electronic device confirms that each swing arm is in contact with the support surface again, and then controls each swing arm to swing back to the initial angle, so that the electronic device returns to the position shown in (5). Figure 6 The standing posture shown in (1).
[0147] This application also provides an electronic device, such as... Figure 7 As shown, it includes a device body 701 and multiple moving parts 702; Figure 7 (1) is a side view of the electronic device. Figure 7 (2) is a front view of the electronic device; each moving part 702 includes a swing arm, the swing arm and the device body 701 are rotatably connected, and the device body drives the swing arm to swing through a servo motor; the device body 701 is provided with a processor for controlling the moving parts;
[0148] The connection between the swing arm and the equipment body 701 can be such that the swing arm is mounted on the shaft of the servo motor, and the servo motor is mounted inside the equipment body 701.
[0149] The processor is used to: obtain motion instructions for triggering target actions;
[0150] Based on motion commands, generate motion control signals;
[0151] Based on motion control signals, multiple moving parts are controlled to swing at an angle, forming a continuously superimposed driving force over a target time period, which drives the electronic device to perform the target action; the output current of the power supply does not exceed the current threshold during the target time period.
[0152] Optionally, the device body 701 includes a first body 7011 and a second body 7012 that are rotatably connected, wherein: the first body is provided with a display module 7013; and the swing arm is rotatably connected to the second body.
[0153] The structure of the above-mentioned electronic device can be found in [reference]. Figure 8 , Figure 8 (1) is a side view of the electronic device. Figure 8 (2) is a front view of the electronic device. Figure 8 (3) is a top view of the electronic device. The first body can rotate relative to the second body about its own axis perpendicular to the support surface, for example, rotating to Figure 8 The angle shown in the dashed box in (3) can also rotate around other axes. The first body and the second body can be connected by a hinge structure or other rotatable connection structure. The display module 7013 can display a prompt message that the target action cannot be performed due to low voltage, or it can display other content.
[0154] The control methods and working principles of the above electronic devices can be found in the relevant steps of the motion control method in the foregoing embodiments, and will not be repeated here.
[0155] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The systems or apparatuses described above are divided into various modules or units based on their functions. In implementing this application, the functions of each unit can be implemented in one or more software and / or hardware. In this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0156] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A motion control method, comprising: Obtain motion commands to trigger target actions; Based on the motion command, a motion control signal is generated; Based on the motion control signal, multiple moving parts are controlled to swing at an angle, forming a continuously superimposed driving force over a target time period, thereby driving the electronic device to perform the target action; During the target time period, the output current of the power supply does not exceed the current threshold.
2. The method according to claim 1, wherein controlling multiple moving parts to form a continuously superimposed driving force over a target time period by angular oscillation includes at least one of the following: Control at least two moving parts to oscillate at different times within the target time period, and the driving force generated by each moving part at different times is continuously distributed in time and superimposed on each other to form a continuous driving force; Multiple moving parts are controlled to swing sequentially at multiple amplitudes within the target time period. The driving force generated by each moving part at the corresponding amplitude is continuously distributed in time and superimposed on each other to form a continuous driving force.
3. The method according to claim 2, wherein controlling the oscillation of at least two moving parts at different times within the target time period comprises: Control the first moving part to swing at a first moment, control the second moving part to swing at a second moment, control the third moving part to swing at a third moment, and control the fourth moving part to swing at a fourth moment; The second time point is after the first time point, the third time point is after the second time point, and the fourth time point is after the third time point. The interval between the second time point and the first time point is less than the interval between the third time point and the second time point, and the interval between the fourth time point and the third time point is less than the interval between the third time point and the second time point.
4. The method according to claim 2, wherein controlling the plurality of moving parts to oscillate sequentially with multiple amplitudes within the target time period includes: Control the first and second moving parts to swing from a first angle in a first direction to a second angle; Control the third and fourth moving parts to swing from the third angle toward the first direction to the second angle; The first angle is greater than the second angle, the third angle is greater than the second angle, and the first angle is different from the third angle.
5. The method according to claim 4, further comprising, before controlling the moving part to swing to the second angle: Control the first and second moving parts to swing to the first angle, and control the third and fourth moving parts to swing to the third angle; After controlling multiple moving parts to swing sequentially at multiple amplitudes within the target time period, the method further includes: In response to the movement component leaving the support surface, each movement component is controlled to swing from the second angle toward the first direction to the fourth angle, and the third and fourth movement components are controlled to swing from the fourth angle toward the second direction to the fifth angle; the first direction is opposite to the second direction. In response to the moving parts re-contacting the support surface, control each moving part to return to its initial angle.
6. The method according to claim 3 or 4, further comprising: The swing angle, swing direction, or swing time of each moving component is determined based on the motion command or the position of the moving component.
7. The method according to claim 1, wherein generating a motion control signal based on the motion command comprises at least one of the following: In response to the output voltage of the power supply being higher than a voltage threshold, a motion control signal is generated based on the motion command and the output voltage; In response to the target action's action type meeting the condition, a motion control signal is generated based on the motion command.
8. The method according to claim 7, wherein generating the motion control signal based on the motion command and the output voltage comprises: The swing amplitude of each moving part is determined based on the output voltage; The swing amplitude is positively correlated with the output voltage; A motion control signal is generated based on the swing amplitude and the motion command.
9. An electronic device, comprising a device body and a plurality of moving parts; Each moving component includes a swing arm, which is rotatably connected to the device body, and the device body drives the swing arm to swing via a servo motor; The device body is equipped with a processor for controlling the moving parts; The processor is used for: Obtain motion commands to trigger target actions; Based on the motion command, a motion control signal is generated; Based on the motion control signal, multiple moving parts are controlled to swing at an angle, forming a continuously superimposed driving force over a target time period, thereby driving the electronic device to perform the target action; during the target time period, the output current of the power supply does not exceed the current threshold.
10. The device according to claim 9, wherein the device body comprises a first body and a second body rotatably connected, wherein: The first body is equipped with a display module; The swing arm is rotatably connected to the second body.