This application claims priority to Chinese Patent Application No. 201610544019.1, filed Jul. 8, 2016, which is hereby incorporated by reference herein as if set forth in its entirety.
Technical Field
The present disclosure relates to robot servo technology, and more particularly to a method for servo locking control and a servo.
Description of Related Art
Robot is a machine that can perform appropriate actions according to control instructions from a control unit. A servo is a driving component of the robot and also a key component constructing robots joint. When performing actions, the robot need to rotate servo gears to specific positions and lock them in positions. The position locking process is accomplished through a main control circuit and an angular sensor inside the servo. However, this locking control method can only accomplished by cooperation of the main control circuit and the angular sensor, which is unduly inconvenient.
A method for servo locking control includes: controlling a servo to enter a first lock state; determining whether current angular deflection values of the servo in a first preset period are all greater than a preset angular deflection value; controlling the servo to enter a second lock state, when the current angular deflection values of the servo in the first preset period are all greater than the preset angular deflection value; determining whether current angular changing values of the servo in a second preset period are all less than a preset angular changing value, and controlling the servo to enter the first lock state, when the current angular changing values of the servo in the second preset period are all less than the preset angular changing value.
A servo includes a main control circuit, an actuating motor, an angular sensor, a reduction gear, and an output axis. The angular sensor acquires and outputs angular information. The main control circuit controls the actuating to motor to work through the reduction gear and the output axis by performing the method for servo locking control.
Other objects, advantages and novel features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
Many aspects of the present embodiments can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the present embodiments. Moreover, in the drawings, all the views are schematic, and like reference numerals designate corresponding parts throughout the several views.
The disclosure is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings, in which like reference numerals indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references can mean “at least one” embodiment.
Embodiment 1
In step S11, entering a first lock state. Specifically, a servo receives a first locking instruction from the control unit after powered up, and enters the first lock state according to the first locking instruction. The first lock state is a secure lock state. The secure lock state is one where a main control circuit of the servo controls gears of the servo to move to a target locking position that corresponds to a target value and then remain in the target locking position. When the position of the gears deviates from the target locking position, the output torque of the gears is controlled to exert a force on the gears. The direction of the force is opposite to the direction of the gears rotation, thereby remaining the gears in the target locking position until a new locking instruction is received.
In step S12, determining whether current angular deflection values of the servo in a first preset period are all greater than a preset angular deflection value. Current angular deflection value is an absolute value of difference between a current angular value and a latest target locking value. The preset angular deflection value is an angular deflection value used to determine whether the position of the gears deviates from the target locking position. When the current angular deflection value is greater than the preset angular deflection value, it indicates that a relative great external force is applying on the gears and making the gears deviate from the target locking position.
In step S13, entering a second lock state, when the current angular deflection values of the servo in the first preset period are all greater than the preset angular deflection value. The second lock state is a weak lock state. The weak lock state is one where the main control circuit controls the gears to move to the target locking position, and then reduces the output torque of the gears and changes the target locking position of the servo to make the target locking position change with the current angular values, when an external force applying on the gears for a long time greater than a preset force is detected. The preset force makes the current angular deflection values of the gears relative to the target locking position greater than the preset angular deflection value.
Understandably, if the current angular deflection value is greater than the preset angular deflection value, it indicates that a relative greater external force is applying on the servo and making the servo deviate from the target locking position. If the current angular deflection values that were computed according to the acquired current angular values in the first preset period are all greater than the preset angular deflection value, it indicates that there has always been an external force applying on the servo within the first preset period to make the servo deviate from the target locking position for a long time. It causes the servo to switch from the secure lock state to the weak lock state.
In step S14, determining whether current angular changing values of the servo in a second preset period are all less than a preset angular changing value. Current angular changing value is an absolute value of difference between a current angular value acquired at this time and an angular value acquired at the last time. The preset angular changing value is a reference value used to determine the output angle variation degree of the gears. If the current angular changing value is less than the preset angular changing value, which means the differential value between the current angular value acquired at this time and the angular value acquired at the last time is small, the gears stay still.
In step S15, entering the first lock state, when the current angular changing values of the servo in the second preset period are all less than the preset angular changing value. Understandably, if the current angular changing values of the servo in the second preset period are all less than the preset angular changing value, it indicates that the angular of the gears are currently in a relatively stable state. The main control circuit of the servo now resets the output torque of the servo to make the servo enter the first lock state. It helps to maintain the servo in proper order.
The method provided by the embodiment of the invention can make the current angular deflection values of the servo in the first preset period are all greater than the preset angular deflection value through the imposition of external force, that is, makes the servo to switch from the secure lock state to the weak lock state, and makes the servo to switch to the secure lock state when the current angular changing values of the servo in the second preset period are all less than the preset angular changing value. The method can control the current angular values of the servo through the imposition of external force to realize the gears locking control. The servo can flexible transition from the secure lock state to the weak lock state. The control method is both simple and flexible.
Embodiment 2
In step S21, entering a first lock state. Specifically, a servo receives a first locking instruction from the control unit after powered up, enters the first lock state according to the first locking instruction, and records the latest target value α0 when the servo enters the first lock state. The first lock state is a secure lock state. The secure lock state is one where a main control circuit of the servo controls gears of the servo to move to a target locking position that corresponds to a target value and then remain in the target locking position. When the position of the gears deviates from the target locking position, the output torque of the gears is controlled to exert a force on the gears. The direction of the force is opposite to the direction of the gears rotation, thereby remaining the gears in the target locking position until a new locking instruction is received.
In step S22, determining whether the time of the servo in the first lock state exceeds a secure lock preset stable time, when the servo enters the first lock state. When the time of the servo in the first lock state exceeds the secure lock preset stable time, performs the step S23. In step S23, determining whether current angular deflection values ε1 of the servo in a first preset period Δt1 are all greater than a preset angular deflection value ε0. When the time of the servo in the first lock state does not exceed the secure lock preset stable time, makes the servo to maintain the first lock state and performs the step S22. Understandably, the servo may have large amplitude swing movement during the servo bootup. That makes the servo may not be adequately locked in the default position after entering the first lock state. So the servo needs to wait for some time (that is, the secure lock preset stable time) after entering the first lock state to stabilise the servo locking, and then determines whether there is a greater external force that makes the current angular deflection values ε1 in the first preset period Δt1 are all greater than the preset angular deflection value ε0. Understandably, it can effectively prevent the servo from entering the weak lock state because of error detecting during the servo bootup, by setting the step S22. The error detecting is because of the servo cannot be adequately locked in the default position when entering the first lock state during the servo bootup. This will affect servo performance.
In step S23, determining whether current angular deflection values ε1 of the servo in a first preset time period Δt1 are all greater than a preset angular deflection value ε0. The preset angular deflection value ε0 is an angular deflection value used to determine whether the position of the gears deviates from the target locking position. When the current angular deflection value ε1 is greater than the preset angular deflection value ε0, it indicates that a relative greater external force is applying on the servo and making the servo deviate from the target locking position. If the current angular deflection values ε1 in the first preset period Δt1 that were computed according to the acquired current angular values β1 are all greater than the preset angular deflection value ε0, it indicates that there has always been an external force applying on the servo within the first preset period Δt1 to make the servo deviate from the target locking position for a long time. Thus, the servo controls the servo to switch from the secure lock state to the weak lock state. Understandably, the servo repeats the step S23 after entering the first lock state to determine whether the current angular deflection values ε1 acquired within the first preset period Δt1 (continuous period of time) are all greater than the preset angular deflection value ε0. In the present embodiment, step S23 includes the following steps.
In step S231, recording the latest target value of the servo α0. Understandably, when the servo enters the first lock state, the servo records the latest target value α0 of the servo.
In step S232, acquiring the current angular values β1 of the servo every unit time t1.
In step S233, computing the current angular deflection values ε1 according to the latest target value α0 and the current angular values β1. Specifically, the servo acquires and saves the current angular values β1 of the servo by the angular sensor installed in the servo every unit time t1, and computes the current angular deflection values ε1. The current angular deflection value ε1 is an absolute value of difference between the current angular value β1 and the latest target value α0, that is, ε1=|β1−α0|.
In step S234, comparing each of the current angular deflection values ε1 with the preset angular deflection value ε0, and determining whether one of the current angular deflection values ε1 being compared is greater than the preset angular deflection value ε0.
In step S235, increasing an angular deflection counter n1 by one, when the one of the current angular deflection values ε1 being compared is greater than the preset angular deflection value ε0, and determining whether the angular deflection counter n1 is greater than a first threshold value N1. When the angular deflection counter n1 is greater than the first threshold value N1, confirms the current angular deflection values ε1 of the servo in the first preset period Δt1 are all greater than the preset angular deflection value ε0. Understandably, the current angular deflection value ε1 is an absolute value of difference between the current angular value β1 and the latest target value α0, and the current angular values β1 is acquired every unit time t1. When the current angular deflection value ε1 is greater than the preset angular deflection value ε0, the servo increases the angular deflection counter n1 by one. Therefore a target time can be obtained by multiplying the unit time t1 with the angular deflection counter n1. The target time is required when the current angular deflection values ε1 are all greater than the preset angular deflection value ε0. It can be determined whether the current angular deflection values ε1 in the first preset period Δt1 are all greater than the preset angular deflection value ε0 by comparing the target time with the first preset period Δt1. The first threshold value N1 can be a quotient acquired by dividing the first preset period Δt1 by the unit time t1. It can be determined whether the current angular deflection values ε1 in a first preset period Δt1 are all greater than the preset angular deflection value ε0, by determining whether the angular deflection counter n1 is greater than the first threshold value N1. Computational process is simple and convenience.
In the step S236, resetting the angular deflection counter n1 and determining whether the current angular deflection value ε1 acquired at the next unit time is greater than the preset angular changing value ε0, when the one of the current angular deflection values ε1 being compared is not greater than the preset angular deflection value ε0. Understandably, it is impossible that the current angular deflection values ε1 acquired within the first preset period Δt1 are all greater than the preset angular deflection value ε0, when the current angular deflection value ε1 acquired at any unit time is not greater than the preset angular deflection value ε0. Therefore, the servo resets the angular deflection counter n1, and determines whether the current angular deflection value ε1 acquired at the next unit time is greater than the preset angular deflection value ε0.
In the step S237, determining whether the current angular deflection value ε1 acquired at the next unit time is greater than the preset angular deflection value ε0, when the angular deflection counter n1 is not greater than the first threshold value N1. Understandably, it can be determined that the current angular deflection values ε1 acquired within the first preset period Δt1 are all greater than the preset angular deflection value ε0 as long as the angular deflection counter n1 is greater than the first threshold value N1. Accordingly, if the angular deflection counter n1 is not greater than the first threshold value N1, then it will need to determine whether the current angular deflection value ε1 acquired at the next unit time is greater than the preset angular deflection value ε0, until the angular deflection counter n1 is greater than the first threshold value N1.
In step S24, entering a second lock state, when the current angular deflection values ε1 of the servo in the first preset period Δt1 are all greater than the preset angular deflection value ε0. The second lock state is a weak lock state. That means the current angular deflection values ε1 acquired within the first preset period Δt1 which is the consecutive time are all greater than the preset angular deflection value ε0. Understandably, the weak lock state is one where the main control circuit controls the gears to move to the target locking position, and then reduces the output torque of the gears and changes the target locking position of the servo to make the target locking position change with the current angular values β1, when an external force applying on the gears for a long time greater than a preset force is detected. The preset force makes the current angular deflection values ε1 of the gears relative to the target locking position greater than the preset angular deflection value ε0. Understandably, the servo does not enter the weak lock state and performs the step S23, when any of the current angular deflection values ε1 in the first preset period Δt1 is not greater than the preset angular deflection value ε0.
Understandably, when the servo is in the secure lock state, if the current angular deflection values ε1 in the first preset period Δt1 are all greater than the preset angular deflection value ε0, the servo switches from the secure lock state to the weak lock state, and updates the last current angular value β1 acquired within the first preset period Δt1 to the latest target value α0. This makes the servo transition from the secure lock state to the weak lock state flexibly, and makes the servo flexibility and easier to control.
In step S25, updating the last current angular value β1 acquired within the first preset period Δt1 to the latest target value α0. At the next unit time t1, the servo updates the last current angular value β1 acquired within the first preset period Δt1 to the latest target value α0.
In step S26, determining whether the current angular changing values θ1 of the servo in a second preset period Δt2 are all less than a preset angular changing value θ0. Current angular changing value θ1 is an absolute value of difference between a current angular value acquired at this time and an angular value acquired at the last time. The preset angular changing value θ0 is a reference value used to determine the output angle variation degree of the gears. When the current angular changing value θ1 is less than the preset angular changing value θ0, which means the differential value between the current angular value acquired at this time and the angular value acquired at the last time is small, the gears stay still.
In step S261, acquiring and saving the current angular values β1 of the servo every unit time t1.
In step S262, computing the current angular changing value according to the current angular value acquired at this time and the angular value acquired at the last time. In the embodiment, the current angular value acquired by the angular sensor can be represented as β1, the angular value acquired at the last time can be represented as β0, the current angular value acquired at the next time can be represented as β2. The current angular changing value θ1 is an absolute value of difference between the current angular value β1 acquired at this time and the angular value β0 acquired at the last time, that is, θ1=|β1−β0|.
In step S263, comparing each of the current angular changing values θ1 with the preset angular changing value θ0, and determining whether one of the current angular changing values θ1 being compared is less than the preset angular changing value θ0.
In step S264, increasing an angular changing counter n2 by one and determining whether the angular changing counter n2 is greater than a second threshold value N2, when the one of the current angular changing values θ1 being compared is less than the preset angular changing value θ1. When the angular changing counter n2 is greater than the second threshold value N2, confirms the current angular changing values θ1 of the servo in the second preset period Δt2 are all less than the preset angular changing value θ0. Understandably, the current angular changing value θ1 is an absolute value of difference between the current angular value β1 acquired at this time and the angular value β0 acquired at the last time. The current angular values β1 is acquired every unit time t1. The servo increases the angular changing counter n2 by one, when the current angular changing value θ1 is less than the preset angular changing value θ0. Therefore a target time can be obtained by multiplying the unit time t1 with the angular changing counter n2. The target time is required when the current angular changing values are all less than the preset angular changing value θ0. It can be determined whether the current angular changing values θ1 in the second preset period Δt2 are all less than the preset angular changing value θ0, by comparing the target time with the second preset period Δt2. The second threshold value N2 can be a quotient acquired by dividing the second preset period Δt2 by the unit time t1. It can be determined whether the current angular changing values θ1 in the second preset period Δt2 are all less than the preset angular changing value θ0, by determining whether the angular changing counter n2 is greater than the second threshold value N2.
In step S265, resetting the angular changing counter n2 and determining whether the current angular changing value θ1 acquired at the next unit time is less than the preset angular changing value θ0, when the one of the current angular changing values θ1 being compared is less than the preset angular changing value θ1. Understandably, it is impossible that the current angular changing values θ1 acquired within the second preset period Δt2 are all less than the preset angular changing value θ2, when the current angular changing value θ1 acquired at any unit time is not less than the preset angular changing value θ0. Therefore the servo resets the angular changing counter n2, and determines whether the current angular changing value θ1 acquired at the next unit time is less than the preset angular changing value θ0.
In step S266, determining whether the current angular changing value θ1 acquired at the next unit time is less than the preset angular changing value θ0, when the angular changing counter n2 is not greater than the second threshold value N2. Understandably, it can be determined that the current angular changing values θ1 acquired within the second preset period Δt2 are all less than the preset angular changing value θ0 as long as the angular changing counter n2 is greater than the second threshold value N2. Accordingly, the servo determines whether the current angular changing value θ1 acquired at the next unit time is less than the preset angular changing value θ0, when the angular changing counter n2 is not greater than the second threshold value N2.
In step S27, entering the first lock state, when the current angular changing values θ1 of the servo in the second preset period Δt2 are all less than the preset angular changing value θ0. If the current angular changing values θ1 of the servo in the second preset period Δt2 are all less than the preset angular changing value θ0, then the current angular changing values θ1 of the servo acquired within the second preset period Δt2 are all less than the preset angular changing value θ2. That means the angle of the gears is in a stable state. The servo now resets the output torque of the servo to make the servo to enter the first lock state. It helps to maintain the servo in proper order. Understandably, if any of the current angular changing values θ1 in the second preset period Δt2 is not less than the preset angular changing value θ0, then performs the step S26.
In step S28, updating the last current angular value acquired within the second preset period Δt2 to the latest target value α0. The servo uses the absolute value of difference between the current angular value β1 and updated latest target value as the current angular deflection value ε1, when acquiring the current angular value at the next unit time and computing the current angular deflection value ε1.
Understandably, when the servo is in the weak lock state, if the current angular changing values θ1 of the servo in the second preset period Δt2 are all less than the preset angular changing value θ0, then the servo switches from the weak lock state to the secure lock state, and updates the last current angular value acquired within the second preset period Δt2 to the latest target value α0. This makes the servo transition from the weak lock state to the secure lock state flexibly, and makes the servo flexibility and easier to control.
The method provided by the embodiment of the invention can make the current angular deflection values ε1 of the servo in the first preset period Δt1 are all greater than the preset angular deflection value ε0 through the imposition of external force, that is, makes the servo to switch from the secure lock state to the weak lock state, and makes the switch to the secure lock state when the current angular changing values θ1 of the servo in the second preset period Δt2 are all less than the preset angular changing value θ0. The method controls the gears of the servo to switch between the secure lock state and the weak lock state through the imposition of external force. The control method is both simple and flexible, and makes the servo can meet the demands in use.
Embodiment 3
Although the features and elements of the present disclosure are described as embodiments in particular combinations, each feature or element can be used alone or in other various combinations within the principles of the present disclosure to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
2016 1 0544019 | Jul 2016 | CN | national |
Number | Name | Date | Kind |
---|---|---|---|
4864508 | Iwagaya | Sep 1989 | A |
5180956 | Oaki | Jan 1993 | A |
5612602 | Kubota | Mar 1997 | A |
5886491 | Yoshida | Mar 1999 | A |
6379042 | Polkus | Apr 2002 | B1 |
8523765 | Kawai | Sep 2013 | B2 |
Number | Date | Country | |
---|---|---|---|
20180011478 A1 | Jan 2018 | US |