CN107741731B - Error processing method caused by S-curve calculation precision - Google Patents

Error processing method caused by S-curve calculation precision Download PDF

Info

Publication number
CN107741731B
CN107741731B CN201710959299.7A CN201710959299A CN107741731B CN 107741731 B CN107741731 B CN 107741731B CN 201710959299 A CN201710959299 A CN 201710959299A CN 107741731 B CN107741731 B CN 107741731B
Authority
CN
China
Prior art keywords
moment
section
displacement
value
displacement value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710959299.7A
Other languages
Chinese (zh)
Other versions
CN107741731A (en
Inventor
粟汝基
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CO-TRUST TECHNOLOGIES Co Ltd
Original Assignee
CO-TRUST TECHNOLOGIES Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CO-TRUST TECHNOLOGIES Co Ltd filed Critical CO-TRUST TECHNOLOGIES Co Ltd
Priority to CN201710959299.7A priority Critical patent/CN107741731B/en
Publication of CN107741731A publication Critical patent/CN107741731A/en
Application granted granted Critical
Publication of CN107741731B publication Critical patent/CN107741731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/404Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by control arrangements for compensation, e.g. for backlash, overshoot, tool offset, tool wear, temperature, machine construction errors, load, inertia
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/35Nc in input of data, input till input file format
    • G05B2219/35408Calculate new position data from actual data to compensate for contour error

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)
  • Feedback Control In General (AREA)

Abstract

The embodiment of the invention discloses a method for processing errors caused by S-curve calculation precision, which comprises the following steps: calculating the displacement value of each moment in an acceleration section, a constant speed section and a deceleration section in the S curve; comparing the total displacement of the acceleration section, the constant speed section and the deceleration section with a set position to obtain a difference value between the set position and the total displacement; when the difference value meets a preset condition, correcting the displacement value of each moment in the acceleration section or the deceleration section; and controlling the machine to move according to the corrected displacement value at each moment. By implementing the method, the tail end of the S curve can be smoother, and the machine is prevented from shaking.

Description

