Disclosure of Invention
The object of the present invention is to solve at least one of the technical drawbacks mentioned.
Therefore, the invention aims to provide a robot dragging teaching track generation method.
In order to achieve the above object, an embodiment of the present invention provides a method for generating a robot dragging teaching track, including the following steps:
step S1, receiving the joint position value collected by the sensor of the robot, filtering the joint position value to eliminate high-frequency jitter, and carrying out differential processing on the filtered joint position value to obtain the speed and the acceleration of the robot;
step S2, according to the joint position value, velocity and acceleration generated in step S1, approximating the user dragging teaching trajectory by means of piecewise linear fitting, and calculating the description of the trajectory information of the robot in cartesian space, including: forming a continuous Cartesian space position P through a robot positive solution according to the continuous joint position values, and obtaining a straight line segment through iterative fitting; constructing a turning area between the straight line sections to realize smooth transition between the straight line sections; taking an average speed of the path on the teaching curve as a desired speed of the straight line segment, wherein the speed of the cartesian space is v (t) ═ jac (t) × J _ dot (t), jac (t) is a jacobian matrix at the corresponding time, and J _ dot (t) is the joint angular speed output in step S1;
and step S3, generating a user program file for describing the track according to the straight line segment, the turning area and the speed obtained in the step S2, and converting the track dragged by the user into a text instruction so as to modify and optimize the taught track.
Further, in the step S1, joint position values are collected by an encoder installed at a robot joint or a motor end.
Further, in step S1, the joint position value is filtered by combining a band-stop filter and a band-pass filter.
Further, in the step S2, the fitting to obtain a straight line segment includes the following steps:
the joint position J (t) is known, the position P (t) ═ FK (J (t)) of the Cartesian space is obtained through positive solution of a robot, the continuous Cartesian space position P is formed through the continuous joint position J, and t is acquisition time;
setting the starting point of a straight line segment as F0, setting the end point of the straight line segment as F1, setting F1 and F0 as a point on P, setting the straight line formed by F0 and F1 as L, integrating fabs (L (t) -P (t)), wherein the fabs are absolute value functions, the integrated result represents the error between a fitted straight line and an actual curve, and when the error is smaller than a set threshold, F1 is a reasonable straight line segment path end point, and searching reasonable F1 on P, and continuously iterating to obtain the fitted straight line segment.
Further, in the step S2, the radius of the turning area is determined according to the front-rear straight line segment length.
Further, in the step S3, the user program file includes: movel P0, V100, Z20, where P0 is the straight line segment target position, V100 represents velocity magnitude, and Z20 represents turn zone radius.
The robot dragging teaching track generation method has the following beneficial effects:
(1) friction and high-frequency jitter introduced by human hands are eliminated through filtering, so that smoothness of a subsequently generated track can be improved;
(2) the teaching track dragged by the user is fitted in a Cartesian space linear form, the fitting precision can be set automatically according to the actual situation, and the flexibility is high;
(3) the straight line section is smoothly transited by using the turning area, so that the consistency of the track is ensured;
(4) the user track is stored in a text instruction form, and the target point, the speed or the turning area can be modified and perfected according to the requirement, so that the method is convenient and flexible.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
As shown in fig. 1 and fig. 5, a robot dragging teaching track generating method according to an embodiment of the present invention includes the following steps:
and step S1, receiving the joint position value collected by the sensor of the robot, filtering the joint position value to eliminate high-frequency jitter, and carrying out difference processing on the filtered joint position value to obtain the speed and the acceleration of the robot.
In one embodiment of the invention, joint position values are collected by encoders mounted on the joints or motor ends of the robot. By performing a preliminary processing of the data acquired from the robot sensors. The sensor can be an encoder at a robot joint or a motor end, and the acquired raw data is a joint position value.
Because the track generation needs speed and acceleration besides the position, the speed and the acceleration can not be directly measured generally, and the position needs to be differentially acquired. Specifically, it can be found by analyzing actual experimental data that, when dragging at a low speed or a high speed, a certain high-frequency jitter exists at the acquired position, and the jitter is more obvious after being differentiated into a speed and an acceleration (fig. 2 is a speed obtained by directly differentiating original data), if a track is generated by directly using the data, the robot jitter is easily caused when playing back the track, and therefore, the data is further processed before extracting track information.
The sources of fluctuation of the position data are mainly two: one is the existence of the friction force of the robot joint, which is embodied as non-linearity, and can be described by the following formula, where fe is external force, fs is maximum static friction, fv is viscous friction coefficient, v is relative motion velocity,
because the parameters of the friction force model are time-varying and difficult to determine, the parameters are difficult to eliminate by only friction compensation, and the hand feeling of dragging is influenced by the existence of friction, so that certain overshoot and oscillation are inevitable when a human hand drags; another source is the natural frequency of the human hand as it is dragged, which is also difficult to avoid.
In order to solve the problems, the invention adopts a mode of combining a band-stop filter and a band-pass filter to filter the joint position value, and mainly aims to filter original joint position data, eliminate high-frequency jitter and then obtain speed and acceleration through difference. The filtering can adopt a mode of combining a band-stop filter with a band-pass filter, the band-stop filter filters the jitter of specific frequency of hands, the band-pass filter eliminates high-frequency jitter caused by friction force, and meanwhile expected track information is reserved
And step S2, approaching the user dragging teaching track by adopting a piecewise straight line fitting mode according to the joint position value, the speed and the acceleration generated in the step S1, and calculating the description of the track information of the robot in a Cartesian space.
(1) And (3) forming a continuous Cartesian space position P through the positive solution of the robot according to the continuous joint position values, and obtaining a straight line segment through iterative fitting.
The trajectory of the robot can be represented in two ways, one is joint space and the other is cartesian space. From the use point of view, the trajectory description expected by the user is the movement of the workpiece relative to the workpiece, so that the description in the Cartesian space is more reasonable. Since the trajectory of the user dragging the teaching can be an arbitrary spatial curve, it cannot be described by a uniform expression. The invention adopts a piecewise straight line fitting mode to approach the teaching track dragged by the user.
Specifically, the fitting to obtain the straight line segment comprises the following steps:
when the joint position J (t) is known, the cartesian space position P (t) ═ FK (J (t)) is obtained by the positive solution of the robot, and the continuous joint position J can form the continuous cartesian space position P, and t is the acquisition time.
Assuming that the starting point of the straight line segment is F0, the starting point of the straight line segment may be a point on P, assuming that the ending point of the straight line segment is F1, the point is also a point on P, the straight line formed by F0 and F1 is L, fabs (L (t) -P (t)) are integrated, fabs are absolute value functions, the integrated result represents the error between the fitted straight line and the actual curve, and F1 is the reasonable ending point of the straight line segment path when the error is smaller than the set threshold. The fitting straight line segment is obtained iteratively by searching for a reasonable F1 on P, as shown in fig. 3.
(2) And (4) constructing a turning area between the straight line sections to realize smooth transition between the straight line sections.
The straight line segment fitted above is only continuous in position, but there is a sudden change in slope, which causes inconsistency in robot operation. Therefore, a turning area is constructed between the straight line sections, and the radius of the turning area is determined according to the lengths of the front straight line section and the rear straight line section. A smooth transition between straight line segments is achieved using a turning zone, as shown in fig. 4.
(3) The desired velocity of the straight line segment is an average velocity of the path on the teaching curve, and the velocity in cartesian space is v (t) ═ jac (t) × J _ dot (t), where jac (t) is the jacobian matrix at the corresponding time, and J _ dot (t) is the joint angular velocity output in step S1.
And step S3, generating a user program file for describing the track according to the straight line segment, the turning area and the speed obtained in the step S2, and converting the track dragged by the user into a text instruction so as to modify and optimize the taught track.
In one embodiment of the invention, the user program file includes: movel P0, V100, Z20, where P0 is the straight line segment target position, V100 represents velocity magnitude, and Z20 represents turn zone radius. The track dragged by the user is converted into a line of text instruction, and the track which is taught and finished can be modified and optimized conveniently.
According to the method for generating the robot dragging teaching track, the handheld dragging robot reaches the appointed pose or moves along the specific track, the robot collects sensor information, records target point or track data, generates the dragging teaching track after processing, and a user reproduces the teaching track in a track playback mode. The intuitive teaching mode reduces the requirements on operators, can greatly shorten the time cost of application deployment, improves the programming efficiency, and has very obvious practicability and economic value.
The robot dragging teaching track generation method has the following beneficial effects:
(1) friction and high-frequency jitter introduced by human hands are eliminated through filtering, so that smoothness of a subsequently generated track can be improved;
(2) the teaching track dragged by the user is fitted in a Cartesian space linear form, the fitting precision can be set automatically according to the actual situation, and the flexibility is high;
(3) the straight line section is smoothly transited by using the turning area, so that the consistency of the track is ensured;
(4) the user track is stored in a text instruction form, and the target point, the speed or the turning area can be modified and perfected according to the requirement, so that the method is convenient and flexible.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention. The scope of the invention is defined by the appended claims and equivalents thereof.