Curve trajectory planning method, electronic device and storage medium
By acquiring and converting the first constraint parameter of the motion control system into a second parameter with stronger differentiability and generating a second curve, the speed mutation and vibration problems caused by the acceleration and deceleration curve in the prior art are solved, and a smoother motion control effect is achieved.
Patent Information
- Application Number
- CN202311532129.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-11-15
AI Technical Summary
When using acceleration and deceleration curves for control in existing motion control systems, there are problems such as sudden speed changes, severe vibrations, and noise, resulting in poor control effects.
By obtaining the first constraint parameters of the object to be planned and converting them into second constraint parameters with stronger differentiability, the planning module is used to generate the second curve to achieve conversion between different acceleration and deceleration curves, simplifying the planning process and avoiding acceleration mutations.
It improves the control effect of motion control, reduces the sudden changes in speed and acceleration, reduces vibration and noise during motion, and improves the smoothness of control.
Smart Images

Figure CN117369370B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motion control technology, and in particular to a curve trajectory planning method, an electronic device, and a readable storage medium. Background Art
[0002] With the continuous development of science and technology, motion control technology has been widely used in high-end CNC equipment and mechanical equipment such as robots. Among them, the moving parts of mechanical equipment are often unable to start and stop directly at high speed. Therefore, it is necessary to design reasonable acceleration and deceleration curves to make the starting and stopping processes fast and smooth, such as linear acceleration and deceleration curves, exponential acceleration and deceleration curves, and trigonometric function acceleration and deceleration curves.
[0003] Currently, motion control systems usually use a pre-planned single acceleration and deceleration curve to control moving parts to move quickly and accurately along a given trajectory in a very short time. However, due to the different smoothness of different acceleration and deceleration curves, there are a large number of speed mutations during the movement process, which makes it easy for severe vibration and noise to occur during the movement. Therefore, the current motion control based on acceleration and deceleration curves has poor control effect. Summary of the Invention
[0004] The main purpose of this application is to provide a curve trajectory planning method, an electronic device and a readable storage medium, aiming to solve the technical problem of poor control effect of motion control using acceleration and deceleration curves in the prior art.
[0005] To achieve the above objectives, the present application provides a curve trajectory planning method, which includes:
[0006] Obtaining first constraint parameters for planning a first curve for the object to be planned;
[0007] converting the first constraint parameter into a second constraint parameter of a second curve, wherein the second curve is more differentiable than the first curve;
[0008] According to the initial motion parameters of the object to be planned and the second constraint parameters, curve trajectory planning is performed on the object to be planned to obtain the second curve.
[0009] To achieve the above objectives, the present application further provides a curve trajectory planning device, the curve trajectory planning device comprising:
[0010] An acquisition module, configured to acquire a first constraint parameter for planning a first curve for the object to be planned;
[0011] a conversion module, configured to convert the first constraint parameter into a second constraint parameter of a second curve, wherein the second curve is more differentiable than the first curve;
[0012] A planning module is used to plan a curve trajectory for the object to be planned according to the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve.
[0013] The present application also provides an electronic device, which includes: a memory, a processor, and a program of the curve trajectory planning method stored in the memory and runnable on the processor. When the program of the curve trajectory planning method is executed by the processor, the steps of the curve trajectory planning method as described above can be implemented.
[0014] The present application also provides a computer-readable storage medium, on which is stored a program for implementing the curve trajectory planning method. When the program of the curve trajectory planning method is executed by a processor, the steps of the curve trajectory planning method as described above are implemented.
[0015] The present application also provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned curve trajectory planning method when executed by a processor.
[0016] The present application provides a curve trajectory planning method, electronic device, and readable storage medium, namely, obtaining first constraint parameters for planning a first curve for an object to be planned; converting the first constraint parameters into second constraint parameters for a second curve, wherein the second curve is more differentiable than the first curve; and performing curve trajectory planning for the object to be planned based on the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve. Because the second curve is more differentiable than the first curve, using the second curve as the acceleration and deceleration curve for planning the object to be planned can make the speed and acceleration of the object to be planned more continuous during actual motion. That is, using the second curve instead of the first curve to control the acceleration and deceleration of the object to be planned can reduce the problem of sudden changes in speed and acceleration during the trajectory motion of the object to be planned. At the same time, by switching between the constraint parameters of the first curve and the constraint parameters of the second curve, the purpose of flexibly planning different types of acceleration and deceleration curves for the object to be planned can be achieved while simplifying the curve planning process. Instead of always controlling the trajectory motion of the object to be planned through a single planned acceleration and deceleration curve. Therefore, the technical defect that a large number of speed mutations occur during the movement due to the different smoothness of different acceleration and deceleration curves, which in turn makes it easy for severe vibrations and noise to occur during the movement, is overcome. Therefore, the control effect of motion control based on acceleration and deceleration curves is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 This is a flow chart of the first embodiment of the curve trajectory planning method of the present application;
[0020] Figure 2 Schematic diagram of before and after comparison of the sinusoidal acceleration and deceleration curve for adjusting the initial reconstructed jerk in the first embodiment of the curve trajectory planning method of the present application;
[0021] Figure 3 This is a flow chart of the second embodiment of the curve trajectory planning method of the present application;
[0022] Figure 4 Schematic diagram of the comparison before and after the secondary adjustment of the acceleration in the second embodiment of the curve trajectory planning method of this application
[0023] Figure 5 This is a schematic diagram of an embodiment of the curve trajectory planning device of the present application;
[0024] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the curve trajectory planning method in the embodiment of the present application.
[0025] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0026] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0027] Example 1
[0028] First of all, it should be understood that the speed, trajectory, position and other parameters of mechanical equipment are usually controlled in real time through motion control technology. In the process of high-speed motion control, in order to make the starting and stopping processes faster and smoother, reasonable acceleration and deceleration curves are often designed. Taking the acceleration and deceleration process of the motor as an example, if acceleration and deceleration can be achieved in a very short time, the operation of the motor will be relatively stable. However, different acceleration and deceleration curves have different characteristics. For example, the trapezoidal acceleration and deceleration curve and the exponential acceleration and deceleration curve will have sudden acceleration changes in the control process, that is, the acceleration changes greatly at a certain time step. The sine curve can make the acceleration of the trajectory motion process continuous because its derivative is also a trigonometric function. Therefore, the current sine curve is used in operation. Motion control systems are more widely used. However, using a sine curve to control the acceleration and deceleration of a motor involves a large number of trigonometric function operations, which places high demands on the control hardware. That is, different acceleration and deceleration curves have shortcomings. No matter which single acceleration and deceleration curve is used for motion control, the control effect is not good. If the advantages of different acceleration and deceleration curves can be taken into account, for example, the sine curve can be used to avoid the problem of sudden acceleration changes in the acceleration and deceleration curve, and the planning process of the sine curve can be simplified, the control effect of motion control using the acceleration and deceleration curve can be significantly improved. The essence lies in whether the planning process conversion between different acceleration and deceleration curves can be realized. In summary, there is an urgent need for a method to improve the control effect of motion control using the acceleration curve.
[0029] The present application embodiment provides a curve trajectory planning method. In the first embodiment of the curve trajectory planning method of the present application, referring to Figure 1 , the curve trajectory planning method includes:
[0030] Step S10, obtaining first constraint parameters for planning a first curve for the object to be planned;
[0031] Step S20, converting the first constraint parameter into a second constraint parameter of a second curve, wherein the second curve is more differentiable than the first curve;
[0032] Step S30 : performing curve trajectory planning on the object to be planned according to the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve.
[0033] It is understandable that when performing motion control, mechanical equipment can be controlled by designing acceleration and deceleration curves to avoid shock, loss of step or vibration during the motion process. However, the existing acceleration and deceleration curves have certain advantages and disadvantages. For example, the linear acceleration and deceleration algorithm is simple and time-saving, but its acceleration curve is discontinuous and there is a problem of speed mutation, which affects the processing quality of the mechanical equipment. The trigonometric function acceleration and deceleration curve can use the sine curve between 0-π to construct a speed curve, and then realize the continuous differentiability of acceleration and jerk, so as to achieve the purpose of smooth and optical transition of speed. However, the trigonometric function acceleration and deceleration curve involves a large number of trigonometric function operations, which is not conducive to implementation in hardware. Therefore, the current control effect of motion control using acceleration and deceleration curves is poor.
[0034] To address the above-mentioned defects, an embodiment of the present application provides a curve trajectory planning method, which can perform data processing in sequence through the acquisition module, conversion module and planning module of the control device, thereby constructing a second curve based on the first constraint parameters of the first curve, thereby achieving the purpose of converting between different acceleration and deceleration curves, and because the second curve is more differentiable than the first curve, the motion control of the object to be planned using the second curve can avoid the acceleration mutation problem faced by the first curve to a certain extent, and the second constraint parameters of the second curve are directly converted from the first constraint parameters of the first curve, rather than being re-planned, thereby simplifying the construction process when constructing the second curve, that is, the constructed second curve can retain the advantageous characteristics of the second curve and avoid the complex calculation problems in the curve construction process, wherein the acquisition module is used to obtain the constraint parameters of the acceleration and deceleration curve, the conversion module is used to realize the conversion of the constraint parameters of different acceleration and deceleration curves, and the planning module is used to plan the acceleration and deceleration curve.
[0035] In addition, it should be noted that the object to be planned is used to characterize the moving parts of the mechanical equipment waiting for acceleration and deceleration curve planning, which can be specifically a motor shaft, a robotic arm or a screw, etc. The first curve and the second curve both belong to the acceleration and deceleration curve, which can be specifically one or more, wherein the second curve is more differentiable than the first curve. For example, in one feasible method, the first curve can be a trapezoidal acceleration and deceleration curve, and the second curve can be an exponential acceleration and deceleration curve, that is, the second curve is more continuous in acceleration change than the first curve. For example, in another feasible method, the first curve can be a trapezoidal acceleration and deceleration curve, and the second curve can be a sinusoidal acceleration and deceleration curve, that is, the first curve has the problem of acceleration mutation, and the second curve uses the sine function sin as the acceleration, and its derivative is a trigonometric function, thereby avoiding the problem of acceleration mutation. Among them, the first curve can be constructed or not (only the first constraint parameter of the first curve is determined), and the second curve needs to be constructed.
[0036] In addition, it should be noted that the first constraint parameter and the second constraint parameter are both subject to constraint parameters, which can be one or more. The constraint parameters are used to constrain the motion trajectory of the object to be planned, and can specifically include motion distance, maximum motion speed, maximum acceleration constraint, maximum deceleration constraint and maximum jerk constraint, etc. It can be understood that the constraint parameters of different acceleration and deceleration curves are generally the same, but there are also differences. For example, in one feasible method, assuming that the first curve is a trapezoidal acceleration and deceleration curve and the second curve is a sinusoidal acceleration and deceleration curve, the first curve and the second curve may be the same in motion distance and maximum motion speed, but there are differences in maximum acceleration constraint, maximum deceleration constraint and maximum acceleration. For example, the maximum acceleration constraint in the first constraint parameter is a constant, and the maximum acceleration constraint in the second constraint parameter is a trigonometric function value, wherein the constraint parameters can be expressed as numerical values in specific form.
[0037] In addition, it should be noted that the initial motion parameters are used to characterize the initial real-time motion state, which is determined by the current time step of the object to be planned. Specifically, they can be initial acceleration and initial velocity, etc., which can be collected by the set sensors. When performing curve planning, the horizontal coordinate of the curve can be set to time, and the vertical coordinate of the curve can be set to position, velocity, acceleration, and jump, etc. For example, in one feasible method, assuming that the vertical coordinate of the curve is velocity and the horizontal coordinate of the curve is time, the second curve is the velocity-time sine curve of the object to be planned. In addition, when performing curve planning, the number of curve segments needs to be set, which can be two, three or four segments, etc.
[0038] As an example, steps S10 to S30 include: obtaining initial motion parameters of the object to be planned, planning a trapezoidal acceleration and deceleration curve for the object to be planned based on the initial motion parameters, and determining a first constraint parameter of the trapezoidal acceleration and deceleration curve; inputting the first constraint parameter into a preset curve conversion model, performing numerical conversion on the first constraint parameter through the preset curve conversion model to obtain a second constraint parameter of a sinusoidal acceleration and deceleration curve, wherein the preset curve conversion model can specifically be a curve conversion formula; and planning the sinusoidal acceleration and deceleration curve for the object to be planned through the initial motion parameters of the object to be planned and the second constraint parameter. Since the sinusoidal acceleration and deceleration curve uses the sine value as the acceleration, its derivative is also a trigonometric function, that is, the acceleration changes smoothly, which can effectively avoid the acceleration mutation problem of the trapezoidal acceleration and deceleration curve. At the same time, since the second constraint parameter of the sinusoidal acceleration and deceleration curve is obtained by converting the first constraint parameter of the trapezoidal acceleration and deceleration curve, that is, the second constraint parameter of the sinusoidal acceleration and deceleration curve is not obtained by performing a large number of calculations on trigonometric functions, the planning process of the sinusoidal acceleration and deceleration curve can be simplified. Therefore, the sinusoidal acceleration and deceleration curve planned by this curve planning method can avoid the acceleration mutation problem of the object to be planned during trajectory motion, and can also simplify the curve trajectory planning process, thereby improving the control effect of motion control using the acceleration and deceleration curve.
[0039] In one practicable manner, assuming that in the first constraint parameter, the movement distance is x and the maximum movement speed is v max , the maximum acceleration constraint is a max , the maximum deceleration constraint is d max , the maximum jerk constraint is J max In the initial motion parameters, the initial acceleration is v0 and the initial velocity is a0, then the preset curve conversion model is as follows:
[0040]
[0041]
[0042]
[0043]
[0044]
[0045] Among them, a' max is the maximum acceleration constraint in the second constraint parameter, d' max is the maximum deceleration constraint in the second constraint parameter, at t=t a When , a sinusoidal curve model consistent with the trapezoidal curve model value can be obtained, as follows:
[0046] v=v0+a′ max t a
[0047]
[0048] The step of performing curve trajectory planning on the object to be planned based on the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve includes:
[0049] Step A10: detecting whether the second curve can be obtained by planning based on the initial motion parameters and the second constraint parameters;
[0050] Step A20: If yes, then plan the second curve for the object to be planned based on the initial motion parameters and the second constraint parameters.
[0051] In this embodiment, it should be noted that since the sinusoidal acceleration and deceleration curve has trajectory specification standards, when constructing the sinusoidal acceleration and deceleration curve, it is necessary to ensure that the sinusoidal acceleration and deceleration curve can be constructed under the initial motion parameters and the second constraint parameters. At the same time, since the sinusoidal acceleration and deceleration curve is not set reasonably for the given acceleration and the given speed, the final sinusoidal acceleration and deceleration curve will have a curve planning reversal. Therefore, in actual application scenarios, it cannot be ensured that the sinusoidal acceleration and deceleration curve converted by the curve conversion model meets the actual motion requirements of the planned object.
[0052] In order to solve the above defects, a specific detection means is set to first detect whether a sinusoidal acceleration / deceleration curve can be planned and obtained, and when the sinusoidal acceleration / deceleration curve cannot be obtained normally, the constraint parameters that can construct the sinusoidal acceleration / deceleration curve are reconstructed by setting a constraint parameter reconstruction means. It should be understood that reconstruction is required only when the initial acceleration is less than the maximum acceleration limit (determined by the positive or negative of the initial acceleration and the product of the initial velocity), and the purpose of reconstruction is to ensure the continuity of the sinusoidal acceleration / deceleration curve. For example, in an implementable manner, the product of the initial velocity v0 and the initial acceleration a0 can be calculated as a condition for determining whether the sinusoidal acceleration / deceleration curve needs to be reconstructed. When the product of the initial velocity v0 and the initial acceleration a0 is positive, it indicates that the current state of the object to be planned is in the acceleration section of the sinusoidal acceleration / deceleration curve. When the product of the initial velocity v0 and the initial acceleration a0 is negative, it indicates that the current state of the object to be planned is in the deceleration section of the sinusoidal acceleration / deceleration curve. Taking the current state of the object to be planned in the acceleration section as an example, the maximum acceleration limit a is used at this time. max It is the judgment value for whether the sinusoidal acceleration and deceleration curve is reconstructed. If the initial acceleration a0 is less than the maximum acceleration limit a max, and the initial acceleration a0 is not zero, it means that the initial point of the sinusoidal acceleration / deceleration curve in this curve segment is at the maximum acceleration limit a max On the sinusoidal acceleration and deceleration curve under the limit, that is, the sinusoidal acceleration and deceleration curve is continuous. At this time, by determining that the initial point is at the maximum acceleration limit a max The phase of the sinusoidal acceleration and deceleration curve under the constraint is obtained, and the motion reconstruction parameters corresponding to the curve segment can be calculated through the phase. The motion reconstruction parameters are used to characterize the reconstructed motion parameters, which may include the reconstruction initial speed, the reconstruction initial position, and the reconstruction distance. According to the difference of the second constraint parameters, a preset reconstruction model is set for reconstruction. The preset reconstruction model can be specifically as follows:
[0053]
[0054]
[0055] x'=x+(x0-x0')
[0056]
[0057] Where x' is the initial distance for reconstruction, x'0 is the initial position for reconstruction, v'0 is the initial velocity for reconstruction, w is the phase, and J is the jerk constraint.
[0058] As an example, steps A10 to A20 include: determining the total number of parameters of the initial motion parameters and the second constraint parameters, and detecting whether the sinusoidal acceleration and deceleration curve can be planned based on the size relationship between the total number of parameters and the preset number of parameters; if it is detected that the sinusoidal acceleration and deceleration curve can be planned, then planning the second curve for the object to be planned based on the initial velocity, initial acceleration and second constraint parameters; if it is detected that the second curve cannot be planned, reconstructing the initial velocity and the initial acceleration through a preset reconstruction model to obtain a reconstructed initial velocity and a reconstructed initial acceleration; and planning the sinusoidal acceleration and deceleration curve for the object to be planned based on the reconstructed initial velocity, the reconstructed initial acceleration and the second constraint parameters.
[0059] The specific steps of determining the total amount of the initial motion parameters and the second constraint parameters, and detecting whether the sinusoidal acceleration / deceleration curve can be planned based on the relationship between the total amount of parameters and the preset number of parameters are as follows:
[0060] If the total number of parameters is greater than or equal to the preset number of parameters, it is determined that the sinusoidal acceleration and deceleration curve can be planned. If the total number of parameters is less than the preset number of parameters, it is determined that the sinusoidal acceleration and deceleration curve cannot be planned. For example, assuming that the total number of parameters is zero, each initial motion parameter and the second constraint parameter is recorded as the total number of parameters plus 1, and the preset number of parameters is a specific value. Then, by comparing the two, it can be determined whether the sinusoidal acceleration and deceleration curve can be planned.
[0061] First, determine whether a sinusoidal acceleration / deceleration curve can be planned through the initial motion parameters and the second constraint parameters. When it is determined that a sinusoidal acceleration / deceleration curve can be planned, the existing initial motion parameters and the second constraint parameters are used to plan a sinusoidal acceleration / deceleration curve for the object to be planned. When it is determined that a sinusoidal acceleration / deceleration curve cannot be planned, the motion reconstruction parameters are obtained by reconstructing the initial motion parameters, and a sinusoidal acceleration / deceleration curve is planned according to the motion reconstruction parameters and the second constraint parameters. That is, ensure that a sinusoidal acceleration / deceleration curve that meets the actual needs of the user can be planned through the curve trajectory planning method, thereby avoiding the technical defect of reverse curve planning of the sinusoidal acceleration / deceleration curve due to unreasonable setting of the initial motion parameters. Therefore, on the premise of improving the control effect of motion control using the acceleration / deceleration curve, it lays the foundation for completely solving the problem of acceleration mutation in the process of motion control using the acceleration / deceleration curve.
[0062] The initial motion parameters include an initial velocity and an initial acceleration, the second constraint parameters include an acceleration constraint parameter, and the step of detecting whether the second curve can be planned based on the initial motion parameters and the second constraint parameters includes:
[0063] Step B10, determining acceleration mutation parameters of the object to be planned according to the initial velocity and initial acceleration;
[0064] Step B20: Determine whether the second curve can be obtained by planning by comparing the magnitude relationship between the acceleration mutation parameter and the acceleration constraint parameter.
[0065] In this embodiment, it should be noted that since the number of parameters is not sufficient to fully feedback whether the object to be planned can plan a standard sinusoidal acceleration and deceleration curve under the constraints of the initial acceleration and initial velocity, the acceleration mutation parameter can be determined by further calculation of the initial acceleration and initial velocity, and whether a sinusoidal acceleration and deceleration curve can be planned is determined by the acceleration mutation parameter. Among them, the acceleration mutation parameter is used to characterize the acceleration mutation amplitude, which can be specifically the product of the initial acceleration and the initial velocity, and the acceleration constraint parameter can specifically be the maximum acceleration or the maximum deceleration.
[0066] As an example, steps B10 to B20 include: calculating the product of the initial velocity and the initial acceleration, and using the product of the initial velocity and the initial acceleration as the acceleration mutation parameter of the object to be planned; if it is determined that the acceleration mutation parameter is less than the maximum deceleration in the acceleration constraint parameter, it is determined that the sinusoidal acceleration / deceleration curve cannot be planned; if it is determined that the acceleration mutation parameter is greater than or equal to the maximum deceleration in the acceleration constraint parameter, it is determined that the sinusoidal acceleration / deceleration curve can be planned.
[0067] As another example, steps B10 to B20 include: calculating the product of the initial velocity and the initial acceleration, and using the product of the initial velocity and the initial acceleration as the acceleration mutation parameter of the object to be planned; if it is determined that the acceleration mutation parameter is greater than the maximum acceleration in the acceleration constraint parameters, it is determined that the sinusoidal acceleration / deceleration curve cannot be planned; if it is determined that the acceleration mutation parameter is less than or equal to the maximum acceleration in the acceleration constraint parameters, it is determined that the sinusoidal acceleration / deceleration curve can be planned.
[0068] By setting the product of the initial velocity and the initial acceleration as the judgment condition when determining whether a sinusoidal acceleration and deceleration curve can be planned, and then judging whether a sinusoidal acceleration and deceleration curve can be planned based on the size relationship between the product of the initial velocity and the initial acceleration and the acceleration and deceleration constraint, it is possible to accurately determine whether the acceleration and deceleration mutation of the object to be planned on the sinusoidal acceleration and deceleration curve meets the standard specifications, thereby improving the accuracy of the judgment on whether a sinusoidal acceleration and deceleration curve can be constructed.
[0069] The motion reconstruction parameters include an initial reconstruction acceleration, the second constraint parameters include a jerk constraint parameter and a distance constraint parameter, and the step of planning the second curve for the object to be planned based on the motion reconstruction parameters and the second constraint parameters includes:
[0070] Step C10: when the initial reconstructed acceleration is not the preset acceleration, determining a first distance change of the object to be planned under the joint constraint of the initial reconstructed acceleration and the jerk constraint parameter;
[0071] Step C20, detecting whether the distance difference between the first distance variation and the distance constraint parameter is less than a preset distance difference threshold;
[0072] Step C30: If yes, iteratively adjust the reconstructed jerk corresponding to the initial reconstructed acceleration, and return to the execution step of determining a first distance change of the object to be planned under the joint constraints of the initial reconstructed acceleration and the jerk constraint parameter, until the distance difference is greater than or equal to the preset distance difference threshold;
[0073] Step C40: If not, planning the second curve for the object to be planned according to the motion reconstruction parameters and the second constraint parameters.
[0074] In this embodiment, it should be noted that, since the sinusoidal acceleration and deceleration curve cannot be constructed normally, the motion parameters of the planned object need to be reconstructed. However, the obtained motion reconstruction parameters do not necessarily conform to the sinusoidal acceleration and deceleration curve specifications. Therefore, before constructing the sinusoidal acceleration and deceleration standard curve, the motion reconstruction parameters still need to be judged. For example, assuming that the reconstructed initial speed in the motion reconstruction parameters is a1, since the sinusoidal acceleration and deceleration standard curve requires that the initial speed must be zero, then when a1 is not zero, a1 must be reduced to zero first. The reduction method can be specifically controlled by a control device. When a1 is reduced to Zero, because a1 changes, other motion reconstruction parameters also change accordingly, and then it is necessary to further determine whether the changed motion reconstruction parameters are reasonable. Since the sinusoidal acceleration and deceleration curve still has the risk of reverse when it is unreasonable, it is still necessary to adaptively adjust the relevant parameters in an unreasonable situation to ensure that the construction of the sinusoidal acceleration and deceleration curve meets the actual application requirements. When the first initial reconstruction speed is zero, it is necessary to determine whether the given speed and given distance are reasonable to avoid the reverse problem of the sinusoidal acceleration and deceleration curve. For example, in one feasible method, assuming that a1 is greater than, the initial reconstruction speed and initial reconstruction distance are as follows:
[0075]
[0076]
[0077] Among them, J' max is the jerk limit in the second constraint parameter, v'0 is the initial reconstruction velocity, x' is the initial reconstruction distance (the distance difference between the first distance variation and the distance constraint parameter), a1 is the initial reconstruction acceleration, and x is the distance constraint parameter.
[0078] In addition, it should be noted that the jerk constraint parameter is used to represent the jerk constraint value, the distance constraint parameter is used to represent the specific value of the distance constraint, and the first distance change is used to characterize the distance of the object to be planned from the starting position to the end position, that is, the initial reconstructed acceleration a1 is J' under the jerk constraint value in the second constraint parameter. max The direct drop displacement under the above conditions, wherein the direct drop displacement can be specifically:
[0079]
[0080] Since the object to be planned will move in the opposite direction when the direct-descent displacement is greater than the specific value of the distance constraint, the reconstructed jerk corresponding to the initial reconstructed acceleration needs to be adjusted so that the direct-descent displacement is less than the specific value of the distance constraint. The specific adjustment method can be the Newton iteration method. For example, in one feasible method, it is assumed that the reconstructed jerk is iteratively adjusted by the Newton iteration method, that is, the jerk J1 is used as the independent variable, and the distance difference between the first distance change and the distance constraint parameter is the dependent variable. The independent variable and the dependent variable are substituted into the following formula:
[0081]
[0082] Among them, the residual displacement difference obtained by using the initial motion variable is a point, and the residual displacement obtained by using the maximum jerk of the mechanical constraint is another point. Then the residual displacement function between the two points is a monotonically decreasing function of the maximum jerk that can be achieved, and the function value, that is, the independent variable value when the residual displacement difference is 0 or close to 0, is the actual maximum jerk that can be achieved. For example, in an practicable manner, the embodiment of the present application takes the jerk when the first displacement difference is greater than zero as the actual maximum jerk that can be achieved, wherein, with reference to Figure 2 , Figure 2 Schematic diagram of the before and after comparison of the sinusoidal acceleration and deceleration curve for adjusting the initial reconstructed acceleration.
[0083] As an example, steps C10 to C40 include: determining whether the initial reconstructed acceleration is zero, and when the initial reconstructed acceleration is not zero, determining a first distance change of the object to be planned according to the initial reconstructed acceleration and the jerk constraint parameter; subtracting the first distance change from the distance constraint parameter to obtain a distance difference, and detecting whether the distance difference is less than a preset distance difference threshold; if it is detected that the distance difference is less than the preset distance difference threshold, adjusting the reconstructed jerk corresponding to the initial reconstructed acceleration by Newton iteration method, and using the adjusted reconstructed jerk as the reconstructed jerk, and returning to the execution step: determining the first distance change of the object to be planned under the joint constraints of the initial reconstructed acceleration and the jerk constraint parameter until the distance difference is greater than or equal to the preset distance difference threshold; if it is detected that the distance difference is greater than or equal to the preset distance difference threshold, planning the second curve for the object to be planned according to the motion reconstruction parameter and the second constraint parameter.
[0084] The step of planning the second curve for the object to be planned according to the motion reconstruction parameters and the second constraint parameters includes:
[0085] Step D10, detecting whether to perform secondary reconstruction on the motion reconstruction parameters according to the initial reconstruction speed;
[0086] Step D20: If yes, reconstruct the initial reconstructed speed into a secondary initial reconstructed speed, and reconstruct the initial reconstructed distance into a secondary initial reconstructed distance, wherein the secondary initial reconstructed speed is less than or equal to the speed constraint parameter;
[0087] Step D30, when the secondary initial reconstruction distance is greater than a preset distance threshold, determining a termination reconstruction speed of the object to be planned under the initial reconstruction acceleration;
[0088] Step D40, adjusting the initial reconstruction acceleration according to the corresponding relationship between the initial reconstruction speed and the termination reconstruction speed to obtain an adjusted acceleration;
[0089] Step D50 : constructing the second curve according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the adjusted acceleration, and the second constraint parameter.
[0090] In this embodiment, it should be noted that after setting the adaptive acceleration adjustment algorithm, it can be determined that the reconstructed acceleration meets the requirements of the sinusoidal acceleration and deceleration standard curve, that is, the jump is controlled within a reasonable range to avoid the sinusoidal curve reversal problem caused by unreasonable jump, but there will still be a sinusoidal curve reversal problem caused by the initial reconstruction speed and the initial reconstruction distance. Therefore, it is necessary to determine whether there will be a curve reversal problem by reconstructing the initial speed, and perform a secondary reconstruction of the motion reconstruction parameters when the curve reversal problem occurs. Specifically, it can be determined according to the range to which the initial reconstruction parameters belong. If a secondary reconstruction is performed, then after the secondary reconstruction, it is determined whether the sinusoidal acceleration and deceleration curve has a curve reversal risk based on the secondary initial reconstruction distance. After determining that there is a curve reversal risk, the acceleration is adaptively adjusted through the initial reconstruction speed and the termination reconstruction speed to obtain the adjusted acceleration, and finally the sinusoidal acceleration and deceleration curve is constructed based on the adjusted acceleration.
[0091] As an example, steps D10 to D50 include: detecting whether the motion reconstruction parameters are reconstructed secondary according to the range to which the initial reconstruction speed belongs; if it is detected that the motion reconstruction parameters are reconstructed secondary, reconstructing the initial reconstruction speed into a secondary initial reconstruction speed, and reconstructing the initial reconstruction distance into a secondary initial reconstruction distance, wherein the secondary initial reconstruction speed is less than or equal to the speed constraint parameter; when the secondary initial reconstruction distance is greater than a preset distance threshold, calculating the termination reconstruction speed of the object to be planned under the initial reconstruction acceleration; adjusting the initial reconstruction acceleration according to the correspondence between the initial reconstruction speed and the termination reconstruction speed to obtain an adjusted acceleration; constructing the second curve according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the adjusted acceleration and the second constraint parameter.
[0092] The specific steps of adjusting the initial reconstruction acceleration according to the correspondence between the initial reconstruction speed and the termination reconstruction speed to obtain the adjusted acceleration may be:
[0093] If the initial reconstruction speed is less than the termination reconstruction speed, the initial reconstruction acceleration is adjusted to:
[0094]
[0095] The specific steps of adjusting the initial reconstruction acceleration according to the correspondence between the initial reconstruction speed and the termination reconstruction speed to obtain the adjusted acceleration may also be:
[0096] If the initial reconstruction speed is greater than the termination reconstruction speed, and the termination reconstruction speed is greater than or equal to zero, the initial reconstruction acceleration is adjusted to:
[0097]
[0098] The specific step of adjusting the initial reconstruction acceleration according to the correspondence between the initial reconstruction speed and the termination reconstruction speed to obtain the adjusted acceleration may also be:
[0099] If the initial reconstruction speed is greater than the termination reconstruction speed, and the termination reconstruction speed is less than zero, and at the same time, the sum of the first distance at which the initial reconstruction speed drops to zero and the second distance at which the termination reconstruction speed drops to zero is less than or equal to the movement distance x, then the initial reconstruction acceleration is adjusted to:
[0100]
[0101] It can be understood that when the sum of the first distance at which the initial reconstruction speed drops to zero and the second distance at which the reconstruction speed stops dropping to zero is greater than the movement distance x, the sinusoidal acceleration / deceleration curve will not have a curve reversal problem.
[0102] The step of detecting whether to perform secondary reconstruction on the motion reconstruction parameters according to the initial reconstruction speed includes:
[0103] Step E10: determining whether to perform secondary reconstruction on the motion reconstruction parameters according to the direction between the initial reconstruction speed and the initial reconstruction distance; and / or
[0104] Step E20 : determining whether to perform secondary reconstruction on the motion reconstruction parameters according to the magnitude relationship between the initial reconstruction speed and the speed constraint parameter.
[0105] As an example, steps E10 to E20 include: when the directions of the initial reconstruction speed and the initial reconstruction distance are consistent, determining not to perform secondary reconstruction on the motion reconstruction parameters; and when the directions of the initial reconstruction speed and the initial reconstruction distance are inconsistent, determining to perform secondary reconstruction on the motion reconstruction parameters; and / or
[0106] When the initial reconstruction speed is greater than the speed constraint parameter, it is determined to perform secondary reconstruction on the motion reconstruction parameters; when the initial reconstruction speed is less than or equal to the speed constraint parameter, it is determined not to perform secondary reconstruction on the motion reconstruction parameters.
[0107] In one practicable manner, when the motion reconstruction parameters are reconstructed using the direction between the initial reconstruction speed and the initial reconstruction distance, the speed and distance obtained by the secondary reconstruction are as follows:
[0108] v′0=0
[0109]
[0110] When the motion reconstruction parameters are reconstructed based on the magnitude relationship between the initial reconstruction speed and the speed constraint parameter, the speed and distance obtained by the reconstructed speed are as follows:
[0111] v′0=v max
[0112]
[0113] The present application provides a curve trajectory planning method, namely, obtaining first constraint parameters for planning a first curve for an object to be planned; converting the first constraint parameters into second constraint parameters for a second curve, wherein the second curve is more differentiable than the first curve; and performing curve trajectory planning for the object to be planned based on the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve. Because the second curve is more differentiable than the first curve, using the second curve as the acceleration and deceleration curve for planning the object to be planned can make the speed and acceleration of the object to be planned more continuous during actual motion. That is, using the second curve instead of the first curve to control the acceleration and deceleration of the object to be planned can reduce the problem of sudden changes in speed and acceleration during the trajectory motion of the object to be planned. At the same time, by switching between the constraint parameters of the first curve and the constraint parameters of the second curve, the purpose of flexibly planning different types of acceleration and deceleration curves for the object to be planned can be achieved while simplifying the curve planning process. Instead of always controlling the trajectory motion of the object to be planned through a single planned acceleration and deceleration curve. Therefore, the technical defect that a large number of speed mutations occur during the movement due to the different smoothness of different acceleration and deceleration curves, which in turn makes it easy for severe vibrations and noise to occur during the movement, is overcome. Therefore, the control effect of motion control based on acceleration and deceleration curves is improved.
[0114] Example 2
[0115] Further, refer to Figure 3 In another embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to above and will not be described in detail. On this basis, the step of constructing the second curve according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the adjusted acceleration and the second constraint parameter includes:
[0116] Step F10, determining whether the object to be planned has reverse motion at the secondary initial reconstruction speed and the secondary initial reconstruction distance;
[0117] Step F20: If yes, then adjust the adjusted acceleration a second time according to the termination reconstruction speed to obtain the target acceleration;
[0118] Step F30 : constructing the second curve according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the target acceleration and the second constraint parameter.
[0119] In this embodiment, it should be noted that after the motion parameters such as speed, acceleration and jerk are determined to not cause the sinusoidal acceleration and deceleration curve to have a curve reversal problem due to the rationality of the settings, the total relative displacement of the object to be planned within a certain period must also be synchronously controlled within a reasonable range, otherwise reverse motion will still occur. That is, after the above-mentioned secondary reconstruction of the initial motion parameters, it is necessary to continue to calculate the difference between the distance x2 from the secondary initial reconstruction speed to the secondary termination reconstruction speed and the motion distance difference dx, and use the difference to determine whether the object to be planned will have a reverse motion, where the condition for the reverse motion is that the total relative distance is less than the displacement from the initial speed to the final speed.
[0120] As an example, steps F10 to F30 include: determining the total relative distance from the secondary initial reconstruction speed to the corresponding secondary termination reconstruction speed under the secondary initial reconstruction speed and the secondary reconstruction distance, and subtracting the total relative distance from the secondary reconstruction distance to obtain a difference; when the difference is greater than or equal to zero, determining that the object to be planned does not have reverse motion; when the difference is less than zero, determining that the object to be planned has reverse motion; if it is determined that the object to be planned has reverse motion, performing a secondary adjustment on the adjusted acceleration according to the termination reconstruction speed to obtain a target acceleration; constructing the second curve according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the target acceleration and the second constraint parameter.
[0121] The second adjustment of the adjusted acceleration according to the termination reconstruction speed to obtain the target acceleration may be:
[0122] If the termination reconstruction velocity is zero, the direct drop displacement is calculated:
[0123]
[0124] When x-dx<0, the target acceleration obtained by secondary adjustment is:
[0125]
[0126] The second adjustment of the adjusted acceleration according to the termination reconstruction speed to obtain the target acceleration may also be:
[0127] If the termination reconstruction speed is less than zero, the direct drop displacement is calculated:
[0128]
[0129] When x-dx<0, the target acceleration obtained by secondary adjustment is:
[0130]
[0131] The second adjustment of the adjusted acceleration according to the termination reconstruction speed to obtain the target acceleration may be specifically:
[0132] If the termination reconstruction speed is greater than zero and less than the secondary initial reconstruction speed, the straight-down displacement is calculated as:
[0133]
[0134] When x-dx<0, the target acceleration obtained by secondary adjustment is:
[0135]
[0136] The second adjustment of the adjusted acceleration according to the termination reconstruction speed to obtain the target acceleration may be specifically:
[0137] If the termination reconstruction speed is greater than zero and greater than the secondary initial reconstruction speed, the straight-down displacement is calculated as:
[0138]
[0139] When x-dx<0, the target acceleration obtained by secondary adjustment is:
[0140]
[0141] In one practicable manner, referring to Figure 4 , Figure 4 This is a schematic diagram of the before and after comparison of the secondary adjustment of the acceleration.
[0142] The step of constructing the second curve according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the adjusted acceleration and the second constraint parameter includes:
[0143] Step G10, when the secondary initial reconstruction speed is equal to the speed constraint parameter, determining the number of first curve segments corresponding to the second curve;
[0144] Step G20, when the secondary initial reconstruction speed is less than or equal to the speed constraint parameter, determining the speed extreme value of the object to be planned under the joint constraints of the secondary initial reconstruction speed, the secondary initial reconstruction distance, and the target acceleration;
[0145] Step G30, determining the number of second curve segments corresponding to the second curve according to the magnitude relationship between the speed extreme value and the speed constraint parameter;
[0146] Step G40: construct the second curve according to the number of the first curve segments or the number of the second curve segments.
[0147] In this embodiment, it should be noted that the number of curve segments of the sinusoidal acceleration and deceleration curve under different parameter constraints is different, which can be specifically obtained by the secondary initial reconstruction speed v2 and the maximum speed constraint v" in the second constraint parameter. max The speed limit can be specifically the maximum achievable speed. For example, in one practicable manner, if the secondary initial reconstruction speed v2 is equal to the maximum speed constraint v" max , the curve is divided into two sections: uniform speed section and deceleration section; if the secondary initial reconstruction speed v2 is less than the maximum speed constraint v" max , calculate the maximum achievable speed under the current parameters; if the calculated maximum achievable speed is greater than the maximum speed constraint v" max , then the planned curve has a uniform speed segment under the current parameters, and the curve is divided into at least three segments. If the final speed is less than 0, there are two segments from the maximum achievable speed segment to the final speed, and the curve is divided into four segments; if the calculated maximum achievable speed is less than or equal to the maximum speed constraint v" max , then under the current parameters, the planned curve does not have a uniform speed segment, and the curve is divided into at least two segments. If the final speed is less than 0, there are two segments from the maximum achievable speed segment to the final speed, and the curve is divided into three segments.
[0148] As an example, steps G10 to G40 include: when the secondary initial reconstruction speed is equal to the speed constraint parameter, using the preset number of curve segments as the first number of curve segments corresponding to the second curve; when the secondary initial reconstruction speed is less than or equal to the speed constraint parameter, calculating the speed extreme value of the object to be planned under the joint constraints of the secondary initial reconstruction speed, the secondary initial reconstruction distance and the target acceleration; determining the second number of curve segments corresponding to the second curve based on the size relationship between the speed extreme value and the speed constraint parameter; and constructing the second curve through the first number of curve segments or the second number of curve segments.
[0149] The embodiment of the present application provides a second curve construction method, that is, determining whether the object to be planned has reverse motion under the second initial reconstruction speed and the second initial reconstruction distance; if so, performing a second adjustment on the adjustment acceleration according to the termination reconstruction speed to obtain the target acceleration; and constructing the second curve according to the second initial reconstruction speed, the second initial reconstruction distance, the target acceleration and the second constraint parameter. Compared with the method of circumventing the reverse problem of the sine curve by adjusting the jerk and acceleration to obtain the second curve, the embodiment of the present application determines whether the object to be planned will have reverse motion in displacement by the second reconstruction speed and the second initial reconstruction distance in the second curve, so that when there is reverse motion, the adjustment acceleration is adaptively adjusted to achieve the purpose of completely avoiding the curve reverse problem in the second curve construction process, thereby overcoming the technical defect of curve planning reverse due to unreasonable given initial speed and given displacement, and thus laying a foundation for improving the control effect of motion control using acceleration and deceleration curves.
[0150] Example 3
[0151] The present application also provides a curve trajectory planning device, referring to Figure 5 , the curve trajectory planning device includes:
[0152] An acquisition module 101 is configured to acquire a first constraint parameter for planning a first curve for an object to be planned;
[0153] A conversion module 102, configured to convert the first constraint parameter into a second constraint parameter of a second curve, wherein the second curve is more differentiable than the first curve;
[0154] The planning module 103 is configured to perform curve trajectory planning on the object to be planned according to the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve.
[0155] Optionally, the planning module 103 is further configured to:
[0156] detecting, based on the initial motion parameters and the second constraint parameters, whether the second curve can be obtained by planning;
[0157] If yes, planning the second curve for the object to be planned according to the initial motion parameters and the second constraint parameters;
[0158] If not, reconstruct the initial motion parameters to obtain motion reconstruction parameters;
[0159] The second curve is planned for the object to be planned according to the motion reconstruction parameters and the second constraint parameters.
[0160] Optionally, the initial motion parameters include an initial velocity and an initial acceleration, the second constraint parameters include an acceleration constraint parameter, and the planning module 103 is further configured to:
[0161] Determining acceleration mutation parameters of the object to be planned according to the initial velocity and initial acceleration;
[0162] By comparing the magnitude relationship between the acceleration mutation parameter and the acceleration constraint parameter, it is determined whether the second curve can be planned.
[0163] Optionally, the motion reconstruction parameter includes an initial reconstruction acceleration, the second constraint parameter includes a jerk constraint parameter and a distance constraint parameter, and the planning module 103 is further configured to:
[0164] When the initial reconstructed acceleration is not a preset acceleration, determining a first distance change of the object to be planned under the joint constraint of the initial reconstructed acceleration and the jerk constraint parameter;
[0165] Detecting whether a distance difference between the first distance variation and the distance constraint parameter is less than a preset distance difference threshold;
[0166] If so, iteratively adjust the reconstructed jerk corresponding to the initial reconstructed acceleration, and return to the execution step of: determining a first distance change of the object to be planned under the joint constraints of the initial reconstructed acceleration and the jerk constraint parameter, until the distance difference is greater than or equal to the preset distance difference threshold;
[0167] If not, planning the second curve for the object to be planned according to the motion reconstruction parameters and the second constraint parameters.
[0168] Optionally, the motion reconstruction parameters include an initial reconstruction speed, an initial reconstruction acceleration, and an initial reconstruction distance, the second constraint parameters include a speed constraint parameter, and the planning module 103 is further configured to:
[0169] detecting whether to perform secondary reconstruction on the motion reconstruction parameters according to the initial reconstruction speed;
[0170] If yes, reconstructing the initial reconstruction speed into a secondary initial reconstruction speed, and reconstructing the initial reconstruction distance into a secondary initial reconstruction distance, wherein the secondary initial reconstruction speed is less than or equal to the speed constraint parameter;
[0171] When the secondary initial reconstruction distance is greater than a preset distance threshold, determining a termination reconstruction speed of the object to be planned under the initial reconstruction acceleration;
[0172] Adjusting the initial reconstruction acceleration according to the corresponding relationship between the initial reconstruction speed and the termination reconstruction speed to obtain an adjusted acceleration;
[0173] The second curve is constructed according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the adjusted acceleration, and the second constraint parameter.
[0174] Optionally, the planning module 103 is further configured to:
[0175] determining whether to perform secondary reconstruction on the motion reconstruction parameters according to a direction between the initial reconstruction speed and the initial reconstruction distance; and / or
[0176] Whether to perform secondary reconstruction on the motion reconstruction parameters is determined according to the magnitude relationship between the initial reconstruction speed and the speed constraint parameter.
[0177] Optionally, the planning module 103 is further configured to:
[0178] determining whether the object to be planned has reverse motion at the secondary initial reconstruction speed and the secondary initial reconstruction distance;
[0179] If yes, then performing a secondary adjustment on the adjusted acceleration according to the termination reconstruction speed to obtain a target acceleration;
[0180] The second curve is constructed according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the target acceleration and the second constraint parameter.
[0181] Optionally, the planning module 103 is further configured to:
[0182] When the secondary initial reconstruction speed is equal to the speed constraint parameter, determining the number of first curve segments corresponding to the second curve;
[0183] When the secondary initial reconstruction speed is less than or equal to the speed constraint parameter, determining a speed extreme value of the object to be planned under the joint constraints of the secondary initial reconstruction speed, the secondary initial reconstruction distance, and the target acceleration;
[0184] determining the number of second curve segments corresponding to the second curve according to a magnitude relationship between the speed extreme value and the speed constraint parameter;
[0185] The second curve is constructed according to the number of the first curve segments or the number of the second curve segments.
[0186] The curved trajectory planning device provided by the present invention utilizes the curved trajectory planning method described in the aforementioned embodiment to address the technical issue of poor control effectiveness associated with motion control using acceleration and deceleration curves. Compared to the prior art, the beneficial effects of the curved trajectory planning device provided by the embodiment of the present invention are the same as those of the curved trajectory planning method described in the aforementioned embodiment. Other technical features of the curved trajectory planning device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0187] Example 4
[0188] An embodiment of the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the curve trajectory planning method in the above-mentioned embodiment one.
[0189] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0190] like Figure 6 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. Various programs and data required for the operation of the electronic device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus.
[0191] Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, hard disk, etc.; and communication devices 1009. The communication devices can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or have instead.
[0192] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 1009, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0193] The electronic device provided by the present invention utilizes the curved trajectory planning method of the aforementioned embodiment to address the technical issue of poor control effectiveness associated with motion control using acceleration and deceleration curves. Compared to the prior art, the electronic device provided by the present invention achieves the same beneficial effects as the curved trajectory planning method provided by the aforementioned embodiment. Other technical features of the electronic device are the same as those disclosed in the aforementioned embodiment and are not further detailed here.
[0194] It should be understood that various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in an appropriate manner.
[0195] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
[0196] Example 5
[0197] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the curve trajectory planning method in the above embodiment.
[0198] The computer-readable storage medium provided in the embodiment of the present invention can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media can 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 thereof. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0199] The computer-readable storage medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0200] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device: obtains first constraint parameters for planning a first curve for the object to be planned; converts the first constraint parameters into second constraint parameters for a second curve, wherein the second curve is more differentiable than the first curve; and performs curve trajectory planning for the object to be planned based on the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve.
[0201] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0202] The flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0203] The modules involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0204] The computer-readable storage medium provided by the present invention stores computer-readable program instructions for executing the aforementioned curved trajectory planning method, resolving the technical issue of poor control effectiveness associated with motion control using acceleration and deceleration curves. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiments of the present invention are similar to those of the curved trajectory planning method provided by the aforementioned embodiments and are not further elaborated here.
[0205] Example 6
[0206] The present application also provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned curve trajectory planning method when executed by a processor.
[0207] The computer program product provided in this application solves the technical problem of poor control effects associated with motion control using acceleration and deceleration curves. Compared to the prior art, the beneficial effects of the computer program product provided in this embodiment of the present invention are the same as those of the curve trajectory planning method provided in the above-mentioned embodiment, and are not further elaborated here.
[0208] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A curve trajectory planning method, characterized in that: The curve trajectory planning method comprises: Obtaining first constraint parameters for planning a first curve for the object to be planned; converting the first constraint parameter into a second constraint parameter of a second curve, wherein the second curve is more differentiable than the first curve; performing curve trajectory planning on the object to be planned according to the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve; The step of performing curve trajectory planning on the object to be planned based on the initial motion parameters of the object to be planned and the second constraint parameters to obtain the second curve includes: detecting, based on the initial motion parameters and the second constraint parameters, whether the second curve can be obtained by planning; If yes, planning the second curve for the object to be planned according to the initial motion parameters and the second constraint parameters; If not, reconstruct the initial motion parameters to obtain motion reconstruction parameters; Planning the second curve for the object to be planned according to the motion reconstruction parameter and the second constraint parameter; The initial motion parameters include initial velocity and initial acceleration, and the second constraint parameters include acceleration constraint parameters. The step of detecting whether the second curve can be obtained by planning according to the initial motion parameters and the second constraint parameters includes: Determining acceleration mutation parameters of the object to be planned according to the initial velocity and initial acceleration; By comparing the magnitude relationship between the acceleration mutation parameter and the acceleration constraint parameter, it is determined whether the second curve can be planned.
2. The curve trajectory planning method according to claim 1, characterized in that: The motion reconstruction parameters include an initial reconstruction acceleration, and the second constraint parameters include a jerk constraint parameter and a distance constraint parameter. The step of planning and obtaining the second curve for the object to be planned according to the motion reconstruction parameter and the second constraint parameter comprises: When the initial reconstructed acceleration is not a preset acceleration, determining a first distance change of the object to be planned under the joint constraint of the initial reconstructed acceleration and the jerk constraint parameter; Detecting whether a distance difference between the first distance variation and the distance constraint parameter is less than a preset distance difference threshold; If so, iteratively adjust the reconstructed jerk corresponding to the initial reconstructed acceleration, and return to the execution step of: determining a first distance change of the object to be planned under the joint constraints of the initial reconstructed acceleration and the jerk constraint parameter, until the distance difference is greater than or equal to the preset distance difference threshold; If not, planning the second curve for the object to be planned according to the motion reconstruction parameters and the second constraint parameters.
3. The curve trajectory planning method according to claim 1, wherein: The motion reconstruction parameters include initial reconstruction speed, initial reconstruction acceleration and initial reconstruction distance, and the second constraint parameters include speed constraint parameters. The step of planning and obtaining the second curve for the object to be planned according to the motion reconstruction parameter and the second constraint parameter comprises: detecting whether to perform secondary reconstruction on the motion reconstruction parameters according to the initial reconstruction speed; If yes, reconstructing the initial reconstruction speed into a secondary initial reconstruction speed, and reconstructing the initial reconstruction distance into a secondary initial reconstruction distance, wherein the secondary initial reconstruction speed is less than or equal to the speed constraint parameter; When the secondary initial reconstruction distance is greater than a preset distance threshold, determining a termination reconstruction speed of the object to be planned under the initial reconstruction acceleration; Adjusting the initial reconstruction acceleration according to the corresponding relationship between the initial reconstruction speed and the termination reconstruction speed to obtain an adjusted acceleration; The second curve is constructed according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the adjusted acceleration, and the second constraint parameter.
4. The curve trajectory planning method according to claim 3, characterized in that: The step of detecting whether to perform secondary reconstruction on the motion reconstruction parameters according to the initial reconstruction speed includes: determining whether to perform secondary reconstruction on the motion reconstruction parameters according to a direction between the initial reconstruction speed and the initial reconstruction distance; and / or Whether to perform secondary reconstruction on the motion reconstruction parameters is determined according to the magnitude relationship between the initial reconstruction speed and the speed constraint parameter.
5. The curve trajectory planning method according to claim 3, characterized in that: The step of constructing the second curve according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the adjusted acceleration and the second constraint parameter includes: determining whether the object to be planned has reverse motion at the secondary initial reconstruction speed and the secondary initial reconstruction distance; If yes, then performing a secondary adjustment on the adjusted acceleration according to the termination reconstruction speed to obtain a target acceleration; The second curve is constructed according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the target acceleration and the second constraint parameter.
6. The curve trajectory planning method according to claim 5, characterized in that: The step of constructing the second curve according to the secondary initial reconstruction speed, the secondary initial reconstruction distance, the adjusted acceleration and the second constraint parameter includes: When the secondary initial reconstruction speed is equal to the speed constraint parameter, determining the number of first curve segments corresponding to the second curve; When the secondary initial reconstruction speed is less than or equal to the speed constraint parameter, determining a speed extreme value of the object to be planned under the joint constraints of the secondary initial reconstruction speed, the secondary initial reconstruction distance, and the target acceleration; determining the number of second curve segments corresponding to the second curve according to a magnitude relationship between the speed extreme value and the speed constraint parameter; The second curve is constructed according to the number of the first curve segments or the number of the second curve segments.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the curve trajectory planning method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program for implementing the curve trajectory planning method, and the program for implementing the curve trajectory planning method is executed by a processor to implement the steps of the curve trajectory planning method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Reconfigurable computer numerical control system, numerical control method thereof and reconstruction method thereof
CN102354147A
Motion track planning method and device, equipment and storage medium
CN113703399A