Self-adaptive S-shaped planning curve motion damping method and device
By calculating and adjusting the target motion parameters in the S-type planning curve, the motion trajectory is optimized, and the problem of poor movement effect of conventional S-type curves in high moment of inertia, high acceleration, and short distance motion is achieved, and smoother and more comfortable motion control is achieved.
Patent Information
- Application Number
- CN202411445675.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-02-28
AI Technical Summary
The conventional S-shaped curve has poor movement effect in high inertia, high acceleration, and short-distance sports occasions, resulting in large impact on the equipment and affecting accuracy and stability.
By calculating the target distances of the seven stages of the S-type planning curve to be planned and dynamically adjusting the target motion parameters of each stage, an optimized target S-type planning curve is obtained to reduce impact and vibration and improve the stability of the motion.
The smooth transition of the motion trajectory is achieved, the impact and vibration caused by sudden velocity changes are reduced, the stability and comfort of the motion are improved, and the overall motion performance is enhanced.
Smart Images

Figure CN119536384A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor drive technology, and in particular to a motion damping method and device for an adaptive S-shaped planning curve. Background Art
[0002] In the existing technology of high-precision equipment such as slicers, the smoothness of the motion control curve is crucial to ensure the accuracy of the equipment and extend the life of the equipment. The traditional T-type motion curve has no smoothing function, which will produce a large impact at the start and stop of the movement, resulting in unstable movement, thus affecting the service life and processing quality of the equipment.
[0003] In order to solve the above problems, the conventional S-curve came into being. The conventional S-curve is a typical 4-segment S-curve, which controls the smoothing effect of the planned curve by setting the acceleration and deceleration. Specifically, the speed curve of this S-curve presents an S-shaped change, which can achieve a certain smoothing effect under the condition of small inertia load. However, because its acceleration curve is triangular, it does not transition smoothly when switching between acceleration and deceleration. In high inertia, high acceleration, and short distance motion, the motion effect of the conventional S-curve cannot achieve the ideal smoothing effect.
[0004] Especially in short-distance movement, the conventional S-curve will have a greater impact on the machine, affecting the accuracy and stability of the equipment. This impact will not only reduce the processing quality of the equipment, but may also cause wear and failure of the equipment, increasing maintenance costs. Summary of the invention
[0005] One purpose of an embodiment of the present invention is to provide a motion damping method and device for an adaptive S-shaped planning curve, which is used to solve the technical problem that a conventional S-shaped curve will have a large impact on a machine device, affecting the accuracy and stability of the device.
[0006] In a first aspect, an embodiment of the present invention provides a motion damping method for an adaptive S-shaped planning curve, the method comprising:
[0007] Get the starting motion parameters;
[0008] According to the starting motion parameters, the target distances corresponding to the seven stages in the S-shaped planning curve to be planned are calculated, and the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned;
[0009] According to the target distance and the preset planning distance, determining the target motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned;
[0010] A target S-shaped planning curve is obtained according to the target motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned.
[0011] In a second aspect, an embodiment of the present invention provides a motion damping device that is adaptive to an S-shaped planning curve, the device comprising:
[0012] An acquisition unit, used for acquiring a starting motion parameter;
[0013] A calculation unit, used for calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned according to the starting motion parameters, wherein the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned;
[0014] A determination unit, used to determine target motion parameters corresponding to seven stages in the S-shaped planning curve to be planned according to the target distance and the preset planning distance;
[0015] The determining unit is further used to obtain a target S-shaped planning curve according to target motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned.
[0016] In a third aspect, an embodiment of the present invention provides a computer device, including:
[0017] at least one processor; and,
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] 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 method according to the first aspect.
[0020] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method as described in the first aspect.
[0021] In the scheme implemented by the motion damping method, device, equipment and storage medium of the above-mentioned adaptive S-shaped planning curve, the method ensures the smooth transition of the motion trajectory by calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned, reduces the impact and vibration caused by the sudden change of speed, thereby improving the smoothness of the motion and ensuring that each section of the motion process meets the predetermined damping requirements; further, by comparing the target distance with the preset planning distance, the target motion parameters of each stage are dynamically adjusted to ensure the adaptability and flexibility of the motion curve, so as to better cope with different motion requirements and environmental changes; according to the target motion parameters of the seven stages, the optimized target S-shaped planning curve is finally obtained, which can not only effectively reduce shock, but also improve the smoothness and comfort of the motion, improve the overall motion performance, and simplify the operator's workflow through automated parameter calculation and adjustment, reduce the possibility of human errors, and make motion control easier and faster. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0023] Figure 1 It is a schematic flow chart of a motion damping method of an adaptive S-shaped planning curve in one embodiment of the present invention;
[0024] Figure 2A It is a curve diagram of seven stages in an S-shaped planning curve to be planned in one embodiment of the present invention;
[0025] Figure 2B It is a schematic diagram of the changes of motion parameters in seven stages of an S-shaped planning curve to be planned in one embodiment of the present invention;
[0026] Figure 3 It is a schematic structural diagram of a motion damping device with an adaptive S-shaped planning curve in one embodiment of the present invention;
[0027] Figure 4 It is a schematic diagram of the structure of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0029] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0030] The technical solution of the present application can be applied to various slicer usage scenarios.
[0031] In view of this, the present application proposes a motion damping method of an adaptive S-shaped planning curve to solve the above problems, which is described in detail below.
[0032] See also Figure 1 , Figure 1 A schematic flow chart of a motion damping method for an adaptive S-shaped planning curve provided in an embodiment of the present invention, the method comprising the following steps:
[0033] S10. Obtaining initial motion parameters.
[0034] Among them, the above-mentioned starting motion parameters may include but are not limited to a preset planned distance, maximum speed, maximum acceleration, maximum deceleration, acceleration, deceleration, etc.
[0035] The preset planning distance refers to the total distance that needs to be moved from the starting position to the final position. This is one of the most basic parameters, which directly affects the shape and size of the motion planning curve; the maximum speed Vmax refers to the maximum speed allowed during the motion process, which is the upper limit of the motion speed; the maximum acceleration a maxIt refers to the maximum acceleration allowed during the movement. This parameter is used to limit the acceleration to prevent excessive acceleration from causing system instability or generating excessive impact force. Maximum deceleration refers to the maximum deceleration allowed during the movement. This parameter is used to limit the deceleration to ensure the stability of the system during the deceleration process. Jerk refers to the rate of change of acceleration, that is, the derivative of acceleration. This parameter is used to describe the speed of change of acceleration to ensure the smoothness of the acceleration change process. Deceleration refers to the rate of change of deceleration, that is, the derivative of deceleration. This parameter is used to describe the speed of change of deceleration to ensure the smoothness of the deceleration change process.
[0036] Optionally, starting speed Vst: the initial speed at the beginning of movement, usually 0, but may not be 0 in some cases; starting acceleration Ast: the initial acceleration at the beginning of movement, usually 0, but may not be 0 in some cases; starting deceleration Dst: the initial deceleration at the beginning of movement, usually 0, but may not be 0 in some cases.
[0037] The above-mentioned initial motion parameters may be set manually or may be empirical values obtained based on previous motion control experience, and are not limited thereto.
[0038] It can be seen that in this embodiment, by obtaining the initial motion parameters, a precise starting point can be provided for motion control, thereby ensuring the accuracy of the entire motion process.
[0039] S20. Calculate target distances corresponding to seven stages in the S-shaped planning curve to be planned according to the starting motion parameters, where the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned.
[0040] The seven stages in the above-mentioned S-shaped planning curve to be planned may include: the first stage (acceleration stage), the second stage (uniform acceleration stage), the third stage (deceleration stage), the fourth stage (uniform speed stage), the fifth stage (acceleration and deceleration stage), the sixth stage (uniform deceleration stage), and the seventh stage (deceleration and deceleration stage). For example, the above-mentioned seven stages can refer to Figure 2A , Figure 2A A curve diagram describing the seven stages of the S-shaped planning curve to be planned.
[0041] Specifically, the first stage (acceleration stage) is when the acceleration gradually increases from rest, that is, the acceleration gradually increases from zero to the maximum acceleration, and the distance corresponding to the first stage is the calculation result based on the initial acceleration and time; the second stage (uniform acceleration stage) is when the acceleration reaches the maximum value and remains constant, and the speed continues to increase, and the distance corresponding to the second stage is the calculation result based on the maximum acceleration and time; the third stage (deceleration stage) is when the acceleration gradually decreases from the maximum value to zero, and the distance corresponding to the third stage is calculated based on the process of gradual decrease in acceleration; the fourth stage (uniform speed stage) is when the acceleration remains unchanged at the maximum value, the acceleration is zero, and the distance corresponding to the fourth stage is calculated based on the constant speed and time; the fifth stage (acceleration and deceleration stage) is when the acceleration gradually decreases from zero to the maximum deceleration, and the distance corresponding to the fifth stage is calculated based on the process of gradual increase in deceleration; the sixth stage (uniform deceleration stage) is when the acceleration remains unchanged at the maximum deceleration, and the speed gradually decreases, and the distance corresponding to the sixth stage is calculated based on the maximum deceleration and time; the seventh stage (deceleration and deceleration stage) is when the acceleration gradually decreases from the maximum deceleration to zero, and the distance corresponding to the seventh stage is calculated based on the process of gradual decrease in deceleration.
[0042] The target distance represents the total distance covered by the entire S-shaped planning curve obtained by adding the distances (displacements) of the seven stages.
[0043] Specifically, the calculation process of S20 may be performed with reference to the following formula:
[0044]
[0045]
[0046]
[0047]
[0048] The above formulas respectively describe the change rules of the maximum jerk J(t), acceleration a(t), velocity v(t) and displacement s(t) in each stage. The above formulas can be used to calculate the target distance in each stage. By adding these distances, the total distance of the entire movement process can be obtained.
[0049] For example, the motion parameters in the above seven stages can be referred to Figure 2B , Figure 2B The schematic diagram of the change of motion parameters in the seven stages of the S-shaped planning curve to be planned is described.
[0050] Specifically, the seven stages are explained according to the above formula: the first stage (acceleration stage) is t∈[0, t1], and the jerk J(t)=J max, acceleration a(t) = J max t, speed Displacement Where v0 is the initial velocity. The time corresponding to the first stage (acceleration stage) can be t∈[0, t1]; the time corresponding to the second stage (uniform acceleration stage) can be t∈[t1, t2], the time corresponding to the third stage (deceleration stage) can be t∈[t2, t3], the time corresponding to the fourth stage (uniform speed stage) can be t∈[t3, t4], the time corresponding to the fifth stage (acceleration and deceleration stage) can be t∈[t4, t5], the time corresponding to the sixth stage (uniform deceleration stage) can be t∈[t5, t6], and the time corresponding to the seventh stage (deceleration and deceleration stage) can be t∈[t6, t7]. Therefore, the subsequent six stages can be deduced in this way.
[0051] It can be seen that in this embodiment, by adding the distances of the seven stages, the total distance of the entire S-shaped planning curve is obtained. The total distance will be used to compare with the preset planning distance to verify whether the planning meets the motion requirements or whether adjustments are needed. In this way, the accuracy and efficiency of the motion control system can be ensured.
[0052] In one embodiment, the target distances corresponding to the seven stages in the S-shaped planning curve to be planned are calculated according to the starting motion parameters, including obtaining the first speeds corresponding to the seven stages in the S-shaped planning curve to be planned according to the starting motion parameters; obtaining the first distances corresponding to the seven stages in the S-shaped planning curve to be planned according to the first speeds corresponding to the seven stages in the S-shaped planning curve to be planned; obtaining the target distance according to the first distances corresponding to the seven stages in the S-shaped planning curve to be planned, and the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned.
[0053] The first speed refers to the speed at the beginning of each stage. According to the initial motion parameters (such as maximum speed, maximum acceleration, etc.), the first speed corresponding to each stage can be calculated.
[0054] The first distance is the displacement corresponding to the velocity at the end of each stage, starting from the first velocity of the stage. This is usually calculated by integrating the velocity-time curve.
[0055] The definition of the target distance is consistent with that in S20, that is, by adding the first distance of each stage, the total displacement of the entire movement process can be obtained.
[0056] As described in S20, the first speed corresponding to the first stage (acceleration stage) is v1, that is, The first speed corresponding to the second stage (uniform acceleration stage) is v2=v1+a max t, and so on, which will not be repeated here.
[0057] As described in S20, the first distance corresponding to the first stage (acceleration stage) is The first distance corresponding to the second stage (uniform acceleration stage) is And so on, no repetition is given here.
[0058] It can be seen that this embodiment ensures that the motion control system can accurately plan a motion trajectory from the initial position to the final position while satisfying various constraints in the motion process.
[0059] In one embodiment, before calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned according to the starting motion parameters, the method also includes: judging whether the uniform speed stage currently exists according to the starting motion parameters and preset judgment conditions; if the uniform speed stage exists, calculating the starting motion parameters according to a first preset formula to obtain a second motion parameter, and the second motion parameter is used to calculate the target distances corresponding to the seven stages in the S-shaped planning curve to be planned; or, if the uniform speed stage does not exist, calculating the starting motion parameters according to a second preset formula to obtain a third motion parameter, and the third motion parameter is used to calculate the target distances corresponding to the seven stages in the S-shaped planning curve to be planned.
[0060] Among them, in judging whether the uniform speed stage currently exists according to the starting motion parameters and the preset judgment conditions, it is judged whether the uniform speed stage exists by comparing the maximum speed Vmax, the starting speed Vst with the preset acceleration ProAcc, the preset deceleration ProDec and the jerk Jmax.
[0061] Among them, the uniform speed stage can be divided into uniform acceleration and uniform deceleration stages.
[0062] Specifically, the preset judgment conditions are as follows:
[0063] (Vmax-Vst)>((ProAcc*ProAcc) / Jmax---The first preset judgment condition when in uniform acceleration;
[0064] (Vmax-Vst)>((ProDec*ProDec) / Jmax--The second preset judgment condition when in uniform deceleration.
[0065] Since uniform acceleration and uniform deceleration are set to equal values, ProAcc in the following formulas can be replaced by ProDec.
[0066] Wherein, if the uniform speed stage exists, the initial motion parameter is calculated according to the first preset formula, and in the process of obtaining the second motion parameter, the calculation can be performed by the following first preset formula:
[0067] T1=T3=T5=T7=ProAcc / Jmax
[0068] T2=T6=((Vmax-Vst) / ProAcc)-T1
[0069] amax=ProAcc
[0070] The second motion parameter may include but is not limited to the time and speed of the uniform speed stage; amax=ProAcc means that the maximum acceleration is set to the preset acceleration.
[0071] If the condition is not met, it means that the difference between the maximum speed and the starting speed is not enough to achieve a complete uniform acceleration and uniform deceleration stage. In this case, the parameters need to be adjusted to ensure the smoothness of the motion. If the uniform speed stage does not exist, the starting motion parameter is calculated according to the second preset formula to obtain the third motion parameter, which can be calculated by the following second preset formula:
[0072] T2=T6=dAtSet
[0073] amax=pow((Vmax-Vst)*Jmax,0.5)
[0074] T1=T3=T5=T7==pow((Vmax-Vst) / Jmax,0.5)
[0075] Among them, dAtSet is the preset time parameter, which is not uniquely limited here; the maximum acceleration amax is recalculated based on the starting speed, maximum speed and jerk.
[0076] Note that T1 to T7 mentioned above represent the first to seventh stages.
[0077] Further, in the target distances corresponding to the seven stages in the S-shaped planning curve to be planned, the calculation can be performed by the formula mentioned in S20, which will not be repeated here.
[0078] It can be seen that, through the set judgment and parameter adjustment in this embodiment, it is possible to adapt to different motion requirements and ensure that a smooth motion curve can be achieved in various situations, thereby improving the performance and accuracy of the motion control system.
[0079] S30. Determine target motion parameters corresponding to seven stages in the S-shaped planning curve to be planned according to the target distance and the preset planning distance.
[0080] The preset planning distance is the total distance set when the motion trajectory is designed, which is usually fixed or set according to specific application requirements.
[0081] Among them, the purpose of comparing these two distances is to verify whether the calculated S-shaped planning curve can meet the actual movement requirements. That is, based on the comparison between the target distance and the preset planning distance, the movement parameters of each stage, such as speed and acceleration, can be determined to ensure that the machine can move along the predetermined trajectory. If the target distance is greater than the preset planning distance, it may be necessary to adjust the movement parameters, such as reducing acceleration or deceleration, to ensure that the machine does not exceed the predetermined movement distance; if the target distance is less than the preset planning distance, it may be necessary to increase the speed of the machine at certain stages to ensure that the entire preset planning distance can be covered.
[0082] The target motion parameters may include: time parameters for each stage (such as T1, T2, T3, etc.), speed parameters at the beginning and end of each stage, acceleration parameters or deceleration parameters at each stage, and distance parameters at each stage.
[0083] Optionally, if parameters need to be adjusted, it may involve iterative calculations, i.e. recalculating the velocity, acceleration, and displacement at each stage until an optimal combination of motion parameters that satisfies a preset planning distance is found.
[0084] It can be seen that this embodiment ensures that the S-shaped planning curve can not only meet the requirements of motion performance in practical applications, but also accurately reach the predetermined position, thereby achieving efficient and smooth motion control.
[0085] S40, obtaining a target S-shaped planning curve according to target motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned.
[0086] The target motion parameters include acceleration, speed, time and distance of each stage, which define the detailed characteristics of the S-curve. That is, the target motion parameters of each stage are determined according to the calculation results of the previous step, and they include but are not limited to the starting speed, ending speed, acceleration, deceleration, duration and distance of each stage.
[0087] Among them, the S-shaped planning curve is usually composed of multiple mathematical functions, which describe the relationship between the change of speed and time and the resulting displacement. By substituting the target motion parameters of each stage into the corresponding mathematical model, the curve equation of each stage can be obtained. By splicing the curve equations of these stages together, a complete S-shaped planning curve is formed, that is, the target S-shaped planning curve.
[0088] Among them, the target S-shaped planning curve usually has the following characteristics: at the start and end stages, the speed transitions smoothly to reduce mechanical shock. During the acceleration and deceleration stages, the acceleration or deceleration is kept within the preset maximum value to avoid excessive torque from causing damage to the mechanical structure. In the uniform speed stage (if any), the speed remains constant to achieve stable processing or transportation. The change rates of acceleration, deceleration, acceleration and deceleration of the S curve are consistent.
[0089] It can be seen that in this embodiment, a smooth and efficient target S-shaped planning curve can be obtained through accurate target motion parameters, thereby improving the performance and reliability of the entire method.
[0090] The method ensures a smooth transition of the motion trajectory by calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned, reduces the impact and vibration caused by the sudden change in speed, thereby improving the stability of the motion and ensuring that each section of the motion process meets the predetermined shock absorption requirements; further, by comparing the target distance with the preset planning distance, the target motion parameters of each stage are dynamically adjusted to ensure the adaptability and flexibility of the motion curve, so as to better cope with different motion requirements and environmental changes; according to the target motion parameters of the seven stages, the optimized target S-shaped planning curve is finally obtained, which can not only effectively reduce shock, but also improve the stability and comfort of the motion, and improve the overall motion performance, and through the automated parameter calculation and adjustment, the operator's workflow is simplified, the possibility of human error is reduced, and motion control is made simpler and faster.
[0091] In one embodiment, the target motion parameters corresponding to the seven stages in the S-type planning curve to be planned are determined according to the target distance and the preset planning distance, including: judging whether the target distance is greater than the preset planning distance; if the target distance is greater than the preset planning distance, obtaining the first motion parameters corresponding to the seven stages in the current S-type planning curve to be planned; iteratively processing the first motion parameters corresponding to the seven stages in the S-type planning curve to be planned, and when the iteration stop condition is reached, obtaining the second distances corresponding to the seven stages in the S-type planning curve to be planned, the second distance is the sum of the distances of the seven stages in the S-type planning curve to be planned, and the iteration stop condition is that the second distance is less than or equal to the preset planning distance; judging whether there is a uniform speed stage according to the second distances corresponding to the seven stages in the S-type planning curve to be planned, if the uniform speed stage exists, judging whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed; if they are the same, obtaining the motion parameters corresponding to the seven stages in the current S-type planning curve to be planned as the target motion parameters.
[0092] Among them, first compare the calculated target distance (the sum of the distances of the seven stages of the S-shaped planning curve) with the preset planning distance. If the target distance is greater than the preset planning distance, it means that the current planning curve does not meet the requirements and needs to be adjusted.
[0093] The first motion parameter may include but is not limited to the time, speed, acceleration and jerk of each stage.
[0094] The iterative processing is to iteratively process parameters such as acceleration, speed, time, etc. until the total moving distance (second distance) is less than or equal to the preset planned distance.
[0095] Specifically, the iterative processing may include adjusting the values of acceleration and deceleration, changing the duration of the uniform speed stage, or adjusting the starting and ending speeds, etc. If it is found during the iterative process that the speed of the uniform speed stage is different from the preset uniform speed, it may be necessary to further adjust the parameters until the preset conditions are met.
[0096] The iteration stopping condition may be that the second distance is less than or equal to the preset planning distance, or that the adjustment parameters reach a certain accuracy or the number of iterations reaches an upper limit.
[0097] Among them, after each iteration, the sum of the distances of the seven stages is recalculated, which is called the second distance.
[0098] Among them, after the iteration stops, it is determined whether there is a uniform speed stage according to the new second distance. If there is a uniform speed stage, it is further checked whether the speed of the uniform speed stage is the same as the preset uniform speed. If the speed of the uniform speed stage is the same as the preset uniform speed, then the motion parameters corresponding to the seven stages in the S-shaped planning curve obtained by the current iteration will be regarded as the target motion parameters, which will be used for the final motion control. The final target motion parameters will ensure that the mechanical device can complete the precise motion from the starting position to the preset planning distance without exceeding the preset planning distance.
[0099] It can be seen that in this embodiment, the motion parameters of the seven stages are adjusted according to the comparison between the target distance and the preset planning distance to ensure that the final motion curve can meet the preset planning distance.
[0100] In one embodiment, the determination of whether the target distance is greater than the preset planning distance includes: if the target distance is less than or equal to the preset planning distance, determining that there is a uniform speed stage in the target distance; determining whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed; if they are the same, obtaining the motion parameters corresponding to the seven stages in the current S-shaped planning curve to be planned as the target motion parameters.
[0101] Among them, if the target distance is less than or equal to the preset planning distance, it means that the total distance of the currently calculated S-shaped planning curve has met or is less than the total distance required to be covered by the motion trajectory.
[0102] Among them, the uniform speed stage is the part of the S-shaped curve where the speed remains constant, usually located between the acceleration stage and the deceleration stage.
[0103] If there is a uniform speed stage, it is necessary to determine whether the speed of the uniform speed stage is consistent with the preset uniform speed. The preset uniform speed is the constant speed expected to be achieved in motion planning.
[0104] If the uniform speed in the uniform speed stage is the same as the preset uniform speed, the motion parameters of the seven stages in the currently planned S-curve can be determined as the target motion parameters, which means that no further adjustment is required and the current parameters have met the planning requirements.
[0105] Optionally, if the speed in the uniform speed stage is different from the preset uniform speed, the motion parameters may need to be readjusted, such as increasing or decreasing the time of the uniform speed stage, or adjusting the parameters of the acceleration and deceleration stages, to achieve the preset uniform speed.
[0106] It can be seen that this embodiment ensures that the motion task is completed in an optimized manner within a predetermined stroke, while meeting the requirements of motion accuracy and efficiency.
[0107] In one embodiment, the first motion parameters corresponding to the seven stages in the S-type planning curve to be planned are iteratively processed, and when the iteration stop condition is reached, the second distances corresponding to the seven stages in the S-type planning curve to be planned are obtained, including: according to the first motion parameters corresponding to the seven stages in the S-type planning curve to be planned, the second speeds corresponding to the seven stages in the S-type planning curve to be planned are obtained; according to the second speeds corresponding to the seven stages in the S-type planning curve to be planned, the third distances corresponding to the seven stages in the S-type planning curve to be planned are obtained; according to the third distances corresponding to the seven stages in the S-type planning curve to be planned, the fourth distance is obtained, and the fourth distance is the sum of the distances of the seven stages in the S-type planning curve to be planned; when the iteration stop condition is reached, the fourth distance is determined to be the second distances corresponding to the seven stages in the S-type planning curve to be planned.
[0108] The second speed is based on the preliminary planning or the calculation result of the previous iteration. Further, the third distance of each stage is calculated using the second speed of each stage. This is obtained by integrating the speed curve, that is, the speed of each stage multiplied by the duration of the stage. The third distances of the seven stages in the S-shaped planning curve are added together to obtain the fourth distance, which is the total distance of the entire S-shaped planning curve.
[0109] In the iteration process, when the fourth distance meets the preset planning distance requirement (for example, the fourth distance is less than or equal to the preset planning distance), the iteration stops. When the iteration stops, the fourth distance is the sum of the third distances of the seven stages, which represents the total distance of the S-curve in the current iteration; when the fourth distance reaches or approaches the preset planning distance, the iteration stop condition is met, and the fourth distance at this time is determined as the second distance, that is, the final accepted total distance.
[0110] For example, if: the preset planned distance is less than the target distance, the actual speed cannot reach the set speed, nV1=max(Vst,Vend); nV2=Vmax; Vmax=(nV1+nV2) / 2.0; T4=dVtSet; continue to return to S20 for iteration, otherwise it means there is a uniform speed segment; calculate whether the uniform speed is equal to the preset uniform speed, if equal, calculate the uniform speed time T4=(Pos-s acc-s dec) / Vmax to end the iteration; otherwise V max is too small and V amax needs to be increased; Vmax=(Vmax+nV2) / 2; T4=dVtSet; continue to return to S20 for iteration. Among them, nV1 is the larger value of the new starting speed and ending speed, which ensures that in the new speed planning, the starting and ending speeds will not be lower than the original starting speed; nV2 is the previously set maximum speed Vmax, which is the highest speed expected to be achieved in the planning; the new maximum speed Vmax: by taking the average of nV1 and nV2 to reduce the maximum speed, making the motion planning more practical and feasible; T4 represents the uniform speed segment time, which is set to dVtSet here, which may be the preset uniform speed segment time or the time calculated according to other conditions.
[0111] It can be seen that the purpose of the iterative optimization process in this embodiment is to find the most suitable motion parameters so that the motion trajectory can not only meet the limitations of mechanical performance but also accurately reach the predetermined target position.
[0112] In one embodiment, judging whether there is a uniform speed stage according to the second distances corresponding to the seven stages in the S-shaped planning curve to be planned includes: when the second distances corresponding to the seven stages in the S-shaped planning curve to be planned are less than or equal to the preset planning distance, determining that there is a uniform speed stage.
[0113] The second distance is the sum of the distances of the seven stages recalculated after adjusting the parameters of the S-shaped planning curve. This distance is obtained in the iterative process and may have been optimized for parameters such as speed and acceleration.
[0114] Among them, when the second distance is less than or equal to the preset planning distance, it means that the adjusted S-shaped planning curve can complete the movement without exceeding the preset planning distance. It means that under the current motion parameter configuration, the total length of the motion trajectory is appropriate, and there is enough space (time or distance) between the acceleration and deceleration stages to accommodate a uniform speed stage.
[0115] It can be seen that in this embodiment, determining the existence of the uniform speed stage helps to avoid safety hazards caused by excessive speed or excessive acceleration.
[0116] In one embodiment, determining whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed includes: if they are not the same, determining the motion parameters to be iterated, the motion parameters to be iterated being the motion parameters corresponding to each sub-distance in the second distance; iteratively processing the motion parameters to be iterated so that the motion parameters after iteration meet the iteration stop condition.
[0117] The motion parameters to be iterated refer to the corresponding motion parameters of each stage in the second distance, such as speed, acceleration, time, etc. These parameters will be used for the next iterative calculation.
[0118] The determined motion parameters to be iterated are adjusted through iterative processing until the speed of the uniform speed stage matches the preset uniform speed and meets other motion requirements and constraints. During the iterative process, the motion parameters may need to be adjusted multiple times, including but not limited to changing the acceleration values of the acceleration stage and the deceleration stage, adjusting the speed and duration of the uniform speed stage, and recalculating the distance of each stage.
[0119] It can be seen that this embodiment ensures that the S-shaped planning curve not only meets the preset motion requirements, but also can be executed efficiently and accurately.
[0120] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present application, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0121] As another aspect of the embodiment of the present application, the embodiment of the present application provides a motion damping device for an adaptive S-shaped planning curve. The motion damping device for an adaptive S-shaped planning curve can be a software module, which includes a number of instructions stored in a memory, and the processor can access the memory and call the instructions for execution to complete the motion damping method for the adaptive S-shaped planning curve described in the above-mentioned various embodiments.
[0122] See also Figure 3 , Figure 3 Schematic diagram of the structure of a motion damping device with an adaptive S-shaped planning curve provided in an embodiment of the present application. Figure 3 As shown, the motion damping device 300 of the adaptive S-shaped planning curve includes:
[0123] An acquisition unit 301 is used to acquire a starting motion parameter;
[0124] A calculation unit 302 is used to calculate the target distances corresponding to the seven stages in the S-shaped planning curve to be planned according to the starting motion parameters, wherein the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned;
[0125] A determination unit 303 is used to determine target motion parameters corresponding to seven stages in the S-shaped planning curve to be planned according to the target distance and the preset planning distance;
[0126] The determining unit 303 is further configured to obtain a target S-shaped planning curve according to target motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned.
[0127] The method ensures a smooth transition of the motion trajectory by calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned, reduces the impact and vibration caused by the sudden change in speed, thereby improving the stability of the motion and ensuring that each section of the motion process meets the predetermined shock absorption requirements; further, by comparing the target distance with the preset planning distance, the target motion parameters of each stage are dynamically adjusted to ensure the adaptability and flexibility of the motion curve, so as to better cope with different motion requirements and environmental changes; according to the target motion parameters of the seven stages, the optimized target S-shaped planning curve is finally obtained, which can not only effectively reduce shock, but also improve the stability and comfort of the motion, and improve the overall motion performance, and through the automated parameter calculation and adjustment, the operator's workflow is simplified, the possibility of human error is reduced, and motion control is made simpler and faster.
[0128] In one embodiment, in the step of calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned according to the starting motion parameters, the calculation unit 302 is further used to: obtain the first speeds corresponding to the seven stages in the S-shaped planning curve to be planned according to the starting motion parameters; obtain the first distances corresponding to the seven stages in the S-shaped planning curve to be planned according to the first speeds corresponding to the seven stages in the S-shaped planning curve to be planned; obtain the target distance according to the first distances corresponding to the seven stages in the S-shaped planning curve to be planned, and the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned.
[0129] In one embodiment, in determining the target motion parameters corresponding to the seven stages in the S-type planning curve to be planned according to the target distance and the preset planning distance, the determination unit 303 is further used to: determine whether the target distance is greater than the preset planning distance; if the target distance is greater than the preset planning distance, obtain the first motion parameters corresponding to the seven stages in the current S-type planning curve to be planned; iteratively process the first motion parameters corresponding to the seven stages in the S-type planning curve to be planned, and when the iteration stop condition is reached, obtain the second distances corresponding to the seven stages in the S-type planning curve to be planned, the second distance is the sum of the distances of the seven stages in the S-type planning curve to be planned, and the iteration stop condition is that the second distance is less than or equal to the preset planning distance; determine whether there is a uniform speed stage according to the second distances corresponding to the seven stages in the S-type planning curve to be planned; if the uniform speed stage exists, determine whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed; if they are the same, obtain the motion parameters corresponding to the seven stages in the current S-type planning curve to be planned as the target motion parameters.
[0130] In one embodiment, in the determination of whether the target distance is greater than the preset planning distance, the determination unit 303 is further used to: if the target distance is less than or equal to the preset planning distance, determine whether there is a uniform speed stage in the target distance, and determine whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed; if they are the same, obtain the motion parameters corresponding to the seven stages in the current S-shaped planning curve to be planned as the target motion parameters.
[0131] In one embodiment, in the iterative processing of the first motion parameters respectively corresponding to the seven stages in the S-type planning curve to be planned, when the iteration stop condition is reached, the second distances corresponding to the seven stages in the S-type planning curve to be planned are obtained, and the determination unit 303 is also used to: obtain the second speeds respectively corresponding to the seven stages in the S-type planning curve to be planned according to the first motion parameters respectively corresponding to the seven stages in the S-type planning curve to be planned; obtain the third distances respectively corresponding to the seven stages in the S-type planning curve to be planned according to the second speeds respectively corresponding to the seven stages in the S-type planning curve to be planned; obtain the fourth distance according to the third distances respectively corresponding to the seven stages in the S-type planning curve to be planned, and the fourth distance is the sum of the distances of the seven stages in the S-type planning curve to be planned; when the iteration stop condition is reached, determine the fourth distance as the second distances corresponding to the seven stages in the S-type planning curve to be planned.
[0132] In one embodiment, in judging whether there is a uniform speed stage according to the second distances corresponding to the seven stages in the S-shaped planning curve to be planned, the determination unit 303 is further used to: determine that there is a uniform speed stage when the second distances corresponding to the seven stages in the S-shaped planning curve to be planned are less than or equal to the preset planning distance.
[0133] In one embodiment, in the determination of whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed, the determination unit 303 is further used to: if they are not the same, determine the motion parameters to be iterated, the motion parameters to be iterated being the motion parameters corresponding to each sub-distance in the second distance; iterate the motion parameters to be iterated so that the motion parameters after the iteration meet the iteration stop condition.
[0134] In one embodiment, before calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned based on the starting motion parameters, the determining unit 303 is also used to: determine whether the uniform speed stage currently exists based on the starting motion parameters and preset judgment conditions; if the uniform speed stage exists, calculate the starting motion parameters according to the first preset formula to obtain the second motion parameters, and the second motion parameters are used to calculate the target distances corresponding to the seven stages in the S-shaped planning curve to be planned; or, if the uniform speed stage does not exist, calculate the starting motion parameters according to the second preset formula to obtain the third motion parameters, and the third motion parameters are used to calculate the target distances corresponding to the seven stages in the S-shaped planning curve to be planned.
[0135] It should be noted that the above-mentioned motion damping device of the adaptive S-shaped planning curve can execute the motion damping method of the adaptive S-shaped planning curve provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the embodiment of the motion damping device of the adaptive S-shaped planning curve, please refer to the motion damping method of the adaptive S-shaped planning curve provided in the embodiment of the present application.
[0136] See also Figure 4 , Figure 4 4 is a schematic diagram of a computer device provided in an embodiment of the present application. The computer device includes one or more processors 41 and a memory 42. The memory 42 is connected to the one or more processors 41, for example, connected to the processor 41 via a bus.
[0137] The processor 41 is configured to support the computer device to perform the corresponding functions in the method in the above method embodiment. The processor 41 can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof. The above hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above PLD can be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0138] The memory 42 is used to store program codes, etc. The memory 42 may include a volatile memory (VM), such as a random access memory (RAM); the memory 42 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 42 may also include a combination of the above-mentioned types of memories.
[0139] The memory 42 may be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the motion damping method of the adaptive S-shaped planning curve in the embodiment of the present application. The processor 41 executes various functional applications and data processing of the motion damping method of the adaptive S-shaped planning curve and the motion damping device of the adaptive S-shaped planning curve by running the non-volatile software programs, instructions and modules stored in the memory 42, that is, realizes the functions of each module or unit of the motion damping method of the adaptive S-shaped planning curve and the motion damping device of the adaptive S-shaped planning curve provided in the above method embodiment.
[0140] The memory 42 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function. The data storage area may store data created according to the use of the motion damping device of the adaptive S-shaped planning curve, etc. In some embodiments, the memory 42 may optionally include a memory 42 remotely arranged relative to the processor 41, and these remote memories 42 may be connected to the motion damping device of the adaptive S-shaped planning curve via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0141] The one or more modules are stored in the memory 42, and when executed by the one or more processors 41, execute the motion damping method of the adaptive S-shaped planning curve in any of the above method embodiments, for example, execute the method steps described in the above method embodiments to realize the functions of the modules described in the above device embodiments.
[0142] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method described in the above embodiment.
[0143] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0144] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A motion damping method for an adaptive S-shaped planning curve, characterized in that: The method comprises: Get the starting motion parameters; According to the starting motion parameters, the target distances corresponding to the seven stages in the S-shaped planning curve to be planned are calculated, and the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned; According to the target distance and the preset planning distance, determining the target motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned; A target S-shaped planning curve is obtained according to the target motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned.
2. The method according to claim 1, characterized in that The target distances corresponding to the seven stages in the S-shaped planning curve to be planned are calculated according to the starting motion parameters, including: According to the starting motion parameters, first speeds corresponding to seven stages in the S-shaped planning curve to be planned are obtained; According to the first speeds respectively corresponding to the seven stages in the S-shaped planning curve to be planned, the first distances respectively corresponding to the seven stages in the S-shaped planning curve to be planned are obtained; According to the first distances respectively corresponding to the seven stages in the S-shaped planning curve to be planned, a target distance is obtained, and the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned.
3. The method according to claim 1, characterized in that The step of determining target motion parameters corresponding to seven stages in the S-shaped planning curve to be planned according to the target distance and the preset planning distance includes: Determine whether the target distance is greater than the preset planning distance; If the target distance is greater than the preset planning distance, obtaining first motion parameters corresponding to the seven stages in the current S-shaped planning curve to be planned; Iteratively process the first motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned, and when the iteration stop condition is reached, obtain the second distances corresponding to the seven stages in the S-shaped planning curve to be planned, wherein the second distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned, and the iteration stop condition is that the second distance is less than or equal to the preset planning distance; According to the second distances corresponding to the seven stages in the S-shaped planning curve to be planned, determining whether there is a uniform speed stage; If the uniform speed stage exists, determining whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed; If they are the same, the motion parameters corresponding to the seven stages in the current S-shaped planning curve to be planned are obtained as the target motion parameters.
4. The method according to claim 3, characterized in that The determining whether the target distance is greater than the preset planned distance includes: If the target distance is less than or equal to the preset planned distance, it is determined that there is a uniform speed stage in the target distance; Determining whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed; If they are the same, the motion parameters corresponding to the seven stages in the current S-shaped planning curve to be planned are obtained as the target motion parameters.
5. The method according to claim 3, characterized in that: The iterative processing of the first motion parameters respectively corresponding to the seven stages in the S-shaped planning curve to be planned, and obtaining the second distances corresponding to the seven stages in the S-shaped planning curve to be planned when the iteration stop condition is reached, comprises: According to the first motion parameters respectively corresponding to the seven stages in the S-shaped planning curve to be planned, second speeds respectively corresponding to the seven stages in the S-shaped planning curve to be planned are obtained; According to the second speeds respectively corresponding to the seven stages in the S-shaped planning curve to be planned, the third distances respectively corresponding to the seven stages in the S-shaped planning curve to be planned are obtained; According to the third distances respectively corresponding to the seven stages in the S-shaped planning curve to be planned, a fourth distance is obtained, where the fourth distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned; When the iteration stop condition is reached, the fourth distance is determined to be the second distance corresponding to the seven stages in the S-shaped planning curve to be planned.
6. The method according to claim 3, characterized in that The determining whether there is a uniform speed stage according to the second distances corresponding to the seven stages in the S-shaped planning curve to be planned includes: When the second distances corresponding to the seven stages in the to-be-planned S-shaped planning curve are less than or equal to the preset planning distance, it is determined that there is a uniform speed stage.
7. The method according to claim 3 or 4, characterized in that: The determining whether the uniform speed corresponding to the uniform speed stage is the same as the preset uniform speed includes: If they are not the same, determining a motion parameter to be iterated, wherein the motion parameter to be iterated is a motion parameter corresponding to each sub-distance in the second distance; The motion parameters to be iterated are iterated so that the iterated motion parameters meet the iteration stop condition.
8. The method according to claim 3, characterized in that Before calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned according to the starting motion parameters, the method further includes: According to the initial motion parameters and the preset judgment conditions, determining whether the uniform speed stage exists at present; If the uniform speed stage exists, the starting motion parameter is calculated according to the first preset formula to obtain the second motion parameter, and the second motion parameter is used to calculate the target distances corresponding to the seven stages in the S-shaped planning curve to be planned; or If the uniform speed stage does not exist, the starting motion parameter is calculated according to the second preset formula to obtain a third motion parameter, and the third motion parameter is used to calculate the target distances corresponding to the seven stages in the S-shaped planning curve to be planned.
9. A motion damping device with an adaptive S-shaped planning curve, characterized in that: The device comprises: An acquisition unit, used for acquiring a starting motion parameter; A calculation unit, used for calculating the target distances corresponding to the seven stages in the S-shaped planning curve to be planned according to the starting motion parameters, wherein the target distance is the sum of the distances of the seven stages in the S-shaped planning curve to be planned; A determination unit, used to determine target motion parameters corresponding to seven stages in the S-shaped planning curve to be planned according to the target distance and the preset planning distance; The determining unit is further used to obtain a target S-shaped planning curve according to target motion parameters corresponding to the seven stages in the S-shaped planning curve to be planned.
10. A computer device, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the computer device implements the method according to any one of claims 1 to 8.