A forward-looking speed planning method and device based on continuous trajectory
Through the forward-looking speed planning method based on continuous trajectory, the problem of frequent start and stop of equipment in CNC processing is solved, the stability and efficiency of the processing process are achieved, and the service life of the equipment is extended.
Patent Information
- Application Number
- CN202411609832.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-11-12
AI Technical Summary
In CNC machining, the multi-stage nature of the continuous trajectory causes the equipment to start and stop frequently during the processing process, causing equipment to vibrate and reduce processing efficiency, affecting the service life of the equipment.
The forward-looking velocity planning method based on continuous trajectory is adopted. By obtaining the continuous motion trajectory of the industrial controller, calculating the speed vector data, and carrying out forward-looking velocity planning, ensuring that the machining tool does not need to pause at the highest target speed during the trajectory transition, reducing equipment vibration.
Improve processing efficiency, reduce equipment vibration frequency, extend equipment service life, and ensure the stability and continuity of the processing process.
Smart Images

Figure CN119472518B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of numerical control machining, and particularly to a look-ahead speed planning method and device based on a continuous trajectory. Background Art
[0002] With the upgrade of the automation level of industrial equipment, the prices of servo drivers and the like are continuously decreasing, and numerical control machining accounts for an increasing proportion in industrial equipment. Many industrial products increasingly tend to use numerical control methods to achieve contour machining. During the process of using numerical control machining, the machining tool is mainly controlled by an industrial controller to machine an industrial product along a predetermined trajectory.
[0003] Since the trajectories required by industrial products are diverse, in some scenarios with high process requirements, the entire machining process is required to be as fast as possible and as jitter-free as possible. However, in the continuous trajectory to be machined, due to the multi-segment nature of the continuous trajectory, when machining one trajectory and then continuing to machine the next trajectory, the equipment may need to pause first, determine the machining direction of the next trajectory, and then restart the machining, resulting in a relatively serious start-stop problem in the entire machining process, which is likely to cause vibration of the overall equipment, thereby affecting the machining efficiency and reducing the service life of the equipment at the same time. Summary of the Invention
[0004] The purpose of the present invention is to solve the problems in the prior art, and a look-ahead speed planning method and device based on a continuous trajectory are proposed.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions:
[0006] A look-ahead speed planning method based on a continuous trajectory includes the following steps:
[0007] Obtain at least two continuous motion trajectories of an industrial controller; the two continuous motion trajectories include a first target trajectory and a second target trajectory, the second target trajectory is an interpolation trajectory of the first target trajectory, and the motion time of the first target trajectory is before the motion time of the second target trajectory;
[0008] Obtain a first trajectory parameter of the first target trajectory and a second trajectory parameter of the second target trajectory;
[0009] Based on the first spatial coordinate information where the first target trajectory is located, calculate first velocity vector data of the first target trajectory, and based on the second spatial coordinate information where the second target trajectory is located, calculate second velocity vector data of the second target trajectory;
[0010] Based on the first velocity vector data and the second velocity vector data, determine the change result of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory; the sub-directions of each axis include the horizontal axis direction, the vertical axis direction, and the longitudinal axis direction;
[0011] Based on the first trajectory parameter, the second trajectory parameter, and the change result, perform look-ahead speed planning for the motion trajectory of the industrial controller.
[0012] According to a look-ahead speed planning method based on a continuous trajectory provided by the present invention, the performing look-ahead speed planning for the motion trajectory of the industrial controller based on the first trajectory parameter, the second trajectory parameter, and the change result includes:
[0013] If the change result is that the sub-directions of each axis of the second target trajectory do not change relative to the sub-directions of each axis of the first target trajectory, then calculate the maximum allowable transition speed of each axis of the first target trajectory based on the first trajectory parameter and the second trajectory parameter;
[0014] Determine the transition speed with the smallest value among the maximum allowable transition speeds of each axis of the first target trajectory as the minimum step-over transition speed of the first target trajectory;
[0015] Use the minimum step-over transition speed of the first target trajectory as the highest target speed when entering the second target trajectory, so that the machining tool controlled by the industrial controller directly enters the second target trajectory after reaching the highest target speed within the first target trajectory.
[0016] According to a look-ahead speed planning method based on a continuous trajectory provided by the present invention, the obtaining at least two continuous motion trajectories of the industrial controller includes:
[0017] Input the first target trajectory into the trajectory generation model to obtain the second target trajectory output by the trajectory generation model; the trajectory generation model is trained based on sample trajectory data and its corresponding labeled trajectory data;
[0018] Correspondingly, the specific steps for training the trajectory generation model include:
[0019] Obtain historical trajectory data; the historical trajectory data includes first historical trajectory data corresponding to the first historical trajectory and second historical trajectory data corresponding to the second historical trajectory, and the second historical trajectory is the interpolation trajectory of the first historical trajectory;
[0020] Classify the first historical trajectory data and the second historical trajectory data to obtain first classified trajectory data and second classified trajectory data respectively;
[0021] Based on the first classified trajectory data and the second classified trajectory data, the pre-trained LSTM neural network is trained to obtain the trajectory generation model.
[0022] According to a look-ahead speed planning method based on continuous trajectories provided by the present invention, the loss function of the trained trajectory generation model is:
[0023]
[0024] where L represents the total loss function, represents the i-th predicted trajectory position of the model, T i represents the actual i-th trajectory position, represents represents the distance between and T i and ω1 represents the weight coefficient of trajectory prediction; represents the predicted speed of the model at the i-th trajectory position, υ i represents the actual speed at the i-th trajectory position, ω2 represents the weight coefficient of speed prediction, represents represents the relative error between and υ i ; represents the angle of the k-th point on the arc predicted by the model, θ k represents the angle of the k-th point on the actual arc, M represents the total number of points on the arc, and ω3 represents the weight coefficient of arc angle prediction; represents the predicted tool wear rate by the model, d represents the actual tool wear rate, and ω4 represents the weight coefficient of tool wear rate prediction; represents the predicted cutting parameter value by the model, c represents the actual cutting parameter value, and ω5 represents the weight coefficient of cutting parameter prediction.
[0025] According to a look-ahead speed planning method based on continuous trajectories provided by the present invention, the first target trajectory includes, and the second target trajectory includes a straight trajectory or an arc trajectory. Wherein, when the first target trajectory is an arc trajectory, the first speed vector data is calculated based on the tangent angle at the end of the first target trajectory; when the second target trajectory is an arc trajectory, the second speed vector data is calculated based on the tangent angle at the start of the second target trajectory.
[0026] A look-ahead speed planning method based on a continuous trajectory according to the present invention, wherein the first trajectory parameter includes a step constant, a gear ratio of an axis of the first target trajectory, a pulse unit feed speed, and a speed component ratio of the first target trajectory; the second trajectory parameter includes the step constant, a gear ratio of an axis of the second target trajectory, a pulse unit feed speed, and a speed component ratio of the second target trajectory.
[0027] A look-ahead speed planning method based on a continuous trajectory according to the present invention, calculating first speed vector data of the first target trajectory based on first spatial coordinate information where the first target trajectory is located, and calculating second speed vector data of the second target trajectory based on second spatial coordinate information where the second target trajectory is located, includes:
[0028] Calculating components of each axis in the coordinates where the first target trajectory is located relative to a vector and a feed direction based on the first spatial coordinate information where the first target trajectory is located, and calculating sub-directions of each axis of the first target trajectory based on the components of each axis in the coordinates where the first target trajectory is located relative to the vector and the feed direction;
[0029] Calculating components of each axis in the coordinates where the second target trajectory is located relative to a vector and a feed direction based on the second spatial coordinate information where the second target trajectory is located, and calculating sub-directions of each axis of the first target trajectory based on the components of each axis in the coordinates where the second target trajectory is located relative to the vector and the feed direction.
[0030] A look-ahead speed planning device based on a continuous trajectory, includes:
[0031] A first acquisition unit, configured to acquire at least two continuous motion trajectories of an industrial controller, the two continuous motion trajectories including a first target trajectory and a second target trajectory, and a motion time of the first target trajectory being before a motion time of the second target trajectory; a second acquisition unit, configured to acquire a first trajectory parameter of the first target trajectory and a second trajectory parameter of the second target trajectory; a calculation unit, configured to calculate first speed vector data of the first target trajectory based on first spatial coordinate information where the first target trajectory is located, and calculate second speed vector data of the second target trajectory based on second spatial coordinate information where the second target trajectory is located; a judgment processing unit, configured to determine a change result of sub-directions of each axis of the second target trajectory relative to sub-directions of each axis of the first target trajectory based on the first speed vector data and the second speed vector data; the sub-directions of each axis including a horizontal axis direction, a vertical axis direction, and a longitudinal axis direction; an output unit, configured to perform look-ahead speed planning on a motion trajectory of the industrial controller based on the first trajectory parameter, the second trajectory parameter, and the change result.
[0032] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of a forward-looking speed planning method based on a continuous trajectory as described in any one of claims 1 to 7 are implemented.
[0033] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a forward-looking speed planning method based on a continuous trajectory as described in any one of claims 1 to 7 are implemented.
[0034] The present invention has the following advantages compared with the prior art:
[0035] A forward-looking speed planning method and device based on a continuous trajectory provided by the present invention obtain the speed vector data of the acquired trajectory by acquiring the continuous trajectory to be worked, so as to quickly judge whether the continuous trajectory needs interpolation transition, and complete the forward-looking speed planning of the continuous trajectory movement after the judgment, so that the interpolation trajectory can transition at the highest target speed during the transition, so that the machining tool can quickly enter when machining the interpolation trajectory without pausing the device, and further make the entire machining process as fast as possible, with as few stops or non-stop transitions as possible, and minimize the vibration frequency caused to the overall device, thereby reducing the impact on the overall performance of the industrial controller, improving the machining efficiency and the service life of the device at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0037] Figure 1 It is a schematic flow chart of a forward-looking speed planning method based on a continuous trajectory provided by an embodiment of the present invention;
[0038] Figure 2 It is one of the schematic diagrams of two trajectories provided by an embodiment of the present invention;
[0039] Figure 3 It is the second of the schematic diagrams of two trajectories provided by an embodiment of the present invention;
[0040] Figure 4 It is a schematic structural diagram of a forward-looking speed planning device based on a continuous trajectory provided by an embodiment of the present invention; <>
[0041] Figure 5 It is a schematic structural diagram of an electronic device proposed by the present invention. Specific Embodiments
[0042] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.
[0043] The following combines Figures 1 - 5 to describe a look-ahead speed planning method and apparatus based on a continuous trajectory of the present invention.
[0044] Figure 1 is a schematic flowchart of a look-ahead speed planning method based on a continuous trajectory provided by the present invention. As Figure 1 shown, the method includes:
[0045] Step 101, obtain at least two continuous motion trajectories of an industrial controller.
[0046] Among them, the two continuous motion trajectories include a first target trajectory and a second target trajectory. The second target trajectory is an interpolation trajectory of the first target trajectory, and the motion time of the first target trajectory is before the motion time of the second target trajectory.
[0047] Specifically, the first target trajectory is the current machining trajectory of a machining tool, and the second target trajectory is the to-be-machined trajectory that the machining tool subsequently enters immediately. The first target trajectory includes a linear trajectory or a circular arc trajectory, and the second target trajectory includes a linear trajectory or a circular arc trajectory, so as to form four continuous motion trajectory states between the first target trajectory and the second target trajectory. At the same time, when obtaining the corresponding first target trajectory and second target trajectory, the position information of the coordinate system in which the first target trajectory and the second target trajectory are located is also correspondingly determined. The coordinate system is a three-dimensional space coordinate system including the x-axis, y-axis, and z-axis. The first target trajectory can be obtained in real time through an equipment operation plan or a sensor installed on the machining tool, and the second target trajectory can be obtained through an equipment operation plan, a sensor installed on the machining tool, and by a trajectory generation model through inputting the first target trajectory.
[0048] Step 102, obtain a first trajectory parameter of the first target trajectory and a second trajectory parameter of the second target trajectory.
[0049] Specifically, the first trajectory parameter includes a step constant, the gear ratio of the axis of the first target trajectory, and the pulse unit feed rate; the second trajectory parameter includes a step constant, the gear ratio of the axis of the second target trajectory, and the pulse unit feed rate. The step constant is calculated from the difference in the transition speeds of the first target trajectory and the second target trajectory. Since it is necessary to limit the step of each axis, there is a maximum allowable step constant (usually 1) to facilitate the calculation of the subsequent allowable maximum transition speed. The gear ratio of the axis of the first target trajectory and the pulse unit feed rate, as well as the gear ratio of the axis of the second target trajectory and the pulse unit feed rate, can all be obtained by querying the numerical control equipment manual.
[0050] Step 103: Based on the first spatial coordinate information of the first target trajectory, calculate the first velocity vector data of the first target trajectory, and based on the second spatial coordinate information of the second target trajectory, calculate the second velocity vector data of the second target trajectory.
[0051] Specifically, the first spatial coordinate information is the corresponding position information in the coordinate system where the first target trajectory is located, and the second spatial coordinate information is the corresponding position information in the coordinate system where the second target trajectory is located. The calculation process of the first velocity vector data is as follows: Based on the spatial coordinate information of the first target trajectory, calculate the components of each axis of the first target trajectory in the coordinate with respect to the vector and the feed direction, and calculate the sub-directions of each axis of the first target trajectory based on the components of each axis of the first target trajectory in the coordinate with respect to the vector and the feed direction. The calculation process of the second velocity vector data is as follows: Based on the spatial coordinate information of the second target trajectory, calculate the components of each axis of the second target trajectory in the coordinate with respect to the vector and the feed direction, and calculate the sub-directions of each axis of the second target trajectory based on the components of each axis of the second target trajectory in the coordinate with respect to the vector and the feed direction.
[0052] Meanwhile, after obtaining the first velocity vector data and the second velocity vector data, the first trajectory parameter further includes the velocity component ratio of the first target trajectory calculated from the first velocity vector data, and the second trajectory parameter further includes the velocity component ratio of the second target trajectory calculated from the second velocity vector data. Among them, the velocity component is the projection of the tangent vector on each coordinate axis in the circular arc trajectory, and the velocity component on the straight line trajectory is the component of the velocity vector of the straight line trajectory corresponding to each coordinate axis, where the velocity vector is calculated based on the parametric equation of the straight line trajectory.
[0053] Step 104: Based on the first velocity vector data and the second velocity vector data, determine the change result of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory; the sub-directions of each axis include the horizontal axis direction, the vertical axis direction, and the longitudinal axis direction.
[0054] Specifically, the sub-directions of each axis of the first target trajectory and the sub-directions of each axis of the second target trajectory are both calculated in step 103. After determining the sub-directions of each axis of the first target trajectory and the sub-directions of each axis of the second target trajectory in step 103, compare the sub-directions of each axis of the first target trajectory with the sub-directions of each axis of the second target trajectory, that is, compare the change results of the sub-directions in the horizontal axis direction (x-axis), the vertical axis direction (y-axis), and the longitudinal axis direction (z-axis) respectively.
[0055] Step 105, based on the first trajectory parameter, the second trajectory parameter, and the change result, perform a look-ahead speed planning for the motion trajectory of the industrial controller.
[0056] Specifically, if the change result is that the sub-directions of each axis of the second target trajectory do not change relative to the sub-directions of each axis of the first target trajectory, the process of performing a look-ahead speed planning for the motion trajectory of the industrial controller is as follows:
[0057] Based on the first trajectory parameter and the second trajectory parameter, calculate the maximum allowable transition speed of each axis of the first target trajectory; determine the transition speed with the smallest value among the maximum allowable transition speeds of each axis of the first target trajectory as the minimum step-over transition speed of the first target trajectory; use the minimum step-over transition speed of the first target trajectory as the highest target speed when entering the second target trajectory, so that the machining tool controlled by the industrial controller accelerates or decelerates within the first target trajectory to reach the minimum step-over transition speed and then directly enters the second target trajectory.
[0058] The present invention relates to the fields of numerical control machining, motion trajectories, and trajectory planning, and proposes a look-ahead speed planning method based on continuous trajectories. In the present invention, the proposed look-ahead speed planning method enables the machining tool to quickly enter during the machining interpolation trajectory without pausing the equipment, thereby making the entire machining process as fast as possible, with as few stops or non-stop transitions as possible, and minimizing the vibration frequency caused to the overall equipment, thus reducing the impact on the overall performance of the industrial controller and improving the machining efficiency while increasing the service life of the equipment.
[0059] Specifically, in step 101, when the acquired continuous motion trajectory is greater than 2, following the position of the moving tool, the second target trajectory always remains the next trajectory entered by the moving tool after passing through the first target trajectory, so as to realize the automatic adjustment of the actual position of the second target trajectory according to the running state and position of the moving tool. For example, when the continuous motion trajectory is 3, when the machining tool moves to the middle second motion trajectory, at this time, the second motion trajectory is the first target trajectory, and the third motion trajectory is the second target trajectory.
[0060] Specifically, in step 103, when calculating the first velocity vector data and the second velocity vector data, when the first target trajectory is an arc trajectory, the first velocity vector data is calculated based on the tangent angle at the end of the first target trajectory; when the second target trajectory is an arc trajectory, the second velocity vector data is calculated based on the tangent angle at the start of the second target trajectory. The steps are as follows:
[0061] If the first target trajectory or the second target trajectory is a straight-line trajectory, in one embodiment, there is a given vector Then the parametric direction of the straight-line trajectory in three-dimensional space is The velocity vector of the straight-line trajectory
[0062] For the x-axis: The velocity component of the straight-line trajectory in the x direction
[0063] The x-axis relative to the vector The component is:
[0064] For the y-axis: The velocity component of the straight-line trajectory in the y direction
[0065] The y-axis relative to the vector The component is:
[0066] For the z-axis: The velocity component of the straight-line trajectory in the z direction is
[0067] The z-axis relative to the vector The component is:
[0068] Where, · represents the dot product operation, is the vector The modulus of
[0069] Meanwhile, when calculating the feed directions of the first target trajectory and the second target trajectory, according to the coordinates P1(x1, y1, z1) and P2(x2, y2, z2) of two points on the straight-line trajectory in the corresponding coordinate system, the feed direction vector is: Normalize it to obtain the unit feed direction vector Where
[0070] After that, the sub-directions of each axis of the first target trajectory and the sub-directions of each axis of the second target trajectory are obtained as follows: The sub-direction of the x-axis is The sub-direction of the axis is The sub-direction of the axis is
[0071] Similarly, in an embodiment, when the first target trajectory or the second target trajectory is an arc trajectory, the feed direction of the arc trajectory is also the tangent vector direction at a certain point of the arc. The coordinates of the center of the circle of the arc trajectory in three-dimensional space are (a, b, c), and the radius is r. Its parametric equation is:
[0072] where and θ are parameters representing angles.
[0073] When calculating the tangent vector, first take the partial derivatives of the parametric equation respectively:
[0074]
[0075]
[0076] Then at any angle the tangent vector is:
[0077] And
[0078] Take the cross product. Then calculate the cross product to get the tangent vector
[0079]
[0080] The obtained sub-direction for the x-axis is:
[0081] The obtained sub-direction for the y-axis is:
[0082] The obtained sub-direction for the z-axis is:
[0083] In addition, after determining the first velocity vector of the first target trajectory and the second velocity vector of the second target trajectory, when calculating the first trajectory parameter of the first target trajectory and the second trajectory parameter of the second target trajectory, if it is a straight-line trajectory, according to the velocity components of the corresponding axes obtained above: Compare the velocity components of any two axes to obtain the velocity component ratio of the straight-line trajectory. If it is an arc trajectory, according to the obtained sub-direction for the x-axis above: The sub-direction for the y-axis is: And the sub-direction for the z-axis is: Thus, the component of the velocity in the x-axis is The component in the y-axis is The component in the z-axis is Similarly, by comparing the velocity components of any two axes, the velocity component ratio of the circular arc trajectory can be obtained. Furthermore, the velocity component ratios corresponding to the first trajectory parameter on the linear trajectory or the circular arc trajectory, and the velocity component ratios corresponding to the second trajectory parameter on the linear trajectory or the circular arc trajectory can be obtained.
[0084] In step 104, after obtaining the sub-directions of each axis of the first target trajectory and the second target trajectory through the above process, compare the sub-directions of each axis of the first target trajectory and the second target trajectory, and finally obtain the change result of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory. Specifically, the change result includes two situations: the sub-directions of each axis of the second target trajectory do not change relative to the sub-directions of each axis of the first target trajectory, or there is any change in any direction of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory. When there is any change in any direction of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory, it includes at least 7 situations: the x-axis of the sub-directions of each axis of the second target trajectory changes compared with the first target trajectory, the y-axis changes, the z-axis changes, both the x-axis and the y-axis change, both the x-axis and the z-axis change, both the y-axis and the z-axis change, and the x-axis, y-axis, and z-axis all change.
[0085] Furthermore, in the actual interpolation movement process, in order to make the two paths in the interpolation move at the target speed as much as possible under possible circumstances, but when any of the above 7 situations may exist in the two paths in the interpolation, directly transitioning to the next path (i.e., the second target trajectory) at the current target speed may cause errors at the front end of the second path (i.e., the second target trajectory), affecting the interpolation effect. Therefore, when transitioning between the two paths in the above seven situations, the transition speed is zero.
[0086] Next, an example description will be given of the situation where the transition speed is zero when transitioning between two paths.
[0087] Figures 2 - 3 It is an example diagram of two paths provided by the present invention.
[0088] When both paths, namely the first target trajectory and the second target trajectory, are linear trajectories, Figure 2 in (1) the vector directions of the two paths are basically the same, and the two axis directions in the coordinate system do not change, satisfying the velocity transition. Figure 2 in (2) the vector direction of the two paths decomposed into the X-axis direction in the coordinate system has changed. Therefore, the X-axis involves the process of deceleration - stop - direction change - restart, making the transition speed zero.
[0089] Such as Figure 3As shown in [reference], when one of the two paths, i.e., the first target trajectory and the second target trajectory, is a straight-line trajectory and the other is an arc trajectory, Figure 3 in (3) and (5) of [reference], the first target trajectory is a straight-line trajectory and the second target trajectory is an arc trajectory. At this time, the tangent direction of the arc trajectory is basically the same as the direction of the straight-line trajectory, and there is no change in the direction of the axes in the coordinate system after decomposition, which satisfies the speed transition, and the transition speed is greater than zero. Instead, Figure 3 in (4) of [reference], the first target trajectory is a straight-line trajectory and the second target trajectory is an arc trajectory. After decomposition into the coordinate system, the x-axis and y-axis of the second target trajectory have both changed directions. Therefore, the transition speed is zero.
[0090] In summary, according to the above calculations, the component directions of the straight-line trajectory and the arc trajectory in the coordinate system are obtained. If non-zero speed transition is allowed for the two paths, then no change is allowed in the directions of all axes of the two trajectories in the coordinate system. On the contrary, as long as the components of all axes do not change direction, the speed trend can reach the target speed with acceleration or deceleration and directly enter the new path, thereby eliminating the need to stop any servo, which can better suppress the vibration during trajectory movement. When the transition speed is zero, the moving speed of the machining tool in the first target trajectory should be accelerated first and then decelerated to achieve a speed of zero when reaching the second target trajectory, avoiding problems such as errors in the machining work caused by forced transition. Therefore, the look-ahead speed transition plan of this application determines the highest target speed allowed for transition between the two paths by excluding the reverse direction of any axis of the two paths, so as to make the trajectory machining process more stable and smooth.
[0091] Furthermore, the calculation process of the highest target speed allowed for transition is as follows:
[0092] According to step 105, in one embodiment, if Lmt represents the step constant, S (in units of 0.01 mm / s) represents the target transition speed, P represents the gear ratio of the current axis, z0 represents the speed component ratio of the first target trajectory, z1 represents the speed component ratio of the second target trajectory, and n is the pulse unit feed speed of the current axis. Since the difference in the transition speeds of the first target trajectory and the second target trajectory is equal to the step constant, and since it is necessary to limit the step of each axis, there is a maximum allowable step constant (usually 1). Therefore, we have: S * z0 * P = n = Lmt / ((z0 - z1) / z0). Here, S * z0 * P on the left represents the pulse unit feed speed of the current axis under the target transition speed, considering the speed component ratio and the gear ratio, and Lmt / ((z0 - z1) / z0) on the right is obtained according to the definition of the step constant. Thus, from S * z0 * P = n, we can get S = n / z0 / P. And because n = Lmt / ((z0 - z1) / z0), we finally get S = Lmt / (z0 - z1) / P. Thus, based on the maximum allowable step constant, the maximum allowable transition speed of the current axis is obtained. Similarly, continue to calculate the maximum allowable transition speeds when calculating the gear ratios of the other two axes, compare the magnitudes of the maximum allowable transition speeds of each axis, and take the transition speed with the smallest value as the minimum step transition speed of the first target trajectory. Finally, the industrial controller controls the machining tool to accelerate or decelerate within the first target trajectory and directly enter the second target trajectory after reaching the minimum step transition speed, completing the entire planning process.
[0093] In addition, during the look-ahead speed planning process, there may often be real-time adjustments between the motion trajectory route and the actual working route, such as the actual shape of the workpiece, the performance of the machine tool equipment, the wear condition of the tool during long-term use, and the cutting parameters of different tools and other factors, resulting in a gap between the actual motion trajectory route and the planned route. Therefore, during the process of the machining tool passing through the first target trajectory and the second target trajectory, the trajectory itself may change. Thus, if the second target trajectory route can be accurately predicted, it can better serve the above-mentioned look-ahead speed planning and improve the accuracy of its planning.
[0094] Specifically, in order to improve the accuracy of the routes of the first target trajectory and the second target trajectory in actual work, the present invention provides a trajectory generation model for predicting the second target trajectory based on the first target trajectory, inputting the first target trajectory into the trajectory generation model, and obtaining the second target trajectory output by the trajectory generation model; the trajectory generation model is trained based on sample trajectory data and its corresponding labeled trajectory data.
[0095] Correspondingly, the specific steps for training the trajectory generation model include:
[0096] Obtain historical trajectory data; the historical trajectory data includes the first historical trajectory data corresponding to the first historical trajectory and the second historical trajectory data corresponding to the second historical trajectory, and the second historical trajectory is the interpolation trajectory of the first historical trajectory;
[0097] Classify the first historical trajectory data and the second historical trajectory data to obtain the first classified trajectory data and the second classified trajectory data respectively;
[0098] Based on the first classified trajectory data and the second classified trajectory data, train the pre-trained LSTM neural network to obtain a trajectory generation model.
[0099] In fact, the historical trajectory data is obtained from the device background work records or can also be obtained from the data storage device. The historical trajectory data may be messy. And when there are more than 2 continuous motion trajectories, the motion trajectories in the middle part may be either the first historical trajectory data or the second historical trajectory data. Therefore, by classifying the historical trajectory data, the first classified trajectory data and the second classified trajectory data are obtained, making the first classified trajectory data the set of the first historical trajectory data and the corresponding second historical trajectory data, while the second classified trajectory data is the labeled trajectory data corresponding to the first historical trajectory data and the second historical trajectory data. The labeled trajectory data labels information such as the starting point, ending point, and key nodes of the trajectory, which can be used more pertinently for subsequent model training. At the same time, during the classification process, irrelevant or poor-quality data can also be filtered out through screening to improve the accuracy of the data used for subsequent model training. For example, if the user hopes to classify the historical trajectory data of the past month, during the classification process, first divide the continuous trajectory part of the historical trajectory data of the past month into several classes containing the first target trajectory and the second target trajectory. Each class has the first classified trajectory data and the second classified trajectory data, and both the first classified trajectory data and the second classified trajectory data include the position coordinates in the coordinate system where the first target trajectory and the second target trajectory are located, the initial velocity, the maximum velocity, the wear condition of the tool, the cutting parameter values of the tool, and the transition velocity and other data. At this time, filter out the poor-quality data when cutting errors occur, and the first classified trajectory data and the second classified trajectory data corresponding to the first target trajectory and the second target trajectory when the transition velocity is zero, to obtain the sets corresponding to the finally classified first classified trajectory data and the second classified trajectory data.
[0100] In addition, before inputting the classified first classified trajectory data and second classified trajectory data into the trajectory generation model, it is also necessary to perform data conversion on the first classified trajectory data and second classified trajectory data so that the first classified trajectory data and second classified trajectory data are converted into a format suitable for input into the LSTM neural network, that is, the data needs to be converted into the form of time steps and features. More specifically, during the process of model training, the classified first classified trajectory data and second classified trajectory data are converted into the appropriate format and then input into the input layer of the LSTM neural network. In the input layer, the data is preliminarily processed into a form suitable for subsequent network layer processing. Specifically, the data is arranged in the format of time steps and features. Each time step corresponds to the data of a trajectory point, and each feature represents different attributes of the trajectory point, such as position coordinates, speed, etc. Then, the data enters the LSTM cell layer. In this layer, each LSTM cell processes the input data according to the mechanisms of the forget gate, input gate, and output gate. The forget gate determines what information that is no longer important for the current trajectory prediction should be discarded from the cell state at the previous moment, and the input gate determines what has an important impact on the current trajectory development and adds it to the cell state. Through these gating mechanisms, the LSTM cell can effectively capture the long-term dependencies in the time series and model the dynamic changes in the trajectory historical data. Then, the data is further subjected to feature extraction and abstraction in the hidden layer. The hidden layer consists of multiple LSTM cells and can learn more complex patterns and rules. As the training progresses, the weights and biases of the hidden layer are continuously adjusted to optimize the performance of the network. The output of the hidden layer is used as the input for the next layer and is passed to the output layer.
[0101] In the process of inputting the first target trajectory into the trained trajectory generation model and obtaining the second target trajectory as the output. Specifically, when the first target trajectory is input into the trained trajectory generation model, in the output layer, the final prediction result is generated based on the output of the hidden layer. For the trajectory generation task, the output can be the position coordinates, speed, etc. of the next trajectory point, that is, the position coordinates, speed, etc. of the second target trajectory in the coordinate system.
[0102] According to the present invention, a forward-looking speed planning method based on continuous trajectories is provided, and the loss function of the trained trajectory generation model is:
[0103]
[0104] where L represents the total loss function, [[ID=1...]] represents the i-th trajectory position predicted by the model, T i represents the actual i-th trajectory position, represents and T i the distance between them, and ω1 represents the weight coefficient of trajectory prediction; The predicted speed when the model is at the i-th trajectory position, υ i The actual speed when at the i-th trajectory position, ω2 represents the weight coefficient of speed prediction, Represents The relative error between υ i And; The angle of the k-th point on the arc predicted by the model, θ k The angle of the k-th point on the actual arc, M represents the total number of points on the arc, ω3 represents the weight coefficient of arc angle prediction; The predicted tool wear rate by the model, d represents the actual tool wear rate, ω4 represents the weight coefficient of tool wear rate prediction; The predicted cutting parameter value by the model, c represents the actual cutting parameter value, ω5 represents the weight coefficient of cutting parameter prediction.
[0105] The loss function of the trained trajectory generation model comprehensively considers multiple aspects such as trajectory position, speed, arc angle of the trajectory, tool wear rate, and cutting parameters. Among them, cutting parameters include speed, feed rate, cutting depth, cutting width, cutting power, etc. Thus, after the input of the first target trajectory, it can quickly predict the actual position of the subsequent second target trajectory to improve the prediction accuracy. At this time, the importance of different factors can also be highlighted according to actual needs by adjusting the weight coefficients of different parts.
[0106] Figure 4 It is a schematic structural diagram of a look-ahead speed planning device based on continuous trajectories provided by the present invention, as Figure 4 Shown, the device includes: a first acquisition unit 10, configured to acquire at least two continuous motion trajectories of an industrial controller. The two continuous motion trajectories include a first target trajectory and a second target trajectory. The motion time of the first target trajectory is before the motion time of the second target trajectory; a second acquisition unit 20, configured to acquire the first trajectory parameters of the first target trajectory and the second trajectory parameters of the second target trajectory. A calculation unit 30 is configured to calculate the first velocity vector data of the first target trajectory based on the first spatial coordinate information where the first target trajectory is located, and calculate the second velocity vector data of the second target trajectory based on the second spatial coordinate information where the second target trajectory is located; a judgment processing unit 40, configured to determine the change result of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory based on the first velocity vector data and the second velocity vector data. The axis directions include the horizontal axis direction, the vertical axis direction, and the longitudinal axis direction; an output unit 50, configured to perform look-ahead speed planning on the motion trajectory of the industrial controller based on the first trajectory parameters, the second trajectory parameters, and the change result.
[0107] Figure 5 is a schematic structural diagram of the electronic device provided by the present invention. As Figure 5 shown, the electronic device may include: a processor 1010, a communications interface 1020, a memory 1030, and a communication bus 1040. Among them, the processor 1010, the communications interface 1020, and the memory 1030 complete mutual communication through the communication bus 1040. The processor 1010 may call logic instructions in the memory 1030 to execute a look-ahead speed planning method based on a continuous trajectory. The method includes: obtaining at least two continuous motion trajectories of an industrial controller; the two continuous motion trajectories include a first target trajectory and a second target trajectory, the second target trajectory is an interpolation trajectory of the first target trajectory, and the motion time of the first target trajectory is before the motion time of the second target trajectory; obtaining a first trajectory parameter of the first target trajectory and a second trajectory parameter of the second target trajectory; calculating first velocity vector data of the first target trajectory based on first spatial coordinate information where the first target trajectory is located, and calculating second velocity vector data of the second target trajectory based on second spatial coordinate information where the second target trajectory is located; determining a change result of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory based on the first velocity vector data and the second velocity vector data; the axis directions include a horizontal axis direction, a vertical axis direction, and a longitudinal axis direction; performing look-ahead speed planning on the motion trajectory of the industrial controller based on the first trajectory parameter, the second trajectory parameter, and the change result.
[0108] In addition, when the logic instructions in the above-mentioned memory 1030 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.
[0109] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute a continuous-trajectory-based look-ahead speed planning method provided by each of the above methods. The method includes: obtaining at least two continuous motion trajectories of an industrial controller; the two continuous motion trajectories include a first target trajectory and a second target trajectory, the second target trajectory is an interpolation trajectory of the first target trajectory, and the motion time of the first target trajectory is before the motion time of the second target trajectory; obtaining a first trajectory parameter of the first target trajectory and a second trajectory parameter of the second target trajectory; calculating first speed vector data of the first target trajectory based on first spatial coordinate information where the first target trajectory is located, and calculating second speed vector data of the second target trajectory based on second spatial coordinate information where the second target trajectory is located; determining a change result of a sub-direction of each axis of the second target trajectory relative to a sub-direction of each axis of the first target trajectory based on the first speed vector data and the second speed vector data; the axis directions include a horizontal axis direction, a vertical axis direction, and a longitudinal axis direction; performing look-ahead speed planning on the motion trajectory of the industrial controller based on the first trajectory parameter, the second trajectory parameter, and the change result.
[0110] In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute a continuous-trajectory-based look-ahead speed planning method provided by each of the above. The method includes: obtaining at least two continuous motion trajectories of an industrial controller, and obtaining a first trajectory parameter of the first target trajectory and a second trajectory parameter of the second target trajectory; the two continuous motion trajectories include a first target trajectory and a second target trajectory, and the motion time of the first target trajectory is before the motion time of the second target trajectory; calculating first speed vector data of the first target trajectory and second speed vector data of the second target trajectory based on spatial coordinate information where the first target trajectory and the second target trajectory are located; determining a change result of a sub-direction of each axis of the second target trajectory relative to a sub-direction of each axis of the first target trajectory based on the first speed vector data and the second speed vector data; the axis directions include a horizontal axis direction, a vertical axis direction, and a longitudinal axis direction; performing look-ahead speed planning on the motion trajectory of the industrial controller based on the first trajectory parameter, the second trajectory parameter, and the change result.
[0111] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0112] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0113] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.
Claims
1. A look-ahead speed planning method based on continuous trajectories, characterized in that, Including the following steps: Obtain at least two consecutive motion trajectories of an industrial controller; the two consecutive motion trajectories include a first target trajectory and a second target trajectory, the second target trajectory is an interpolation trajectory of the first target trajectory, and the motion time of the first target trajectory is before the motion time of the second target trajectory; Obtain a first trajectory parameter of the first target trajectory and a second trajectory parameter of the second target trajectory; Based on the first spatial coordinate information where the first target trajectory is located, calculate first velocity vector data of the first target trajectory, and based on the second spatial coordinate information where the second target trajectory is located, calculate second velocity vector data of the second target trajectory; Based on the first velocity vector data and the second velocity vector data, determine the change result of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory; the sub-directions of each axis include the horizontal axis direction, the vertical axis direction, and the longitudinal axis direction; Based on the first trajectory parameter, the second trajectory parameter, and the change result, perform a look-ahead speed planning for the motion trajectory of the industrial controller; Among them, the performing a look-ahead speed planning for the motion trajectory of the industrial controller based on the first trajectory parameter, the second trajectory parameter, and the change result includes: If the change result is that the sub-directions of each axis of the second target trajectory do not change relative to the sub-directions of each axis of the first target trajectory, then calculate the maximum allowable transition speed of each axis of the first target trajectory based on the first trajectory parameter and the second trajectory parameter; Determine the transition speed with the smallest value among the maximum allowable transition speeds of each axis of the first target trajectory as the minimum step-over transition speed of the first target trajectory; Use the minimum step-over transition speed of the first target trajectory as the highest target speed when entering the second target trajectory, so that the machining tool controlled by the industrial controller directly enters the second target trajectory after reaching the highest target speed within the first target trajectory.
2. The forward speed planning method based on a continuous trajectory according to claim 1, wherein The obtaining at least two consecutive motion trajectories of the industrial controller includes: Input the first target trajectory into a trajectory generation model to obtain the second target trajectory output by the trajectory generation model; the trajectory generation model is trained based on sample trajectory data and its corresponding labeled trajectory data; Correspondingly, the specific steps for training the trajectory generation model include: Obtain historical trajectory data; the historical trajectory data includes first historical trajectory data corresponding to a first historical trajectory and second historical trajectory data corresponding to a second historical trajectory, and the second historical trajectory is an interpolation trajectory of the first historical trajectory; Classify the first historical trajectory data and the second historical trajectory data to obtain first classified trajectory data and second classified trajectory data respectively; Based on the first classified trajectory data and the second classified trajectory data, perform model training on a pre-trained LSTM neural network to obtain the trajectory generation model.
3. A look-ahead speed planning method based on a continuous trajectory according to claim 2, characterized in that, The loss function for obtaining the trajectory generation model is: ; where, L represents the total loss function, represents the predicted position of the i-th trajectory by the model, represents the actual position of the i-th trajectory, represents the distance between [[ID=*]] and represents the weight coefficient of trajectory prediction; represents the speed when the model predicts the i-th trajectory position, represents the actual speed at the i-th trajectory position, represents the weight coefficient of speed prediction, represents the relative error between and represents the angle of the k-th point on the arc predicted by the model, represents the angle of the k-th point on the actual arc, M represents the total number of points on the arc, represents the weight coefficient of arc angle prediction; represents the predicted tool wear rate by the model, represents the actual tool wear rate, represents the weight coefficient of tool wear rate prediction; represents the predicted cutting parameter value by the model, represents the actual cutting parameter value, represents the weight coefficient of cutting parameter prediction.
4. A look-ahead speed planning method based on a continuous trajectory according to claim 1, characterized in that The first target trajectory includes a linear trajectory or an arc trajectory, and the second target trajectory includes a linear trajectory or an arc trajectory. Wherein, when the first target trajectory is an arc trajectory, the first velocity vector data is calculated based on the tangent angle at the end of the first target trajectory; when the second target trajectory is an arc trajectory, the second velocity vector data is calculated based on the tangent angle at the start of the second target trajectory.
5. A preview speed planning method based on a continuous trajectory according to claim 1, characterized in that The first trajectory parameter includes a step constant, the gear ratio of the axis of the first target trajectory, the pulse unit feed rate, and the speed component ratio of the first target trajectory; the second trajectory parameter includes the step constant, the gear ratio of the axis of the second target trajectory, the pulse unit feed rate, and the speed component ratio of the second target trajectory.
6. The preview speed planning method based on a continuous trajectory according to claim 1, characterized in that Calculating the first velocity vector data of the first target trajectory based on the first spatial coordinate information where the first target trajectory is located, and calculating the second velocity vector data of the second target trajectory based on the second spatial coordinate information where the second target trajectory is located, includes: Calculating the component of each axis in the coordinates where the first target trajectory is located relative to the vector and the feed direction based on the spatial coordinate information where the first target trajectory is located, and calculating the sub-directions of each axis of the first target trajectory based on the component of each axis in the coordinates where the first target trajectory is located relative to the vector and the feed direction; Calculating the component of each axis in the coordinates where the second target trajectory is located relative to the vector and the feed direction based on the spatial coordinate information where the second target trajectory is located, and calculating the sub-directions of each axis of the first target trajectory based on the component of each axis in the coordinates where the second target trajectory is located relative to the vector and the feed direction.
7. A look-ahead speed planning device based on a continuous trajectory, characterized in that Includes: A first acquisition unit for acquiring at least two continuous motion trajectories of an industrial controller, the two continuous motion trajectories including a first target trajectory and a second target trajectory, and the motion time of the first target trajectory being before the motion time of the second target trajectory; A second acquisition unit for acquiring the first trajectory parameter of the first target trajectory and the second trajectory parameter of the second target trajectory; A calculation unit for calculating the first velocity vector data of the first target trajectory based on the first spatial coordinate information where the first target trajectory is located, and calculating the second velocity vector data of the second target trajectory based on the second spatial coordinate information where the second target trajectory is located; A judgment processing unit for determining the change result of the sub-directions of each axis of the second target trajectory relative to the sub-directions of each axis of the first target trajectory based on the first velocity vector data and the second velocity vector data; the sub-directions of each axis include the horizontal axis direction, the vertical axis direction, and the longitudinal axis direction; An output unit for performing look-ahead speed planning on the motion trajectory of the industrial controller based on the first trajectory parameter, the second trajectory parameter, and the change result; Wherein, performing look-ahead speed planning on the motion trajectory of the industrial controller based on the first trajectory parameter, the second trajectory parameter, and the change result, includes: If the change result is that the sub-directions of each axis of the second target trajectory do not change relative to the sub-directions of each axis of the first target trajectory, then based on the first trajectory parameter and the second trajectory parameter, calculate the maximum allowable transition speed of each axis of the first target trajectory; Determine the transition speed with the smallest value among the maximum allowable transition speeds of each axis of the first target trajectory as the minimum step-over transition speed of the first target trajectory; Use the minimum step-over transition speed of the first target trajectory as the highest target speed when entering the second target trajectory, so that the machining tool controlled by the industrial controller directly enters the second target trajectory after reaching the highest target speed within the first target trajectory.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of a continuous-trajectory-based look-ahead speed planning method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of a continuous-trajectory-based look-ahead speed planning method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Continuous trajectory planning transition method for robot tail end
CN105710881A
Track planning method and device and computer readable storage medium
CN113485250A