Error processing method caused by S-curve calculation precision
Technical Field
The invention relates to the field of industrial control, in particular to an error processing method caused by S curve calculation precision.
Background
In the industrial control industry, a PLC controller can more smoothly control the machine to start moving and stop moving through an S-shaped curve control strategy, the finally planned position (calculated position) and a given position have deviation due to data type and calculation precision errors in the planning process of an S-shaped curve, and if the deviation value is not well processed, the tail end of the S-shaped curve is not smooth, so that the machine (controlled equipment) shakes during operation.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an error processing method caused by S-curve calculation accuracy, which can make the tail end of an S-curve smoother and avoid the machine from shaking.
In order to solve the above technical problem, an aspect of the embodiments of the present invention provides a method for processing an error caused by S-curve calculation accuracy, including:
calculating the displacement value of each moment in an acceleration section, a constant speed section and a deceleration section in the S curve;
comparing the total displacement of the acceleration section, the constant speed section and the deceleration section with a set position to obtain a difference value between the set position and the total displacement;
and when the difference value meets a preset condition, correcting the displacement value of each moment in the acceleration section or the deceleration section.
The step of calculating the displacement value at each moment in the acceleration section, the constant speed section and the deceleration section in the S-curve specifically includes:
in the acceleration section, the displacement value at each moment is obtained by calculation of formula one:
sa ═ V _ lim · Ta · (1-Ta × sin (t pi/Ta)/pi)/2 (one)
Wherein V _ lim is the maximum target speed, Ta is the total time of acceleration, and t is a certain moment;
in the uniform speed segment, the displacement value at the first moment is obtained through calculation of a formula two:
sc ═ V _ lim × t (0< t < Tc) (two)
Wherein Tc is the total time of the uniform velocity section;
in the deceleration section, the displacement value at each moment is obtained through the calculation of the formula three:
sd ═ V _ lim ═ t + Td ═ sin (t pi/Td)/pi)/2 (three)
Where Td is the total time of deceleration.
When the difference value meets a predetermined condition, the step of correcting the displacement value at each moment in the acceleration section or the deceleration section specifically comprises the following steps:
when the difference value is larger than zero, obtaining the displacement value calculated by the acceleration section or the deceleration section in the last three times at each moment, and obtaining two position increments according to the three displacement values;
comparing the two position increments corresponding to each moment with the difference value;
and if the difference value is positioned between two position increments corresponding to the time, adding the difference value to the last displacement value of the time to be used as the current displacement value of the time, and otherwise, using the latest displacement value obtained by calculation as the current displacement value of the time.
When the difference value meets a predetermined condition, the step of correcting the displacement value at each moment in the acceleration section or the deceleration section specifically comprises the following steps:
when the difference is less than zero, subtracting a preset length from the calculated constant speed section, and comparing the total displacement of the acceleration section, the constant speed section and the deceleration section with a set position again to obtain a current difference of the set position and the total displacement, so that the current difference is greater than zero;
obtaining displacement values calculated in the last three times of each moment of the acceleration section or the deceleration section, and obtaining two position increments according to the three displacement values;
comparing the two position increments corresponding to each moment with the current difference;
and if the current difference value is positioned between two position increments corresponding to the moment, adding the difference value to the last displacement value of the moment to serve as the current displacement value of the moment, and otherwise, taking the latest displacement value obtained through calculation as the current displacement value of the moment.
The embodiment of the invention has the following beneficial effects:
the invention provides an error processing method caused by S curve calculation accuracy, which can make the final displacement value the same as or close to the set position and make the transition of each position smoother by correcting the displacement value calculated at each moment in an acceleration section or a deceleration section, thereby overcoming the problem of position jitter caused by the inequality between the position after curve planning caused by calculation error and the set position; or the problem that the planning is finished in advance because the planned position is equal to the set position when the curve is not planned is solved; the controlled equipment is smoother and more accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic main flow chart of an embodiment of a method for processing an error caused by S-curve calculation accuracy according to the present invention;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of step S12 in FIG. 1;
FIG. 3 is a flowchart illustrating one embodiment of step S12 in FIG. 1.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, in order to avoid obscuring the present invention with unnecessary details, only the structures and/or processing steps closely related to the scheme according to the present invention are shown in the drawings, and other details not so relevant to the present invention are omitted.
As shown in fig. 1, a main flow diagram of an embodiment of an error processing method caused by S-curve calculation accuracy according to the present invention is shown; in this embodiment, the method comprises the steps of:
step S10, calculating the displacement value of each moment in the acceleration section, the constant speed section and the deceleration section in the S curve;
specifically, in the acceleration section, the displacement value at each moment is obtained by calculation according to formula one:
sa ═ V _ lim · Ta · (1-Ta × sin (t pi/Ta)/pi)/2 (one)
Wherein V _ lim is the maximum target speed, Ta is the total time of acceleration, and t is a certain moment;
in the uniform speed segment, the displacement value at the first moment is obtained through calculation of a formula two:
sc ═ V _ lim × t (0< t < Tc) (two)
Wherein Tc is the total time of the uniform velocity section;
in the deceleration section, the displacement value at each moment is obtained through the calculation of the formula three:
sd ═ V _ lim ═ t + Td ═ sin (t pi/Td)/pi)/2 (three)
Where Td is the total time of deceleration.
It can be understood that V _ lim, Ta and sin () calculations may all cause errors, and eventually result in errors in the results of the calculations; for example, V _ lim is typically in rpm (revolutions per minute) or pps (pulses per second), and when converting to an internally used unit, it may need to be recalculated, or the maximum target speed may need to be modified, and the calculations in the middle process may have errors due to the tradeoff in accuracy caused by the multiplication and division of data.
Step S11, comparing the total displacement of the acceleration section, the uniform velocity section and the deceleration section with a set position to obtain a difference value between the set position and the total displacement;
specifically, an acceleration stage displacement value Sa, a constant velocity stage displacement value Sc, and a deceleration stage displacement value Sd are calculated, the sum of the calculated three stage displacement values (Sa + Sc + Sd) is subtracted from a set position (for example, SM) to see whether a difference exists, if not, processing is not required, and if so, a difference Se (i.e., a value obtained by SM- (Sa + Sc + Sd)) needs to be recorded;
step S12, when the difference value meets the preset condition, correcting the displacement value of each moment in the deceleration section;
in step S13, the machine is controlled to move according to the corrected displacement value at each time.
Fig. 2 and fig. 3 are combined to show the detailed processing procedure when the error value is greater than zero and less than zero in step S12, respectively.
As shown in fig. 2, when the error value is greater than zero, the step S12 specifically includes:
step S120, obtaining displacement values calculated in the last three times of each moment of the deceleration section, and obtaining two position increments according to the three displacement values; for example, if the displacement values calculated three times the latest at a certain time are S1, S2, and S3 (where S1 is the displacement value of the earliest time and S3 is the currently calculated displacement value), then the position increment Sd1 of the last time may be calculated as S2-S1, and the position increment Sd2 of the current time may be calculated as S3-S2;
step S121, comparing the two position increments corresponding to each time with the difference, specifically comparing Sd1 with Sd2 and the difference Se in one example;
step S122, if the difference is between two position increments corresponding to the time, adding the position increment to the last displacement value at the time as the current displacement value at the time, otherwise, taking the latest displacement value obtained by calculation as the current displacement value at the time, for example, when a certain time Sd1< ═ Se < Sd2, the displacement value corresponding to the latest time calculated is considered to have a large error, and it needs to be corrected, specifically, the last displacement value plus the difference (S2+ Se) is taken as the current displacement value at the time; otherwise, the calculated displacement value corresponding to the latest displacement at the moment is considered to have no error or have very small error, and the latest displacement value obtained by calculation is directly used as the primary and current displacement value at the moment without correction. By this step, the final displacement value can be brought closer to the set position, overcoming the unsmooth curve end.
As shown in fig. 3, when the error value is less than zero, the step S12 specifically includes:
step S130, subtracting a preset length from the calculated uniform velocity section (specifically, in a formula II, subtracting a fixed value from Tc), shortening the uniform velocity section, and comparing the total displacement of the acceleration section, the uniform velocity section and the deceleration section with a set position again to obtain a current difference value between the set position and the total displacement, wherein the current difference value is greater than zero;
step S131, obtaining displacement values calculated in the last three times of each moment of the deceleration section, and obtaining two position increments according to the three displacement values;
step S132, comparing the two position increments corresponding to each moment with the current difference;
step S133, if the current difference is located between two position increments corresponding to the time, adding the difference to the last displacement value at the time as the current displacement value at the time, otherwise, taking the latest displacement value obtained by calculation as the current displacement value at the time.
It is understood that the following steps S131 to S133 are similar to the steps S120 to S122 in the previous embodiment, and are not described in detail.
It will be appreciated that the above method may also be used to correct the acceleration segment, in a similar manner and will not be described in detail here.
The implementation of the invention has the following beneficial effects:
it can be understood that in the method provided by the present invention, through correcting the displacement value calculated at each moment in the acceleration section or the deceleration section, the final displacement value can be made to be the same as or close to the set position, and the transition of each position is made to be smoother, so that the problem of position jitter caused by the fact that the position after the curve planning is completed and the set position are not equal due to the calculation error can be overcome; or the problem that the planning is finished in advance because the planned position is equal to the set position when the curve is not planned is solved; the controlled equipment is smoother and more accurate.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing is directed to embodiments of the present application and it is noted that numerous modifications and adaptations may be made by those skilled in the art without departing from the principles of the present application and are intended to be within the scope of the present application.

