Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
The method is suitable for the ping-pong robot with a guide rail in the short side direction of the ping-pong table and a tandem mechanical arm with at least 5 degrees of freedom. The guide rails are similar to left and right steps when people hit balls, so that the problem that the working space of the mechanical arm cannot cover the table tennis table in a large range is solved; the mechanical arm simulates the arm of a human to complete various swinging actions. The x axis of the coordinate system of the ping-pong robot is defined to coincide with the linear motion of the guide rail, the y axis is the projection of the middle line of the long edge of the ping-pong table on the horizontal plane where the guide rail is located, the intersection point of the x axis and the y axis determines the origin O of the coordinate system, and the z axis is vertically upward, as shown in fig. 3. The origin of a racket coordinate system at the tail end of the table tennis robot is defined to be positioned at the center of the racket, the z-axis is perpendicular to the racket surface and is a normal direction of the racket, the y-axis points to the racket handle, and the x-axis is determined by a right-hand rule. The racket has a front side and a back side, wherein the front side is the side pointing to the normal line, and the back side is the side departing from the normal line, as shown in fig. 4.
The method for controlling the ball hitting motion of the table tennis robot refers to a process of how the robot obtains the motion parameters of a racket at the tail end and drives each joint to complete the ball hitting action, and mainly comprises a ball hitting response analysis module, a ball hitting strategy selection module and a motion trajectory planning module, as shown in fig. 1, the flow analysis of the whole ball hitting motion system is as follows:
the racket motion parameter in the hitting response analysis module refers to a hitting point (x) required for realizing target hitting controlh,yh,zh) Speed of racket (v)xh,vyh,vzh) Normal to the racket (x)zph,yzph,zzph) And the remaining movement time thThese parameters are obtained by the prediction system and are outside the scope of the present invention. The coordinate values of the hitting point, the speed of the racket and the normal line of the racket are described in the coordinate system of the table tennis robot, and the residual motion time thRefers to the time from the current position of the bat to the expected impact with the table tennis ball.
The hitting state machine in the hitting response analysis module refers to three possible states of the current table tennis robot: hold wait, go to hit ball, and return wait, as shown in fig. 2. The holding waiting means that the table tennis robot is at a waiting point of a certain configuration and is kept still to wait for the racket motion parameters of the prediction system; the process that the table tennis robot drives the bat to go to the hitting point from a waiting point or a certain posture of returning to the waiting point after the last hitting is carried out, and during the process, a new hitting request of the acquisition and prediction system is closed, namely new hitting point information cannot be responded; the return-to-wait refers to the process of returning to the waiting point after the bat at the tail end of the table tennis robot reaches the hitting point and finishes the collision with the table tennis, during which the hitting request is turned on again, and new hitting point information is responded. After obtaining the racket motion parameters, putting a batting application to a batting state machine, and if the robot is in a state of going to the batting state machine at the moment, the batting request is rejected, and rhythm prompt information is output; if the robot is on hold or returns to wait for 2 state machines, then the stroke request is allowed to be processed. Generally speaking, in a slow-beat ball hitting task, the table tennis robot will have enough time to go to the ball hitting point from the static state of the waiting point and then return to the waiting point to keep static each time, while in a fast-beat ball hitting task, the table tennis robot may still receive a new set of ball hitting requests in the process of going to the waiting point from the ball hitting point, at the moment, the table tennis robot will try to give up going to the waiting point and directly turn to the moving target of the ball hitting point to realize ball hitting, when the beat is fast to a certain degree, the table tennis robot still goes to the process of ball hitting and receives a new set of ball hitting requests, the table tennis robot will ignore the new ball hitting requests and continue to complete the movement plan, and the mode of adopting the ball hitting state machine can effectively adapt to the fast-beat ball hitting task and simultaneously ensure a high effective ball hitting success rate, and the robustness of the system is improved.
The working space analysis in the hitting response analysis module refers to the preliminary judgment of the hitting point position (x) of the racketh,yh,zh) Whether or not within the working space of the robot, i.e. xmin≤xh≤xmax,ymin≤yh≤ymaxAnd zmin≤zh≤zmaxIf not, giving up the motion parameters of the racket and outputting the out-of-limit prompt information, wherein xmin,xmax,ymin,ymax,zminAnd zmaxRespectively represents the minimum value and the maximum value allowed by the hitting point in the coordinate system x, y and z of the table tennis robot.
The table tennis robot batting strategy selection module has the main functions that different batting strategies are selected to complete inverse kinematics solution according to the batting interval to which the position of the batting point of the bat belongs, and the angle q of each joint at the batting moment is obtained
ihAnd angular velocity
As shown in fig. 3, the hitting strategy selection module includes 4 strategies of hitting a table tennis ball near, hitting a table tennis ball far, hitting a backhand and hitting a forehand according to the positions of the hitting points around and around the coordinate system of the table tennis robot. With redundant optimization of specific targets, the inverse kinematics of the 4 hitting strategies differed slightly.
The distance judgment in the batting strategy selection module refers to the configuration of a distance value ycfgWhen hitting the ball|yh|>ycfgWhen the current is determined to be yh|≤ycfgAnd (4) judging left and right. The front and back judgment means to analyze the hitting point yhWhen y ishWhen the number is more than 0, the hitting point is far away from the front of the table tennis robot, the track of the table tennis is generally a short table tennis, a table tennis hitting strategy is adopted, as shown in fig. 4, the z value of the y-axis unit vector of the table tennis coordinate system under the world coordinate system is configured to be more than 0, namely the z value isyphThe risk that the table tennis robot collides with the table tennis table can be effectively reduced if the table tennis robot is more than 0; when y ishWhen the number is less than 0, the ball hitting point is far behind the robot, the table tennis is generally a high-distance ball at the moment, a long-distance table ball hitting strategy is adopted, as shown in fig. 5, the z value of the y-axis unit vector of the table tennis coordinate system under the table tennis robot coordinate system is configured to be less than 0, namely the z value is smaller than 0yphLess than 0, so that the risk of ball hitting failure caused by collision of the table tennis ball with the table tennis robot before the table tennis ball collides with the racket can be effectively reduced. The left and right judgment means to analyze the hitting point xhWhen x is a symbol ofhWhen the number is less than 0, the hitting point is at the left side position of the robot, a backhand hitting strategy is adopted, and a racket normal vector z is configured as shown in figure 6phY value under the coordinate system of the table tennis robot is less than 0, namely yzphIf less than 0, the back side of the racket is used for hitting the ball; when x ishWhen the ball hitting point is at the right side position of the robot, a forehand ball hitting strategy is adopted, and a racket normal vector z is configured as shown in figure 7phY value under the coordinate system of the table tennis robot is larger than 0, namely yzphAnd if the height is more than 0, the ball is hit by using the front surface of the racket.
The near table batting strategy and the far table batting strategy both adopt
inverse kinematics 1 to solve joint angles, which is inverse kinematics based on kinematic decomposition, and in order to fully exert the working space of the mechanical arm in the front and rear directions, the displacement q of a guide rail at the batting point moment is configured
1h=x
hSpeed of
Namely, the displacement of the ball hitting point in the left-right direction is realized only by the guide rail, and the mechanical arm realizes the remaining end constraint (y)
h,z
h,x
zph,y
zph,z
zph,v
xh,v
yh,v
zh) And completing the angle q of each joint of the mechanical arm by utilizing a redundancy optimization inverse kinematics algorithm
ihAnd angular velocity
The subscript i indicates the number of each joint. The forehand batting strategy and the backhand batting strategy both adopt inverse kinematics 2 to solve joint angles, the inverse kinematics is optimized based on operability, the operability of the mechanical arm in the batting direction is maximum, and the angle q of each joint of the table tennis robot at the batting point is obtained
ihAnd angular velocity
Subscript i represents the serial number of each joint, the limiting safety problem caused by the fact that a hitting point is too close to a mechanical arm base in
inverse kinematics 1 can be effectively solved by adopting the mode, the distance between the hitting point and the mechanical arm base is increased by utilizing a guide rail, the mechanical arm can achieve more flexible hitting due to larger operability, and the operability in the hitting speed direction is β
pIs calculated as
Where p is a unit column vector of the direction of the hitting speed, θ is each joint angle of the robot arm, and J (θ) represents a jacobian matrix of the robot arm. And if the
inverse kinematics 1 or the inverse kinematics 2 fails to solve, outputting a prompt message of solving errors and terminating the batting request.
The motion trail planning module of the table tennis robot has the main function of planning the joint motion of the table tennis robot from a current point to a hitting point and then to a waiting point. The robot waiting point state in the motion trail planning module refers to the configuration of a group of joint angles q
ieWhen the table tennis robot is in the state of keeping waiting, the table tennis robot keeps still at the set of joint angles, namely the waiting point is the target stop point after the current hitting, so the joint angular velocity corresponding to the waiting point
Angular acceleration
The subscript i indicates the number of each joint. The current point state of the robot in the motion trail planning module refers to the angle q of each current joint of the ping-pong robot
icAngular velocity
And angular acceleration
The subscript i indicates the number of each joint, and in particular, q when the table tennis robot is in a hold wait state machine
ic=q
ie,
Joint space trajectory planning in the motion trajectory planning module refers to planning according to the current t of the table tennis robot
cAngle q of each joint at any moment
icAngular velocity
And angular acceleration
Hitting point t
hAngle q of each joint at any moment
ihAngular velocity
Returning to the robot waiting point t after hitting the ball
eAngle q of each joint at any moment
ieAngular velocity
And angular acceleration
The motion trail of each joint of the ping-pong robot for completing the batting request is obtained by adopting a 7 th-order polynomial interpolation algorithm, namely the angle q of each joint corresponding to each control period
ijAngular velocity
And angular acceleration
Wherein t is
eThe index i represents the number of each joint, and j represents each control cycle.
Depending on the constraints of the angles, angular velocities and angular accelerations of the current point, the hitting point and the waiting point, the polynomial coefficient (b) of the 7 th-order polynomial interpolation of each joint can be solved by the following system of linear equationsi7,bi6,bi5,bi4,bi3,bi2,bi1,bi0) Wherein the subscript i represents the number of each joint.
In the above formula, q
ic、
And
respectively representing the angle, angular velocity and angular acceleration of the ith joint at the current time point, q
ih、
Respectively representing the angle, the angular velocity and the angular acceleration of the ith joint at the ball striking point, q
ie、
And
respectively representing the angle, angular velocity and angular acceleration of the ith joint during the waiting period, a
mnA predetermined constant representing the motion control model, b
i7To b
i0The interpolation coefficients of the polynomial are represented.
The joint limiting and collision analysis in the motion trail planning module refers to the judgment of whether the joint angle, the angular velocity and the angular acceleration of each joint planned in each period exceed the limits and whether a racket collides with a table, namely q
imin≤q
ij≤q
imax,
And z
pj≥z
pminWhether or not q is satisfied simultaneously
imin,q
imax,
And
respectively the minimum and maximum values allowed for the angle, angular velocity and angular acceleration of each joint, z
pjZ value track, z value track of batting sports bat in coordinate system of table tennis robot acquired by positive kinematics calculation
pminIs the minimum height value allowed by the racket. If the safety error is not met, outputting safety error prompt information and terminating the batting request; if the requirement is met, the table tennis robot executes a batting request and drives each joint to complete batting tasks.
Compared with the prior art, the invention has the advantages that:
1. the response of the return waiting state in the batting state machine to a new batting request realizes the online modification of the movement planning track, and can effectively improve the adaptability of the table tennis robot to batting with fast beat;
2. 4 strategies of near table hitting, far table hitting, forehand hitting and backhand hitting are selected according to different areas where hitting points belong, and compared with the traditional method for configuring the hitting surface, the control method for the hitting motion effectively increases the flexibility and the hitting range of the table tennis robot;
3. the batting motion control method adopts 7-degree polynomial interpolation to complete joint track planning of the current point, the batting point and the waiting point, and reduces the maximum value of the angular acceleration value of the joint on the premise of ensuring the continuity and stability of batting motion.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.