A corner smoothing velocity planning method based on time rounding strategy
Through the corner smoothing speed planning method based on the time rounding strategy, the problems of kinematic parameter overrun and speed fluctuation in the existing technology are solved, online speed planning and efficient interpolation are realized, and the stability and efficiency of the motion are ensured.
Patent Information
- Application Number
- CN202410692238.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-05-31
AI Technical Summary
It is difficult to achieve speed planning in which the kinematic parameters do not exceed limits and the total time is an integer multiple of the interpolation period with the existing technology. Especially in multi-segment linear motion, there are problems of speed fluctuation and vibration.
A corner smoothing speed planning method based on time rounding strategy is adopted. By adaptively reading the line segments to be planned for speed, limiting the maximum speed at the end, and planning the speed of all line segments in sequence from front to back, using the S-shaped speed curve and time rounding strategy, Ensure that all kinematic parameters do not exceed limits and achieve rounding of interpolation time.
It realizes online solution, reduces the compensation time, and improves the interpolation efficiency. All calculations have analytical solutions and no numerical iterative solution is required. This avoids the problem of excessive memory space occupation and ensures motion stability.
Smart Images

Figure CN118276514B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of robot trajectory speed planning and interpolation, and in particular to a corner smoothing speed planning method based on a time rounding strategy. Background Art
[0002] In robot control, acceleration and deceleration control is required to avoid impact and vibration of each axis and ensure the smooth movement of moving parts. Moreover, most of the current control systems are based on position-driven discrete control, and the data transmission cycle is the interpolation cycle, which is a fixed time cycle. In theory, the total time should be an integer multiple of the interpolation cycle, but it is difficult to ensure that the total time is an integer multiple of the interpolation cycle and the kinematic parameters do not exceed the limit.
[0003] The Chinese invention patent with the announcement number CN107765639B discloses a rounding error compensation method for S-curve acceleration and deceleration, which only lists the speed planning of a single straight line and is not applicable to the rounding of multiple continuous straight lines. Therefore, a speed planning method that can be solved online and can ensure time rounding is needed to effectively improve the vibration of processing. Summary of the invention
[0004] Purpose of the invention: To propose a corner smoothing speed planning method based on time rounding strategy, which adopts single-segment interpolation total time rounding strategy and S-shaped speed curve, aiming to eliminate the speed fluctuation problem caused by rounding error.
[0005] To achieve the above object, a first aspect of the present invention provides a corner smoothing speed planning method based on a time rounding strategy, comprising the following steps:
[0006] Step 1: adaptively read the line segment to be speed-planned, and construct the corner curve to calculate the corner speed under the constraint;
[0007] Step 2: limiting the maximum speed at the end of the speed planning;
[0008] Step 3: Plan the speed of all line segments from front to back and perform time rounding;
[0009] Step 4: interpolate the speed planned data.
[0010] In a further embodiment of the first aspect, there are two judgment conditions for adaptively reading the line segment to be speed-planned in step 1. Each time, two adjacent lines are taken for judgment, one: the total number of points read is greater than a certain fixed value; the other: the angle between the two adjacent line segments is less than 90°; if one of the conditions is met, data reading is stopped.
[0011] In a further embodiment of the first aspect, the maximum speed at the end of the speed planning in step 2 is mainly to avoid the speed change caused by the subsequent time rounding from affecting the speed planned previously. The final speed mainly comes from three speed constraints: one is the last corner speed; the other is the maximum feed speed k ( ) times, and the third is the maximum achievable speed that can be accelerated by half the distance from the look-ahead end point to the midpoint of the corner, and the minimum value among the three is taken.
[0012] In a further embodiment of the first aspect, the maximum achievable speed that can be accelerated by half the distance from the forward end point to the midpoint of the corner is calculated as follows: assuming that the maximum achievable speed can reach the maximum feed speed, the relationship between the required distance and the actual distance is calculated. If the required distance is less than the actual distance, the maximum feed speed can be reached, otherwise the maximum feed speed cannot be reached; secondly, assuming that there is a uniform acceleration segment area, the pure acceleration distance is calculated based on the seven-segment S-shaped speed curve. If it is less than the actual distance, there is a uniform acceleration segment, and based on the motion relationship equation, the maximum achievable speed is calculated through a quadratic equation; finally, when the maximum acceleration cannot be reached and there is no uniform acceleration segment, and the initial velocity is not equal to 0, a cubic equation is calculated through the motion relationship, and the Cardano formula is used to solve it. When the initial velocity is equal to 0, the cubic equation is directly solved.
[0013] In a further embodiment of the first aspect, step 3 is based on an S-shaped speed curve when planning all line segments from front to back. If a straight line is accelerating from front to back, the achievable speed is calculated based on the method of step 2, and the time is rounded to an integer multiple of the interpolation period using a time rounding strategy and the corresponding jerk is calculated; if it is decelerating, the reverse achievable speed is also calculated based on the method of step 2, and the time is rounded to an integer multiple of the interpolation period using a speed rounding strategy and the corresponding jerk is calculated; it is determined whether the calculated jerk exceeds the limit.
[0014] In a further embodiment of the first aspect, the time rounding strategy is: rounding up the calculated sum of the time of each stage, and distributing the time error generated by the rounding to each stage in proportion, and obtaining the speed of the uniform speed section by using the constant path length. And using the relationship between the speed and jerk of the acceleration and deceleration sections, calculate the corrected jerk. If the corrected jerk of the acceleration or deceleration stage exceeds the limited jerk, a secondary correction is performed.
[0015] In a further embodiment of the first aspect, during the secondary correction, the speed operation stage is adjusted according to the relationship between the initial and final speeds. If the initial speed is less than the final speed, the secondary correction presents pure acceleration or a combination of acceleration and uniform speed; if the initial speed is greater than the final speed, the secondary correction presents pure deceleration or a combination of deceleration and uniform speed; if the initial speed is equal to the final speed, the secondary correction presents a uniform speed state; and the time of each stage is recalculated with the maximum jerk and rounded upward, and the uniform speed section speed and the acceleration / deceleration jerk are re-corrected on the condition that the path length remains unchanged.
[0016] In a further embodiment of the first aspect, if the jerk obtained after time rounding for each straight line is still over the limit, it is necessary to eliminate it in combination with the forward-looking speed planning method. When the jerk exceeds the limit in the non-backtracking state, if the current line segment is in the accelerating state, the terminal speed is updated and the current line segment is readjusted; if the current line segment is in the decelerating state, the starting speed is updated, the current line segment is readjusted and back-adjusted. When the jerk exceeds the limit in the backtracking state, if the current line segment is in the accelerating state, the terminal speed is updated, the forward-looking segment is adjusted to the current segment, the current segment is readjusted and rounded backward; if the current line segment is in the decelerating state, the starting speed is updated, the forward-looking segment is adjusted to the segment before the current segment, and rounded backward again.
[0017] In a further embodiment of the first aspect, when decelerating, if the initial velocity after time rounding is not equal to the corner velocity, a reverse backtracking adjustment is required. When the backtracking adjustment encounters forward acceleration, and the final velocity after the forward acceleration is rounded off is equal to the corner velocity, the backtracking is stopped and the speed is adjusted forward; otherwise, the backtracking direction adjustment is performed.
[0018] In a further embodiment of the first aspect, when the exit condition of the acceleration segment is not met during backtracking, the backtracking direction needs to be adjusted. If the initial speed of the acceleration segment is greater than the final speed of the next deceleration segment, the initial speed of the deceleration segment is adjusted to be equal to the initial speed of the acceleration segment, and the speed is rounded again and the backtracking adjustment continues; if the initial speed of the acceleration segment is less than the final speed of the next deceleration segment, the final speed of the acceleration segment is adjusted to be equal to the final speed of the deceleration segment, and the backtracking direction is adjusted backward until the exit condition is met.
[0019] As a second aspect of the present invention, an electronic device is proposed, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the corner smoothing speed planning method based on the time rounding strategy disclosed in the first aspect and its further embodiments.
[0020] As a third aspect of the present invention, a computer-readable storage medium is proposed, in which at least one executable instruction is stored. When the executable instruction is run on an electronic device, the electronic device executes the corner smoothing speed planning method based on the time rounding strategy disclosed in the first aspect and its further embodiments.
[0021] Compared with the prior art, the present invention has the following outstanding substantive features and significant technological advances:
[0022] 1. The rounding strategy proposed in this method can be solved online and ensure that all kinematic parameters are within the limit. It can be easily integrated into the real-time control system to achieve online speed planning.
[0023] 2. This method is based on the rounding strategy of the total interpolation time of a single segment, which minimizes the compensation time and improves the interpolation efficiency. Moreover, all calculations have analytical solutions and do not require numerical iteration solutions.
[0024] 3. This method uses adaptive reading of the points to be planned for speed, which not only meets the speed planning requirements but also avoids the problem of large memory space occupation caused by processing too many points at one time. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flow chart for realizing the time rounding method for smooth trajectory speed planning proposed by the present invention.
[0026] Figure 2 It is a model diagram of corner smoothing velocity planning.
[0027] Figure 3 It is a coordinate diagram of the local coordinate system and the global coordinate system.
[0028] Figure 4 It is the point data diagram of corner smoothing speed planning.
[0029] Figure 5 This is the path speed simulation effect diagram of corner smoothing speed planning.
[0030] Figure 6 This is the path acceleration simulation effect diagram of corner smoothing velocity planning.
[0031] Figure 7 This is the simulation effect diagram of the path acceleration of corner smoothing velocity planning.
[0032] Figure 8 This is the simulation effect diagram of the path profile error of corner smoothing velocity planning. DETAILED DESCRIPTION
[0033] In the following description, a large number of specific details are provided to provide a more thorough understanding of the present invention. However, it is apparent to those skilled in the art that the present invention can be implemented without one or more of these details. In other examples, in order to avoid confusion with the present invention, some technical features known in the art are not described.
[0034] This embodiment discloses a specific process of a corner smoothing speed planning method based on a time rounding strategy, and the flow chart is as follows: Figure 1 As shown, the following steps are included:
[0035] Step 1: Adaptively read the line segment to be speed-planned, and construct the corner speed under the corner curve calculation constraint. There are two judgment conditions for adaptively reading the line segment to be speed-planned. Each time, two adjacent lines are taken for judgment. First, the total number of points read is greater than a fixed value; second, the angle between the two adjacent line segments is less than 90°; if one of the conditions is met, data reading is stopped.
[0036] Step 2: Limiting the maximum speed at the end of speed planning is mainly to prevent the speed change caused by subsequent time rounding from affecting the speed of the previous speed planning. The final speed mainly comes from three speed constraints: the last corner speed; the maximum feed speed k ( ) times, and the third is the maximum achievable speed that can be accelerated from half the distance from the forward end point E to the midpoint h of the last corner, and the minimum value among the three is taken. The maximum achievable speed that can be accelerated from half the distance from the forward end point to the midpoint of the corner is calculated as follows: Assuming that the maximum achievable speed can reach the maximum feed speed, calculate the relationship between the required distance and the actual distance. If the required distance is less than the actual distance, the maximum feed speed can be reached, otherwise the maximum feed speed cannot be reached; secondly, assuming that there is a uniform acceleration segment area, calculate the pure acceleration distance based on the 7-segment S-shaped speed curve. If it is less than the actual distance, there is a uniform acceleration segment, and based on the motion relationship equation, the maximum achievable speed is calculated through a quadratic equation; finally, when the maximum acceleration cannot be reached and there is no uniform acceleration segment, and the initial velocity is not equal to 0, a cubic equation is listed through the motion relationship, and the Cardano formula is used to solve it. When the initial velocity is equal to 0, the cubic equation is directly solved. When the uniform acceleration segment exists, the calculation is shown in formula (1); when the maximum acceleration cannot be reached and the initial velocity is not equal to 0, the calculation is shown in formula (2).
[0037] (1)
[0038] in, The time used for the acceleration section and uniform acceleration section of the S-curve. is the final velocity of the line segment, is the maximum speed that can be accelerated, d is the length of the line segment, j maxis the maximum jerk.
[0039] (2)
[0040] in, is the maximum acceleration that can be achieved according to the maximum jerk, is the initial velocity of the line segment, is the maximum speed that can be accelerated, d is the length of the line segment, t1 is the time required for the acceleration to reach a, j max is the maximum jerk, D is the discriminant of Cardano’s formula, and p, q, a1, a2 are temporary variables.
[0041] Step 3: When planning all line segments from front to back, the speed is based on the 7-segment S-shaped speed curve. If a straight line is accelerating from front to back, the maximum achievable speed is calculated based on the method in step 2, and the time rounding strategy is used to round the time to an integer multiple of the interpolation period and calculate the corresponding jerk; if it is deceleration, the reverse achievable speed is also calculated based on the method in step 2, and the speed rounding strategy is used to round the time to an integer multiple of the interpolation period and calculate the corresponding jerk, and determine whether backtracking adjustment is required. Determine whether the calculated jerk exceeds the limit.
[0042] The time rounding strategy is: round up the total time of each stage calculated, and distribute the rounded time to each stage in proportion, and use the unchanged path length to obtain the speed of the uniform speed segment. And use the relationship between the speed and jerk of the acceleration and deceleration stages to calculate the corrected jerk. If the corrected jerk of the acceleration or deceleration stage exceeds the limited jerk, a secondary correction is performed. During the secondary correction, the speed operation stage is adjusted according to the relationship between the initial and final speeds. If the initial speed is less than the final speed, the secondary correction presents pure acceleration or a combination of acceleration and uniform speed; if the initial speed is greater than the final speed, the secondary correction presents pure deceleration or a combination of deceleration and uniform speed; if the initial speed is equal to the final speed, the secondary correction presents a uniform speed state; and recalculates the time of each stage with the maximum jerk and rounds up the time, and re-corrects the uniform speed and the acceleration / deceleration jerk under the condition that the path length remains unchanged. The time rounding strategy is shown in formula (3), and the secondary correction strategy of the acceleration stage is shown in formula (4).
[0043] (3)
[0044] in, is the time of each stage of the S-type speed curve, T is the total time, ceil(*) is the upward rounding function, is the interpolation period, is the total time of the acceleration section, uniform speed section, and deceleration section after rounding. are the corresponding time segments of the rounded S-shaped speed curve, are the accelerations of the acceleration section and the deceleration section respectively. is the initial velocity of the line segment, is the maximum speed that can be accelerated, d is the length of the line segment, j max is the maximum jerk, v f is a uniform speed.
[0045] (4)
[0046] Among them, t1, t2, and t4 are the times corresponding to the S-shaped speed curve. is the initial velocity of the line segment, is the maximum speed that can be accelerated, d is the length of the line segment, j max is the maximum jerk.
[0047] If the jerk obtained after time rounding for each straight line is still out of limit, it needs to be eliminated by combining the forward-looking speed planning method. When the jerk exceeds the limit in the non-backtracking state, if the current line segment is in the accelerating state, the terminal speed is updated and the current line segment is readjusted; if the current line segment is in the decelerating state, the starting speed is updated, the current line segment is readjusted and backtracked. When the jerk segment exceeds the limit in the backtracking state, if the current line segment is in the accelerating state, the terminal speed is updated, the forward-looking segment is adjusted to the current segment, and it is rounded back again; if the current line segment is in the decelerating state, the starting speed is updated, the forward-looking segment is adjusted to the segment before the current segment, and it is rounded back again.
[0048] During deceleration, if the initial speed after time rounding is not equal to the corner speed, a reverse backtracking adjustment is required. When encountering positive acceleration during the backtracking adjustment, and the final speed of the forward acceleration is equal to the corner speed, stop backtracking and continue to adjust the speed forward. When the exit condition of the acceleration segment is not met during backtracking, it is necessary to adjust the backtracking direction. If the initial speed of the acceleration segment is greater than the final speed of the next deceleration segment, adjust the initial speed of the deceleration segment to be equal to the initial speed of the acceleration segment, re-round and continue to adjust forward; if the initial speed of the acceleration segment is less than the final speed of the next deceleration segment, adjust the final speed of the acceleration segment to be equal to the final speed of the deceleration segment, and adjust the backtracking direction backward until the exit condition is met. Figure 2 For example, if the speed at point f is greater than or equal to the speed at point h, adjust the speed at point g to be equal to point f and continue backtracking; if the speed at point f is less than the speed at point h, adjust the speed at point g to be equal to point h and adjust the backtracking direction.
[0049] Step 4: Interpolate the speed planned data. It is necessary to establish the mapping relationship between the local coordinate system of the corner curve and the global coordinate system. According to the classification of the in and out corners, establish the local coordinate system respectively, such as Figure 3 As shown (processing direction is from A to C), the local coordinate system of the corner is , the local coordinate system of the corner is , and set the Z coordinate to 0. According to the rotation transformation relationship, the transformation relationship from the local plane position to the three-dimensional space position is established, and the transformation relationship is as shown in (5). And interpolation is performed according to the S-shaped velocity curve.
[0050] P = T × [ X , Y , 0 , 1 ]' (5)
[0051] Where T is the transformation matrix from the local coordinate system to the world coordinate system, and X and Y are the coordinates in the local coordinate system.
[0052] Embodiment effect:
[0053] Set the maximum allowable speed of the processing trajectory to , the maximum acceleration is , the maximum jerk is , the maximum contour error is 0.1mm, the interpolation period is 1ms, and the forward point is 30. The corner curve used in this embodiment is a clothoid curve. The point data of the speed planning path is as follows Figure 4 shown.
[0054] The simulation effect is as follows Figure 5-Figure 8 ,in Figure 5 It is the speed curve diagram; Figure 6 is the acceleration curve diagram; Figure 7 is the acceleration curve diagram; Figure 8 is the error curve; Figure 5-Figure 8 It can be seen that all kinematic parameters are within the constraints. The total time is 889ms, and the time consumption of each segment is [62, 29, 27, 27, 27, 23, 33, 29, 29, 28, 28, 29, 29, 28, 27, 28, 29, 28, 31, 25, 28, 28, 27, 26, 26, 28, 37, 66] (unit / ms), achieving the rounding of the interpolation time of each segment. Figure 5 It can be seen that the uniform speed section of the maximum achievable speed is slightly lower than the maximum speed, which is the result of the time rounding strategy. Figure 5-Figure 7 It can be seen that the method of the present invention can effectively round off the interpolation time, and each kinematic parameter is within the constraint range.
[0055] The corner smoothing speed planning method based on the time rounding strategy disclosed in the above embodiment can be written into a program product in the actual application process, and the program product is written into a storage medium and runs on an electronic device. More specific examples of the computer-readable storage medium mentioned in this embodiment may include but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable signal medium can also be any readable medium other than a readable storage medium, which can send, propagate or transmit a program used by an instruction execution system, an apparatus or a device or used in combination with it.
[0056] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A corner smoothing speed planning method based on time rounding strategy, It is characterized in that The steps include: Step 1: Read the line segment to be executed for speed planning, construct the corner curve, and calculate the corner speed under the constraint; The line segment for reading the speed planning to be executed has two judgment conditions, and two adjacent lines are taken for judgment each time; Judgment condition 1: The total number of points read is greater than the predetermined fixed value; Judgment condition 2: The angle between two adjacent line segments is less than 90°; Step 2: limiting the maximum speed of the final stage of speed planning, including three speed constraints, taking the minimum value of the three speed constraints as the maximum speed of the final stage of speed planning; Constraint 1: Last corner speed; Constraint 2: k times the maximum feed rate, 0<k<1; Constraint 3: The maximum achievable speed that can be accelerated from half the distance from the look-ahead end point to the midpoint of the last corner; In constraint three, the maximum achievable speed that can be accelerated by half the distance from the forward end point to the midpoint of the last corner is calculated as follows: Assuming that the maximum achievable speed can reach the maximum feed speed, the relationship between the required distance and the actual distance is calculated. If the required distance is less than the actual distance, the maximum feed speed can be reached, otherwise the maximum feed speed cannot be reached; Assuming that there is a uniform acceleration segment, the distance without uniform acceleration segment is calculated based on the S-shaped velocity curve. If it is less than the actual distance, there is a uniform acceleration segment. Based on the equation of motion, the maximum achievable speed is calculated by a quadratic equation. If the maximum acceleration cannot be reached, there is no uniform acceleration section, and the initial velocity is not equal to 0, a cubic equation of one variable is established through the kinematic relationship and solved using the Cardano formula; When the initial velocity is equal to 0, directly solve the cubic equation; Step 3: Based on the S-shaped speed curve, perform speed planning and time rounding operations on all line segments from front to back: If a straight line is accelerating from front to back, calculate the maximum achievable speed, and use the time rounding strategy to round the time to an integer multiple of the interpolation period and calculate the corresponding jerk; If the speed on a straight line is decelerating from the front to the back, calculate the speed that can be reached in the reverse direction, and use the speed rounding strategy to round the time to an integer multiple of the interpolation period and calculate the corresponding jerk; Determine whether the calculated jerk exceeds the limit; The time rounding strategy includes: The sum of the time of each stage calculated according to the S-shaped speed curve is rounded upward, and the time error generated by the rounding is proportionally distributed to each stage; Using the constant path length, find the speed of the uniform speed segment; The corrected jerk is calculated using the relationship between the speed and jerk in the acceleration and deceleration stages. If the corrected jerk in the acceleration or deceleration stage exceeds the limited jerk, a secondary correction is performed. During the second correction, the operation stage is adjusted according to the relationship between the initial and final speeds: If the initial velocity is less than the final velocity, the secondary correction presents pure acceleration or a combination of acceleration and uniform velocity; If the initial velocity is greater than the final velocity, the secondary correction presents pure deceleration or a combination of deceleration and uniform velocity; If the initial velocity is equal to the final velocity, the secondary correction presents a uniform speed state, and the time of each stage is recalculated with the maximum jerk and rounded upward. Under the condition that the path length remains unchanged, the uniform speed segment speed and the acceleration / deceleration jerk are recorrected; Step 4: Perform interpolation operation on the data completed by speed planning in step 3.
2. The corner smoothing speed planning method based on the time rounding strategy according to claim 1, It is characterized in that If the jerk obtained after time rounding for each straight line is still out of limit, it can be eliminated by combining the forward-looking speed planning method: When the jerk exceeds the limit in the non-backtracking state, if the current line segment is in the accelerating state, the endpoint speed is updated and the current line segment is readjusted; If the current line segment is in a deceleration state, update the starting speed, readjust the current line segment and adjust back; When the jerk exceeds the limit in the backtracking state, if the current line segment is in the accelerating state, the endpoint speed is updated, the forward-looking segment is adjusted to the current segment, and then rounded back again; if the current line segment is in the decelerating state, the starting point speed is updated, the forward-looking segment is adjusted to the segment before the current segment, and then rounded back again.
3. The corner smoothing speed planning method based on time rounding strategy according to claim 2, It is characterized in that During deceleration, if the initial velocity after time rounding is not equal to the corner velocity, reverse backtracking adjustment is performed; when forward acceleration is encountered during the backtracking adjustment, and the final velocity after forward acceleration is rounded off is equal to the corner velocity, backtracking is stopped and the speed is continued to be adjusted forward; otherwise, adjustment is performed in the backtracking direction.
4. The corner smoothing speed planning method based on time rounding strategy according to claim 3, It is characterized in that When the acceleration stage exit condition is not met during backtracking, the backtracking direction is adjusted: If the initial speed of the acceleration segment is greater than the final speed of the next deceleration segment, the initial speed of the deceleration segment is adjusted to be equal to the initial speed of the acceleration segment, and the speed is rounded again and adjusted backwards; if the initial speed of the acceleration segment is less than the final speed of the next deceleration segment, the final speed of the acceleration segment is adjusted to be equal to the final speed of the deceleration segment, and the direction of backtracking is adjusted backwards until the exit condition is met.