Claims (2)

1. An error processing method caused by S-curve calculation accuracy is characterized by comprising the following steps:
calculating the displacement value of each moment in an acceleration section, a constant speed section and a deceleration section in the S curve;
comparing the total displacement of the acceleration section, the constant speed section and the deceleration section with a set position to obtain a difference value between the set position and the total displacement;
when the difference value meets a preset condition, correcting the displacement value of each moment in the acceleration section or the deceleration section;
controlling the machine to move according to the corrected displacement value at each moment;
when the difference value meets a preset condition, the step of correcting the displacement value at each moment in the acceleration section and the deceleration section specifically comprises the following steps:
when the difference value is larger than zero, obtaining the displacement value calculated by the acceleration section or the deceleration section in the last three times at each moment, and obtaining two position increments according to the three displacement values;
comparing the two position increments corresponding to each moment with the difference value;
if the difference value is between two position increments corresponding to the time, adding the difference value to the last displacement value of the time to serve as the current displacement value of the time, and otherwise, taking the latest displacement value obtained through calculation as the current displacement value of the time;
or, when the difference satisfies a predetermined condition, the step of performing correction processing on the displacement value at each time in the acceleration section or the deceleration section specifically includes:
when the difference is less than zero, subtracting a preset length from the calculated constant speed section, and comparing the total displacement of the acceleration section, the constant speed section and the deceleration section with a set position again to obtain a current difference of the set position and the total displacement, so that the current difference is greater than zero;
obtaining displacement values calculated in the last three times of each moment of the acceleration section or the deceleration section, and obtaining two position increments according to the three displacement values;
comparing the two position increments corresponding to each moment with the current difference;
and if the current difference value is positioned between two position increments corresponding to the moment, adding the difference value to the last displacement value of the moment to serve as the current displacement value of the moment, and otherwise, taking the latest displacement value obtained through calculation as the current displacement value of the moment.
2. The method according to claim 1, wherein the step of calculating the displacement value at each moment in the acceleration segment, the constant velocity segment and the deceleration segment of the S-curve is specifically:
in the acceleration section, the displacement value at each moment is obtained by calculation of formula one:
sa ═ V _ lim · Ta · (1-Ta × sin (t pi/Ta)/pi)/2 (one)
Wherein V _ lim is the maximum target speed, Ta is the total time of acceleration, and t is a certain moment;
in the uniform speed segment, the displacement value at the first moment is obtained through calculation of a formula two:
sc ═ V _ lim × t (0< t < Tc) (two)
Wherein Tc is the total time of the uniform velocity section;
in the deceleration section, the displacement value at each moment is obtained through the calculation of the formula three:
sd ═ V _ lim ═ t + Td ═ sin (t pi/Td)/pi)/2 (three)
Where Td is the total time of deceleration.
CN201710959299.7A 2017-10-16 2017-10-16 Error processing method caused by S-curve calculation precision Active CN107741731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710959299.7A CN107741731B (en) 2017-10-16 2017-10-16 Error processing method caused by S-curve calculation precision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710959299.7A CN107741731B (en) 2017-10-16 2017-10-16 Error processing method caused by S-curve calculation precision

