Adaptive relationship determination method for S-curve global planning parameters considering system errors
By adopting the S-curve global planning parameter adaptive relationship discrimination method that considers system errors in the motion control system, the error problem caused by floating-point number operations is solved, the S-curve parameters are accurately discriminated, and the operating efficiency and stability of the system are improved. It is suitable for a variety of operation and control systems.
Patent Information
- Application Number
- CN202410449259.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-04-15
AI Technical Summary
In the S-curve planning of the existing motion control system, due to the system error and accuracy dead zone problem of floating point calculation, the relationship judgment is inaccurate, which may lead to the failure of the system curve planning, run out of control or system crash, and the system error cannot be effectively considered, affecting Operational efficiency, accuracy and stability.
Using the S-curve global planning parameter adaptive relationship discrimination method that considers system errors, the PLC controller is used to identify infinite numbers, invalid numbers, normalized numbers and large orders of magnitude, combined with the mapping of system errors and the minimum storage unit of floating point numbers ULP, to carry out band The relationship comparison with precision dead zone improves the operating efficiency and accuracy of the system.
It achieves accurate relationship identification of S-curve global planning parameters, improves the operating efficiency, accuracy and stability of the operation control system, is suitable for adaptive planning of different system errors, and ensures safe and stable operation of the system.
Smart Images

