Mechanical arm teaching control method, device, equipment and medium
By obtaining the teaching trajectory through calibration and transformation relationships, and combining it with the parameters of the dynamic motion primitive model, the complexity and accuracy problems of existing robotic arm teaching methods are solved, and efficient and intuitive robotic arm teaching control is achieved.
Patent Information
- Application Number
- CN202511472863.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-15
- Publication Date
- 2025-12-16
AI Technical Summary
Existing robotic arm teaching methods suffer from high modeling costs, complex operations, precision dependence on absolute model accuracy, low efficiency, and difficulty in balancing intuitiveness, high precision, and high efficiency.
By acquiring and calibrating the teaching tool file, the transformation relationship between the robot arm base coordinate system and the optical positioning coordinate system and between the robot arm end effector coordinate system and the teaching tool coordinate system is established. The teaching trajectory of a preset number of times is obtained and converted into dynamic motion primitive model parameters. The target teaching trajectory and joint angle sequence are determined to achieve precise trajectory control of the robot arm.
It achieves robotic arm teaching control that requires no complex parameter input or manual physical intervention, while maintaining intuitiveness and high efficiency, thus improving the robotic arm's precise trajectory control and stable operation execution capabilities.
Smart Images

Figure CN121132673A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of mechanical control, and particularly relates to a mechanical arm teaching control method, device, equipment and medium. BACKGROUND
[0002] With the in-depth promotion of industrial intelligent manufacturing, industrial mechanical arms have become the core equipment of modern production lines. Their applications have been expanded from traditional welding, spraying and carrying to precise assembly, polishing, detection and man-machine collaborative work, greatly improving production efficiency and work precision and providing key support for flexible production.
[0003] Before the current mechanical arm performs a task, the work path and posture (i.e., teaching) need to be planned. The existing teaching methods mainly include three types: (1) offline teaching programming, which requires the construction of a high-precision model. The modeling cost is high, and the precision depends on the absolute accuracy of the model. In actual application of the offline program, a large amount of on-site calibration and correction by engineers is required, which is low in efficiency; (2) teaching by a teaching device, which relies on the manual input of parameters or the recording of points by a joystick control arm. The operation is not intuitive, the learning curve is steep, the teaching process is time-consuming, and the teaching of complex curve trajectories is extremely difficult; and (3) traction teaching, which requires manual traction of the mechanical arm to record the trajectory. The precision and repeatability are insufficient due to the rigid deformation of the arm body and hand jitter, and it is difficult to adapt to precise work.
[0004] Therefore, how to provide a mechanical arm teaching scheme that takes into account intuitiveness, high precision and high efficiency without relying on complex parameter input or manual physical intervention for mechanical arm control is a problem that needs to be solved by those skilled in the art. SUMMARY
[0005] The embodiments of the application provide a mechanical arm teaching control method, device, equipment and medium, aiming to make the teaching process without complex parameter input or manual physical intervention, taking into account intuitiveness, high precision and high efficiency, so as to realize precise trajectory control and stable work execution of the mechanical arm.
[0006] In a first aspect, the embodiments of the application provide a mechanical arm teaching control method, which comprises: obtaining a teaching tool file and performing a calibration operation based on the teaching tool file to obtain a first conversion relationship from a mechanical arm base coordinate system to an optical positioning coordinate system and a second conversion relationship from a mechanical arm end coordinate system to a teaching tool coordinate system; obtaining teaching trajectories corresponding to a preset number of teaching operations based on the first conversion relationship and the second conversion relationship; wherein the preset number is at least two; converting each of the teaching trajectories into a dynamic motion primitive model parameter, and determining a target teaching trajectory based on each of the dynamic motion primitive model parameters; Determine a target robot joint angle sequence based on the target teaching trajectory, and control the robot based on the target robot joint angle sequence.
[0007] Optionally, the calibration based on the teaching tool file obtains a first conversion relationship from the robot base coordinate system to the optical positioning coordinate system and a second conversion relationship from the robot end coordinate system to the teaching tool coordinate system, and includes: In a first calibration change process, at least two groups of first rotation matrices from the optical positioning coordinate system to the teaching tool coordinate system and the origin position of the teaching tool coordinate system in the optical positioning coordinate system are obtained based on the teaching tool file; wherein, in the first calibration change process, the robot end changes the pose and keeps the position unchanged; Based on the first rotation matrix and the origin position of the teaching tool coordinate system, a translation matrix from the robot end coordinate system to the teaching tool coordinate system is determined; In a second calibration change process, at least two groups of first robot end positions in the optical positioning coordinate system and second robot end positions in the robot base coordinate system are obtained based on the teaching tool file; wherein, in the second calibration change process, the robot end changes the position and keeps the pose unchanged; Based on the first robot end position and the second robot end position, a first conversion relationship from the robot base coordinate system to the optical positioning coordinate system is determined; Based on the first conversion relationship, a second rotation matrix from the robot end coordinate system to the teaching tool coordinate system is determined to obtain a second conversion relationship from the robot end coordinate system to the teaching tool coordinate system.
[0008] Optionally, the first conversion relationship and the second conversion relationship are used to obtain a teaching trajectory corresponding to a preset number of teaching operations, including: In the teaching operation process, a third conversion relationship from the teaching tool coordinate system to the optical positioning coordinate system is obtained based on the teaching tool file; Based on the first conversion relationship, the second conversion relationship and the third conversion relationship, a teaching trajectory corresponding to the teaching operation is determined; Repeat the above steps until the number of repetitions reaches the preset number.
[0009] Optionally, the target teaching trajectory is determined based on each dynamic motion primitive model parameter, including: Determine the total trajectory deviation based on each dynamic motion primitive model parameter and the to-be-optimized dynamic motion primitive model parameter; Optimize the to-be-optimized dynamic motion primitive model parameter based on the total trajectory deviation; The above steps are repeatedly performed until the dynamic motion primitive model parameter to be optimized meets an optimization stop condition. The dynamic motion primitive model parameter to be optimized is determined as a target dynamic motion primitive model parameter, and the target dynamic motion primitive model parameter is converted into a target teaching trajectory.
[0010] Optionally, before the total trajectory deviation is determined based on the dynamic motion primitive model parameters and the dynamic motion primitive model parameter to be optimized, the method further includes: A smoothness index of each teaching trajectory is calculated, and a weight value corresponding to each teaching trajectory is determined based on the smoothness index; Correspondingly, the total trajectory deviation is determined based on the dynamic motion primitive model parameters and the dynamic motion primitive model parameter to be optimized, including: An individual trajectory deviation corresponding to each teaching trajectory is determined based on the dynamic motion primitive model parameters and the dynamic motion primitive model parameter to be optimized; The total trajectory deviation is determined based on the individual trajectory deviations of each teaching trajectory and the corresponding weight values.
[0011] Optionally, the target mechanical arm joint angle sequence is determined based on the target teaching trajectory, including: Mechanical arm movement constraint information is obtained, and at least two sets of mechanical arm joint angle sequences are generated based on the mechanical arm movement constraint information and the target teaching trajectory; Mechanical arm movement energy consumptions corresponding to each set of mechanical arm joint angle sequences are calculated; The mechanical arm joint angle sequence with the lowest mechanical arm movement energy consumption is determined as the target mechanical arm joint angle sequence.
[0012] Optionally, the mechanical arm movement energy consumptions corresponding to each set of mechanical arm joint angle sequences are calculated, including: Mechanical arm joint speed sequences and mechanical arm joint acceleration sequences corresponding to each set of mechanical arm joint angle sequences are calculated; A driving torque sequence is determined based on the mechanical arm joint angle sequences, the mechanical arm joint speed sequences, and the mechanical arm joint acceleration sequences; The mechanical arm movement energy consumptions corresponding to each set of mechanical arm joint angle sequences are determined based on the driving torque sequence.
[0013] In a second aspect, an embodiment of the present application provides a mechanical arm teaching control device, the device including: a calibration relationship module, configured to acquire a teaching tool file and perform calibration based on the teaching tool file to obtain a first conversion relationship from a base coordinate system of a robot arm to an optical positioning coordinate system and a second conversion relationship from an end coordinate system of the robot arm to a teaching tool coordinate system; a teaching operation module, configured to acquire a teaching trajectory corresponding to a preset number of teaching operations based on the first conversion relationship and the second conversion relationship, wherein the preset number is at least two; a trajectory determination module, configured to convert each of the teaching trajectories into a dynamic motion primitive model parameter and determine a target teaching trajectory based on each of the dynamic motion primitive model parameters; a robot arm control module, configured to determine a target robot arm joint angle sequence based on the target teaching trajectory and control the robot arm based on the target robot arm joint angle sequence.
[0014] Optionally, the calibration relationship module is specifically configured to: in a first calibration change process, acquire, based on the teaching tool file, at least two groups of a first rotation matrix from the optical positioning coordinate system to the teaching tool coordinate system and a teaching tool coordinate system origin position in the optical positioning coordinate system, wherein in the first calibration change process, the end of the robot arm changes in pose and remains unchanged in position; determine, based on the first rotation matrix and the teaching tool coordinate system origin position, a translation matrix from the end coordinate system of the robot arm to the teaching tool coordinate system; in a second calibration change process, acquire, based on the teaching tool file, at least two groups of a first robot arm end position in the optical positioning coordinate system and a second robot arm end position in the base coordinate system of the robot arm, wherein in the second calibration change process, the end of the robot arm changes in position and remains unchanged in pose; determine, based on the first robot arm end position and the second robot arm end position, the first conversion relationship from the base coordinate system of the robot arm to the optical positioning coordinate system; determine, based on the first conversion relationship, a second rotation matrix from the end coordinate system of the robot arm to the teaching tool coordinate system to obtain the second conversion relationship from the end coordinate system of the robot arm to the teaching tool coordinate system.
[0015] Optionally, the teaching operation module is specifically configured to: in a teaching operation process, acquire, based on the teaching tool file, a third conversion relationship from the teaching tool coordinate system to the optical positioning coordinate system; determine, based on the first conversion relationship, the second conversion relationship, and the third conversion relationship, a teaching trajectory corresponding to a teaching operation; The above steps are repeatedly performed until the number of repetitions reaches a preset number.
[0016] Optionally, the trajectory determination module is specifically configured to: determine a total trajectory deviation based on the dynamic motion primitive model parameters and the to-be-optimized dynamic motion primitive model parameters; optimize the to-be-optimized dynamic motion primitive model parameters based on the total trajectory deviation; repeatedly perform the above steps until the to-be-optimized dynamic motion primitive model parameters meet an optimization stop condition; determine the to-be-optimized dynamic motion primitive model parameters as target dynamic motion primitive model parameters, and convert the target dynamic motion primitive model parameters into a target teaching trajectory.
[0017] Optionally, the trajectory determination module is further configured to: calculate a smoothness index of each teaching trajectory, and determine a weight value corresponding to each teaching trajectory based on the smoothness index; determine an individual trajectory deviation corresponding to each teaching trajectory based on the dynamic motion primitive model parameters and the to-be-optimized dynamic motion primitive model parameters; determine a total trajectory deviation based on the individual trajectory deviations of each teaching trajectory and the corresponding weight values.
[0018] Optionally, the robot arm control module is specifically configured to: obtain robot arm motion constraint information, and generate at least two groups of robot arm joint angle sequences based on the robot arm motion constraint information and the target teaching trajectory; calculate robot arm motion energy consumption corresponding to each group of robot arm joint angle sequences; determine a robot arm joint angle sequence with the lowest robot arm motion energy consumption as a target robot arm joint angle sequence.
[0019] Optionally, the robot arm control module is specifically configured to: calculate a robot arm joint speed sequence and a robot arm joint acceleration sequence corresponding to each group of robot arm joint angle sequences; determine a driving torque sequence based on the robot arm joint angle sequence, the robot arm joint speed sequence, and the robot arm joint acceleration sequence; determine robot arm motion energy consumption corresponding to each group of robot arm joint angle sequences based on the driving torque sequence.
[0020] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
[0021] In a fourth aspect, a readable storage medium is provided, which stores a program or instructions, and the program or instructions, when executed by a processor, implement the steps of the method according to the first aspect.
[0022] In the embodiments of the present application, a teaching tool file is obtained, and a calibration operation is performed based on the teaching tool file to obtain a first conversion relationship from a mechanical arm base coordinate system to an optical positioning coordinate system and a second conversion relationship from a mechanical arm end coordinate system to a teaching tool coordinate system; based on the first conversion relationship and the second conversion relationship, a teaching trajectory corresponding to a preset number of teaching operations is obtained; wherein the preset number is at least twice; each teaching trajectory is converted into a dynamic motion primitive model parameter, and a target teaching trajectory is determined based on each dynamic motion primitive model parameter; a target mechanical arm joint angle sequence is determined based on the target teaching trajectory, and a mechanical arm is controlled based on the target mechanical arm joint angle sequence. The above-mentioned mechanical arm teaching control method makes the teaching process unnecessary to input complex parameters or manual physical intervention, and takes into account intuitiveness, high precision and high efficiency, so as to realize precise trajectory control and stable operation execution of the mechanical arm. BRIEF DESCRIPTION OF DRAWINGS
[0023] Figure 1 is a flowchart of a mechanical arm teaching control method provided by an embodiment of the present application; Figure 2 is a flowchart of a mechanical arm teaching control method provided by an embodiment of the present application; Figure 3 is a flowchart of a mechanical arm teaching control method provided by an embodiment of the present application; Figure 4 is a structural diagram of a mechanical arm teaching control device provided by an embodiment of the present application; Figure 5 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purposes, technical solutions and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below with reference to the drawings. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only parts related to the present application are shown in the drawings, but not all. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The processes can correspond to methods, functions, procedures, subroutines, etc.
[0025] The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art belong to the scope of protection of the present application.
[0026] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually a class, not limited to the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in an "or" relationship.
[0027] The mechanical arm teaching control method, device, equipment and medium provided by the embodiments of the present application will be described in detail below with reference to the drawings, through specific embodiments and application scenarios.
[0028] Embodiment one Figure 1 is a flowchart of the mechanical arm teaching control method provided by the first embodiment of the present application. As shown in Figure 1 , the specific steps include the following steps: S101, obtaining a teaching tool file, and performing calibration operation based on the teaching tool file to obtain a first conversion relationship from a mechanical arm base coordinate system to an optical positioning coordinate system and a second conversion relationship from a mechanical arm end coordinate system to a teaching tool coordinate system; Firstly, the present application is applicable to the scene that needs to pre-teach to control the movement of the robot arm according to the teaching trajectory. It can be understood that the execution subject of the present application can be a terminal device with image processing capability.
[0029] The teaching tool can be an end effector integrated with optical marker points (such as a mechanical claw with an array of reflective balls, a probe or a special calibration rod), that is, the surface of the teaching tool is fixed with marker points that can be recognized by the optical positioning system, for realizing high-precision spatial positioning. The teaching tool file can be a configuration file recording the geometric parameters of the teaching tool, which can contain information such as the three-dimensional coordinates of the optical marker points in the teaching tool coordinate system, the tool length, the type and size of the end effector, etc., providing basic data for coordinate system conversion. The way to obtain the teaching tool file can be to scan the teaching tool by the optical positioning system, automatically record the coordinates of the optical marker points and generate the configuration file.
[0030] The robot arm base coordinate system can be a right-handed rectangular coordinate system with the center of the robot arm base mounting surface as the origin, the stretching direction of the robot arm body as the X axis, and the upward direction perpendicular to the mounting surface as the Z axis; the optical positioning coordinate system can be a coordinate system with the optical center of the optical positioning system as the origin, the direction of the camera optical axis as the Z axis, and the horizontal direction of the imaging plane as the X axis; the robot arm end coordinate system can be a coordinate system with the center of the robot arm end flange as the origin, the output shaft direction of the flange as the Z axis, and the tool mounting reference direction as the X axis; the teaching tool coordinate system can be a coordinate system with the end working point of the teaching tool as the origin, the tool axis direction as the Z axis, and the tool symmetry plane direction as the X axis.
[0031] The first conversion relationship from the robot arm base coordinate system to the optical positioning coordinate system can be a conversion matrix (including a rotation matrix and a translation matrix) for converting the coordinates in the robot arm base coordinate system to the coordinates in the optical positioning coordinate system; the second conversion relationship from the robot arm end coordinate system to the teaching tool coordinate system can be a conversion matrix for converting the coordinates in the robot arm end coordinate system to the coordinates in the teaching tool coordinate system.
[0032] The manner of calibrating based on the teaching tool file to obtain the first conversion relationship from the base coordinate system of the robot arm to the optical positioning coordinate system and the second conversion relationship from the end coordinate system of the robot arm to the teaching tool coordinate system can comprise: in a first calibration variation process, obtaining at least two groups of first rotation matrices from the optical positioning coordinate system to the teaching tool coordinate system and the origin position of the teaching tool coordinate system in the optical positioning coordinate system based on the teaching tool file; wherein the pose of the robot arm end is changed and the position is kept unchanged in the first calibration variation process; based on the first rotation matrix and the origin position of the teaching tool coordinate system, determining a translation matrix from the end coordinate system of the robot arm to the teaching tool coordinate system; in a second calibration variation process, obtaining at least two groups of first robot arm end positions in the optical positioning coordinate system and second robot arm end positions in the base coordinate system of the robot arm based on the teaching tool file; wherein the position of the robot arm end is changed and the pose is kept unchanged in the second calibration variation process; based on the first robot arm end position and the second robot arm end position, determining the first conversion relationship from the base coordinate system of the robot arm to the optical positioning coordinate system; based on the first conversion relationship, determining a second rotation matrix from the end coordinate system of the robot arm to the teaching tool coordinate system, to obtain the second conversion relationship from the end coordinate system of the robot arm to the teaching tool coordinate system.
[0033] Optionally, the calibration based on the teaching tool file to obtain the first conversion relationship from the base coordinate system of the robot arm to the optical positioning coordinate system and the second conversion relationship from the end coordinate system of the robot arm to the teaching tool coordinate system comprises: in a first calibration variation process, obtaining at least two groups of first rotation matrices from the optical positioning coordinate system to the teaching tool coordinate system and the origin position of the teaching tool coordinate system in the optical positioning coordinate system based on the teaching tool file; wherein the pose of the robot arm end is changed and the position is kept unchanged in the first calibration variation process; based on the first rotation matrix and the origin position of the teaching tool coordinate system, determining a translation matrix from the end coordinate system of the robot arm to the teaching tool coordinate system; in a second calibration variation process, obtaining at least two groups of first robot arm end positions in the optical positioning coordinate system and second robot arm end positions in the base coordinate system of the robot arm based on the teaching tool file; wherein the position of the robot arm end is changed and the pose is kept unchanged in the second calibration variation process; based on the first robot arm end position and the second robot arm end position, determining the first conversion relationship from the base coordinate system of the robot arm to the optical positioning coordinate system; based on the first conversion relationship, determining a second rotation matrix from the end coordinate system of the robot arm to the teaching tool coordinate system, to obtain the second conversion relationship from the end coordinate system of the robot arm to the teaching tool coordinate system.
[0034] The first calibration change process can be a calibration operation process for determining the conversion relationship between the robot end coordinate system and the teaching tool coordinate system, and controlling the robot end to adjust different postures at a fixed spatial position. In the first calibration change process, the robot end changes the posture and keeps the position unchanged, that is, the center of the robot end flange (the origin of the robot end coordinate system) is always at the same spatial position and does not have any translation in the whole first calibration process; only by adjusting the rotation angle of the robot joint, the posture of the robot end is changed.
[0035] The first rotation matrix from the optical positioning coordinate system to the teaching tool coordinate system can be a matrix describing the posture relationship of the teaching tool coordinate system relative to the optical positioning coordinate system. The way to obtain the first rotation matrix from the optical positioning coordinate system to the teaching tool coordinate system can be to confirm the known three-dimensional coordinates of the optical mark points fixed on the teaching tool surface in the teaching tool coordinate system according to the teaching tool file, and to obtain the real-time three-dimensional coordinates of the optical mark points in the optical positioning coordinate system by shooting the optical mark points on the teaching tool by the optical positioning system after adjusting the posture of the robot end each time in the first calibration change process, and to calculate the rotation matrix that minimizes the error of the two sets of optical mark point coordinates (the known three-dimensional coordinates in the teaching tool coordinate system and the real-time three-dimensional coordinates in the optical positioning coordinate system) under the same posture as the first rotation matrix from the optical positioning coordinate system to the teaching tool coordinate system.
[0036] The origin position of the teaching tool coordinate system in the optical positioning coordinate system can be the three-dimensional spatial coordinates of the reference origin of the teaching tool coordinate system in the optical positioning coordinate system. The way to obtain the origin position of the teaching tool coordinate system in the optical positioning coordinate system can be to rotate the vector of the origin of the teaching tool coordinate system relative to an optical mark point in the optical positioning coordinate system based on the first rotation matrix, and to add the real-time three-dimensional coordinates of the optical mark point in the optical positioning coordinate system to obtain the origin position of the teaching tool coordinate system in the optical positioning coordinate system.
[0037] The translation matrix from the robot end coordinate system to the teaching tool coordinate system can be a vector describing the spatial position offset relationship of the origin of the teaching tool coordinate system relative to the origin of the robot end coordinate system. Based on the first rotation matrix and the origin position of the teaching tool coordinate system, the way to determine the translation matrix from the robot end coordinate system to the teaching tool coordinate system can be to substitute the first rotation matrix and the origin position of the teaching tool coordinate system into the following formula: ; wherein, represents the first rotation matrix under the Nth posture in the first calibration change process, represents the position of the origin of the teaching tool coordinate system in the Nth pose in the first calibration change process, represents the position of the end of the robot arm in the teaching tool coordinate system, represents the position of the end of the robot arm in the optical positioning coordinate system; solving the above formula by least squares method , that is, the translation matrix from the end of the robot arm coordinate system to the teaching tool coordinate system.
[0038] wherein the derivation process of the above formula is: The conversion relationship between the end of the robot arm and the teaching tool is relatively fixed, so the pose change of the end of the robot arm , that is, the rotation matrix from the teaching tool coordinate system to the optical positioning coordinate system) is consistent with the pose change of the teaching tool , that is, the rotation matrix from the end of the robot arm coordinate system to the optical positioning coordinate system) is consistent, so we can get: , ; wherein, is the position of the end of the robot arm in the optical positioning coordinate system, is the position of the end of the robot arm in the teaching tool coordinate system, is the position of the origin of the teaching tool coordinate system in the optical positioning coordinate system, is the position of the origin of the teaching tool coordinate system in the teaching tool coordinate system, is the translation matrix from the teaching tool coordinate system to the optical positioning coordinate system; The two formulas can be further simplified as: ; Both sides are multiplied by , we can get: ; Convert to matrix multiplication form, we can get: ; wherein, is a 3-order unit matrix; Expand, we can get: .
[0039] The second calibration change process can be a calibration operation process for determining the conversion relationship between the robot base coordinate system and the optical positioning coordinate system, and controlling the end of the robot arm to adjust different spatial positions while keeping the pose fixed. Among them, the end of the robot arm changes position and keeps the pose unchanged in the second calibration change process, that is, the pose of the end of the robot arm remains unchanged throughout the second calibration process, and does not rotate at all, only by adjusting the movement of the robot joints, the spatial position of the origin of the end of the robot arm coordinate system is changed.
[0040] The way of obtaining the first mechanical arm end position in the optical positioning coordinate system and the second mechanical arm end position in the mechanical arm base coordinate system based on the teaching tool file can be that the second mechanical arm end position in the mechanical arm base is calculated based on the forward kinematics relationship of the mechanical arm, the teaching tool position in the optical positioning coordinate system is obtained based on the teaching tool file through the optical positioning system, and the teaching tool position in the optical positioning coordinate system is substituted into the following formula to obtain: ; Wherein, is the teaching tool position in the optical positioning coordinate system; Wherein, and The acquisition process includes: confirming the known three-dimensional coordinates of the optical marker points fixed on the surface of the teaching tool in the teaching tool coordinate system according to the teaching tool file, shooting the optical marker points on the teaching tool by using the optical positioning system, obtaining the real-time three-dimensional coordinates of the optical marker points in the optical positioning coordinate system, and calculating the rotation matrix and the translation matrix between the two groups of optical marker point coordinates at the same position.
[0041] Correspondingly, the first mechanical arm end position in the optical positioning coordinate system and the second mechanical arm end position in the mechanical arm base coordinate system are: .
[0042] Based on the first mechanical arm end position and the second mechanical arm end position, the way of determining the first conversion relationship from the mechanical arm base coordinate system to the optical positioning coordinate system can be that the covariance matrix H is constructed by decentralizing the first mechanical arm end position and the second mechanical arm end position respectively, the singular value decomposition method is used on the covariance matrix H to obtain three matrices U, V and S, the rotation matrix from the optical positioning coordinate system to the mechanical arm base coordinate system is , the centroid of the first mechanical arm end position and the centroid of the second mechanical arm end position are calculated, the centroid of the first mechanical arm end position, the centroid of the second mechanical arm end position and the rotation matrix from the optical positioning coordinate system to the mechanical arm base coordinate system are substituted into to obtain the translation matrix from the optical positioning coordinate system to the mechanical arm base coordinate system, the rotation matrix and the translation matrix from the optical positioning coordinate system to the mechanical arm base coordinate system are assembled into a conversion matrix, and the inverse matrix of the conversion matrix is calculated as the first conversion relationship from the mechanical arm base coordinate system to the optical positioning coordinate system.
[0043] Based on the first transformation relationship, a second rotation matrix is determined from the robot arm end-effector coordinate system to the teaching pendant coordinate system. This process, which yields the second transformation relationship from the robot arm end-effector coordinate system to the teaching pendant coordinate system, can be achieved by using the transformation matrix from the first transformation relationship. Substitution In this process, the second rotation matrix from the robot arm end-effector coordinate system to the teaching tool coordinate system is obtained. .in, The rotation matrix from the robot arm's end effector coordinate system to the robot arm's base coordinate system can be calculated based on the robot arm's forward kinematics. The second rotation matrix from the robot arm's end effector coordinate system to the teaching pendant coordinate system... With translation matrix This constitutes a second transformation relationship from the coordinate system of the robotic arm's end effector to the coordinate system of the teaching tool.
[0044] The advantage of this scheme is that by controlling the robot arm's end effector to change its posture while keeping its position fixed during the first calibration change, and then controlling the robot arm's end effector to change its position while keeping its posture fixed during the second calibration change, the translation and rotation parameters can be decoupled for calibration, which greatly improves the calibration accuracy and efficiency of coordinate system transformation relationships.
[0045] S102, based on the first conversion relationship and the second conversion relationship, obtain the teaching trajectory corresponding to a preset number of teaching operations; wherein, the preset number of operations is at least two. The teaching trajectory can be a spatiotemporal sequence composed of a series of discrete pose points. The preset number of times can be a pre-set number of times to repeat the teaching operation.
[0046] Teaching operation can be an operation in which the operator holds a teaching tool and moves along the target operation path.
[0047] The method of obtaining the teaching trajectory corresponding to the teaching operation for a preset number of times based on the first transformation relationship and the second transformation relationship can be adopted by obtaining the third transformation relationship from the teaching tool coordinate system to the optical positioning coordinate system based on the teaching tool file during the teaching operation, determining the teaching trajectory corresponding to the teaching operation based on the first transformation relationship, the second transformation relationship and the third transformation relationship, and repeating the above steps until the number of repetitions reaches the preset number of times.
[0048] Optionally, obtaining the teaching trajectory corresponding to a preset number of teaching operations based on the first transformation relationship and the second transformation relationship includes: During the teaching operation, a third transformation relationship from the teaching tool coordinate system to the optical positioning coordinate system is obtained based on the teaching tool file; determine the teaching trajectory corresponding to the teaching operation based on the first conversion relationship, the second conversion relationship and the third conversion relationship; Repeat the above steps until the number of repetitions reaches the preset number of times.
[0049] The third conversion relationship from the teaching tool coordinate system to the optical positioning coordinate system can be a conversion matrix (including a rotation matrix and a translation matrix ).
[0050] Based on the teaching tool file, the third conversion relationship from the teaching tool coordinate system to the optical positioning coordinate system can be obtained in the following manner: and , assemble and into a conversion matrix, and calculate the inverse matrix of the conversion matrix as the third conversion relationship from the teaching tool coordinate system to the optical positioning coordinate system.
[0051] Based on the first conversion relationship, the second conversion relationship and the third conversion relationship, the teaching trajectory corresponding to the teaching operation can be determined in the following manner: based on the second conversion relationship and the real-time pose of the teaching tool in the optical positioning coordinate system (i.e., the real-time third conversion relationship), the real-time pose of the end of the robot arm in the optical positioning coordinate system is calculated; based on the first conversion relationship, the real-time pose of the end of the robot arm in the optical positioning coordinate system is converted into a real-time pose in the robot arm base coordinate system, and the teaching trajectory corresponding to the teaching operation is obtained.
[0052] The advantages of this scheme are that by obtaining the third conversion relationship from the teaching tool coordinate system to the optical positioning coordinate system based on the teaching tool file during the teaching operation, and determining the teaching trajectory corresponding to the teaching operation based on the first conversion relationship, the second conversion relationship and the third conversion relationship, multi-coordinate system precise linkage can be realized, and the teaching trajectory can truly restore the operation intention of the operator, while taking into account the precision and executability of the trajectory.
[0053] S103, convert each of the teaching trajectories into a dynamic motion primitive model parameter, and determine a target teaching trajectory based on each of the dynamic motion primitive model parameters; The dynamic motion primitive model parameter can be a core parameter set describing the dynamic characteristics of the trajectory, including a basis function parameter, a weight parameter, an initial state parameter, a target state parameter and a time scale parameter.
[0054] The manner of converting the teaching trajectory into the dynamic motion primitive model parameter can adopt time normalization processing on the teaching trajectory, construct a preset number of Gaussian basis functions and determine the center and width parameters thereof, solve the weight parameter based on the dynamic equation of the dynamic motion primitive (such as a second-order linear system) by using the least square method or the gradient descent method, minimize the mean square error between the output trajectory and the teaching trajectory, extract the initial pose of the teaching trajectory as the initial state parameter, the terminal pose as the target state parameter, and determine the time scale parameter according to the teaching time length, and integrate the above parameters to form the dynamic motion primitive model parameter corresponding to the teaching trajectory.
[0055] The target teaching trajectory can be an optimal reference trajectory that fuses common features of multiple teaching operations and eliminates abnormal fluctuations. The manner of determining the target teaching trajectory based on each dynamic motion primitive model parameter can adopt statistical analysis and optimization on each dynamic motion primitive model parameter to obtain a teaching quality score corresponding to each dynamic motion primitive model parameter, determine a weight value corresponding to each dynamic motion primitive model parameter according to the teaching quality score, and obtain the target teaching trajectory based on the weighted average of each dynamic motion primitive model parameter and the corresponding weight value.
[0056] In S104, a target mechanical arm joint angle sequence is determined based on the target teaching trajectory, and a mechanical arm is controlled based on the target mechanical arm joint angle sequence.
[0057] The mechanical arm joint angle sequence can be a set of joint angle values arranged in time sequence, and each angle value at a time corresponds to the specific position of each joint (such as a rotating joint or a moving joint) of the mechanical arm, including the joint number, the time stamp and the corresponding angle parameter, and is used to quantitatively describe the motion state of the mechanical arm. The target mechanical arm joint angle sequence is a joint angle time sequence that can make the end effector of the mechanical arm accurately reproduce the target teaching trajectory. The manner of determining the target mechanical arm joint angle sequence based on the target teaching trajectory can adopt an inverse kinematics solver combining numerical iteration and analytical method to solve each target pose in the target teaching trajectory to obtain the target mechanical arm joint angle sequence.
[0058] The manner of controlling the mechanical arm based on the target mechanical arm joint angle sequence can adopt time stamp to decompose the target joint angle sequence into real-time control instructions, which are sent to the mechanical arm controller through an industrial bus. The mechanical arm controller compares the current joint angle with the target angle to calculate the output torque to drive the movement of each joint motor by using the position closed-loop control strategy.
[0059] In the embodiment of the present application, a teaching tool file is acquired, and calibration is performed based on the teaching tool file to obtain a first conversion relationship from a base coordinate system of a mechanical arm to an optical positioning coordinate system and a second conversion relationship from an end coordinate system of the mechanical arm to a teaching tool coordinate system; based on the first conversion relationship and the second conversion relationship, teaching trajectories corresponding to a preset number of teaching operations are acquired; the preset number is at least twice; each teaching trajectory is converted into a dynamic motion primitive model parameter, and a target teaching trajectory is determined based on each dynamic motion primitive model parameter; a target mechanical arm joint angle sequence is determined based on the target teaching trajectory, and the mechanical arm is controlled based on the target mechanical arm joint angle sequence. The above mechanical arm teaching control method does not require complex parameter input or manual physical intervention in the teaching process, and takes into account intuitiveness, high precision and high efficiency, thereby realizing precise trajectory control and stable operation execution of the mechanical arm.
[0060] Embodiment Two Figure 2 is a flowchart of a mechanical arm teaching control method provided in Embodiment Two of the present application. The present scheme makes a more optimal improvement on the above-mentioned embodiment, and the specific improvement is that: the determination of the target teaching trajectory based on each dynamic motion primitive model parameter includes: determining a total trajectory deviation based on each dynamic motion primitive model parameter and a to-be-optimized dynamic motion primitive model parameter; optimizing the to-be-optimized dynamic motion primitive model parameter based on the total trajectory deviation; repeatedly performing the above-mentioned steps until the to-be-optimized dynamic motion primitive model parameter meets an optimization stop condition; determining the to-be-optimized dynamic motion primitive model parameter as a target dynamic motion primitive model parameter, and converting the target dynamic motion primitive model parameter into a target teaching trajectory.
[0061] As shown in Figure 2 , the method specifically includes the following steps: S201, a teaching tool file is acquired, and calibration is performed based on the teaching tool file to obtain a first conversion relationship from a base coordinate system of a mechanical arm to an optical positioning coordinate system and a second conversion relationship from an end coordinate system of the mechanical arm to a teaching tool coordinate system; S202, based on the first conversion relationship and the second conversion relationship, teaching trajectories corresponding to a preset number of teaching operations are acquired; the preset number is at least twice; S203, each teaching trajectory is converted into a dynamic motion primitive model parameter; S204, a total trajectory deviation is determined based on each dynamic motion primitive model parameter and a to-be-optimized dynamic motion primitive model parameter; The to-be-optimized dynamic motion primitive model parameter can be a set of to-be-solved dynamic motion primitive model parameters, which are consistent in structure with the dynamic motion primitive model parameters corresponding to each teaching trajectory, and are used to construct an optimal teaching trajectory capable of fusing common characteristics of multiple teaching operations.
[0062] The total trajectory deviation can be a quantitative index of the overall deviation degree between the trajectory generated by the to-be-optimized dynamic motion primitive model and each teaching trajectory, and comprehensively reflects the fitting effect of the to-be-optimized dynamic motion primitive model on the common characteristics of multiple teaching operations. The smaller the value of the total trajectory deviation is, the higher the overall consistency between the trajectory generated by the to-be-optimized dynamic motion primitive model and each teaching trajectory is.
[0063] Based on each dynamic motion primitive model parameter and the to-be-optimized dynamic motion primitive model parameter, the total trajectory deviation can be determined by determining individual trajectory deviations corresponding to each teaching trajectory based on each dynamic motion primitive model parameter and the to-be-optimized dynamic motion primitive model parameter, and calculating the average value of each individual trajectory deviation as the total trajectory deviation.
[0064] Optionally, before the total trajectory deviation is determined based on each dynamic motion primitive model parameter and the to-be-optimized dynamic motion primitive model parameter, the method further comprises: calculating a smoothness index of each teaching trajectory, and determining a weight value corresponding to each teaching trajectory based on the smoothness index; Correspondingly, the total trajectory deviation is determined based on each dynamic motion primitive model parameter and the to-be-optimized dynamic motion primitive model parameter, comprising: determining individual trajectory deviations corresponding to each teaching trajectory based on each dynamic motion primitive model parameter and the to-be-optimized dynamic motion primitive model parameter; determining the total trajectory deviation based on the individual trajectory deviations of each teaching trajectory and the corresponding weight values.
[0065] The smoothness index of the teaching trajectory can be a parameter quantitatively describing the motion continuity and stability of the teaching trajectory. The smoothness index of the teaching trajectory can be calculated by sorting the time intervals of adjacent position points of the discrete position sequence of the teaching trajectory according to the time stamp, calculating the velocity of each time step by the first-order difference method, calculating the acceleration of each time step based on the velocity sequence by the first-order difference method, and calculating the root mean square value of the acceleration sequence as the smoothness index of the teaching trajectory.
[0066] The weight value corresponding to one teaching trajectory can be a coefficient reflecting the reliability and reference value of the teaching trajectory. The manner of determining the weight value corresponding to each teaching trajectory based on the smoothness index can be to perform reverse processing on the smoothness index (the root mean square value of the acceleration sequence) corresponding to each teaching trajectory to obtain a smoothness score, calculate the sum of the smoothness scores of all teaching trajectories, and divide the smoothness score of one teaching trajectory by the sum of the smoothness scores to obtain the weight value of the teaching trajectory.
[0067] The individual trajectory deviation corresponding to one teaching trajectory can be a quantitative value of the degree of deviation of the trajectory generated by the to-be-optimized dynamic motion primitive model from the pose of the teaching trajectory at the same time stamp.
[0068] The manner of determining the individual trajectory deviation corresponding to one teaching trajectory based on the dynamic motion primitive model parameter and the to-be-optimized dynamic motion primitive model parameter can be to perform time normalization on the trajectory generated by the to-be-optimized model and the teaching trajectory, calculate the position deviation and the attitude deviation at each time node, calculate the root mean square values of the position deviation and the attitude deviation of all time nodes respectively, and sum the two root mean square values to obtain the individual trajectory deviation corresponding to the teaching trajectory.
[0069] The manner of determining the total trajectory deviation based on the individual trajectory deviation of each teaching trajectory and the corresponding weight value can be to multiply the individual trajectory deviation of each teaching trajectory by the corresponding weight value, and sum the multiplication results to obtain the total trajectory deviation.
[0070] The advantage of this scheme is that by determining the weight value corresponding to each teaching trajectory based on the smoothness index of the teaching trajectory, and determining the total trajectory deviation based on the individual trajectory deviation of each teaching trajectory and the corresponding weight value, the optimization logic of prioritizing high-quality teaching trajectories and weakening the influence of low-quality teaching trajectories can be realized, and the generation of the final target trajectory is avoided from being disturbed by individual low-quality teaching trajectories with jitter and mutation.
[0071] S205, optimizing the to-be-optimized dynamic motion primitive model parameter based on the total trajectory deviation; The manner of optimizing the to-be-optimized dynamic motion primitive model parameter based on the total trajectory deviation can be to calculate the gradient of the total trajectory deviation to the to-be-optimized dynamic motion primitive model parameter based on the gradient descent algorithm, and adjust the to-be-optimized dynamic motion primitive model parameter in the negative gradient direction.
[0072] S206, identifying whether the to-be-optimized dynamic motion primitive model parameter meets an optimization stop condition; if yes, performing S207; if no, performing S204; The optimization stop condition being met by the to-be-optimized dynamic motion primitive model parameter can mean that the total trajectory deviation corresponding to the to-be-optimized dynamic motion primitive model parameter has reached a minimum value, and the total trajectory deviation cannot be further reduced by optimizing the to-be-optimized dynamic motion primitive model parameter.
[0073] S207, determining the to-be-optimized dynamic motion primitive model parameter as a target dynamic motion primitive model parameter, and converting the target dynamic motion primitive model parameter into a target teaching trajectory; At this time, the to-be-optimized dynamic motion primitive model parameter that meets the optimization stop condition is the finally determined target dynamic motion primitive model parameter.
[0074] The target dynamic motion primitive model parameter can be converted into a target teaching trajectory in the following manner: determining a time sequence of the target teaching trajectory based on a time scale parameter in the target dynamic motion primitive model parameter, calculating a basis function output value at each time step according to a basis function parameter, and combining a weight parameter to obtain a nonlinear driving force term, substituting the nonlinear driving force term into a dynamic equation of the dynamic motion primitive, and solving to obtain a position and velocity increment at the time step, starting from initial state parameters to accumulate the position increment of each time step through time integration to obtain a complete position sequence, simultaneously solving a pose sequence based on a dynamic model of the pose parameter, and integrating the processed position sequence and pose sequence according to a time stamp to form a continuous, smooth, and dynamically constrained target teaching trajectory.
[0075] S208, determining a target mechanical arm joint angle sequence based on the target teaching trajectory, and controlling the mechanical arm based on the target mechanical arm joint angle sequence.
[0076] The present scheme has the following advantages: the total trajectory deviation is determined based on each dynamic motion primitive model parameter and the to-be-optimized dynamic motion primitive model parameter, the to-be-optimized dynamic motion primitive model parameter is optimized based on the total trajectory deviation, and the target dynamic motion primitive model parameter is obtained, which can effectively fuse the common features of multiple teaching operations, eliminate random errors (such as trajectory deviation caused by operator hand shaking and environmental interference) in single teaching, and make the finally generated target dynamic motion primitive model parameter have higher trajectory representation accuracy.
[0077] Embodiment three Figure 3is a flowchart of a mechanical arm teaching control method provided in Embodiment Three of the present application. The present solution makes a more optimal improvement on the above-mentioned embodiments, and the specific improvement is that: the target mechanical arm joint angle sequence is determined based on the target teaching trajectory, and the method comprises the following steps: obtaining mechanical arm motion constraint information, and generating at least two groups of mechanical arm joint angle sequences based on the mechanical arm motion constraint information and the target teaching trajectory; calculating the mechanical arm motion energy consumption corresponding to each group of mechanical arm joint angle sequences; and determining the mechanical arm joint angle sequence with the lowest mechanical arm motion energy consumption as the target mechanical arm joint angle sequence.
[0078] As shown in Figure 3 , the method specifically comprises the following steps: S301, obtaining a teaching tool file, and performing calibration operation based on the teaching tool file to obtain a first conversion relationship from a mechanical arm base coordinate system to an optical positioning coordinate system and a second conversion relationship from a mechanical arm end coordinate system to a teaching tool coordinate system; S302, obtaining a teaching trajectory corresponding to a preset number of teaching operations based on the first conversion relationship and the second conversion relationship; wherein the preset number is at least twice; S303, converting each teaching trajectory into a dynamic motion primitive model parameter, and determining a target teaching trajectory based on each dynamic motion primitive model parameter; S304, obtaining mechanical arm motion constraint information, and generating at least two groups of mechanical arm joint angle sequences based on the mechanical arm motion constraint information and the target teaching trajectory; The mechanical arm motion constraint information can be a set of various limiting conditions for ensuring safe, stable and efficient motion of the mechanical arm, and can include joint space constraint information, Cartesian space constraint information and obstacle avoidance information. Specifically, the joint space constraint information can include the angle range of each joint, the maximum speed of the joint, the maximum acceleration of the joint and the maximum torque of the joint, the Cartesian space constraint information can include the position range of the mechanical arm end effector in the Cartesian space, the attitude range, the maximum linear speed and the maximum linear acceleration of the end effector, and the obstacle avoidance information can include the three-dimensional model coordinates of the fixed obstacles in the working environment, the real-time position and motion trend data of the dynamic obstacles, and the size parameters of the mechanical arm itself. The way to obtain the mechanical arm motion constraint information can be to directly read the joint space constraint information and the Cartesian space constraint information from the technical manual or the control system configuration file provided by the mechanical arm manufacturer, and to obtain the obstacle avoidance information by three-dimensional scanning of the mechanical arm working environment using laser radar, depth camera and other sensors.
[0079] The inverse kinematics solver can be used to solve each target pose in the target teaching trajectory by combining numerical iteration and analytical method, wherein the motion constraint information of the robot arm is considered in the solving process, and different solutions are selected to generate different joint angle sequences of the robot arm in the case of multiple joint angle solutions.
[0080] In S305, the motion energy consumption of each group of joint angle sequences of the robot arm is calculated. The motion energy consumption of the robot arm can be the total power consumed by all joint drive motors of the robot arm during the execution of a certain joint angle sequence.
[0081] The method for calculating the motion energy consumption of each group of joint angle sequences of the robot arm can be used to calculate the joint speed sequence and the joint acceleration sequence of the robot arm corresponding to each group of joint angle sequences of the robot arm, determine the drive torque sequence based on the joint angle sequence, the joint speed sequence and the joint acceleration sequence of the robot arm, and determine the motion energy consumption of each group of joint angle sequences of the robot arm based on the drive torque sequence.
[0082] Optionally, the method for calculating the motion energy consumption of each group of joint angle sequences of the robot arm comprises: calculating the joint speed sequence and the joint acceleration sequence of the robot arm corresponding to each group of joint angle sequences of the robot arm; determining the drive torque sequence based on the joint angle sequence, the joint speed sequence and the joint acceleration sequence of the robot arm; determining the motion energy consumption of each group of joint angle sequences of the robot arm based on the drive torque sequence.
[0083] The joint speed sequence of the robot arm can be a set of numerical values arranged in time sequence, describing the instantaneous rotation or movement speed of each joint of the robot arm during the motion process. The joint acceleration sequence of the robot arm can be a set of numerical values arranged in time sequence, describing the rate of change of the speed of each joint of the robot arm. The method for calculating the joint speed sequence and the joint acceleration sequence of the robot arm corresponding to each group of joint angle sequences of the robot arm can be used to calculate the joint speed sequence of the robot arm by using forward difference method on the group of joint angle sequences of the robot arm, and calculate the joint acceleration sequence of the robot arm by using forward difference method on the group of joint speed sequences of the robot arm.
[0084] The driving torque sequence can be a set of numerical values arranged in time sequence, representing the driving motor of each joint of the robot arm, and the "force" size that needs to be output in order for the joint to reach the corresponding motion state. Based on the robot arm joint angle sequence, the robot arm joint speed sequence and the robot arm joint acceleration sequence, the driving torque sequence can be determined by obtaining the dynamic model parameters of the robot arm, establishing a multi-joint dynamics model based on the dynamic model parameters of the robot arm using Lagrange equation, substituting the joint angle, speed and acceleration at each time point into the multi-joint dynamics model to obtain the driving torque, and arranging the driving torque at all time points in time sequence to obtain the driving torque sequence.
[0085] Based on the driving torque sequence, the robot arm motion energy consumption corresponding to each set of robot arm joint angle sequence can be determined by calculating the output power of each joint at each time point based on the driving torque of the joint at the time, calculating the motor input power of the joint based on the efficiency curve of the robot arm (a chart reflecting the motor efficiency under different loads) and the output power, multiplying the motor input power of each small time period by the length of the small time period to obtain the robot arm motion energy consumption of the joint in the small time period, and summing up the robot arm motion energy consumption of all small time periods to obtain the robot arm motion energy consumption corresponding to the set of robot arm joint angle sequence.
[0086] The advantages of this scheme are that by calculating the robot arm joint speed sequence and the robot arm joint acceleration sequence corresponding to each set of robot arm joint angle sequence, determining the driving torque sequence based on the robot arm joint angle sequence, the robot arm joint speed sequence and the robot arm joint acceleration sequence, and determining the robot arm motion energy consumption corresponding to each set of robot arm joint angle sequence based on the driving torque sequence, the robot arm motion energy consumption can be accurately calculated to provide a reliable basis for selecting the joint angle sequence with the lowest power consumption.
[0087] S306, determining the robot arm joint angle sequence with the lowest robot arm motion energy consumption as the target robot arm joint angle sequence; Determining the robot arm joint angle sequence with the lowest robot arm motion energy consumption as the target robot arm joint angle sequence means that among all robot arm joint angle sequences that meet the robot arm motion constraint information and can make the robot arm end effector accurately reproduce the target teaching trajectory, the robot arm joint angle sequence with the lowest total energy consumption in the motion process is selected as the final execution sequence for controlling the robot arm motion (i.e. the target robot arm joint angle sequence).
[0088] S307, controlling the robot arm based on the target robot arm joint angle sequence.
[0089] The advantage of the scheme is that by generating at least two groups of mechanical arm joint angle sequences based on the mechanical arm motion constraint information and the target teaching trajectory, and determining the mechanical arm joint angle sequence with the lowest mechanical arm motion energy consumption as the target mechanical arm joint angle sequence, the economy of the mechanical arm operation can be optimized under the premise of ensuring the safety and accuracy of the mechanical arm motion.
[0090] Embodiment Four Figure 4 is a structural schematic diagram of a mechanical arm teaching control device provided by the embodiment four of the present application. As shown in Figure 4 , the device comprises: a calibration relationship module 410, configured to acquire a teaching tool file, and perform calibration operation based on the teaching tool file to obtain a first conversion relationship from a mechanical arm base coordinate system to an optical positioning coordinate system and a second conversion relationship from a mechanical arm end coordinate system to a teaching tool coordinate system; a teaching operation module 420, configured to acquire a teaching trajectory corresponding to a preset number of teaching operations based on the first conversion relationship and the second conversion relationship; wherein the preset number is at least two; a trajectory determination module 430, configured to convert each of the teaching trajectories into a dynamic motion primitive model parameter, and determine a target teaching trajectory based on each of the dynamic motion primitive model parameters; a mechanical arm control module 440, configured to determine a target mechanical arm joint angle sequence based on the target teaching trajectory, and control the mechanical arm based on the target mechanical arm joint angle sequence.
[0091] Optionally, the calibration relationship module 410 is specifically configured to: in a first calibration change process, acquire at least two groups of first rotation matrices from the optical positioning coordinate system to the teaching tool coordinate system and the teaching tool coordinate system origin positions in the optical positioning coordinate system based on the teaching tool file; wherein the mechanical arm end changes the pose and keeps the position unchanged in the first calibration change process; determine a translation matrix from the mechanical arm end coordinate system to the teaching tool coordinate system based on the first rotation matrix and the teaching tool coordinate system origin position; in a second calibration change process, acquire at least two groups of first mechanical arm end positions in the optical positioning coordinate system and second mechanical arm end positions in the mechanical arm base coordinate system based on the teaching tool file; wherein the mechanical arm end changes the position and keeps the pose unchanged in the second calibration change process; determine the first conversion relationship from the mechanical arm base coordinate system to the optical positioning coordinate system based on the first mechanical arm end position and the second mechanical arm end position; determine a second rotation matrix from the end-of-arm coordinate system to the teaching tool coordinate system based on the first conversion relationship, to obtain a second conversion relationship from the end-of-arm coordinate system to the teaching tool coordinate system.
[0092] Optionally, the teaching operation module 420 is specifically configured to: during the teaching operation, obtain a third conversion relationship from the teaching tool coordinate system to the optical positioning coordinate system based on the teaching tool file; determine a teaching trajectory corresponding to the teaching operation based on the first conversion relationship, the second conversion relationship, and the third conversion relationship; repeat the above steps until the number of repetitions reaches a preset number.
[0093] Optionally, the trajectory determination module 430 is specifically configured to: determine a total trajectory deviation based on the dynamic motion primitive model parameters and the to-be-optimized dynamic motion primitive model parameters; optimize the to-be-optimized dynamic motion primitive model parameters based on the total trajectory deviation; repeat the above steps until the to-be-optimized dynamic motion primitive model parameters meet an optimization stop condition; determine the to-be-optimized dynamic motion primitive model parameters as target dynamic motion primitive model parameters, and convert the target dynamic motion primitive model parameters into a target teaching trajectory.
[0094] Optionally, the trajectory determination module 430 is further configured to: calculate a smoothness index of each teaching trajectory, and determine a weight value corresponding to each teaching trajectory based on the smoothness index; determine an individual trajectory deviation corresponding to each teaching trajectory based on the dynamic motion primitive model parameters and the to-be-optimized dynamic motion primitive model parameters; determine a total trajectory deviation based on the individual trajectory deviations of each teaching trajectory and the corresponding weight values.
[0095] Optionally, the robot control module 440 is specifically configured to: obtain robot motion constraint information, and generate at least two groups of robot joint angle sequences based on the robot motion constraint information and the target teaching trajectory; calculate a robot motion energy consumption corresponding to each group of robot joint angle sequences; determine a robot joint angle sequence with the lowest robot motion energy consumption as a target robot joint angle sequence.
[0096] Optionally, the robot control module 440 is specifically configured to: The mechanical arm joint angle sequence corresponding to each group of mechanical arm joint angle sequences is calculated, and a mechanical arm joint speed sequence and a mechanical arm joint acceleration sequence are calculated. Based on the mechanical arm joint angle sequence, the mechanical arm joint speed sequence, and the mechanical arm joint acceleration sequence, a driving torque sequence is determined. Based on the driving torque sequence, the mechanical arm motion energy consumption corresponding to each group of mechanical arm joint angle sequences is determined.
[0097] In the embodiment of the present application, the calibration relationship module is configured to obtain a teaching tool file and perform calibration operation based on the teaching tool file to obtain a first conversion relationship from a mechanical arm base coordinate system to an optical positioning coordinate system and a second conversion relationship from a mechanical arm end coordinate system to a teaching tool coordinate system; the teaching operation module is configured to obtain a teaching trajectory corresponding to a preset number of teaching operations based on the first conversion relationship and the second conversion relationship; wherein the preset number is at least twice; the trajectory determination module is configured to convert each of the teaching trajectories into a dynamic motion primitive model parameter and determine a target teaching trajectory based on each of the dynamic motion primitive model parameters; and the mechanical arm control module is configured to determine a target mechanical arm joint angle sequence based on the target teaching trajectory and control the mechanical arm based on the target mechanical arm joint angle sequence. The above mechanical arm teaching control device makes the teaching process unnecessary to input complex parameters or manually intervene physically, and balances intuitiveness, high precision and high efficiency, thereby realizing precise trajectory control and stable operation execution of the mechanical arm.
[0098] The mechanical arm teaching control device in the embodiment of the present application can be a device, a component, an integrated circuit or a chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Illustratively, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not limited specifically.
[0099] The mechanical arm teaching control device in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an IOS operating system or other possible operating systems, and the embodiment of the present application is not limited specifically.
[0100] The robotic arm teaching control device provided in this application embodiment can realize the various processes implemented in embodiments one to three above. To avoid repetition, it will not be described again here.
[0101] Example 5 like Figure 5 As shown, this application embodiment also provides an electronic device 500, including a processor 501, a memory 502, and a program or instructions stored in the memory 502 and executable on the processor 501. When the program or instructions are executed by the processor 501, they implement the various processes of the above-described robotic arm teaching control method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0102] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0103] Example 6 This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described robotic arm teaching control method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0104] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0105] It should be noted that, in this document, 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 that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0106] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned example method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a computer software product that contributes to the prior art. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disc, optical disc), and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, or network device, etc.) execute the method described in each embodiment of the present application.
[0107] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the protection scope of the claims.
[0108] The above is only the preferred embodiment of the present application and the technical principle used. The present application is not limited to the specific embodiments described herein. Various obvious changes, readjustments and substitutions made by those skilled in the art without departing from the scope of the present application and the protection scope of the claims are all within the protection scope of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments. Without departing from the concept of the present application, more other equivalent embodiments can also be included, and the scope of the present application is determined by the scope of the claims.
Claims
1. A robotic arm teaching control method, characterized in that, The method includes: Obtain the teaching tool file and perform calibration operations based on the teaching tool file to obtain a first transformation relationship from the robot arm base coordinate system to the optical positioning coordinate system and a second transformation relationship from the robot arm end coordinate system to the teaching tool coordinate system; Based on the first conversion relationship and the second conversion relationship, a teaching trajectory corresponding to a preset number of teaching operations is obtained; wherein, the preset number of operations is at least two. Each of the teaching trajectories is converted into dynamic motion primitive model parameters, and the target teaching trajectory is determined based on each of the dynamic motion primitive model parameters; The target robotic arm joint angle sequence is determined based on the target teaching trajectory, and the robotic arm is controlled based on the target robotic arm joint angle sequence.
2. The robotic arm teaching and control method according to claim 1, characterized in that, The calibration operation based on the teaching tool file, which obtains a first transformation relationship from the robot arm base coordinate system to the optical positioning coordinate system and a second transformation relationship from the robot arm end effector coordinate system to the teaching tool coordinate system, includes: During the first calibration change process, at least two sets of first rotation matrices from the optical positioning coordinate system to the teaching tool coordinate system and the origin position of the teaching tool coordinate system in the optical positioning coordinate system are obtained based on the teaching tool file; wherein, during the first calibration change process, the end effector of the robotic arm changes its posture while maintaining a fixed position. Based on the first rotation matrix and the origin position of the teaching tool coordinate system, determine the translation matrix from the end-effector coordinate system to the teaching tool coordinate system; During the second calibration change process, at least two sets of the first robotic arm end position in the optical positioning coordinate system and the second robotic arm end position in the robotic arm base coordinate system are obtained based on the teaching tool file; wherein, during the second calibration change process, the position of the robotic arm end changes while maintaining a fixed posture. Based on the end positions of the first and second robotic arms, a first transformation relationship from the robotic arm base coordinate system to the optical positioning coordinate system is determined. Based on the first transformation relationship, a second rotation matrix is determined from the robot arm end-effector coordinate system to the teaching tool coordinate system, so as to obtain the second transformation relationship from the robot arm end-effector coordinate system to the teaching tool coordinate system.
3. The robotic arm teaching and control method according to claim 1, characterized in that, The step of obtaining the teaching trajectory corresponding to a preset number of teaching operations based on the first transformation relationship and the second transformation relationship includes: During the teaching operation, a third transformation relationship from the teaching tool coordinate system to the optical positioning coordinate system is obtained based on the teaching tool file; Based on the first conversion relationship, the second conversion relationship, and the third conversion relationship, the teaching trajectory corresponding to the teaching operation is determined; Repeat the above steps until the preset number of repetitions is reached.
4. The robotic arm teaching and control method according to claim 1, characterized in that, The determination of the target teaching trajectory based on the parameters of each of the dynamic motion primitive models includes: Based on the parameters of each dynamic motion primitive model and the parameters of the dynamic motion primitive model to be optimized, the total trajectory deviation is determined. The parameters of the dynamic motion primitive model to be optimized are optimized based on the total trajectory deviation. Repeat the above steps until the parameters of the dynamic motion primitive model to be optimized meet the optimization stopping condition; The parameters of the dynamic motion primitive model to be optimized are determined as the parameters of the target dynamic motion primitive model, and the parameters of the target dynamic motion primitive model are converted into the target teaching trajectory.
5. The robotic arm teaching and control method according to claim 4, characterized in that, Before determining the total trajectory deviation based on the parameters of each of the dynamic motion primitive models and the parameters of the dynamic motion primitive model to be optimized, the method further includes: Calculate the smoothness index of each of the teaching trajectories, and determine the weight value corresponding to each of the teaching trajectories based on the smoothness index; Accordingly, determining the total trajectory deviation based on the parameters of each of the dynamic motion primitive models and the parameters of the dynamic motion primitive model to be optimized includes: Based on the parameters of each dynamic motion primitive model and the parameters of the dynamic motion primitive model to be optimized, the individual trajectory deviation corresponding to each teaching trajectory is determined. The total trajectory deviation is determined based on the individual trajectory deviations of each of the teaching trajectories and their corresponding weight values.
6. The robotic arm teaching and control method according to claim 1, characterized in that, The step of determining the target robotic arm joint angle sequence based on the target teaching trajectory includes: Obtain the motion constraint information of the robotic arm, and generate at least two sets of robotic arm joint angle sequences based on the motion constraint information of the robotic arm and the target teaching trajectory; Calculate the motion energy consumption of the robotic arm corresponding to each set of robotic arm joint angle sequences; The robotic arm joint angle sequence with the lowest motion energy consumption is determined as the target robotic arm joint angle sequence.
7. The robotic arm teaching and control method according to claim 6, characterized in that, The calculation of the robotic arm motion energy consumption corresponding to each set of robotic arm joint angle sequences includes: Calculate the robot arm joint velocity sequence and robot arm joint acceleration sequence corresponding to each group of robot arm joint angle sequences; Based on the robotic arm joint angle sequence, the robotic arm joint velocity sequence, and the robotic arm joint acceleration sequence, a driving torque sequence is determined; The energy consumption of the robotic arm motion corresponding to each set of robotic arm joint angle sequences is determined based on the driving torque sequence.
8. A robotic arm teaching control device, characterized in that, The device includes: The calibration relationship module is used to acquire the teaching tool file and perform calibration operations based on the teaching tool file to obtain a first transformation relationship from the robot arm base coordinate system to the optical positioning coordinate system and a second transformation relationship from the robot arm end coordinate system to the teaching tool coordinate system. The teaching operation module is used to obtain the teaching trajectory corresponding to a preset number of teaching operations based on the first conversion relationship and the second conversion relationship; wherein, the preset number of operations is at least two. The trajectory determination module is used to convert each of the teaching trajectories into dynamic motion primitive model parameters, and to determine the target teaching trajectory based on each of the dynamic motion primitive model parameters; The robotic arm control module is used to determine the target robotic arm joint angle sequence based on the target teaching trajectory, and to control the robotic arm based on the target robotic arm joint angle sequence.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the robotic arm teaching control method as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the robotic arm teaching control method as described in any one of claims 1-7.
Citation Information
Cited By
Human-robot collaborative intent recognition method for robots installing large-sized components
CN122401448A