Publications (2)

Publication Number Publication Date
CN107741731A CN107741731A (en) 2018-02-27
CN107741731B true CN107741731B (en) 2020-02-14

Family

ID=61237634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710959299.7A Active CN107741731B (en) 2017-10-16 2017-10-16 Error processing method caused by S-curve calculation precision

Country Status (1)

Country Link
CN (1) CN107741731B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111977571A (en) * 2019-05-21 2020-11-24 北京京东尚科信息技术有限公司 Speed control method and device for lifting mechanism

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02232822A (en) * 1989-03-07 1990-09-14 Fuji Photo Film Co Ltd Tracking servo device
CN101082507A (en) * 2007-07-13 2007-12-05 重庆工学院 Method for realizing numerical control rotating platform angular displacement forecast measurement using time gate displacement sensor
CN103801981A (en) * 2012-11-14 2014-05-21 中国科学院沈阳计算技术研究所有限公司 Quartic polynomial speed planning algorithm for spline interpolation
CN104181860A (en) * 2014-08-25 2014-12-03 浙江理工大学 S-type acceleration and deceleration control method of numerical control machine tool
CN104865894A (en) * 2015-03-20 2015-08-26 西安交通大学 Statistical model-based moving beam type gantry type machine tool dual-drive feed error compensation method and model
CN105716558A (en) * 2014-12-05 2016-06-29 湘电集团有限公司 Method and system for error correction
JP2016173594A (en) * 2010-06-24 2016-09-29 コーニンクレッカ フィリップス エヌ ヴェKoninklijke Philips N.V. Autofocus for scanning microscopy based on differential measurement
CN106168790A (en) * 2016-02-29 2016-11-30 华南理工大学 A kind of online change target velocity and the S-shaped Acceleration-deceleration Control Method of position

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02232822A (en) * 1989-03-07 1990-09-14 Fuji Photo Film Co Ltd Tracking servo device
CN101082507A (en) * 2007-07-13 2007-12-05 重庆工学院 Method for realizing numerical control rotating platform angular displacement forecast measurement using time gate displacement sensor
JP2016173594A (en) * 2010-06-24 2016-09-29 コーニンクレッカ フィリップス エヌ ヴェKoninklijke Philips N.V. Autofocus for scanning microscopy based on differential measurement
CN103801981A (en) * 2012-11-14 2014-05-21 中国科学院沈阳计算技术研究所有限公司 Quartic polynomial speed planning algorithm for spline interpolation
CN104181860A (en) * 2014-08-25 2014-12-03 浙江理工大学 S-type acceleration and deceleration control method of numerical control machine tool
CN105716558A (en) * 2014-12-05 2016-06-29 湘电集团有限公司 Method and system for error correction
CN104865894A (en) * 2015-03-20 2015-08-26 西安交通大学 Statistical model-based moving beam type gantry type machine tool dual-drive feed error compensation method and model
CN106168790A (en) * 2016-02-29 2016-11-30 华南理工大学 A kind of online change target velocity and the S-shaped Acceleration-deceleration Control Method of position

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于NUBRS曲线插补的五段S曲线加减速控制方法研究;周胜德,梁宏斌,乔宇;《组合机床与自动化加工技术》;20110430(第4期);第37-41,46页 *
基于S曲线的步进电机速度与位移控制;魏磊,赵发勇,王秀英;《佳木斯大学学报(自然科学版)》;20170930;第35卷(第5期);第811-816页 *