Figure CN118348788B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of industrial motion control, and in particular relates to a method for determining an adaptive relationship of S-curve global planning parameters taking system errors into consideration. Background Art
[0002] As one of the indispensable functions of modern high-performance programmable logic controllers (PLCs), motion control is widely used in chip semiconductors, aerospace, robotics, automobile manufacturing and other fields. Motion control systems (abbreviated as motion control systems) usually include motion controllers, drivers, motors, mechanical actuators and feedback units (encoders, resolvers, grating rulers, etc.). Under the premise of stability, different motion control systems have different system errors due to the different resolutions of the feedback units of different motion control systems, as well as the principle errors caused by external interference and the errors caused by environmental changes. The system error cannot be completely eliminated, but can only be reduced to a certain extent, and there is a certain accuracy dead zone. In modern high-performance PLCs, floating-point numbers are inevitably used, such as point logic judgment, electronic cam operation, zero return, etc., especially in S-curve acceleration and deceleration planning, such as position, speed, acceleration, acceleration and other planning parameters are all floating-point numbers. It is necessary to judge the relationship between floating-point planning parameters in various complex situations according to the size of the given target position, and it is necessary to judge the acceleration and deceleration boundaries according to the given acceleration and deceleration parameter constraints. When the given maximum speed cannot be achieved, it is necessary to use numerical iteration methods such as binary search to solve the actual maximum operating speed. The iteration method usually requires setting a floating-point tolerance value to determine the relationship with the solved speed planning parameters to determine whether the planning requirements are met.
[0003] Floating point numbers are approximate representations of any real number in PLC. Due to the limitations of the existing binary CPU architecture and PLC system resources, the real values in the PLC system are discrete, and the finite precision binary floating point numbers cannot accurately represent all decimal real numbers in mathematics. Converting from mathematical decimal real numbers to finite precision floating point numbers will bring errors, and floating point operations will amplify the errors, so it is often inaccurate to rashly use absolute equality (==) to judge whether two floating point numbers are equal. Usually, approximate equality based on absolute error is used, that is, by comparing whether the absolute value of the difference between the two floating point numbers is less than a fixed value (absolute error), to judge whether the two floating point numbers are equal. Although this method is simple, it has certain defects. When the two floating point numbers compared are large orders of magnitude, due to the limited number of significant digits that can be represented by floating point numbers, for example, assuming that the absolute error is set to 1e-4, 12987.658f is the closest to the next floating point number 12987.659f, and the difference between the two is still much larger than the set absolute error, it will be mistakenly judged as unequal. The relative error approximate equality method can make up for the above defects by scaling the fixed value to the magnitude of the number to be compared, but the effect is not good when the comparison number is near 0. At the same time, due to the need to perform multiple floating-point operations, the operation efficiency is not high. In addition to the comparison of floating-point equality, there are also relational operations such as greater than (>), less than (<), greater than or equal to (≥), and less than or equal to (≤) in the operation control system. If these relational operators are directly used in S-curve planning without considering the system error and the accuracy dead zone, it may lead to the failure of system curve planning and the loss of control. On the other hand, if the given allowable error value of floating-point relationship judgment is too large, it will affect the accuracy of system operation. If the given allowable error value is too small, it will easily lead to system instability, fall into an infinite loop, and even cause the system to crash.
[0004] The applicant's preliminary search revealed that the publication number is CN103792887A, the subject name is "Numerical controller with machining path repair function and machining path repair method thereof", the publication date is 20140514, and the IPC classification number is G05B19 / 4097, G05B19 / 41. This invention patent application mainly discloses that "the machining program transferred from CAD / CAM or the machining program designed by the user often has some invalid data points, which will have a negative impact on the machining quality and machine life. The reason is that the invalid data points will produce many unnatural and short machining paths. Such machining paths will constantly turn and change in a short distance, making the machining path change too much, which will lead to multiple and drastic acceleration and deceleration of the speed command planned by the speed planning module. The drastic acceleration and deceleration in a short distance will cause the machine to shake, affecting the machining quality of the cutting tool on the workpiece and shortening the motor life".
[0005] In addition, the invention patent application with the publication number CN108646674A and the subject name of the invention patent application is "Position S-type smoothing instruction generation method, system and electronic device", the publication date is 20181012, and the IPC classification number is G05B19 / 416. This invention patent application mainly discloses that "the point-to-point position control system instruction smoothing method mostly adopts S curves, which are mostly implemented by the host computer controller or a dedicated controller, using its high-speed computing unit and high-precision floating-point operations, through a large number of mathematical operations, and then sent to the driver in the form of pulses. The position of each motion cycle needs to be derived according to the pre-planned parameters. This process requires a large number of operations and is matched with a pulse generating device." "The existing S-curve instruction smoothing method usually plans the curve as a whole according to the set parameters. Before the program starts running, it is necessary to determine the type of curve, such as 7-segment, 6-segment, 5-segment and 4-segment. According to different curve types, different subroutines are run to complete the instruction smoothing."
[0006] The above two patents only involve the application of floating-point numbers in motion control, and do not involve the adaptive relationship determination method of the global planning parameters of the S-curve considering the system error. The adaptive relationship determination method of the global planning parameters of the S-curve considering the system error, there is currently no public conversion method for the technology and information on motion control. Therefore, there is an urgent need for an adaptive relationship determination method of the global planning parameters of the S-curve considering the system error, which, based on the principle of floating-point number storage, can perform adaptive relationship determination according to the order of magnitude changes of the system error and the parameters, and improve the operating efficiency, accuracy, safety and stability of the system. Summary of the invention
[0007] In view of the status of the prior art, the present invention overcomes the above defects and provides an S-curve global planning parameter adaptive relationship determination method taking system errors into consideration, which is used to solve the relationship determination problem of planning parameters in the S-curve of the operation control system.
[0008] The disclosed S-curve global planning parameter adaptive relationship determination method considering system errors is mainly aimed at considering system errors and precision dead zones in the field of S-curve planning of operation and control systems, and focuses on disclosing the relationship determination method for global planning parameters such as infinite numbers (Inf), invalid numbers (Nan), normalized numbers, non-normalized numbers, and large orders of magnitude. Based on the principle of floating-point number storage, it can perform adaptive relationship determination according to the order of magnitude changes of system errors and parameters, thereby improving the operating efficiency, accuracy, safety, and stability of the system.
[0009] The present invention adopts the following technical scheme, and the S-curve global planning parameter adaptive relationship determination method considering system error includes the following steps:
[0010] Step S1: The PLC controller obtains the floating-point S-curve planning parameter a, the floating-point S-curve planning parameter b, and the system error SysErr to be determined; and sets the default value of the absolute equality flag AbsEqualFlag to 0;
[0011] Step S2: The PLC controller performs infinite number (Inf) determination: if the exponent bits in parameter a or parameter b are all 0 and the mantissa bits are all 0, the corresponding parameter is an infinite number; if one of parameter a and parameter b is an infinite number, it is determined whether parameter a is absolutely equal to parameter b, that is, "a==b". If parameter a is absolutely equal to parameter b, the absolute equality flag is set to 1, otherwise, the absolute equality flag remains 0;
[0012] Step S3: The PLC controller performs invalid number (Nan) determination: if the exponent bits in parameter a or parameter b are all 1 and the mantissa bits are not all 0, the corresponding parameter is an invalid number; if one of parameter a and parameter b is an invalid number, the method ends; otherwise, execute step S4;
[0013] Step S4: If both parameter a and parameter b are not invalid numbers, the PLC controller performs "+0" and "-0" discrimination: when the signs of parameter a and parameter b are different, it is judged whether parameter a is absolutely equal to parameter b, that is, "a==b". If parameter a is absolutely equal to parameter b, the absolute equality flag is set to 1; otherwise, the absolute equality flag remains at 0.
[0014] Step S5: The PLC controller maps the system error SysErr to the minimum floating point storage unit ULP: the floating point value corresponding to 1 ULP is 1.19209289550781250000e-7, and this value is set to Epsilon, and:
[0015] M = [SysErr / Epsilon] (1);
[0016] M is the largest integer not exceeding SysErr / Epsilon;
[0017] Step S6: The PLC controller converts the parameter a bit by bit into the integer form Int_a:
[0018] int* Int_a = reinterpret_cast<int*> (&a) (2);
[0019] If Int_a<0, convert Int_a to two's complement representation:
[0020] Int_a = 2147483648 - Int_a (3);
[0021] After the complement conversion, the non-normalized extremely small number near 0 changes continuously;
[0022] If Int_a>0, convert b bit by bit to integer form Int_b:
[0023] int* Int_b = reinterpret_cast<int*> (&b) (4);
[0024] If Int_b<0, convert Int_b to two's complement representation:
[0025] Int_b = 2147483648 - Int_b (5);
[0026] Then calculate the absolute value ABS(Int_a-Int_b) of the difference between Int_a and Int_b;
[0027] Step S7: The PLC controller performs a comparison with a precision dead zone.
[0028] Step S8: The PLC controller performs a “>” discrimination comparison with a precision dead zone;
[0029] Step S9: The PLC controller performs a “<” comparison with a precision dead zone;
[0030] Step S10: The PLC controller performs a “≥” comparison with a precision dead zone;
[0031] Step S11: The PLC controller performs a “≤” comparison with a precision dead zone;
[0032] Step S12: According to step S1 to step S11, the PLC controller outputs the relationship determination result between parameter a and parameter b to meet the global parameter planning requirements of the S curve.
[0033] As a further preferred technical solution of the above technical solution, in step S7, the PLC controller performs a "=" discrimination comparison with a precision dead zone, which is specifically implemented as follows:
[0034] If equation (6) is satisfied, then "a = b" is true; otherwise, "a = b" is false;
[0035] (ABS(Int_a-Int_b) ≤ M * ULP) || (AbsEqualFlag == 1) (6).
[0036] As a further preferred technical solution of the above technical solution, in step S8, the PLC controller performs a ">" discrimination comparison with a precision dead zone, which is specifically implemented as follows:
[0037] If the formula (7) is satisfied, then "a > b" is true; otherwise, "a > b" is false;
[0038] (a > b) && ((ABS(Int_a - Int_b) > M * ULP) || (AbsEqualFlag == 0)) (7).
[0039] As a further preferred technical solution of the above technical solution, in step S9, the PLC controller performs a "≥" discrimination comparison with a precision dead zone, and the specific implementation is as follows:
[0040] If the formula (8) is satisfied, then "a < b" is true; otherwise, "a < b" is false;
[0041] (a < b) && ((ABS(Int_a - Int_b) > M * ULP) || (AbsEqualFlag == 0)) (8).
[0042] As a further preferred technical solution of the above technical solution, in step S10, the PLC controller performs a "≥" discrimination comparison with a precision dead zone, and the specific implementation is as follows:
[0043] If the formula (9) is satisfied, then "a ≥ b" is true; otherwise, "a ≥ b" is false;
[0044] (a ≥ b) || ((ABS(Int_a - Int_b) ≤ M * ULP) || (AbsEqualFlag == 1)) (9).
[0045] As a further preferred technical solution of the above technical solution, in step S11, the PLC controller performs a "≤" discrimination comparison with a precision dead zone, and the specific implementation is as follows:
[0046] If the formula (10) is satisfied, then "a ≤ b" is true; otherwise, "a ≤ b" is false;
[0047] (a ≤ b) || ((ABS(Int_a - Int_b) ≤ M * ULP) || (AbsEqualFlag == 1)) (10).
[0048] As a further preferred technical solution of the above technical solution, in step S1, the parameter a and the parameter b are any two of the following S-curve global planning parameters: target displacement parameter, initial velocity parameter, maximum velocity parameter, final velocity parameter, maximum acceleration parameter, maximum deceleration parameter, acceleration jerk parameter, deceleration jerk parameter.
[0049] The method for determining the adaptive relationship of parameters in global planning of S-curves considering system errors disclosed in the present invention has the following beneficial effects:
[0050] 1. By performing infinite number (Inf) judgment, invalid number (Nan) judgment, "+0" and "-0" judgment and floating point bitwise integer conversion on the S-curve global planning parameters, the relationship judgment of infinite numbers, invalid numbers, normalized numbers, non-normalized numbers, large orders of magnitude and other full floating point domain planning parameters can be realized.
[0051] 2. Considering the system error, by mapping the system error SysErr to the computer's underlying ULP and performing relationship judgment with a precision dead zone, the operating efficiency and accuracy of the operation and control system can be improved while ensuring the safety and stability of the operation and control system.
[0052] 3. The present invention can adaptively distinguish the relationship between planning parameters according to different system errors SysErr, and is applicable to other different operation and control systems such as CNC machine tools and robots. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a control flow chart of the present invention.
[0054] Figure 2 It is a flow chart of the bitwise shaping conversion and calculation of the absolute value of the corresponding difference of the present invention.
[0055] Figure 3 It is the "=" (equal to) judgment flow chart with a precision dead zone of the present invention.
[0056] Figure 4 It is a “>” (greater than) judgment flow chart with a precision dead zone of the present invention.
[0057] Figure 5 It is a "<" (less than) judgment flow chart with a precision dead zone of the present invention.
[0058] Figure 6 It is a "≥" (greater than or equal to) judgment flow chart with a precision dead zone of the present invention.
[0059] Figure 7 It is a "≤" (less than or equal to) judgment flow chart with a precision dead zone of the present invention.
[0060] Figure 8 It is a simulation waveform diagram of S-curve planning under the condition of large-scale planning parameters of the present invention. DETAILED DESCRIPTION
[0061] The present invention discloses a method for determining an adaptive relationship of global planning parameters of an S-curve considering system errors. Figure 1-8, the specific implementation modes of the present invention are further described.
[0062] See attached figure Figures 1 to 8 , Figure 1 The control flow of the present invention is shown; Figure 2 The present invention shows the process of bitwise shaping conversion and calculating the absolute value of the corresponding difference; Figure 3 The "=" (equal to) determination process with a precision dead zone of the present invention is shown; Figure 4 The ">" (greater than) discrimination process with a precision dead zone of the present invention is shown; Figure 5 The "<" (less than) discrimination process with a precision dead zone of the present invention is shown; Figure 6 The "≥" (greater than or equal to) determination process with a precision dead zone of the present invention is shown; Figure 7 The "≤" (less than or equal to) determination process with a precision dead zone of the present invention is shown; Figure 8 The S-curve planning simulation waveform under the condition of large-scale planning parameters of the present invention is shown.
[0063] Example 1.
[0064] Preferably, the S-curve global planning parameter adaptive relationship determination method considering system errors comprises the following steps:
[0065] Step S1: The PLC controller obtains the floating-point S-curve planning parameter a, the floating-point S-curve planning parameter b (hereinafter referred to as parameter a and parameter b), and the system error SysErr to be judged; the default value of the absolute equality flag AbsEqualFlag is set to 0 (indicating that a and b are not absolutely equal);
[0066] Step S2: The PLC controller performs infinite number (Inf) determination: if the exponent bits in parameter a or parameter b are all 0 and the mantissa bits are all 0, the corresponding parameter is an infinite number (Inf); if one of parameter a and parameter b is an infinite number (Inf), it is determined whether parameter a is absolutely equal to parameter b, that is, "a==b". If parameter a is absolutely equal to parameter b, the absolute equality flag AbsEqualFlag is set to 1 (indicating that both a and b are Inf), otherwise, the absolute equality flag AbsEqualFlag continues to remain at 0;
[0067] Step S3: the PLC controller performs invalid number (Nan) discrimination: if the exponent bits in parameter a or parameter b are all 1 and the mantissa bits are not all 0, the corresponding parameter is an invalid number (Nan); if one of parameter a and parameter b is an invalid number (Nan), no further discrimination is required and the discrimination ends directly; otherwise, the next step of discrimination is performed (as a supplementary explanation, generally, taking the square root of a floating-point negative number or finding the logarithm of a floating-point negative number will result in Nan, i.e., an invalid number);
[0068] Step S4: If both parameter a and parameter b are not invalid numbers (Nan), the PLC controller performs "+0" and "-0" discrimination: when the signs of parameter a and parameter b are different, it is judged whether parameter a is absolutely equal to parameter b, that is, "a==b". If parameter a is absolutely equal to parameter b, the absolute equality flag AbsEqualFlag is set to 1 (indicating that parameter a and parameter b are both 0); otherwise, the absolute equality flag AbsEqualFlag continues to remain at 0 (as a supplementary explanation, according to IEEE754, floating-point numbers have +0 and -0. When all bits of the floating-point number are 0, it is expressed as +0; when the sign bit of the floating-point number is 1 and the other bits are 0, it is expressed as -0);
[0069] Step S5: The PLC controller maps the system error SysErr to the minimum floating point storage unit ULP: the floating point value corresponding to 1 ULP is 1.19209289550781250000e-7, and this value is set to Epsilon, and M = [SysErr / Epsilon] (1);
[0070] M is the largest integer not exceeding SysErr / Epsilon (as a supplementary explanation, the above steps convert the system error into M*ULP (M ULPs), that is, complete the mapping of the system error SysErr to the minimum storage unit ULP of the floating point number);
[0071] Step S6: See the accompanying drawings Figure 2 , the PLC controller converts the parameter a bit by bit into the integer form Int_a:
[0072] int* Int_a = reinterpret_cast<int*> (&a) (2);
[0073] If Int_a<0, convert Int_a to two's complement representation:
[0074] Int_a = 2147483648 - Int_a (3);
[0075] After the complement conversion, the non-normalized small numbers around 0 (+0 and -0) change continuously;
[0076] If Int_a>0, convert b bit by bit to integer form Int_b:
[0077] int* Int_b = reinterpret_cast<int*> (&b) (4);
[0078] If Int_b<0, convert Int_b to two's complement representation:
[0079] Int_b = 2147483648 - Int_b (5);
[0080] Then calculate the absolute value ABS(Int_a-Int_b) of the difference between Int_a and Int_b;
[0081] Step S7: See the accompanying drawings Figure 3 , given the discrimination parameters: the absolute value ABS(Int_a-Int_b) obtained in step S6, the maximum integer M (obtained by system error mapping) in step S5, the minimum floating point storage unit ULP, the absolute equality flag AbsEqualFlag in step S4, the PLC controller performs a "=" discrimination comparison with a precision dead zone;
[0082] Step S8: See the accompanying drawings Figure 4 , given the discrimination parameters: the absolute value ABS(Int_a-Int_b) obtained in step S6, the maximum integer M (obtained by system error mapping) in step S5, the minimum floating point storage unit ULP, the absolute equality flag AbsEqualFlag in step S4, and the PLC controller performs a “>” discrimination comparison with a precision dead zone;
[0083] Step S9: See the accompanying drawings Figure 5 , given the discrimination parameters: the absolute value ABS(Int_a-Int_b) obtained in step S6, the maximum integer M (obtained by system error mapping) in step S5, the minimum floating point storage unit ULP, the absolute equality flag AbsEqualFlag in step S4, and the PLC controller performs a “<” discrimination comparison with a precision dead zone;
[0084] Step S10: See the accompanying drawings Figure 6 , given the discrimination parameters: the absolute value ABS(Int_a-Int_b) obtained in step S6, the maximum integer M (obtained by system error mapping) in step S5, the minimum floating point storage unit ULP, the absolute equality flag AbsEqualFlag in step S4, the PLC controller performs a “≥” discrimination comparison with a precision dead zone;
[0085] Step S11: See the accompanying drawings Figure 7 , given the discrimination parameters: the absolute value ABS(Int_a-Int_b) obtained in step S6, the maximum integer M (obtained by system error mapping) in step S5, the minimum floating point storage unit ULP, the absolute equality flag AbsEqualFlag in step S4, the PLC controller performs a “≤” discrimination comparison with a precision dead zone;
[0086] Step S12: According to Steps S1 to S11, the PLC controller outputs the discrimination result of the relationship between parameter a and parameter b to meet the requirements of the S-curve global parameter planning.
[0087] Among them, in Step S1, referring to Table 1 in the attached table, parameter a and parameter b are any two of the following S-curve global planning parameters: target displacement parameter, initial velocity parameter, maximum velocity parameter, final velocity parameter, maximum acceleration parameter, maximum deceleration parameter, acceleration jerk parameter, deceleration jerk parameter.
[0088] Among them, in Step S7, the PLC controller performs a "=" discrimination comparison with a precision dead zone, and the specific implementation is as follows:
[0089] If Equation (6) is satisfied, then "a = b" is true; otherwise, "a = b" is false;
[0090] (ABS(Int_a - Int_b) ≤ M * ULP) || (AbsEqualFlag == 1) (6).
[0091] Among them, in Step S8, the PLC controller performs a ">" discrimination comparison with a precision dead zone, and the specific implementation is as follows:
[0092] If Equation (7) is satisfied, then "a > b" is true; otherwise, "a > b" is false;
[0093] (a > b) && ((ABS(Int_a - Int_b) > M * ULP) || (AbsEqualFlag == 0)) (7).
[0094] Among them, in Step S9, the PLC controller performs a "≥" discrimination comparison with a precision dead zone, and the specific implementation is as follows:
[0095] If Equation (8) is satisfied, then "a < b" is true; otherwise, "a < b" is false;
[0096] (a < b) && ((ABS(Int_a - Int_b) > M * ULP) || (AbsEqualFlag == 0)) (8).
[0097] Among them, in Step S10, the PLC controller performs a "≥" discrimination comparison with a precision dead zone, and the specific implementation is as follows:
[0098] If Equation (9) is satisfied, then "a ≥ b" is true; otherwise, "a ≥ b" is false;
[0099] (a≥b)||((ABS(Int_a-Int_b)≤M*ULP)||(AbsEqualFlag==1)) (9).
[0100] Among them, in step S11, the PLC controller performs a “≤” judgment comparison with a precision dead zone, which is specifically implemented as follows:
[0101] If equation (10) is satisfied, then “a≤b” is true; otherwise, “a≤b” is false;
[0102] (a≤b)||((ABS(Int_a-Int_b)≤M*ULP)||(AbsEqualFlag==1)) (10).
[0103] The following describes the overall concept of the method for determining the adaptive relationship of global planning parameters of an S-curve considering system errors disclosed in this embodiment.
[0104] See attached figure Figure 1 First, input two floating-point planning parameters a and b and the system error SysErr that need to be judged. Let the absolute equality flag be AbsEqualFlag, and the default value is 0, indicating that a and b are not absolutely equal. First, perform the Inf judgment. If one of a and b is Inf, judge whether a is absolutely equal to b, that is, "a==b". If a is absolutely equal to b, AbsEqualFlag is set, indicating that both a and b are Inf. Then, perform the Nan judgment. If one of a and b is Nan, the judgment ends directly. If both a and b are not Nan, perform "+0" and "-0" judgment. When the signs of a and b are different, judge whether a is absolutely equal to b, that is, "a==b". If a is absolutely equal to b, AbsEqualFlag is set, indicating that both a and b are 0. Next, map the system error SysErr to the minimum storage unit ULP of floating point numbers. Then, a and b are converted to integers bit by bit and the absolute value of the corresponding difference is calculated. Finally, if the "=" (equal to) judgment is selected, the "=" judgment with a precision dead zone is performed; if the ">" (greater than) judgment is selected, the ">" judgment with a precision dead zone is performed; if the "<" judgment is selected, the "<" judgment with a precision dead zone is performed; if the "≥" (greater than or equal to) judgment is selected, the "≥" judgment with a precision dead zone is performed; if the "≤" judgment is selected, the "≤" judgment with a precision dead zone is performed.
[0105] The following describes the virtual axis simulation verification results of the S-curve global planning parameter adaptive relationship determination method considering system errors disclosed in this embodiment.
[0106] Assuming the system error SysErr is 1e-6, the parameters of the position motion command used in the simulation are shown in Table 1. As can be seen from Table 1, the S-curve global planning parameters are floating-point numbers of large magnitude.
[0107] See attached figure Figure 8 , the initial velocity of the system is 0.0u·s -1 , the initial position is 0.0u, when t=20:25:58.444, the position movement command is input, and the given target displacement is 1.1234e+25u. By judging the curve planning type of the given planning parameters, the maximum speed V of the actual operation of the system lim Failed to reach the preset maximum speed V max , at this time, it is necessary to use the Newton iteration numerical method to solve the actual maximum running speed. Table 2 of the attached table shows the maximum speed V lim It can be seen from the iterative calculation process that starting from the 7th iteration, due to the limited storage space of the floating-point number in the system, V lim The value of starts to jump between 3.3520197e+25 and 3.3520194e+25. If the traditional absolute error method is used to determine that the iterative error of the solution must be less than or equal to 1e-6, the iterative accuracy can never be achieved, which will cause the system to enter an infinite loop. If the method of the present invention is adopted, the system error is converted and mapped into 8 ULPs, and the above two iterative values are converted into an integer form bit by bit and the difference is 1 ULP. Under the premise of considering the system error, the iterative error requirement is met. Figure 8 It can be seen that the system first goes through acceleration and deceleration before reaching the actual maximum speed of 3.35219e+25u·s -1 , after which acceleration and deceleration and deceleration and deceleration and movement are performed, when t=20:25:59.117, the system reaches the target displacement 1.1234e+25u, and the system speed drops to 0.0u. Obviously, the present invention realizes the relationship judgment of full floating point domain planning parameters such as Inf, Nan, normalized numbers, non-normalized numbers, and large orders of magnitude. It can be seen that the present invention can improve the operating efficiency and accuracy of the operation control system under the premise of ensuring the safety and stability of the operation control system.
[0108] It is worth mentioning that the technical features such as the specific selection of the PLC controller involved in the patent application of this invention should be regarded as the prior art. The specific structure, working principle and possible control method and spatial layout method of these technical features can be selected by conventional methods in the field, and should not be regarded as the inventive point of the patent of this invention. The patent of this invention will not be further elaborated.
[0109] For those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0110] Schedule
[0111] Table 1
[0112]
[0113] Table 2
[0114] Iterations Iteration Value 1 3.5564998e+26 2 1.2541052e+26 3 5.3356686e+25 4 3.5497828e+25 5 3.35480000e+25 6 3.3520201e+25 7 3.3520197e+25 8 3.3520194e+25 9 3.3520197e+25 10 3.3520194e+25 … …
Claims
1. A method for determining the adaptive relationship of S-curve global planning parameters considering system errors, characterized in that: The following steps are involved: Step S1: The PLC controller obtains the floating-point S-curve planning parameter a, the floating-point S-curve planning parameter b, and the system error SysErr to be determined; and sets the default value of the absolute equality flag AbsEqualFlag to 0; Step S2: The PLC controller performs infinite number determination: if the exponent bits in parameter a or parameter b are all 0 and the mantissa bits are all 0, the corresponding parameter is an infinite number; if one of parameter a and parameter b is an infinite number, it is determined whether parameter a is absolutely equal to parameter b, that is, "a==b". If parameter a is absolutely equal to parameter b, the absolute equality flag bit AbsEqualFlag is set to 1, otherwise, the absolute equality flag bit AbsEqualFlag continues to remain at 0; Step S3: The PLC controller performs invalid number determination: if the exponent bits in parameter a or parameter b are all 1 and the mantissa bits are not all 0, the corresponding parameter is an invalid number; if one of parameter a and parameter b is an invalid number, the method ends; otherwise, step S4 is executed; Step S4: If both parameter a and parameter b are not invalid numbers, the PLC controller performs "+0" and "-0" discrimination: when the signs of parameter a and parameter b are different, it is judged whether parameter a is absolutely equal to parameter b, that is, "a==b". If parameter a is absolutely equal to parameter b, the absolute equality flag AbsEqualFlag is set to 1; otherwise, the absolute equality flag AbsEqualFlag continues to remain at 0; Step S5: The PLC controller maps the system error SysErr to the minimum floating point storage unit ULP: the floating point value corresponding to 1 ULP is 1.19209289550781250000e-7, and this value is set to Epsilon, and: M = [SysErr / Epsilon] (1); M is the largest integer not exceeding SysErr / Epsilon; Step S6: The PLC controller converts the parameter a bit by bit into the integer form Int_a: int* Int_a = reinterpret_cast<int*> (&a) (2); If Int_a<0, convert Int_a to two's complement representation: Int_a = 2147483648 - Int_a (3); After the complement conversion, the non-normalized small number near 0 changes continuously; If Int_a>0, convert b bit by bit to integer form Int_b: int* Int_b = reinterpret_cast<int*> (&b) (4); If Int_b<0, convert Int_b to two's complement representation: Int_b = 2147483648 - Int_b (5); Then calculate the absolute value ABS(Int_a-Int_b) of the difference between Int_a and Int_b; Step S7: The PLC controller performs "=" discrimination comparison with a precision dead zone; Step S8: The PLC controller performs a ">" discrimination comparison with a precision dead zone; Step S9: The PLC controller performs a "<" discrimination comparison with a precision dead zone; Step S10: The PLC controller performs a "≥" discrimination comparison with a precision dead zone; Step S11: The PLC controller performs a "≤" discrimination comparison with a precision dead zone; Step S12: According to Steps S1 to S11, the PLC controller outputs the discrimination result of the relationship between parameter a and parameter b to meet the requirements of the S-curve global parameter planning.
2. The method for determining the adaptive relationship of global planning parameters of an S-curve considering system errors according to claim 1 is characterized in that: In Step S7, the PLC controller performs an "=" discrimination comparison with a precision dead zone, and the specific implementation is as follows: If equation (6) is satisfied, then "a = b" is true; otherwise, "a = b" is false; (ABS(Int_a - Int_b) ≤ M * ULP) || (AbsEqualFlag == 1) (6).
3. The method for determining the adaptive relationship of global planning parameters of an S-curve considering system errors according to claim 1 is characterized in that: In Step S8, the PLC controller performs a ">" discrimination comparison with a precision dead zone, and the specific implementation is as follows: If equation (7) is satisfied, then "a > b" is true; otherwise, "a > b" is false; (a > b) && ((ABS(Int_a - Int_b) > M * ULP) || (AbsEqualFlag == 0)) (7).
4. The method for determining the adaptive relationship of global planning parameters of an S-curve considering system errors according to claim 1 is characterized in that: In Step S9, the PLC controller performs a "≥" discrimination comparison with a precision dead zone, and the specific implementation is as follows: If equation (8) is satisfied, then "a < b" is true; otherwise, "a < b" is false; (a < b) && ((ABS(Int_a - Int_b) > M * ULP) || (AbsEqualFlag == 0)) (8).
5. The method for determining the adaptive relationship of global planning parameters of an S-curve considering system errors according to claim 1 is characterized in that: In Step S10, the PLC controller performs a "≥" discrimination comparison with a precision dead zone, and the specific implementation is as follows: If equation (9) is satisfied, then "a ≥ b" is true; otherwise, "a ≥ b" is false; (a ≥ b) || ((ABS(Int_a - Int_b) ≤ M * ULP) || (AbsEqualFlag == 1)) (9).
6. The method for determining the adaptive relationship of global planning parameters of an S-curve considering system errors according to claim 1 is characterized in that: In Step S11, the PLC controller performs a "≤" discrimination comparison with a precision dead zone, and the specific implementation is as follows: If equation (10) is satisfied, then "a ≤ b" is true; otherwise, "a ≤ b" is false; (a ≤ b) || ((ABS(Int_a - Int_b) ≤ M * ULP) || (AbsEqualFlag == 1)) (10).
7. The method for determining the adaptive relationship of global planning parameters of an S-curve considering system errors according to any one of claims 1 to 6, characterized in that: In Step S1, parameter a and parameter b are any two of the following S-curve global planning parameters: target displacement parameter, initial velocity parameter, maximum velocity parameter, final velocity parameter, maximum acceleration parameter, maximum deceleration parameter, acceleration jerk parameter, deceleration jerk parameter.
