S-shaped Velocity Planning Method, Device, Computer Equipment and Storage Medium
By obtaining motion parameters and calculating the target speed type in real time in a five-axis CNC machine tool, the problem that the traditional S-shaped speed planning method cannot be applied online is solved, and real-time response and stable control are achieved during the interpolation process.
Patent Information
- Application Number
- CN202111505841.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2041-12-10
AI Technical Summary
The traditional S-shaped speed planning method cannot be applied to the online environment of five-axis CNC machine tools, especially when information changes during the interpolation process or the tool position is affected by errors, it cannot respond in real time.
An S-shaped speed planning method is provided, by obtaining motion parameters at the starting point of the current interpolation cycle, calculating the first critical displacement and target speed type, determining the current speed change stage, and controlling the tool speed change movement according to the target motion parameters, so as to realize closed-loop operation in an online real-time environment.
During the interpolation process, it can respond to information changes or tool position errors in real time, ensuring that the tool moves according to the S-shaped speed change rules, and improving the stability and adaptability of the machine tool.
Smart Images

Figure CN114253221B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of numerical control machining, and more specifically, relates to an S-shaped speed planning method, device, computer device, and storage medium. Background Art
[0002] The S-shaped speed change rule is a speed control rule widely applied in the numerical control field. Its greatest feature lies in the continuous acceleration during the speed change process, thereby reducing the flexible impact introduced by the sudden change of acceleration, improving the stability of the machine tool, and being beneficial to optimizing the machining quality and extending the service life of the machine tool.
[0003] In order to enable the controlled object to move according to the required S-shaped speed change rule, S-shaped speed planning is required. Traditional S-shaped speed planning is to calculate the speed-time curve that satisfies the S-shaped speed change rule on each tool path segment before the interpolation process, given the motion parameters of each tool path segment on the entire tool path, as well as information such as the starting and ending speeds. During the interpolation process, interpolation is performed according to the previously calculated curve.
[0004] It can be seen that the traditional S-shaped speed planning method is carried out in an offline environment, which requires prior knowledge of the motion parameters of each tool path segment on the entire tool path, as well as information such as the starting and ending speeds. If some information during the interpolation process changes (for example, the user adjusts the feed rate, causing the maximum speed of some segments to change), or some calculation information of some segments cannot be known in advance, the traditional method is no longer applicable, that is, the traditional offline S-shaped speed planning method cannot be applied in a real-time environment. Summary of the Invention
[0005] The purpose of the present invention is to provide an S-shaped speed planning method, aiming to solve the technical problem that the traditional S-shaped speed planning method in a five-axis numerical control machine tool cannot be applied to an online environment where the interpolation process has already started.
[0006] To achieve the above purpose, in a first aspect, the present invention provides an S-shaped speed planning method, including the steps of:
[0007] At the start of the current interpolation cycle, obtain the motion parameters of the current tool path segment, where the motion parameters include the current speed, current acceleration, ending speed, and remaining interpolation segment length;
[0008] According to the motion parameters, calculate the first critical displacement, where the first critical displacement represents the shortest displacement required for the tool to change speed from the current speed to the ending speed according to the S-shaped speed change rule;
[0009] Determine the target speed change type according to the first critical displacement and the remaining interpolation segment length;
[0010] Determine the current acceleration stage in which the starting point is located according to the current speed, the current acceleration, and the acceleration stage included in the target acceleration type;
[0011] Determine the target motion parameters within the current interpolation cycle according to the current acceleration stage;
[0012] Control the tool to complete the acceleration motion of the current interpolation cycle according to the target motion parameters.
[0013] In a second aspect, the present application provides an S-shaped speed planning device, including:
[0014] An acquisition unit, configured to acquire motion parameters of the current tool path segment at the starting point of the current interpolation cycle, where the motion parameters include the current speed, the current acceleration, the end speed, and the remaining interpolation segment length;
[0015] A calculation unit, configured to calculate a first critical displacement according to the motion parameters, where the first critical displacement represents the shortest displacement required for the tool to accelerate from the current speed to the end speed according to the S-shaped acceleration rule;
[0016] A first determination unit, configured to determine the target acceleration type according to the first critical displacement and the remaining interpolation segment length;
[0017] A second determination unit, configured to determine the current acceleration stage in which the starting point is located according to the current speed, the current acceleration, and the acceleration stage corresponding to the target acceleration type;
[0018] A third determination unit, configured to determine the target motion parameters within the current interpolation cycle according to the current acceleration stage;
[0019] A control unit, configured to control the tool to complete the acceleration motion of the current interpolation cycle according to the target motion parameters.
[0020] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange; the foregoing computer program causes a computer to execute some or all of the steps described in the first aspect or the second aspect of the embodiment of the present invention.
[0021] In a fourth aspect, an embodiment of the present invention provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the foregoing computer program is operable to cause a computer to execute some or all of the steps described in the first aspect or the second aspect of the embodiment of the present invention. The computer program product may be a software installation package.
[0022] The beneficial effects of an S-shaped speed planning device provided by the present invention are as follows: The method provided in this application can operate in a closed-loop in an online real-time environment during the interpolation process. In each interpolation cycle, according to the feedback of the current speed, current acceleration, remaining interpolation segment length, and the current variable-speed stage, the target motion parameters of the current interpolation cycle are calculated, and the information such as the displacement and speed that need to be updated can be further calculated and sent to the lower computer for execution. Since this process can work in a closed-loop online environment, it is not necessary to know various information of the entire tool path segment in advance. And during the interpolation process, if some information changes, or the tool position is affected by errors, it can directly respond in the next interpolation cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only 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.
[0024] Figure 1 It is a schematic diagram of an S-shaped speed planning method;
[0025] Figure 2 It is a schematic diagram of the curves of various parameters of a typical S-shaped variable-speed rule changing with time;
[0026] Figure 3 It is a schematic diagram of the variable-speed type corresponding to the first critical displacement provided by the embodiment of the present invention;
[0027] Figure 4 It is a schematic flowchart of the process for obtaining the target speed provided by the embodiment of the present invention;
[0028] Figure 5 It is a schematic flowchart of the process for obtaining the target end speed provided by the embodiment of the present invention;
[0029] Figure 6 It is a schematic structural diagram of an S-shaped speed planning device. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0030] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the scope of protection of the present application.
[0031] In the description, claims and drawings of this application, terms such as "first", "second", "third" and "fourth" are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally further include steps or units not listed, or may optionally further include other steps or units inherent to these processes, methods, products or devices.
[0032] Reference to "embodiment" herein means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The phrase appearing in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0033] First, some terms in the embodiments of the present invention are explained to facilitate the understanding of those skilled in the art.
[0034] (1) A computer numerical control (CNC) machine tool is an automated machine tool equipped with a program control system. This control system can logically process a program with control codes or other symbolic instructions, decode it, represent it in coded numbers, and input it into the numerical control device through an information carrier. After arithmetic processing, the numerical control device issues various control signals to control the movement of the machine tool, and automatically processes the parts according to the shape and size required by the drawing.
[0035] (2) Interpolation is the process by which a machine tool numerical control system determines the tool movement trajectory according to a certain method. It can also be said that a method of calculating intermediate points between known points based on certain data on a known curve, also known as "densification of data points"; the numerical control device densifies the space between the starting point and the ending point of the curve described by the program segment according to the information of the input part program, thereby forming the required contour trajectory. This data densification function is called interpolation. In contour machining, the tool trajectory must strictly and accurately follow the part contour curve. The task of the interpolation operation is to densify the data points between the starting point and the ending point of the known machining trajectory curve. Specifically, within each interpolation cycle (a very short time, generally in milliseconds), a set of data for a tiny straight line segment is calculated according to the command and feed speed, and the tool moves along the tiny straight line segment. After several interpolation cycles, the tool moves from the starting point to the ending point to complete the machining of this section of the contour.
[0036] Such as Figure 2shows a typical S-shaped speed change curve. In Figure 2 , l represents displacement, V represents speed, a represents acceleration, J represents jerk, J m represents the maximum jerk, V m represents the maximum speed, A m represents the maximum acceleration, and t represents time. For a single tool path segment, the complete S-shaped speed change process can be divided into seven segments, namely, jerk-up, constant acceleration, jerk-down, constant speed, deceleration jerk, constant deceleration, and jerk-down deceleration, corresponding to Figure 1 0-t1, t1-t2, t2-t3, t3-t4, t4-t5, t5-t6, t6-t7 in respectively. According to different motion parameter restrictions, several of these speed change stages may be missing. Among them, at the starting point and the ending point of the tool path segment, the acceleration of the tool needs to be zero, and during the movement of the tool, the value of jerk can only be zero or ±J m .
[0037] Please refer to Figure 1 , Figure 1 which shows a flowchart of an S-shaped speed planning method provided by the present application. In the embodiments of this method, taking the numerical control machine tool applying this determination method as the execution main body as an example, it is described from the numerical control machine tool side. Specifically, it may include the following steps:
[0038] Step S101: At the starting point of the current interpolation cycle, obtain the motion parameters of the current tool path segment. The motion parameters include the current speed, current acceleration, end speed, and remaining interpolation segment length;
[0039] Step S102: According to the motion parameters, calculate the first critical displacement, which represents the shortest displacement required for the tool to change speed from the current speed to the end speed according to the S-shaped speed change curve;
[0040] Step S103: Determine the target speed change type according to the first critical displacement and the remaining interpolation segment length;
[0041] Step S104: Determine the current speed change stage where the starting point is located according to the current speed, current acceleration, and the speed change stages included in the target speed change type;
[0042] Step S105: Determine the target motion parameters within the current interpolation cycle according to the current speed change stage;
[0043] Step S106: Control the tool to complete the speed change motion of the current interpolation cycle according to the target motion parameters.
[0044] Specifically, the starting point of the current interpolation cycle can be the starting point of the entire tool path segment or other positions other than the starting point of the tool path segment. When the starting point of the current interpolation cycle is the starting point of the tool path segment, the current acceleration is zero; when the starting point of the current interpolation cycle is not the starting point of the tool path segment, the current acceleration may not be zero. The end speed is the speed at the end of the tool path segment planned before the starting point of the current interpolation cycle, and the remaining interpolation segment length is the distance between the current position and the end of the tool path segment.
[0045] After obtaining the current speed, current acceleration, end speed, and remaining interpolation segment length, calculate the first critical displacement according to these motion parameters. The first critical displacement represents the shortest displacement required for the tool to change speed from the current speed to the end speed according to the S-shaped variable speed curve.
[0046] Specifically, in this embodiment, when calculating the first critical displacement, specific analysis needs to be carried out according to different situations. Figure 3 Ten variable speed types corresponding to the first critical displacement are shown. The curves in the figure represent the variation law of speed with time. The analysis process is as follows:
[0047] 1. When V e -V c ≥0 and A C ≥0, V e represents the end speed, V c represents the current speed, A C represents the current acceleration. At this time, there are the following three situations:
[0048] (1). Let dV1 = V e -V c , If dV1≥dV3, the S-shaped variable speed type corresponding to the first critical displacement is as shown in ① in Figure 3 . The variable speed process of the tool from the current position to the end is plus-acceleration - uniform acceleration (if dV1 = dV3, there is no uniform acceleration stage) - minus-acceleration, and the maximum acceleration A m can be reached.
[0049] The displacement in the plus-acceleration stage where t Aacc =(A m -A c ) / J m ;
[0050] The displacement in the uniform acceleration stage where,
[0051] The displacement in the minus-acceleration stage where t Adec =Am / J m ,V2 = V1 + A m *t Acon ;
[0052] At this time, the first critical displacement S1 = L1 + L2 + L3.
[0053] (2) Let dV1 = V e - V c , If dV1 < dV3 and dV1 > dV2, the S-shaped speed change type corresponding to the first critical displacement is as shown in Figure 3 ② below. The speed change process of the tool from the current position to the end point is positive acceleration - negative acceleration, and the maximum acceleration A cannot be reached m .
[0054] Displacement in the positive acceleration stage where t Aacc =(A m-new - A c ) / J m ,
[0055] Displacement in the negative acceleration stage where t Adec = A m-new / J m ;
[0056] At this time, the first critical displacement S1 = L1 + L2.
[0057] (3) Let dV1 = V e - V c , If dV1 < dV3 and dV1 ≤ dV2, the S-shaped speed change type corresponding to the first critical displacement is as shown in Figure 3 ③ below. The speed change process of the tool from the current position to the end point is negative acceleration - positive deceleration - negative deceleration.
[0058] Sum of displacements in the negative acceleration and positive deceleration stages where the actually achievable maximum acceleration t Dacc =(A m-new + A c ) / J m ;
[0059] Displacement in the negative deceleration stage where t Ddec = A m / J m ,
[0060] At this time, the first critical displacement S1 = L1 + L2.
[0061] 2. When V e -V c ≥0 and A C <0, there are the following two cases at this time:
[0062] (1). Let dV1 = V e -V c , If dV1 ≥ dV3, the S-shaped speed change type corresponding to the first critical displacement is as shown in ④ of Figure 3 . The speed change process of the tool from the current position to the end point is decelerating-deceleration - accelerating-acceleration - uniform acceleration (if dV1 = dV3, there is no uniform acceleration stage) - decelerating-acceleration, and the maximum acceleration A m can be achieved.
[0063] Here, the decelerating-deceleration and accelerating-acceleration sections are combined into one section because their jerk is both J m , and the displacement of the combined decelerating-deceleration and accelerating-acceleration sections where, t Aacc =(A m -A c ) / J m , and at this time A c takes a negative value;
[0064] The displacement of the uniform acceleration stage where,
[0065] The displacement of the decelerating-acceleration stage where, t Adec =A m / J m , V2 = V1 + A m *t Acon ;
[0066] At this time, the first critical displacement S1 = L1 + L2 + L3.
[0067] (2). Let dV1 = V e -V c , If dV1 < dV3, the S-shaped speed change type corresponding to the first critical displacement is as shown in ⑤ of Figure 3 . The speed change process of the tool from the current position to the end point is decelerating-deceleration - accelerating-acceleration - decelerating-acceleration, and the maximum acceleration A m cannot be achieved.
[0068] Here, the decelerating-deceleration and accelerating-acceleration sections are combined into one section because their jerk is both J m , and the displacement of the combined decelerating-deceleration and accelerating-acceleration sections where t Aacc =(A m-new -A c ) / J m ,
[0069] The displacement in the acceleration - deceleration phase where t Adec =A m-new / J m ;
[0070] At this time, the first critical displacement S1 = L1 + L2.
[0071] 3. When V e -V c <0 and A C <0, there are the following three cases:
[0072] (1). Let dV1 = V e -V c , If dV1 ≤ -dV3, the S - shaped speed - change type corresponding to the first critical displacement is as shown in ⑧ of Figure 3 . The speed - change process of the tool from the current position to the end point is acceleration - deceleration - uniform deceleration (if dV1 = -dV3, there is no uniform deceleration phase) - deceleration - deceleration, and the maximum acceleration A m can be achieved.
[0073] The displacement in the acceleration - deceleration phase where t Dacc =(A m +A c ) / J m ;
[0074] The displacement in the uniform deceleration phase where
[0075] The displacement in the deceleration - deceleration phase where t Ddec =A m / J m , V3 = V2 - A m *t Dcon ;
[0076] At this time, the first critical displacement S1 = L1 + L2 + L3.
[0077] (2). Let dV1 = V e -V c , If dV1 > -dV3 and dV1 > -dV2, the S-shaped speed change type corresponding to the first critical displacement at this time is as shown in Figure 3 ⑥ in it. The speed change process of the tool from the current position to the end point is deceleration-deceleration - acceleration-acceleration - deceleration-acceleration, and the maximum acceleration A cannot be reached m .
[0078] Here, the deceleration-deceleration section and the acceleration-acceleration section are combined into one section because their jerk is both J m . After combination, the displacement of the deceleration-deceleration section and the acceleration-acceleration section where, t Aacc =(A m-new -A c ) / J m ,
[0079] The displacement of the deceleration-acceleration stage where, t Adec =A m-new / J m ;
[0080] At this time, the first critical displacement S1 = L1 + L2.
[0081] (3) Suppose dV1 = V e -V c , If dV1 > -dV3 and dV1 ≤ -dV2, the S-shaped speed change type corresponding to the first critical displacement at this time is as shown in Figure 3 ⑦ in it. The speed change process of the tool from the current position to the end point is acceleration-deceleration - deceleration-deceleration, and the maximum acceleration A cannot be reached m .
[0082] The displacement corresponding to the acceleration-deceleration stage where the actually achievable maximum acceleration t Dacc =(A m-new +A c ) / J m ;
[0083] The displacement of the deceleration-deceleration stage where, t Ddec =A m / J m ,
[0084] At this time, the first critical displacement S1 = L1 + L2.
[0085] 4. When V e -V c < 0 and A C ≥ 0, there are the following two situations at this time:
[0086] (1). Let dV1 = V e -V c , If dV1 ≤ -dV3, the S-shaped speed change type corresponding to the first critical displacement is as shown in ⑨ in Figure 3 . The speed change process of the tool from the current position to the end point is deceleration-acceleration - acceleration-deceleration - uniform deceleration (if dV1 = -dV3, there is no uniform deceleration stage) - deceleration-deceleration, and the maximum acceleration A can be achieved m .
[0087] The displacement when the deceleration-acceleration and acceleration-deceleration stages are combined where t Dacc =(A m +A c ) / J m ;
[0088] The displacement of the uniform deceleration stage where
[0089] The displacement of the deceleration-deceleration stage where t Ddec =A m / J m , V3 = V2 - A m *t Dcon ;
[0090] At this time, the first critical displacement S1 = L1 + L2 + L3.
[0091] (2). Let dV1 = V e -V c , If dV1 > -dV3, the S-shaped speed change type corresponding to the first critical displacement is as shown in ⑩ in Figure 3 . The speed change process of the tool from the current position to the end point is deceleration-acceleration - acceleration-deceleration - deceleration-deceleration, and the maximum acceleration A cannot be achieved m .
[0092] The sum of the displacements of the deceleration-acceleration and acceleration-deceleration stages where the actually achievable maximum acceleration t Dacc =(A m-new +A c ) / J m ;
[0093] The displacement of the deceleration-deceleration stage where t Ddec =A m / J m ,
[0094] At this time, the first critical displacement S1 = L1 + L2.
[0095] After calculating the first critical displacement, determine the target variable-speed type according to the relationship between the first critical displacement S1 and the remaining interpolation segment length.
[0096] Specifically, in this embodiment, when the first critical displacement is equal to the remaining interpolation segment length, the target variable-speed type can be determined as the variable-speed type corresponding to the above first critical displacement. For example, when the first critical displacement is equal to the remaining interpolation segment length, and when V e -V c ≥0, A C ≥0 and when, the target variable-speed type is Figure 3 the variable-speed type shown in ① of, and the variable-speed process of the tool from the current position to the end point is plus-plus acceleration - uniform acceleration (if then there is no uniform acceleration stage) - minus acceleration, and the maximum acceleration A m can be achieved.
[0097] In this embodiment, the above step "determine the target variable-speed type according to the first critical displacement and the remaining interpolation segment length" further includes:
[0098] When the first critical displacement is greater than the remaining interpolation segment length, correct the end point speed to obtain the target end point speed;
[0099] Determine the target variable-speed type according to the target end point speed.
[0100] Specifically, when the first critical displacement is greater than the remaining interpolation segment length, it means that the remaining interpolation segment length is not enough for the displacement required by the original S-shaped planning. In this embodiment, the method adopted is to correct the originally planned end point speed obtained. The flow schematic diagram of the correction method is as Figure 5 shown, specifically as follows.
[0101] First, judge whether the current acceleration is equal to zero. When the current acceleration is equal to zero, the correction method is as follows:
[0102] Specifically, when correcting the end point speed, it is first necessary to determine the critical speed. There are two situations: the speed-up process and the speed-down process. The following will explain how to specifically correct the end point speed in these two situations.
[0103] First, explain the speed-up process, that is, V c ≤V e . When the current speed is less than or equal to the end point speed, the above critical speed includes the speed-up critical speed. Determine the speed-up critical speed according to the sum of the square of the maximum acceleration and the ratio of the maximum plus-plus acceleration to the current speed.
[0104] For example, the expression for determining the critical speed during acceleration is as follows:
[0105] V th↑ = V c + A m 2 / J m
[0106] In the above formula, V th↑ represents the critical speed during acceleration, which can be understood as the speed when the current speed accelerates with the maximum jerk to the maximum acceleration and then decelerates with the maximum jerk until the acceleration is 0. The time in the jerk acceleration stage and the jerk deceleration stage is the same.
[0107] According to the above critical speed during acceleration, the expression for calculating the critical displacement during acceleration is:
[0108] S th↑ = (V c + V th↑ ) * A m / J m
[0109] In the above formula, S th↑ represents the critical displacement during acceleration, which represents the displacement from the current speed to the critical speed during acceleration according to the S-shaped variable speed rule.
[0110] After determining the critical displacement during acceleration, compare the critical displacement during acceleration with the remaining interpolation segment length. At this time, there are two cases. When the critical displacement during acceleration is less than or equal to the remaining interpolation segment length, it means that during the interpolation process of this interpolation segment, the critical speed during acceleration can be reached according to the S-shaped variable speed rule. At this time, the first objective function regarding the target end speed can be determined.
[0111] In this case, the motion process of the tool is as follows: when the critical displacement during acceleration is equal to the remaining interpolation segment length, the tool accelerates with the maximum jerk to the maximum acceleration at the current position and then decelerates with the maximum jerk until the acceleration is 0. The time in the jerk acceleration stage and the jerk deceleration stage is the same; when the critical displacement during acceleration is less than the remaining interpolation segment length, the tool accelerates with the maximum jerk to the maximum acceleration at the current position, then uniformly accelerates at the maximum acceleration for a period of time, and then decelerates with the maximum jerk until the acceleration is 0. The time in the jerk acceleration stage and the jerk deceleration stage is the same. Both of these cases correspond to the first objective function. The first objective function is used to characterize the relationship between the displacement when the maximum acceleration can be reached and the target end speed.
[0112] At this time, the first objective function can be expressed as:
[0113] f(x) = a0x 2+b0x + c0
[0114] where x is the target end speed.
[0115] The three coefficients of the first objective function are
[0116]
[0117] Then when the value of the first objective function is the remaining interpolation segment length, the first objective equation in the form of a quadratic equation of one variable is obtained; solving the first objective equation gives the target end speed; the quadratic coefficient of the first objective equation is obtained according to the maximum acceleration; the linear coefficient of the first objective equation is obtained according to the maximum acceleration and the maximum jerk; the constant term of the first objective equation is obtained according to the current speed, the maximum acceleration, and the maximum jerk.
[0118] For example, the first objective equation can be expressed as:
[0119] a0x 2 +b0x + d = 0
[0120] In the above formula,
[0121] where S represents the remaining interpolation segment length.
[0122] It is easy to know that at this time a0 and b0 are positive and d is negative. From the quadratic formula of the quadratic equation of one variable, this equation must have real roots. Take the real root not less than V th↑ That is,
[0123]
[0124] In the above formula, V e-new represents the target end speed. Subsequently, this symbol will be uniformly used to represent the target end speed and will not be elaborated further.
[0125] The corrected target end speed is obtained, and the algorithm ends.
[0126] In the second case of the acceleration process, that is, when the acceleration critical displacement is greater than the remaining interpolation segment length, it means that during the interpolation process of this interpolation segment, the acceleration critical speed cannot be reached according to the S-shaped variable speed rule, that is, the maximum acceleration cannot be reached.
[0127] In this case, the movement process of the tool is as follows: The tool accelerates with the maximum jerk to an acceleration less than the maximum acceleration at the current position, and then decelerates with the maximum jerk until the acceleration is 0. The time of the acceleration phase and the deceleration phase is the same. The second objective function is used to characterize the relationship between the displacement when the maximum acceleration cannot be reached and the target end speed.
[0128] The second objective function for the target end speed is as follows:
[0129]
[0130] When the value of the second objective function is the remaining interpolation segment length, a second objective equation in the form of a cubic equation of one variable is obtained; the second objective equation is solved to obtain the target end speed; the coefficient of the cubic term in the second objective equation is a constant; the coefficients of the quadratic term and the linear term in the second objective equation are both obtained based on the current speed; the constant term in the second objective equation is obtained based on the interpolation segment length, the maximum jerk, and the current speed.
[0131] For example, according to the second objective function and the remaining interpolation segment length S, the second objective equation f(x) = S is determined, both sides of the second objective equation are squared, and after simplification, the first cubic equation of one variable ax 3 + bx 2 + cx + d = 0 is solved. The four coefficients of this equation are
[0132]
[0133] It is easy to know from Shengjin's formula that the solution of this equation is one real root and a pair of conjugate complex roots. The root-finding process of Shengjin's formula is given here:
[0134] First, calculate the three Shengjin coefficients of this equation,
[0135]
[0136] Furthermore, there is
[0137] The corrected end speed is
[0138]
[0139] The corrected target end speed is obtained, and the algorithm ends.
[0140] During the deceleration process, that is, V c > V e , at this time, it is necessary to determine the relationship between the displacement required to change the speed from the current speed to the target end speed according to the S-shaped speed change rule and the target end speed, and then find the final target end speed according to this relationship.
[0141] During the acceleration process, the greater the target end speed, the longer the required displacement. However, during the deceleration process, it is not that the smaller the target end speed, the greater the required displacement, and specific objective functions need to be discussed.
[0142] In one embodiment, the above critical speed includes a deceleration critical speed, and the deceleration critical speed represents the speed calculated by accelerating and decelerating the tool from the current speed to the maximum acceleration at the maximum jerk, and then decelerating from the maximum acceleration to zero acceleration at the maximum jerk;
[0143] First, according to the current speed, and the difference between the square of the maximum acceleration and the ratio of the maximum acceleration to the maximum jerk, the acceleration critical speed is determined.
[0144] For example, when V th↓ = V c - A m 2 / J m , V th↓ is less than or equal to 0, V th↓ represents the deceleration critical speed, and the deceleration critical speed represents the speed calculated by accelerating and decelerating from the current speed to the maximum acceleration (at this time the maximum acceleration is negative) at the maximum jerk, and then decelerating from the maximum acceleration to zero acceleration at the maximum jerk. The time of the jerk acceleration stage and the jerk deceleration stage is the same. When At this time, the maximum acceleration cannot be reached or just reaches the maximum acceleration during the speed change. In this case, the motion process of the tool is: the tool accelerates and decelerates from the starting point to an acceleration less than or equal to the maximum acceleration at the maximum jerk, and then decelerates from this acceleration to zero acceleration at the maximum jerk. The time of the acceleration and deceleration stages is the same.
[0145] At this time, the third objective function regarding the target end speed can be determined:
[0146]
[0147] The domain of the third objective function is [0, V c ).
[0148] When the value of the third objective function is the remaining interpolation segment length, the third objective equation in the form of a cubic equation of one variable is obtained; the third objective equation is solved to obtain the target end speed; the cubic term coefficient in the third objective equation is a constant; the quadratic term coefficient and the linear term coefficient in the second objective equation are both obtained according to the current speed; the constant term in the second objective equation is obtained according to the remaining interpolation segment length, the maximum jerk and the current speed.
[0149] For example, according to the third objective function and the remaining interpolation segment length S, the third objective equation f(x) = S is constructed, and the third objective equation is simplified to obtain the second cubic equation of one variable a3x 3 + b3x 2 + c3x + d3 = 0;
[0150]
[0151] Solve the third target equation to obtain the corrected target end velocity. There are cases where two solutions appear. To ensure the velocity smoothness during the interpolation process, select the larger solution.
[0152] When That is, V th↓ = V c - A m 2 / J m > 0, there are two cases. One is that the maximum acceleration can be reached during the S-shaped speed change process, and the other is that the maximum acceleration cannot be reached.
[0153] In one embodiment, the above-mentioned determination of the objective function regarding the target end velocity based on the critical velocity further includes:
[0154] When the current velocity is greater than the end velocity and the deceleration critical velocity is greater than zero, determine the objective function as a piecewise function with the deceleration critical velocity as the demarcation point. The piecewise function includes a fourth objective function and a fifth objective function. The domain of the fourth objective function is [0, V th↓ , and the domain of the fifth objective function is (V th↓ , V c ), where V th↓ represents the deceleration critical velocity, and V c represents the current velocity.
[0155] During the S-shaped speed change process, when the maximum acceleration is reached, it indicates that the range of the target end velocity is [0, V th↓ . In this case, the motion process of the tool is as follows: when the target end velocity is exactly equal to V th↓ , accelerate and decelerate from the current velocity to the maximum acceleration at the maximum jerk (at this time, the maximum acceleration is negative), and then decelerate from the maximum acceleration to an acceleration of 0 at the maximum jerk. The time of the acceleration and deceleration phases is the same; when the target end velocity is less than V th↓ , accelerate and decelerate from the current velocity to the maximum acceleration at the maximum jerk (at this time, the maximum acceleration is negative), then decelerate uniformly at the maximum acceleration for a period of time, and finally decelerate from the maximum acceleration to an acceleration of 0 at the maximum jerk. The time of the acceleration and deceleration phases is the same.
[0156] When the maximum acceleration cannot be reached, it indicates that the range of the target end velocity is (V th↓ , V c ). In this case, the motion process of the tool is as follows: the tool accelerates and decelerates from the current position to an acceleration greater than the maximum acceleration at the maximum jerk, and then decelerates from the acceleration greater than the maximum acceleration to an acceleration of 0 at the maximum jerk. The time of the acceleration and deceleration phases is the same.
[0157] Thus, it can be determined that the objective function is a piecewise function with the critical deceleration speed as the demarcation point. This piecewise function includes a fourth objective function and a fifth objective function. Among them, the domain of the fourth objective function is [0, V th↓ , and the domain of the fifth objective function is (V th↓ ,V c ).
[0158] Specifically, when ,
[0159]
[0160] Then, according to the piecewise function f(x) and the remaining interpolation segment length S, a fourth objective equation f(x) = S is constructed, and the fourth objective equation is solved to obtain the target end speed.
[0161] When solving the fourth objective equation, since f(x) is a piecewise function, for the convenience of solution, the monotonicity of f(x) is discussed. The following directly gives the conclusion, and the specific derivative derivation process is omitted.
[0162] 1. When f(x) is monotonically increasing on and monotonically decreasing on . The maximum value
[0163] f(x) is a piecewise function and is a quadratic function in the interval x ∈ [0, V th↓ . Moreover The function value at the starting point
[0164] If This is a critical situation, exactly a quadratic function in the interval, while is a radical function.
[0165] 2. When At this time, it is monotonically increasing on and monotonically decreasing on . The point where the maximum value is obtained belongs to the quadratic function rather than the radical function.
[0166] Based on the above monotonicity conclusions, the ultimate goal is to solve the fourth objective equation f(x) = S, and the following conclusions can be obtained:
[0167] First, for both of the above two cases, there will be no S ≥ f(x) max , because in this case, there is no need to correct the end speed, and the original end speed V eIt is always possible to satisfy that the displacement required to complete the S-shaped speed change rule from the current speed to the end speed does not exceed the remaining interpolation segment length S; when f(x) max > S ≥ f(0), there are two solutions, a higher one and a lower one, while when S < f(0), there is only one solution. To ensure the smoothness of the interpolation speed, this application stipulates that when there are two solutions, the larger one is always selected.
[0168] To solve the fourth target equation f(x) = S, two characteristic equations are given here:
[0169]
[0170] In the above formula, the values of each coefficient are respectively:
[0171]
[0172] When , select the above equation (*) to solve the final target end speed, and select the real root within the interval as the target end speed calculation result, and the algorithm ends.
[0173] When , first calculate the value of f(V th↓ ). If the remaining interpolation segment length S ≤ f(V th↓ ), then select the characteristic equation (*) to solve, and select the real root within [V th↓ , V c as the calculation result of V e-new ; conversely, if S > f(V th↓ ), then the equation (**) should be selected to solve, and the calculation result is two real roots. Here, the solution within the interval is selected, and the algorithm ends.
[0174] Through the above method, the target end speed that meets the S-shaped speed change rule after correction can be determined according to the obtained tool motion parameters.
[0175] In this embodiment, when the current acceleration is not zero, the above method for finding the target end speed cannot be directly used to solve the target speed. The method adopted is to first compensate the current acceleration to zero, and then solve according to the above method.
[0176] In this embodiment, when the first critical displacement is greater than the remaining interpolation segment length, the end speed is corrected to obtain the target end speed, including:
[0177] When the current acceleration is not zero and there is a situation where the signs of the acceleration values at two moments are opposite among the variable speed types corresponding to the first critical displacement, calculate the first compensation time, where the first compensation time represents the time required to change the speed from the current acceleration to zero acceleration at the maximum jerk;
[0178] Calculate the first corrected starting speed according to the first compensation time, where the acceleration corresponding to the first corrected starting speed is zero;
[0179] Calculate the first corrected remaining interpolation segment length according to the first corrected starting speed;
[0180] Calculate the target end speed according to the first corrected starting speed, the first corrected remaining interpolation segment length, and the motion parameters.
[0181] Specifically, among the ten variable speed types corresponding to the first critical displacement listed above, Figure 3 in ③, ④, ⑤, ⑥, ⑨, and ⑩, there is a situation where the signs of the acceleration values at two moments are opposite. At this time, it is necessary to calculate the first compensation time, where the first compensation time represents the time required to change the speed from the current acceleration to zero acceleration at the maximum jerk.
[0182] The first compensation time t cor1 has the following expression:
[0183]
[0184] The first corrected starting speed V c_cor1 has the following expression:
[0185]
[0186] The first corrected remaining interpolation segment length dS cor1 has the following expression:
[0187]
[0188] In the above formula, dS represents the remaining interpolation segment length
[0189] Replace the current speed V c_cor with the first corrected starting speed V, c replace the remaining interpolation segment length with the first corrected remaining interpolation segment length dS cor Under other unchanged conditions, calculate the target end speed according to the above method for correcting the end speed when the current acceleration is zero. Since the method is the same, it will not be elaborated here.
[0190] It can be understood that when there is a situation where the signs of the acceleration values at two moments are opposite, when correcting the terminal velocity, the variable-speed process from the current acceleration to zero acceleration at the maximum jerk in the variable-speed type corresponding to the first critical displacement is truncated, and the remaining part is solved for the target terminal velocity according to the method of correcting the terminal velocity when the acceleration is zero as described above.
[0191] In this embodiment, when the first critical displacement is greater than the remaining interpolation segment length and the terminal velocity is corrected to obtain the target terminal velocity, it further includes:
[0192] When the current acceleration is not zero and there is no situation where the signs of the acceleration values at two moments in the variable-speed type corresponding to the first critical displacement are opposite, calculate the second compensation time, where the second compensation time represents the time required for the acceleration to change from zero to the current acceleration at the maximum jerk;
[0193] Calculate the second corrected starting velocity according to the second compensation time, where the acceleration corresponding to the second corrected starting velocity is zero;
[0194] Calculate the second corrected remaining interpolation segment length according to the second corrected starting velocity;
[0195] Calculate the target terminal velocity according to the second corrected starting velocity, the second corrected remaining interpolation segment length, and the motion parameters.
[0196] Specifically, among the ten variable-speed types corresponding to the first critical displacement listed above, Figure 3 for ①, ②, ⑦, and ⑧, there is no situation where the signs of the acceleration values at two moments are opposite. At this time, the second compensation time needs to be calculated, and the second compensation time represents the time required for the acceleration to change from zero to the current acceleration at the maximum jerk.
[0197] The second compensation time t cor2 has the following expression:
[0198]
[0199] The second corrected starting velocity V c_cor2 has the following expression:
[0200]
[0201] The second corrected remaining interpolation segment length dS cor2 has the following expression:
[0202]
[0203] In the above formula, dS represents the remaining interpolation segment length.
[0204] Regarding the second corrected starting velocity Vc_cor2 Replace the current speed V c and the second corrected remaining interpolation segment length dS cor2 Replace the remaining interpolation segment length, with other conditions remaining unchanged. Calculate the target end speed according to the above method for correcting the end speed when the current acceleration is zero. Since the method is the same, it will not be elaborated here.
[0205] It can be understood that when there is no situation where the signs of the acceleration values at two moments are opposite, when correcting the end speed, the variable speed type corresponding to the first critical displacement is added to the S-shaped variable speed process in which the acceleration changes from zero to the current acceleration at the maximum jerk. Then, calculate the target end speed according to the above method for correcting the end speed when the acceleration is zero for the added variable speed type.
[0206] In this embodiment, the above step "determine the target variable speed type according to the first critical displacement and the remaining interpolation segment length" further includes:
[0207] When the first critical displacement is less than the remaining interpolation segment length, calculate the target speed, where the target speed is the maximum speed that can be reached in the target variable speed type;
[0208] Determine the target variable speed type according to the target speed.
[0209] When the first critical displacement is less than the remaining interpolation segment length, in order to complete the S-shaped variable speed process between the start point and the end point of the current interpolation cycle, the method adopted in this application is to obtain a target speed. The flow chart for obtaining the target speed is as Figure 4 shown. The target speed is the maximum speed of its corresponding target variable speed type, and its corresponding acceleration is zero. The tool accelerates from the current position to the target speed and then decelerates from the target speed to the end speed. Different values of the target speed result in various situations for the acceleration and deceleration processes. The following analyzes how to obtain the target speed and the various situations of the acceleration and deceleration processes.
[0210] First, when the current acceleration is equal to zero, the method for obtaining the target speed is as follows:
[0211] According to different values of the current speed, end speed, maximum speed, maximum acceleration, and maximum jerk, there are various situations for the target speed equation for obtaining the target speed. In this embodiment, the first target speed equation, the second target speed equation, the third target speed equation, and the fourth target speed equation are used to represent the target speed equations in different situations.
[0212] The method for determining the first target speed equation includes the steps:
[0213] Calculate the first demarcation speed; the first demarcation speed is equal to the sum of the larger of the current speed and the end speed and the speed increment, and the speed increment is equal to the ratio of the square of the maximum acceleration to the maximum jerk;
[0214] Calculate the second critical displacement according to the first demarcation speed;
[0215] When the second critical displacement is greater than the remaining interpolation segment length, calculate the absolute value of the difference between the end speed and the current speed;
[0216] When the absolute value of the difference between the end speed and the current speed is less than the speed increment, calculate the second demarcation speed; the second demarcation speed is equal to the sum of the smaller of the current speed and the end speed and the speed increment;
[0217] Calculate the third critical displacement according to the second demarcation speed;
[0218] When the third critical displacement is greater than the remaining interpolation segment length, determine the first target speed equation for the target speed according to the current speed, the end speed, the maximum jerk, and the remaining interpolation segment length.
[0219] The expression of the first demarcation speed is:
[0220]
[0221] V b represents the first demarcation speed. Then, find the corresponding second critical displacement according to the first demarcation speed. The second critical displacement refers to the shortest displacement required for the tool to accelerate from the current speed to the first demarcation speed at the maximum jerk and then decelerate from the first demarcation speed to the end speed at the maximum jerk, and the acceleration is 0 at the corresponding positions of the current speed, the first demarcation speed, and the end speed.
[0222] The expression for calculating the second critical displacement is:
[0223]
[0224] If the second critical displacement does not exceed the remaining interpolation segment length, it means that the remaining interpolation segment length can support the tool to accelerate to the first demarcation speed, and at this time the target speed is greater than or equal to the first demarcation speed. The corresponding fourth target speed equation can be determined as:
[0225]
[0226] In the above formula, V t represents the target speed, and S represents the remaining interpolation segment length.
[0227] After simplifying the above formula, it becomes a standard quadratic equation ax 2+bx + c = 0 can be directly solved. The three coefficients of this equation are respectively
[0228]
[0229] The target speed must be positive, and the calculation result of the target speed can be obtained from the quadratic formula:
[0230]
[0231] When the second critical displacement is greater than the remaining interpolation segment length, it indicates that the remaining interpolation segment length is not sufficient to support the tool to accelerate to the first demarcation speed. At this time, calculate the absolute value ε of the difference between the current speed and the end speed, and compare this absolute value with the speed increment for comparison. When continue to calculate the second demarcation speed. The second demarcation speed V a is equal to the sum of the smaller of the current speed and the end speed and the speed increment, that is:
[0232]
[0233] Then, according to the second demarcation speed, find the corresponding third critical displacement. The third critical displacement refers to the shortest displacement required for the tool to accelerate from the current speed to the second demarcation speed with the maximum jerk and then decelerate from the second demarcation speed to the end speed with the maximum jerk. The acceleration is 0 at the corresponding positions of the current speed, the second demarcation speed, and the end speed.
[0234] The specific expression of the third critical displacement S3 is:
[0235]
[0236] Then compare the third critical displacement with the remaining interpolation segment length to determine whether the maximum acceleration can be achieved during the entire movement process. When the third critical displacement is greater than the remaining interpolation segment length, it indicates that the maximum acceleration cannot be achieved. At this time, the first target speed equation can be determined as:
[0237]
[0238] After directly simplifying the first target speed equation, it becomes a sixth-degree unary equation. Convert the two radical terms on the left side of the equal sign into quadratic polynomials respectively. Here, use T1 and T2 to represent the two radicals. The objective function y = T1 + T2, that is
[0239]
[0240] Let x = V t -V e , then there is
[0241]
[0242] Let \(x\) take values \(0\), \(0.5(V m -V e ), \((V m -V e ), that is, there are
[0243]
[0244] Substitute them into the two equations of \(T1\) and \(T2\), and there are
[0245]
[0246]
[0247] According to the three points \((x1, T 11 ), \((x2, T 12 ), \((x3, T 13 ), calculate the Lagrange quadratic interpolation polynomial of \(T1\)
[0248]
[0249] Similarly, according to the three points \((x1, T 21 ), \((x2, T 22 ), \((x3, T 23 ), calculate the Lagrange quadratic interpolation polynomial of \(T2\)
[0250]
[0251] and Add them together, and the estimation equation for the target speed can be obtained
[0252] (a1 + a2)x 2 +(b1 + b2)x + c1 + c2 = S
[0253] The left side of this equation is the target Lagrange quadratic interpolation polynomial, and the right side is the remaining interpolation segment length.
[0254] Use the quadratic formula to solve for \(x\), and then the estimated value of the target speed can be obtained
[0255]
[0256] Regard the estimated value of the target speed obtained above as the target speed, and control the tool movement according to this value.
[0257] When the third critical displacement is less than or equal to the remaining interpolation segment length, it means that the maximum acceleration can be achieved. At this time, the second target speed equation can be determined as:
[0258]
[0259] When it indicates that during the entire movement process, the maximum acceleration will inevitably be reached. If V e ≥V c , the maximum acceleration is reached between the distance corresponding to the current speed and the target speed; if V e <V c , the maximum acceleration is reached between the distance corresponding to the target speed and the end speed. At this time, the third target speed equation regarding the target speed can be determined:
[0260]
[0261] Solve the above first target speed equation, second target speed equation, third target speed equation, and fourth target speed equation to obtain the target speed V t .
[0262] When the current acceleration A c is not equal to zero, the method adopted in this application is to compensate the current acceleration to zero, and then obtain the target speed V t according to the above method.
[0263] In this embodiment, when the first critical displacement is less than the remaining interpolation segment length, calculating the target speed includes:
[0264] When the current acceleration is greater than zero, calculate the acceleration compensation time, and the acceleration compensation time represents the time corresponding to the acceleration increasing from zero to the current acceleration at the maximum jerk;
[0265] According to the acceleration compensation time, calculate the acceleration correction starting speed, and the acceleration corresponding to the acceleration correction starting speed is zero;
[0266] According to the acceleration correction starting speed, calculate the acceleration correction remaining interpolation segment length;
[0267] According to the acceleration correction starting speed, the acceleration correction remaining interpolation segment length, and the motion parameters, calculate the target speed.
[0268] The expression of the acceleration compensation time t cor3 is:
[0269]
[0270] The expression of the acceleration correction starting speed V c_cor3 is:
[0271]
[0272] The acceleration correction remaining interpolation segment length dS cor3The expression is:
[0273]
[0274] In the above formula, dS represents the remaining interpolation segment length.
[0275] Replace the starting speed V of the acceleration correction c_cor3 with the current speed V c , and replace the remaining interpolation segment length with the acceleration correction remaining interpolation segment length dS cor3 . With other conditions unchanged, calculate the target speed according to the method for obtaining the target speed when the current acceleration is zero as described above. Since the method is the same, it will not be elaborated here.
[0276] It can be understood that when the current acceleration is greater than zero, when calculating the target speed, the variable speed type corresponding to the first critical displacement is added to the S-shaped variable speed process in which the acceleration changes from zero to the current acceleration at the maximum jerk (jerk acceleration), and the target speed is solved according to the method for obtaining the target speed when the acceleration is zero for the added variable speed type.
[0277] In this embodiment, when the first critical displacement is less than the remaining interpolation segment length, calculating the target speed further includes:
[0278] When the current acceleration is less than zero, calculate the deceleration compensation time, where the deceleration compensation time represents the time corresponding to decelerating from the current acceleration to zero at the maximum jerk;
[0279] According to the deceleration compensation time, calculate the deceleration correction starting speed, where the acceleration corresponding to the deceleration correction starting speed is zero;
[0280] According to the deceleration correction starting speed, calculate the deceleration correction remaining interpolation segment length;
[0281] According to the deceleration correction starting speed, the deceleration correction remaining interpolation segment length, and the motion parameters, calculate the target speed.
[0282] The second compensation time t cor4 The expression is:
[0283]
[0284] The second correction starting speed V c_cor4 The expression is:
[0285]
[0286] The second correction remaining interpolation segment length dS cor4 The expression is:
[0287]
[0288] In the above formula, dS represents the remaining interpolation segment length.
[0289] Replace the starting speed V of the acceleration correction c_cor4 with the current speed V c , and the remaining interpolation segment length dS of the acceleration correction cor4 Replace the remaining interpolation segment length. With other conditions unchanged, calculate the target speed according to the method for obtaining the target speed when the current acceleration is zero as described above. Since the method is the same, it will not be elaborated here.
[0290] It can be understood that when the current acceleration is greater than zero, when calculating the target speed, the variable speed type corresponding to the first critical displacement truncates the S-shaped variable speed process in which the acceleration varies from the current acceleration to zero at the maximum jerk (deceleration), and the target speed is calculated for the truncated part according to the method for obtaining the target speed when the acceleration is zero as described above.
[0291] According to the method described above, the target end speed and the target speed can be obtained. Then, based on the obtained target end speed or target speed and the acquired motion parameters, each variable speed stage included in the target variable speed type is determined. The specific method is as follows.
[0292] For the target variable speed type corresponding to the target speed, set the target variable speed type to include a pre-variable speed stage and a post-variable speed stage. The pre-variable speed segment is the variable speed stage from the starting state (speed is V c , acceleration is A c ) to the target speed V t and the acceleration is 0. The variable speed stage from the state where the target speed is V t and the acceleration is 0 to the end speed V e is the post-variable speed segment. Determining each variable speed stage included in the target variable speed type includes:
[0293] Pre-variable speed stage:
[0294] 1. Calculate the high critical speed V ht and the low critical speed V lt :
[0295]
[0296] 2. Judge the sign of the starting acceleration. If the starting acceleration A c ≥0, jump to step 3; conversely, if A c <0, jump to step 4;
[0297] 3. Calculate the speed dividing boundary speed V b↑ :
[0298]
[0299] If V t> V ht , jump to step 5;
[0300] If V t < V lt , jump to step 6;
[0301] If V t ∈ [V lt , V ht , at this time, the maximum acceleration cannot be achieved. If V t ≥ V b↑ , then jump to step 7. Conversely, if V t < V b↑ , then jump to step 8.
[0302] 4. Calculate the deceleration boundary speed V b↓
[0303]
[0304] If V t > V ht , jump to step 9;
[0305] If V t < V lt , jump to step 10;
[0306] If V t ∈ [V lt , V ht , at this time, the maximum acceleration cannot be achieved. If V t ≥ V b↓ , then jump to step 11. Conversely, if V t < V b↓ , then jump to step 12.
[0307] 5. At this time, the pre-shifting stage can be divided into a stage of increasing acceleration - constant acceleration - decreasing acceleration. The current shifting stage where the starting point of the current interpolation cycle is located is the increasing acceleration stage. The target motion parameters include the value of the maximum jerk. At this time, the value of the maximum jerk is +J m ;
[0308] 6. At this time, the pre-shifting stage can be divided into a stage of increasing deceleration - constant deceleration - decreasing deceleration. The current shifting stage where the starting point of the previous interpolation cycle is located is the increasing deceleration stage. The target motion parameters include the value of the maximum jerk. At this time, the value of the maximum jerk is -J m ;
[0309] 7. At this time, the pre-shifting stage can be divided into a stage of increasing acceleration - decreasing acceleration. The actually achievable maximum acceleration The current acceleration-changing stage where the starting point of the current interpolation cycle is located is the jerk-acceleration stage. The target motion parameters include the value of the maximum jerk. At this time, the value of the maximum jerk is +J m ;
[0310] 8. At this time, the previous acceleration-changing stage can be divided into the deceleration-acceleration - acceleration-deceleration - deceleration-deceleration acceleration-changing stages. The maximum acceleration that can actually be achieved The current acceleration-changing stage where the starting point of the current interpolation cycle is located is the deceleration-acceleration stage. The target motion parameters include the value of the maximum jerk. At this time, the value of the maximum jerk is -J m ;
[0311] 9. At this time, the previous acceleration-changing stage can be divided into the deceleration-deceleration - jerk-acceleration - uniform-acceleration - deceleration-acceleration acceleration-changing stages. The current acceleration-changing stage where the starting point of the current interpolation cycle is located is the deceleration-deceleration stage. The target motion parameters include the value of the maximum jerk. At this time, the value of the maximum jerk is +J m ;
[0312] 10. At this time, the previous acceleration-changing stage can be divided into the acceleration-deceleration - uniform-deceleration - deceleration-deceleration acceleration-changing stages. The current acceleration-changing stage where the starting point of the previous interpolation cycle is located is the acceleration-deceleration stage. The target motion parameters include the value of the maximum jerk. At this time, the value of the maximum jerk is -J m ;
[0313] 11. At this time, the previous acceleration-changing stage can be divided into the deceleration-deceleration - jerk-acceleration - deceleration-acceleration acceleration-changing stages. The maximum acceleration that can actually be achieved The current acceleration-changing stage where the starting point of the current interpolation cycle is located is the deceleration-deceleration stage. The target motion parameters include the value of the maximum jerk. At this time, the value of the maximum jerk is +J m ;
[0314] 12. At this time, the previous acceleration-changing stage can be divided into the acceleration-deceleration - deceleration-deceleration acceleration-changing stages. The maximum acceleration that can actually be achieved The current acceleration-changing stage where the starting point of the current interpolation cycle is located is the acceleration-deceleration stage. The target motion parameters include the value of the maximum jerk. At this time, the value of the maximum jerk is -J m ;
[0315] The subsequent acceleration-changing stage:
[0316] From the state where the target speed is V t and the acceleration is 0 to the end speed V e is the subsequent acceleration-changing section. Calculate the difference between the target speed and the end speed. Note that the target speed must not be lower than the end speed:
[0317] ΔV t-e = V t - V e
[0318] If then the post-acceleration stage includes three acceleration stages: acceleration - deceleration - deceleration reduction;
[0319] Conversely, if then the post-acceleration stage includes two acceleration stages: acceleration - deceleration reduction.
[0320] From the above analysis, it can be seen that the current acceleration stage where the starting point of the current interpolation cycle is located can be determined according to the acceleration stages included in the target acceleration type and the obtained motion parameters, so as to determine the target motion parameters within the current interpolation cycle. According to the target motion parameters, the tool is controlled to complete the acceleration process within the current interpolation cycle.
[0321] It should be noted that the current interpolation cycle may cross stages, that is, two acceleration stages are experienced within the current interpolation cycle. For example, within a part of the current interpolation cycle, it is in the positive acceleration stage, and in other times, it is in the uniform acceleration stage. The following gives two methods for dealing with cross-stage situations, and other situations can be analogized according to this method.
[0322] 1. For example, crossing from the positive acceleration stage to the uniform acceleration stage within the current interpolation cycle
[0323] Let the interpolation cycle be T, the time in the positive acceleration stage be (A m -A c ) / J m , the time in the uniform acceleration stage be T - (A m -A c ) / J m , the maximum positive acceleration in the positive acceleration stage is +J m , and the maximum positive acceleration in the uniform acceleration stage is zero.
[0324] 2. For example, crossing from the deceleration reduction stage to the positive acceleration stage within the current interpolation cycle
[0325] The maximum achievable acceleration The time in the deceleration reduction stage is A c / J m , the time in the positive acceleration stage is T - A c / J m , the maximum positive acceleration in the deceleration reduction stage is +J m , and the maximum positive acceleration in the positive acceleration stage is +J m
[0326] The method for determining each variable-speed stage included in the variable-speed type corresponding to the target end speed is the same as the method for determining each variable-speed stage included in the variable-speed type corresponding to the target speed. Just replace the target speed with the target end speed and analyze according to the above method. The variable-speed type corresponding to the target end speed does not include a post-variable-speed stage.
[0327] After confirming the variable-speed stages included in the target variable-speed type, according to the included variable-speed stages and the obtained motion parameters, determine the current variable-speed stage where the starting point of the current interpolation cycle is located, so as to determine the target motion parameters within the current interpolation cycle. According to the target motion parameters, control the tool to complete the variable-speed process within this interpolation cycle.
[0328] Compared with the traditional offline open-loop S-shaped speed planning method, the method provided in this application can operate in a closed loop in an online real-time environment during the interpolation process. In each interpolation cycle, according to the feedback current speed, current acceleration, remaining interpolation segment length, and the current variable-speed stage, calculate the target motion parameters of the current interpolation cycle, and further calculate the information such as the displacement and speed that need to be updated and send them to the lower computer for execution.
[0329] Since this process can work in a closed-loop online environment, it is not necessary to know various information of the entire tool path segment in advance. And during the interpolation process, when some information changes, or the tool position is affected by errors, it can directly respond in the next interpolation cycle. Even when the user adjusts the feed rate during the interpolation process, this method can still work properly, which cannot be achieved by the traditional offline method.
[0330] The method embodiments related to the present invention are described in detail above. Next, a device embodiment is described.
[0331] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of an S-shaped speed planning device provided by an embodiment of the present invention; as Figure 6 shown, this device can be applied to a numerical control machine tool and may include an acquisition unit 501, a calculation unit 502, a first determination unit 503, a second determination unit 504, a third determination unit 505, and a control unit 506:
[0332] The acquisition unit 501 is configured to acquire the motion parameters of the current tool path segment at the starting point of the current interpolation cycle, and the motion parameters include the current speed, the current acceleration, the end speed, and the remaining interpolation segment length;
[0333] The calculation unit 502 is configured to calculate a first critical displacement according to the motion parameters, and the first critical displacement represents the shortest displacement required for the tool to change speed from the current speed to the end speed according to the S-shaped variable-speed rule;
[0334] A first determination unit 503, configured to determine a target speed change type according to the first critical displacement and the remaining interpolation segment length;
[0335] A second determination unit 504, configured to determine the current speed change stage where the starting point is located according to the current speed, the current acceleration, and the speed change stages included in the target speed change type;
[0336] A third determination unit 505, configured to determine target motion parameters within a current interpolation period according to the current speed change stage;
[0337] A control unit 506, configured to control the tool to complete a speed change motion in the current interpolation period according to the target motion parameters.
[0338] It should be noted that for the functions of the various functional units of the S-shaped speed planning device in the device embodiment of the present invention and the technical effects that the device can bring, reference can be made to the relevant descriptions in the above method embodiments, which will not be elaborated here.
[0339] The embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium may store a program, and when the program is executed, it may include some or all of the steps described in any one of the above method embodiments.
[0340] The embodiment of the present invention further provides a computer program or a computer program product. The computer program may include instructions. When the computer program is executed by a computer, it enables the computer to execute some or all of the steps described in any one of the above method embodiments.
[0341] In the above embodiments, the descriptions of the various embodiments have their own focuses. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0342] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0343] In several embodiments provided by the present invention, it should be understood that the described device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above-mentioned division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The units of the above device embodiments may or may not be physically separated, and some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present invention.
[0344] In addition, each functional unit in the embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0345] Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and can include several instructions to enable a computer device (which can be a personal computer, a server or a network device, etc., specifically, the processor in the computer device) to execute all or part of the steps of the above methods in the various embodiments of the present invention. Among them, the aforementioned storage medium can include: USB flash drives, mobile hard disks, magnetic disks, optical discs, read-only memories (ROM) or random access memories (RAM), etc., which can store program codes. As described above, the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. An S-shaped speed planning method, characterized in that, The method includes: At the starting point of the current interpolation cycle, obtain the motion parameters of the current tool path segment, where the motion parameters include the current speed, the current acceleration, the end speed, and the remaining interpolation segment length; According to the motion parameters, calculate the first critical displacement, where the first critical displacement represents the shortest displacement required for the tool to change speed from the current speed to the end speed according to the S-shaped speed change rule; When the first critical displacement is greater than the remaining interpolation segment length, the current acceleration is not zero, and in the speed change type corresponding to the first critical displacement, there is a situation where the value signs of the accelerations at two moments are opposite, calculate the first compensation time, where the first compensation time represents the time required for the current acceleration to change speed to zero at the maximum jerk; According to the first compensation time, calculate the first corrected starting speed, where the acceleration corresponding to the first corrected starting speed is zero; According to the first corrected starting speed, calculate the first corrected remaining interpolation segment length; According to the first corrected starting speed, the first corrected remaining interpolation segment length, and the motion parameters, calculate the target end speed; According to the target end speed, determine the target speed change type; According to the current speed, the current acceleration, and the speed change stage included in the target speed change type, determine the current speed change stage where the starting point is located; According to the current speed change stage, determine the target motion parameters within the current interpolation cycle; Control the tool to complete the speed change motion of the current interpolation cycle according to the target motion parameters.
2. The method according to claim 1, wherein The method further includes: When the first critical displacement is greater than the remaining interpolation segment length, the current acceleration is not zero, and in the speed change type corresponding to the first critical displacement, there is no situation where the value signs of the accelerations at two moments are opposite, calculate the second compensation time, where the second compensation time represents the time required for the acceleration to change speed from zero to the current acceleration at the maximum jerk; According to the second compensation time, calculate the second corrected starting speed, where the acceleration corresponding to the second corrected starting speed is zero; According to the second corrected starting speed, calculate the second corrected remaining interpolation segment length; According to the second corrected starting speed, the second corrected remaining interpolation segment length, and the motion parameters, calculate the target end speed.
3. The method according to claim 1, wherein The method further includes: When the first critical displacement is less than the remaining interpolation segment length, calculate the target speed, where the target speed is the maximum speed that can be achieved in the target speed change type; According to the target speed, determine the target speed change type.
4. The method according to claim 3, wherein The calculation of the target speed when the first critical displacement is less than the remaining interpolation segment length includes: When the first critical displacement is less than the remaining interpolation segment length and the current acceleration is greater than zero, calculate the acceleration compensation time, where the acceleration compensation time represents the time required for the acceleration to change speed from zero to the current acceleration at the maximum jerk; According to the acceleration compensation time, calculate the acceleration corrected starting speed, where the acceleration corresponding to the acceleration corrected starting speed is zero; Calculate the remaining interpolation segment length of the acceleration correction based on the starting speed of the acceleration correction; Calculate the target speed based on the starting speed of the acceleration correction, the remaining interpolation segment length of the acceleration correction, and the motion parameters; 5. The method according to claim 3, characterized in that, When the first critical displacement is less than the remaining interpolation segment length, calculating the target speed includes: When the first critical displacement is less than the remaining interpolation segment length and the current acceleration is less than zero, calculate the deceleration compensation time, where the deceleration compensation time represents the time required to change the current acceleration to zero at the maximum jerk; Calculate the starting speed of the deceleration correction based on the deceleration compensation time, where the acceleration corresponding to the starting speed of the deceleration correction is zero; Calculate the remaining interpolation segment length of the deceleration correction based on the starting speed of the deceleration correction; Calculate the target speed based on the starting speed of the deceleration correction, the remaining interpolation segment length of the deceleration correction, and the motion parameters; 6. The method according to claim 1, wherein The method further includes: When the first critical displacement is equal to the remaining interpolation segment length, determine that the target speed change type is the speed change type corresponding to the first critical displacement; 7. An S-shaped speed planning device, characterized in that, For implementing the steps of the method according to any one of claims 1 to 6; 8. A computer program product, characterized in that, The computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be used to execute the method according to any one of claims 1-6; 9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions, and when the program instructions are executed by a processor, the processor executes the method according to any one of claims 1-6.
Citation Information
Patent Citations
Real-time flexible acceleration and deceleration control algorithm based on adaptive prospection and predicative correction
CN109426151A