Also Published As

Publication number Publication date
CN107741731A (en) 2018-02-27

Similar Documents

Publication Publication Date Title
US9389597B2 (en) Motor control device
US20170017227A1 (en) Thermal displacement correction apparatus for machine tool
CN113128018B (en) Friction force calculation method and device, robot and readable storage medium
CN108249238A (en) A kind of elevator is without detent torque compensation method, the apparatus and system of weighing
KR20160104075A (en) Inter-roller conveyance control device
CN107741731B (en) Error processing method caused by S-curve calculation precision
CN106681134A (en) High-precision steering engine position control method
EP0858626A1 (en) Control by means of a set-point generator
EP3865957B1 (en) Feedback control method and feedback control device
EP0258447A1 (en) Method of returning to origin
CN112965439B (en) Control method, device, equipment and storage equipment of electronic cam
US20040135532A1 (en) Servocontrol system and method of setting
CN113726234A (en) PID control-based stepping motor double-closed-loop control method and system
US20180284720A1 (en) Numerical controller
US11300946B2 (en) Control component and method for determining an adapted master value of a master axis
CN113858213B (en) Robot dynamic track planning method for target synchronization
US11086277B2 (en) System and method for determining the parameters of a controller
CN115818325A (en) Tension control method, system, device and computer readable storage medium
JP6643462B2 (en) Method, controller, machine, and computer program for providing roaming profile
CN113253772A (en) Servo positioning system and method based on error estimation and compensation
WO2020261649A1 (en) Parameter adjustment method
US10354683B2 (en) Servo control method having first and second trajectory generation units
CN112068490A (en) Trajectory planning method and device, electronic equipment and storage medium
JP3541857B2 (en) Overshootless auto tuning method
CN116149259A (en) Control method and system for phase deviation of master shaft and slave shaft and related components

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant