Robot motion trail generation method and system
By collecting and transforming motion trajectory data in the robot coordinate system in the VR-tracker teaching system, and combining Kalman filtering and spherical linear interpolation algorithms, the problem of frequent hand-eye calibration required by VR-tracker is solved, and efficient and accurate robot painting operation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-20
AI Technical Summary
Existing VR-tracker teaching systems require frequent hand-eye calibration, resulting in cumbersome and time-consuming operations, making it difficult to meet the real-time and efficient requirements of touch-up spraying operations in industrial production.
By collecting the motion trajectory of the teaching pendant in the tracking coordinate system using a motion tracker, the robot coordinate system base point is obtained. The trajectory data is transformed using a pose transformation matrix, and the trajectory is optimized using Kalman filtering and spherical linear interpolation algorithms to generate the robot painting trajectory, simplifying the teaching process and reducing the reliance on professional skills.
The teaching process has been simplified, production preparation time has been shortened, ease of operation and efficiency have been improved, spraying accuracy has been ensured, and the quality requirements for workpiece re-spraying have been met.
Smart Images

Figure CN121696953A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to, but are not limited to, the field of industrial robot teaching technology, and particularly to a method and system for generating robot motion trajectories. Background Technology
[0002] Currently, relevant manufacturing companies typically use a manual teaching method based on a teach pendant to guide the programming of the touch-up spraying robot at specific points or along simple paths, thereby meeting the immediate touch-up spraying requirements of individual workpieces or specific areas. However, this manual teaching method has certain limitations.
[0003] To address the limitations of manual teaching, industrial robot teaching solutions using virtual reality trackers (VR-trackers) as teaching devices have gradually emerged in the industry, offering improved operational flexibility compared to traditional teach pendants. However, in existing technologies, teaching with VR-trackers requires collecting 10 feature points to complete hand-eye calibration, ensuring pose alignment between the VR-tracker and the robot and guaranteeing the accuracy of the teaching trajectory. More critically, the VR teaching system's base coordinates shift after each power-on, rendering the previously completed hand-eye calibration invalid. A complete re-calibration process must be executed before subsequent teaching operations can proceed. This frequent and repetitive calibration process is not only cumbersome and time-consuming in production preparation but also increases the workload of operators, severely impacting the overall efficiency of touch-up spraying operations and failing to meet the actual demands of industrial production for immediate and efficient touch-up spraying. Summary of the Invention
[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0005] This application provides a method and system for generating robot motion trajectories, which can simplify the robot teaching process, improve operational efficiency, and ensure coating accuracy.
[0006] In a first aspect, embodiments of this application provide a method for generating a robot motion trajectory, comprising: acquiring a first motion trajectory of a teaching pendant in a tracking coordinate system using a motion tracker, the first motion trajectory including pose data acquired by the motion tracker at multiple different coordinate points; obtaining a robot coordinate system base point; converting the pose data in the first motion trajectory to the robot coordinate system based on the robot coordinate system base point to obtain pose data in the corresponding robot coordinate system; obtaining a second motion trajectory for robot painting based on the pose data in the robot coordinate system; and controlling the robot to perform a painting operation based on the second motion trajectory.
[0007] In conjunction with the first aspect, in one embodiment of this application, obtaining the robot coordinate system base point includes: fixing the motion tracker to the robot end effector, wherein the Z-axis of the motion tracker is horizontally opposite to the X-axis of the robot, the X-axis of the motion tracker is horizontally opposite to the Y-axis of the robot, and the Y-axis of the motion tracker is horizontally opposite to the Z-axis of the robot; keeping the motion tracker stationary, and collecting the initial pose data of the motion tracker relative to the tracking coordinate system, and using the initial pose data as the robot coordinate system base point.
[0008] In conjunction with the first aspect, in one embodiment of this application, the step of converting the pose data in the first motion trajectory to the robot coordinate system to obtain pose data in the corresponding robot coordinate system includes: determining the pose transformation matrix of the robot end effector and the pose transformation matrix of the motion tracker; calculating the pose transformation relationship matrix between the motion tracker and the robot end effector based on the pose transformation matrix of the robot end effector and the pose transformation relationship matrix of the motion tracker; and performing coordinate system transformation on the pose data of each coordinate point in the first motion trajectory based on the robot coordinate system base point and the pose transformation relationship matrix to obtain pose data in the corresponding robot coordinate system.
[0009] In conjunction with the first aspect, in one embodiment of this application, after obtaining the second motion trajectory of the robot spraying, the method further includes: performing Kalman filtering on the second motion trajectory to obtain a denoised second motion trajectory.
[0010] In conjunction with the first aspect, in one embodiment of this application, the pose data includes attitude angle data; after obtaining the second motion trajectory of the robot spraying, the method further includes: converting the attitude angle data of each coordinate point in the second motion trajectory into quaternion form; calculating the included angle between two adjacent quaternions; calculating the interpolated quaternion based on the included angle using a spherical linear interpolation algorithm according to preset interpolation parameters; and converting the interpolated quaternion back into attitude angle data to obtain a smooth and continuous second motion trajectory.
[0011] In conjunction with the first aspect, in one embodiment of this application, the calculation formula of the spherical linear interpolation algorithm is as follows: =(sin((1-t)θ) / sinθ)× +(sin(tθ) / sinθ)× ,in, and These are two adjacent quaternions, and θ is... and The angle between them, where t is the interpolation parameter. This is the interpolated quaternion.
[0012] In conjunction with the first aspect, in one embodiment of this application, the pose data of the first motion trajectory is collected with the muzzle of the teaching gun as the teaching reference point, and the second motion trajectory is executed with the nozzle of the spray gun at the end of the robot as the execution reference point.
[0013] Secondly, embodiments of this application provide a robot motion trajectory generation system, comprising: a trajectory acquisition module, used to acquire a first motion trajectory of a teaching pendant in a tracking coordinate system via a motion tracker, the first motion trajectory including pose data acquired by the motion tracker at multiple different coordinate points; a base point acquisition module, used to acquire a base point of the robot coordinate system; a coordinate transformation module, used to transform the pose data in the first motion trajectory to the robot coordinate system based on the base point of the robot coordinate system, to obtain pose data in the corresponding robot coordinate system, and to generate a second motion trajectory for robot painting based on the pose data in the robot coordinate system; and a control execution module, used to control the robot to perform painting operations based on the second motion trajectory.
[0014] In conjunction with the second aspect, in one embodiment of this application, the system further includes: a filtering module, used to perform Kalman filtering on the second motion trajectory to suppress noise in the pose data and obtain a denoised second motion trajectory; and an attitude interpolation module, used to convert the attitude angle data of each coordinate point in the second motion trajectory into quaternion form, calculate the angle between two adjacent quaternions, calculate the interpolated quaternion using a spherical linear interpolation algorithm based on preset interpolation parameters and the angle, and convert the interpolated quaternion back into attitude angle data to obtain a smooth and continuous second motion trajectory.
[0015] In conjunction with the second aspect, in one embodiment of this application, the motion tracker is an infrared optical positioning VR tracker, the tracking coordinate system is the SteamVR coordinate system, and the pose data is six-degree-of-freedom pose data, including position coordinate data and attitude angle data, wherein the attitude angle data is represented by Euler angles in the ZYX order.
[0016] This application provides a method and system for generating robot motion trajectories. The method first uses a motion tracker to collect a first motion trajectory of a teaching pendant in a tracking coordinate system. This first motion trajectory includes pose data collected by the motion tracker at multiple different coordinate points. After obtaining the robot coordinate system base point, the pose data in the first motion trajectory is converted to the robot coordinate system based on the robot coordinate system base point to obtain pose data in the corresponding robot coordinate system. Then, based on the pose data in the robot coordinate system, a second motion trajectory for robot painting is obtained. Finally, the robot is controlled to perform the painting operation based on the second motion trajectory. This application effectively solves the cumbersome drawback of traditional VR-tracker teaching solutions requiring 10-point hand-eye calibration after each power-on. By using the robot coordinate system base point as a reference and recording the pose change of the first motion trajectory relative to that base point to characterize the trajectory, the teaching process is effectively simplified, production preparation time is shortened, and operators are not required to perform complex path programming, reducing reliance on professional skills and improving the convenience and efficiency of teaching operations. Furthermore, it can accurately establish the mapping relationship between the teaching trajectory and the robot execution trajectory, ensuring spraying accuracy and fully meeting the quality requirements of workpiece re-spraying. Attached Figure Description
[0017] Figure 1 This is a flowchart of the robot motion trajectory generation method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the base station positioning process provided in an embodiment of this application; Figure 3 This is a schematic diagram of the triangulation algorithm provided in an embodiment of this application; Figure 4 This is provided by the embodiments of this application. Figure 1 The detailed flowchart of step 130; Figure 5 This is a relative pose coordinate diagram of the robot and the teaching pendant provided in the embodiments of this application; Figure 6 This is a diagram illustrating the effect of using Kalman filtering as provided in an embodiment of this application; Figure 7 This is a flowchart of a motion trajectory generation method provided in another embodiment of this application; Figure 8 This is an interpolation diagram provided in an embodiment of this application; Figure 9 This is a block diagram of the motion trajectory generation system provided in the embodiments of this application; Figure 10(a) is a first hardware schematic diagram provided in a specific embodiment of this application; Figure 10(b) is a schematic diagram of the second hardware provided in a specific embodiment of this application; Figure 10(c) is a schematic diagram of the third hardware provided in a specific embodiment of this application; Figure 10(d) is a schematic diagram of the fourth hardware provided in a specific embodiment of this application; Figure 11 This is a diagram of a spraying teaching system provided in a specific embodiment of this application; Figure 12 This is a schematic diagram of the system working mode interface provided in a specific embodiment of this application; Figure 13 This is a schematic diagram of the system front-end interface provided in a specific embodiment of this application; Figure 14 This is a system workflow diagram provided in a specific embodiment of this application; Figure 15 This is a system teaching flowchart provided in a specific embodiment of this application; Figure 16 This is a system calibration flowchart provided in a specific embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0019] It should be noted that although the flowchart shows a logical order, in some cases, the steps shown or described may be performed in a different order than that shown in the flowchart. The terms "first," "second," etc., used in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the structures, proportions, sizes, etc., depicted in the drawings are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the implementation conditions of this application. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in proportions, or adjustments to size, without affecting the effects and purposes achieved by this application, should still fall within the scope of the technical content disclosed in this application. Similarly, the terms such as "upper," "lower," "left," "right," "middle," and "one" used in this specification are only for clarity of description and are not used to limit the scope of implementation of this application. Changes or adjustments in their relative relationships, without substantially altering the technical content, should also be considered within the scope of implementation of this application.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0021] In industrial production, especially in the workpiece painting process, some workpieces may have defects such as uneven coating or missed areas after initial painting. These require targeted touch-up painting using a touch-up painting robot to ensure the product surface coating quality meets standards. Currently, manufacturers typically use a manual teaching method based on a teach pendant to guide the touch-up painting robot through point-to-point or simple path programming, thus meeting the immediate touch-up painting requirements of individual workpieces or specific areas. However, this manual teaching method relies on the operator's experience, the programming process is cumbersome, and it can only adapt to simple paths. Its guidance efficiency for complex touch-up painting trajectories is low, making it difficult to meet the demands of high-efficiency production.
[0022] To address the limitations of manual teaching, industrial robot teaching solutions using VR-trackers as teach pendants have gradually emerged in the industry, offering improved operational flexibility compared to traditional teach pendants. However, in existing technologies, teaching with VR-trackers requires collecting 10 feature points to complete hand-eye calibration, ensuring pose alignment between the VR-tracker and the robot and guaranteeing the accuracy of the teaching trajectory. More critically, the VR teaching system's base coordinates shift after each power-on, rendering the previously completed hand-eye calibration invalid. A complete re-calibration process must be executed before subsequent teaching operations can proceed. This frequent and repetitive calibration process is not only cumbersome and time-consuming in production preparation but also increases the workload of operators, severely impacting the overall efficiency of touch-up spraying operations and failing to meet the actual demands of industrial production for immediate and efficient touch-up spraying.
[0023] In view of this, embodiments of this application provide a method and system for generating robot motion trajectories. In this method, a first motion trajectory of a teaching pendant in a tracking coordinate system is first acquired using a motion tracker. This first motion trajectory includes pose data acquired by the motion tracker at multiple different coordinate points. After obtaining the robot coordinate system base point, the pose data in the first motion trajectory is converted to the robot coordinate system based on the robot coordinate system base point to obtain pose data in the corresponding robot coordinate system. Then, a second motion trajectory for robot painting is obtained based on the pose data in the robot coordinate system. Finally, the robot is controlled to perform painting operations based on the second motion trajectory. This application effectively solves the cumbersome drawback of traditional VR-tracker teaching solutions requiring 10-point hand-eye calibration after each power-on. By using the robot coordinate system base point as a reference and recording the pose change of the first motion trajectory relative to that base point to characterize the trajectory, the teaching process is effectively simplified, production preparation time is shortened, and operators are not required to perform complex path programming, reducing reliance on professional skills and improving the convenience and efficiency of teaching operations. Furthermore, it can accurately establish the mapping relationship between the teaching trajectory and the robot execution trajectory, ensuring spraying accuracy and fully meeting the quality requirements of workpiece re-spraying.
[0024] The embodiments of this application will be further described below with reference to the accompanying drawings.
[0025] Reference Figure 1 , Figure 1 This is a flowchart of a robot motion trajectory generation method provided in an embodiment of this application. The process may specifically include, but is not limited to, steps 110 to 150.
[0026] Step 110: Collect the first motion trajectory of the teaching gun in the tracking coordinate system using a motion tracker. The first motion trajectory includes pose data collected by the motion tracker at multiple different coordinate points. Step 120: Obtain the robot coordinate system base point; Step 130: Based on the robot coordinate system base point, convert the pose data in the first motion trajectory to the robot coordinate system to obtain the pose data in the corresponding robot coordinate system; Step 140: Based on the pose data in the robot coordinate system, obtain the second motion trajectory of the robot spraying; Step 150: Control the robot to perform the spraying operation according to the second motion trajectory.
[0027] Steps 110 to 150 will be described in detail below.
[0028] It should be noted that the embodiments of this application employ the SteamVR infrared optical positioning system, which consists of a base station and a tracker (i.e., a motion tracker). The base station includes an LED array capable of generating global infrared laser light, and two orthogonally placed rotors with built-in infrared laser emitters. The base station is only responsible for emitting laser signals; specifically, it emits three types of infrared laser signals: a global synchronization signal, an X-plane scanning signal, and a Y-plane scanning signal. The tracker has multiple built-in photosensitive sensors, whose core function is to receive the various laser signals emitted by the base station. When the base station's LED array flashes, the base station synchronously records a timestamp. The photosensitive sensors on the tracker detect the timestamps of the laser light emitted by the infrared laser emitters on the two rotors reaching themselves, and use these timestamps to calculate the corresponding angles of the sensors relative to the two rotors of the base station. Since the poses of the photosensitive sensors on the tracker are pre-set, combined with the known poses of multiple photosensitive sensors, the specific pose of the tracker can be further calculated. The positioning process is as follows: Figure 2 As shown.
[0029] At the start of each scan cycle, the SteamVR tracking system first emits a global synchronization signal from the base station, followed by emitting only the X-plane scanning signal and scanning the entire space. At this time, the Y-plane does not emit a signal, and the laser plane will scan the outer surface of the tracker from left to right. For any photosensitive sensor on the tracker, when it is irradiated by the global synchronization laser, it will emit an electrical signal, and the system will record the timestamp synchronously. When it is subsequently irradiated by the X-plane scanning laser, the sensor will emit an electrical signal again, and the system will record a second timestamp. Based on these two timestamps, the X-plane angle and Y-plane angle of the photosensitive sensor relative to the base station can be calculated, and then the spatial angle of the photosensitive sensor in the base station coordinate system can be determined. When the base station emits X-plane and Y-plane scanning laser signals, the rotor speed is 60 revolutions per second, and the time required for each scanning signal to sweep through a 180° spatial area is 8.333 milliseconds. The system calculates the horizontal angle and vertical angle between the photosensitive sensor and the base station using equations (1) and (2), respectively.
[0030] (1) (2) like Figure 3 As shown, A, B, and C are three photosensitive sensors mounted on the surface of the tracker, and the horizontal angle of each photosensitive sensor relative to the base station is... and vertical angle All parameters are known (i.e., the orientation of each photosensitive sensor relative to the base station is known), while the distance from each photosensitive sensor to the center O of the base station coordinate system is unknown. Therefore, the position coordinates of the tracker relative to the base station can be calculated using the angles of each photosensitive sensor relative to the base station, combined with a triangulation algorithm.
[0031] In a Cartesian coordinate system, the vector OA can be represented as Taking vector OA as an example, its rectangular coordinates can be expressed as equation (3). Similarly, vectors OB and OC can be obtained as follows: (3) Dot product between vectors, as shown in equation (4): (4) In the formula, The cosine of the angle between vectors OA and OB is represented similarly. This represents the cosine of the angle between vectors OA and OC. The cosine value between vectors OB and OC can be represented in rectangular coordinate form as follows: (5) and: (6) Equations (4), (5), and (6) are combined to eliminate [the following]. and We can obtain: (7) because and All are known, and can be obtained according to equation (7). , and By the Law of Cosines, we can obtain: (8) In the formula, The distance between the photosensitive sensors is a known quantity and can be calculated. , and The distances from the three photosensitive sensors to the center O of the base station coordinate system are obtained. At this point, the angle and distance of each photosensitive sensor relative to the base station have been calculated, that is, the pose of each photosensitive sensor relative to the base station has been calculated. Since the relationship between each photosensitive sensor is pre-designed inside the tracker, the pose of the tracker relative to the base station can be calculated.
[0032] In a feasible embodiment, in step 110, when collecting the first motion trajectory of the teaching pendant in the tracking coordinate system using a motion tracker, the motion tracker can be fixed to the teaching pendant. During the teaching operation by the operator holding the teaching pendant, the motion tracker and the corresponding base station will collaboratively collect the spraying motion trajectory data during the teaching process, thereby obtaining the relative pose data throughout the entire process. The first motion trajectory specifically includes six-degree-of-freedom pose data collected by the motion tracker at multiple different coordinate points, and this pose data can be recorded and stored by the motion tracker in real time.
[0033] In one feasible embodiment, the pose data of the first motion trajectory is collected using the muzzle of the teaching gun as the teaching reference point, while the second motion trajectory uses the nozzle of the spray gun at the robot's end effector as the execution reference point. It is understood that, to achieve a precise correspondence between the teaching trajectory and the robot's execution trajectory, the pose data of the first motion trajectory is collected using the muzzle of the teaching gun as the teaching reference point. Correspondingly, the final generated second motion trajectory for robot painting uses the nozzle of the spray gun mounted at the robot's end effector as the execution reference point. This precise correspondence between the two reference points ensures that the operator's intention during the teaching process is accurately transmitted to the robot's painting action through trajectory mapping of the reference points, guaranteeing the consistency between the painting path and the teaching path.
[0034] In one feasible embodiment, the process of obtaining the robot coordinate system base point (i.e., the teaching origin) includes: first, fixing the motion tracker to the robot's end effector, wherein the Z-axis of the motion tracker is horizontally opposite to the X-axis of the robot, the X-axis of the motion tracker is horizontally opposite to the Y-axis of the robot, and the Y-axis of the motion tracker is horizontally opposite to the Z-axis of the robot; then, keeping the motion tracker stationary, and collecting the initial pose data of the motion tracker relative to the tracking coordinate system, using the initial pose data as the robot coordinate system base point. It can be understood that the robot coordinate system base point essentially solidifies the initial associated pose of the motion tracker and the robot's end effector as a reference benchmark. All pose data collected during subsequent teaching processes are calculated relative to this base point, which is also the premise that recalibration is not required every time the device is powered on.
[0035] In one feasible embodiment, such as Figure 4 As shown, the execution process of step 130 may include, but is not limited to, steps 410 to 430.
[0036] Step 410: Determine the pose transformation matrix of the robot end effector and the pose transformation matrix of the motion tracker; Step 420: Calculate the pose transformation relationship matrix between the motion tracker and the robot end effector based on the pose transformation matrix of the robot end effector and the pose transformation matrix of the motion tracker. Step 430: Based on the robot coordinate system base point and pose transformation relationship matrix, perform coordinate system transformation on the pose data of each coordinate point in the first motion trajectory to obtain the pose data in the corresponding robot coordinate system.
[0037] Steps 410 to 430 are the core transformation process for achieving accurate mapping of the teaching trajectory from the tracking coordinate system to the robot coordinate system. Specifically, firstly, step 410 determines the pose transformation matrix of the robot end effector and the pose transformation matrix of the motion tracker, respectively. These two matrices completely represent the spatial pose states of the robot end effector and the motion tracker in their respective coordinate systems. Next, step 420 calculates the pose transformation relationship matrix between the motion tracker and the robot end effector based on the two obtained pose transformation matrices. This matrix essentially establishes the association between the data collected by the motion tracker and the data executed by the robot, ensuring that the conversion logic of the two types of pose data is controllable. Finally, step 430 uses the previously determined robot coordinate system base point (teaching origin) as a fixed reference benchmark, and combines it with the calculated pose transformation relationship matrix to perform coordinate system transformation processing on the pose data of each coordinate point in the first motion trajectory one by one. Finally, the original pose data in the tracking coordinate system is accurately converted into pose data that can be recognized and executed in the robot coordinate system, laying the foundation for the subsequent generation of the second motion trajectory for robot painting.
[0038] The process of step 130 is described below with reference to a specific embodiment.
[0039] In this embodiment, the coordinate system of the robot and the teaching pendant is as follows: Figure 5 As shown, the robot's base coordinate system Robot end-effector coordinate system Spray gun muzzle coordinate system Teaching the muzzle coordinate system SteamVR coordinate system Tracker coordinate system .
[0040] After the teaching system is powered on, the motion tracker is first fixedly installed on the robot's end effector, serving as the zero-point calibration reference point for the entire teaching process. The initial pose read by the motion tracker at this point is recorded as the reference frame (denoted as k=0), which will serve as the reference for all subsequent pose data. During the subsequent teaching process, each pose data point acquired in real-time by the motion tracker is defined with this reference frame k=0 as the fixed reference, ensuring the relativity and consistency of all real-time poses. It should be noted that the "zero-point calibration reference point" and "reference frame" here correspond to the "robot coordinate system base point" mentioned earlier; they are essentially different expressions of the same reference. Specifically, the robot coordinate system base point is defined functionally from the coordinate system reference reference, the zero-point calibration reference point is named functionally from the actual calibration operation, and the reference frame is the frame identifier definition of the initial pose corresponding to this reference point. All three serve as a fixed reference for all real-time pose data during the teaching process.
[0041] During the teaching process, the relative pose of the motion tracker is represented as follows: (9) To describe attitude information, the following is adopted: Sequential Euler angles for rotation matrices: (10) Inverse solution from rotation matrix Euler angles: (11) in, The inverse Euler angle function, (12) The robot end effector transformation matrix is represented as: (13) The relative pose matrix between the robot end effector and the motion tracker is used as... Euler angle unwinding: (14) The pose relationship between the robot and the tracker can be obtained: (15) (16) The above equation transforms the tracker's base coordinate system into the robot's base coordinate system, simplifying the transformation to: (17) Where, function This indicates that the homogeneous transformation matrix is adjusted according to Euler angles. The inverse solution is then processed using equations (7) and (8) before constructing Euler angles. Correct answer.
[0042] During demonstration, the muzzle of the demonstration gun and the nozzle of the spray gun are used as the demonstration reference points. For ease of representation, let... (18) Therefore, the trajectory collected by the teaching gun It can be transformed into a robot executable trajectory through matrix transformation. Combining equations (9) and (10), we can obtain: (19) in, and It can be obtained through measurement.
[0043] In one feasible embodiment, during robot trajectory planning, the pose data collected by sensors inevitably contains noise and uncertainty. Directly using this data for trajectory generation can easily lead to path deviation and decreased execution accuracy. To ensure the stability of trajectory planning and execution, after obtaining the second motion trajectory for robot painting, Kalman filtering can be applied to the second motion trajectory to obtain a denoised second motion trajectory. For example, the converted second motion trajectory... After Kalman filtering, it can be used to drive robots to reproduce the spraying path, ensuring that the spraying process is highly consistent with human operation.
[0044] In a feasible embodiment, when processing pose data using the Kalman filter method, the discrete-time linear system model used is as follows: (20) in, Represents the system state vector. Represents the observation vector; Here is the state transition matrix. For the control matrix, The observation matrix; and These represent process noise and observation noise, respectively, with covariances of... and .
[0045] Kalman filtering consists of a prediction step and an update step, where the prediction (time update) formula is: (twenty one) In the formula, For a moment Prior state estimation, This is the corresponding prior error covariance matrix.
[0046] The updated measurement correction formula is as follows: (twenty two) In the formula, Here is the Kalman gain matrix. For posterior state estimation, The posterior error covariance matrix. Kalman gain. The calculation is based on the minimum mean square error criterion. Through optimal selection... This ensures that the posterior estimation error is orthogonal to the innovation quantity (i.e., the measurement residual), thus obtaining the optimal state estimate in the mean square sense under the assumption that the noise is Gaussian distributed. Figure 6 As shown, the Kalman filter method can achieve real-time and accurate estimation of robot pose state under conditions of uncertainty and noise, effectively improving the smoothness and robustness of trajectory generation.
[0047] Understandably, during trajectory generation and optimization, position coordinates alone cannot fully describe the motion state of the robot's end effector; reasonable interpolation and smoothing of its spatial attitude are also necessary. Directly using Euler angles for interpolation may lead to gimbal lock-up and angle discontinuities. Therefore, after obtaining the second motion trajectory for robot painting, quaternion-based spherical linear interpolation (Slerp) can be used to process the second motion trajectory to ensure the smoothness and continuity of the attitude transition. Figure 7 As shown, the process may include at least steps 710 to 740.
[0048] Step 710: Convert the attitude angle data of each coordinate point in the second motion trajectory into quaternion form; Step 720: Calculate the angle between two adjacent quaternions; Step 730: Based on the preset interpolation parameters, calculate the interpolated quaternion using the spherical linear interpolation algorithm based on the included angle; Step 740: Convert the interpolated quaternion back to attitude angle data to obtain a smooth and continuous second motion trajectory.
[0049] In one feasible embodiment, the six-DOF pose data includes spatial position coordinate data and attitude angle data, wherein the attitude angle data is represented by Euler angles in the ZYX order; the two types of data work together to characterize the spatial pose state of the teaching gun in the tracking coordinate system.
[0050] It should be noted that steps 710 to 740 are key processes for smoothing and optimizing the attitude data of the robot's second motion trajectory. Specifically, step 710 first converts the attitude angle data of each coordinate point in the second motion trajectory into quaternion form; step 720 calculates the angle between two adjacent quaternions to obtain the spatial angular relationship between adjacent attitudes, providing key parameter support for the spherical linear interpolation algorithm; step 730 calculates the interpolated quaternion based on the preset interpolation parameters and the calculated angle using the spherical linear interpolation algorithm. This algorithm ensures that the interpolation process between adjacent attitudes is equivalent to linear interpolation on a unit sphere, making the interpolated attitude angular velocity consistent and avoiding abrupt attitude changes; step 740 then converts the interpolated quaternion back into attitude angle data, finally obtaining a smooth and continuous second motion trajectory.
[0051] In one feasible embodiment, the spherical linear interpolation algorithm first requires calculating the angle between the two quaternions. Then based on the interpolation parameters Calculate the interpolated quaternion Its schematic diagram is as follows Figure 8 As shown, the calculation formula is: (twenty three) in, and These are two adjacent quaternions; for and The angle between them t is the interpolation parameter.
[0052] See Figure 9 This application also provides a robot motion trajectory generation system, the core modules of which are as follows: The trajectory acquisition module 910 is used to acquire the first motion trajectory of the teaching gun in the tracking coordinate system through the motion tracker. The first motion trajectory includes the pose data acquired by the motion tracker at multiple different coordinate points. Base point acquisition module 920 is used to acquire the base point of the robot coordinate system; The coordinate transformation module 930 is used to transform the pose data in the first motion trajectory to the robot coordinate system based on the robot coordinate system base point, to obtain the pose data in the corresponding robot coordinate system, and to generate the second motion trajectory of robot spraying based on the pose data in the robot coordinate system. The control execution module 940 is used to control the robot to perform the spraying operation according to the second motion trajectory.
[0053] In one possible embodiment, system 900 further includes: The filtering module is used to perform Kalman filtering on the second motion trajectory to suppress noise in the pose data and obtain the denoised second motion trajectory. The attitude interpolation module is used to convert the attitude angle data of each coordinate point in the second motion trajectory into quaternion form, calculate the angle between two adjacent quaternions, calculate the interpolated quaternion through the spherical linear interpolation algorithm according to the preset interpolation parameters and the angle, and convert the interpolated quaternion back into attitude angle data to obtain a smooth and continuous second motion trajectory.
[0054] In one feasible embodiment, the motion tracker is an infrared optical positioning VR tracker, and the tracking coordinate system is the SteamVR coordinate system; the pose data is six-degree-of-freedom pose data, including position coordinate data and attitude angle data, and the attitude angle data is represented by Euler angles in the ZYX order.
[0055] It should be noted that the processing logic of each functional module in this system is consistent with the corresponding steps and processes in the aforementioned robot motion trajectory generation method. The specific working principle, execution order and implementation details of each module can be found in the relevant detailed descriptions in the aforementioned method section, and will not be repeated here.
[0056] The motion trajectory generation system will be described in detail below with reference to a specific embodiment.
[0057] The software portion of this system is developed based on the Windows 10 64-bit operating system. The software development environment and related toolkits used include: Python 3.13 programming environment, SteamVR software, and the OpenVR SDK accompanying the pose tracking function. The hardware devices used in this system are shown in Figures 10(a) to 10(d). Figure 10(a) is a schematic diagram of the first hardware component, which includes the Guangzhou CNC RBO8A3 industrial robot and its control cabinet. This hardware is used to receive instructions to complete the spraying operation. Figure 10(b) is a schematic diagram of the second hardware component, which includes the HTC Vive Tracker 3.0 and its infrared base station. This part is used to collect spraying motion trajectory data. Figure 10(c) is a schematic diagram of the third hardware component, which is a Hikvision MV-DL2125-04H-R line laser stereo camera. This hardware is used for workpiece recognition on the production line. Figure 10(d) is a schematic diagram of the fourth hardware component, which is a spraying teaching gun. This hardware is used to connect to the Tracker for teaching the spraying trajectory. In addition, the hardware used in the system includes: a PLC auxiliary control system, which is the real-time data hub and trigger source in the system, used to connect the physical world and the digital world; and a host computer, which is used for the control of the entire system. Data reception, data processing, command sending, real-time monitoring and other operations are all performed on the host computer. The specific configuration of the host computer is as follows: CPU is Intel(R) Core(TM) i5-12600KF, graphics card is NVIDIA GeForce RTX 4060, memory is 16GB*2, and hard drive is 1TB.
[0058] like Figure 11 As shown, the system consists of six modules: a central control module, a teaching module, a calibration module, a trajectory generation module, a robot execution module, and a workpiece tracking module; among which: The central control module is mounted on a PC. This module is responsible for data transmission, interactive communication, and overall control functions with other modules in the system.
[0059] The teaching module consists of an HTC tracker and a base station. On the software side, it uses SteamVR software and the pyopenVR library to perform teaching operations and generate an initial teaching trajectory file. This teaching module corresponds to the trajectory acquisition module mentioned earlier; its core function is to acquire the first motion trajectory of the teaching gun in the tracking coordinate system. The aforementioned initial teaching trajectory file is generated based on this first motion trajectory.
[0060] The calibration module processes the initial teaching trajectory file generated by the teaching module. By calculating the pose association between the motion tracker and the robot end effector, it provides a basis for coordinate system transformation of subsequent pose data.
[0061] The trajectory generation module is specifically designed to optimize the initial teaching trajectory file. Since this initial file is based on trajectory data collected manually by a handheld teaching pendant, directly applying it to the robotic arm may cause compatibility issues (such as trajectory jitter, discontinuous curves, etc.). Therefore, this module is needed to eliminate jitter interference in the trajectory, achieve smooth optimization of the motion curve, and ensure that the trajectory conforms to the motion characteristics of the robotic arm.
[0062] It should be noted that the functions of the calibration module and the trajectory generation module correspond to the coordinate transformation process in the method described above and the coordinate transformation module in the device. Specifically, the coordinate transformation module uses a preset robot coordinate system base point as a reference to transform the pose data in the first motion trajectory to the robot coordinate system, obtain the corresponding pose data in the robot coordinate system, and then generates the second motion trajectory required for the robot's painting operation based on the pose data in the robot coordinate system, thus fully connecting the entire process of teaching acquisition and robot execution.
[0063] The workpiece tracking module consists of a PLC-assisted control system, a grating, a high-speed encoder on the production line, and a camera. Its working principle is as follows: the camera completes deep learning-based model training and image recognition through Hikvision's built-in platform. When a workpiece passes through the grating, the central control module receives a signal and adds the workpiece to the tracking list. After the camera recognizes the workpiece, it names the workpiece. The high-speed encoder generates pulses as the production line moves. When the workpiece passes through the grating, a pulse countdown begins. When the cumulative pulse count generated by the workpiece reaches a certain number, it transmits information to the central control module, realizing the identification and real-time tracking of the workpiece.
[0064] The hardware of the robot execution module (also known as the control execution module mentioned above) is the GCS Robot RB08A3. After receiving data from the central control module, it can call the relevant trajectory library according to the name of the workpiece to realize the spraying of the workpiece.
[0065] All modules' signal transmission and data relay are implemented through a Huawei 12-port enterprise-grade switch (model: S5735-L8T / P4S-A1). The communication methods and connection logic between the various hardware components are as follows: The PC and the GSK robot RB08A3 use the TCP / IP communication protocol, with the GSK robot connected to the switch via a network cable; the PC and the PLC auxiliary control system are also connected to the switch via a network cable, and the two communicate using the third-party library pymodbus. The PLC has a high-speed encoder and grating connected to it, and the PC can indirectly obtain relevant data from the high-speed encoder and grating through the PLC; the PC and the camera use the UDP communication protocol for data transmission; the communication between the PC and the tracker relies on SteamVR software, using the pyopenVR library to achieve data interaction, trajectory acquisition, pose reading, and other related functions, consistent with the software configuration and functional implementation logic of the teaching module mentioned earlier.
[0066] The system's working mode interface is as follows: Figure 12 As shown, a modular layout is adopted to achieve multi-dimensional information integration and interactive control. The top area centrally displays core operating parameters (current linear speed 4.62m / min) and is equipped with three levels of control buttons: start, pause, and emergency stop, forming a complete control chain for the operation process. The parameter configuration area on the left enables device network interconnection settings through structured forms, including industrial communication parameters such as the robot / PLC / camera IP address (e.g., 192.168.99.120), port mapping (20005 / 7920), and pulse address threshold (360 / 60000). It also includes built-in process constraints such as speed judgment range (0.5-6m / min) and motion planning parameters (initial speed 30m / min).
[0067] The central core area constructs a dynamic task management system, which displays the activation status, path configuration, and motion progress (including distance from the endpoint pulse and real-time speed monitoring) of each work order in real time in tabular form. Red and green status indicators distinguish between tasks such as "pink trash can" and "pull-out basket" that are in execution. The three-dimensional space monitoring area on the right adopts a dual-information dimension display, showing both the robot's end-effector coordinate system pose and Euler angle parameters, and simultaneously updating the six-axis joint angle data, forming a complete kinematic data closed loop.
[0068] The bottom status bar integrates device connection diagnostics, displaying system readiness statuses such as database connection and parameter loading. A specially designed intelligent linear velocity calculation module enables visualized calibration of motion accuracy through pulse-to-displacement conversion coefficients. This interface organically integrates equipment control, process parameters, and motion monitoring through a layered information architecture, meeting the needs of efficient teaching and precise control in industrial scenarios.
[0069] The code for obtaining the teaching pose is integrated into the system, and its front-end interface is as follows: Figure 13 As shown, clicking the left-hand button - Main Interface will take you to the main interface, where you can switch between view mode and working mode. Enter the tracker's identification number (obtainable via SteamVR) in the tracker identification number input box, and click OK to open the teaching module and trajectory generation module. Enter the name of the workpiece being taught in the workpiece name field, and fill in the current linear velocity as displayed at the top. Click the "Start Teaching" button to begin teaching.
[0070] See Figure 14 The system's working steps include: 1401. Start the system; 1402. Click on the working mode; 1403. Click the Start button to start the central control module, robot execution module, and workpiece tracking module.
[0071] 1404. As the workpiece passes through the workpiece tracking module grating along the production line, the system collects the grating signal, starts tracking the workpiece in the list, and assigns it a workpiece ID.
[0072] 1405. The high-speed encoder in the workpiece tracking module will start counting pulses on the workpiece when the workpiece is recognized by the grating.
[0073] 1406. The camera in the workpiece tracking module begins to identify the workpiece and sends the workpiece name to the central control module via UDP communication; 1407. The central control module retrieves the corresponding trajectory library based on the workpiece name, reads the trajectory library, and transmits the first line of data to the robot execution module, causing the robot to move to the first point.
[0074] 1408. When the column in the list that is far from the endpoint pulse is negative, the central control module reads the remaining rows of the trajectory library, enabling the robot to complete the spraying trajectory.
[0075] See Figure 15 The system's teaching steps include: 1501. Start the system; 1502. Click on Teach Mode; 1503. Open SteamVR, open the tracker, and power on the base station; 1504. Read the tracker device identification number recognized in SteamVR; 1505. Enter the tracker device identification number into the tracker device identification number box; 1506. Click the start button below the identification box to open the teaching module and trajectory generation module; 1507. Position the teaching gun in the designated location and press the zeroing button; 1508. After entering the workpiece name and the current linear velocity of the production line during teaching, start teaching; 1509. When the workpiece moves to the teaching area along the production line, press the teaching button on the teaching gun to make a spraying trajectory according to the shape of the workpiece; 1510. After the trajectory is completed, release the teach button to generate the original trajectory file; 1511. The data generated by the calibration module is processed to transform the original trajectory into an executable trajectory for the robot; 1512. The robot's executable trajectory is processed by the trajectory generation module to generate the final trajectory file, which is then stored in the trajectory library.
[0076] 1513. To continue teaching, repeat step 1508; to end teaching, close the interface.
[0077] See Figure 16 The system calibration steps include: 1601. Open SteamVR, open the tracker, and power on the base station; 1602. Open the system subsystem calibration module; 1603. Place the tracker in the calibration position at the end of the robotic arm, ensuring the back of the tracker is flush against the end of the robotic arm. Orientation should be such that the tracker's Z-axis is horizontally opposite to the robot's X-axis, the tracker's X-axis is horizontally opposite to the robot's Y-axis, and the tracker's Y-axis is horizontally opposite to the robot's Z-axis. See the diagram below for the tracker's orientation relative to the robotic arm.
[0078] 1604. Start tracker pose recording, keep the tracker stationary, and acquire the tracker's pose. At this point, the tracker's pose is relative to the base station. Establish a reference coordinate system based on this pose (i.e., the robot coordinate system mentioned earlier). All subsequent sensor pose data will be uniformly transformed to this reference coordinate system through coordinate system transformation. (twenty four) in, For the transformed tracker pose, The initial recorded reference pose. The pose obtained from the original tracker.
[0079] 1605. Control the robot to complete 10 large-amplitude posture changes and translation changes, and synchronously record the robot's rotation information and the tracker's rotation information after each change; 1606. Perform pose correlation calculation on the aforementioned collected sample data to determine the rotation relationship matrix between the tracker and the robot end effector. The essence of this step is to transform the collected rotation information into an association matrix, providing key parameters for coordinate system transformation of the subsequent teaching trajectory (such as mapping the pose data collected by the tracker to the robot coordinate system).
[0080] 1607. The rotation relation matrix obtained from the solution. The pose matrix of the robot end effector relative to the robot base coordinate system. Stored together in a specific data format; 1608. For the original teaching files generated by the tracker, the attitude-related processing flow is as follows: Extract the Euler angle parameters rx, ry, and rz corresponding to the attitude in the file, and convert them into rotation matrices according to the Euler angle order ZYX. And then through the formula The rotation matrix of the taught pose acquired by the tracker in the robot coordinate system is calculated. Then, following the Euler angles order of ZYX, Inverse kinematics is performed to obtain the Euler angles rx, ry, and rz in the robot coordinate system. The position-related processing flow is as follows: For the x, y, and z parameters corresponding to the position in the original file, the formula is used... The position coordinates in the robot coordinate system are calculated, where The homogeneous coordinate vector of the teaching position acquired by the tracker in the tracking coordinate system. This is the homogeneous coordinate vector in the transformed robot coordinate system.
[0081] Step 1608 is the specific process of the previous system teaching step 1510.
[0082] It should be noted that the processing logic of steps 1604 to 1608 corresponds to the calculation process of equations (9) to (19) in the previous teaching process. For example, equation (24) involved in step 1604 corresponds to equation (9) in the previous text, and both are used to represent the mathematical expression of the real-time pose of the motion tracker in the robot coordinate system; at the same time, Figure 16 The calibration steps shown are also reflected in the core calculation relationships through the relevant content of equations (9) to (19).
[0083] This embodiment employs a handheld teaching pendant combined with laser positioning technology for trajectory teaching operations. Operators can complete the teaching actions naturally, just like performing actual spraying operations, without the need for cumbersome point-by-point programming using a teaching pendant. This significantly reduces operational difficulty and learning costs, while greatly improving teaching efficiency. Based on relative pose calibration technology, the initially determined teaching origin is used as a fixed reference benchmark. The subsequent acquired pose data undergoes coordinate system transformation processing, effectively eliminating coordinate system drift caused by base station displacement or system restarts, ensuring high repeatability and consistency in the teaching process and trajectory reproduction. This system integrates three core technologies: laser positioning, relative pose calibration, and workpiece tracking. Through a central control module, it achieves multi-sensor information fusion and collaborative control, automatically identifying workpiece types, accurately tracking workpiece positions, and synchronously adapting to the production line speed, comprehensively ensuring the accuracy and efficiency of spraying operations.
[0084] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating robot motion trajectories, characterized in that, include: The first motion trajectory of the teaching gun in the tracking coordinate system is collected by a motion tracker. The first motion trajectory includes the pose data collected by the motion tracker at multiple different coordinate points. Obtain the robot's coordinate system base point; Based on the robot coordinate system base point, the pose data in the first motion trajectory is converted to the robot coordinate system to obtain the pose data in the corresponding robot coordinate system; Based on the pose data in the robot coordinate system, the second motion trajectory of the robot spraying is obtained; The robot is controlled to perform the spraying operation according to the second motion trajectory.
2. The robot motion trajectory generation method according to claim 1, characterized in that, The process of obtaining the robot coordinate system base point includes: The motion tracker is fixed to the end effector of the robot, wherein the Z-axis of the motion tracker is horizontally opposite to the X-axis of the robot, the X-axis of the motion tracker is horizontally opposite to the Y-axis of the robot, and the Y-axis of the motion tracker is horizontally opposite to the Z-axis of the robot. Keep the motion tracker stationary and collect the initial pose data of the motion tracker relative to the tracking coordinate system, and use the initial pose data as the base point of the robot coordinate system.
3. The robot motion trajectory generation method according to claim 1, characterized in that, The step of converting the pose data in the first motion trajectory to the robot coordinate system to obtain the pose data in the corresponding robot coordinate system includes: Determine the pose transformation matrix of the robot's end effector and the pose transformation matrix of the motion tracker; Based on the pose transformation matrix of the robot end effector and the pose transformation matrix of the motion tracker, the pose transformation relationship matrix between the motion tracker and the robot end effector is calculated. Based on the robot coordinate system base point and the pose transformation relationship matrix, the pose data of each coordinate point in the first motion trajectory are transformed to obtain the pose data in the corresponding robot coordinate system.
4. The robot motion trajectory generation method according to claim 1, characterized in that, After obtaining the second motion trajectory of the robot spraying, the method further includes: performing Kalman filtering on the second motion trajectory to obtain a denoised second motion trajectory.
5. The robot motion trajectory generation method according to claim 1, characterized in that, The pose data includes pose angle data; After obtaining the second motion trajectory of the robot spraying, the method further includes: Convert the attitude angle data of each coordinate point in the second motion trajectory into quaternion form; Calculate the angle between two adjacent quaternions; Based on the preset interpolation parameters, the interpolated quaternion is calculated using a spherical linear interpolation algorithm based on the included angle. The interpolated quaternions are converted back to attitude angle data to obtain a smooth and continuous second motion trajectory.
6. The robot motion trajectory generation method according to claim 5, characterized in that, The calculation formula for the spherical linear interpolation algorithm is as follows: =(sin((1-t)θ) / sinθ)× +(sin(tθ) / sinθ)× in, and These are two adjacent quaternions, and θ is... and The angle between them, where t is the interpolation parameter. This is the interpolated quaternion.
7. The robot motion trajectory generation method according to claim 6, characterized in that, The pose data of the first motion trajectory is collected with the muzzle of the teaching gun as the teaching reference point, and the second motion trajectory is executed with the nozzle of the spray gun at the end of the robot as the execution reference point.
8. A robot motion trajectory generation system, characterized in that, include: The trajectory acquisition module is used to acquire the first motion trajectory of the teaching gun in the tracking coordinate system through the motion tracker. The first motion trajectory includes the pose data acquired by the motion tracker at multiple different coordinate points. The base point acquisition module is used to acquire the base points of the robot coordinate system; The coordinate transformation module is used to transform the pose data in the first motion trajectory to the robot coordinate system based on the robot coordinate system base point, to obtain the pose data in the corresponding robot coordinate system, and to generate the second motion trajectory of robot spraying based on the pose data in the robot coordinate system. The control execution module is used to control the robot to perform the spraying operation according to the second motion trajectory.
9. The robot motion trajectory generation system according to claim 8, characterized in that, The system also includes: The filtering module is used to perform Kalman filtering on the second motion trajectory to suppress noise in the pose data and obtain the denoised second motion trajectory. The attitude interpolation module is used to convert the attitude angle data of each coordinate point in the second motion trajectory into quaternion form, calculate the angle between two adjacent quaternions, calculate the interpolated quaternion by means of a spherical linear interpolation algorithm according to the preset interpolation parameters and the angle, and convert the interpolated quaternion back into attitude angle data to obtain a smooth and continuous second motion trajectory.
10. The robot motion trajectory generation system according to claim 8, characterized in that, The motion tracker is an infrared optical positioning VR tracker, and the tracking coordinate system is the SteamVR coordinate system; the pose data is six-degree-of-freedom pose data, including position coordinate data and attitude angle data, and the attitude angle data is represented by Euler angles in the ZYX order.