High-precision linkage interpolation method for trademark die-cutting machine

文档序号:1112369 发布日期:2020-09-29 浏览:25次 中文

阅读说明:本技术 一种商标模切机高精度联动插补的方法 (High-precision linkage interpolation method for trademark die-cutting machine ) 是由 董辉 仲济磊 葛天飞 罗帅 尹超 吴祥 于 2020-06-05 设计创作,主要内容包括:本发明公开了一种商标模切机高精度联动插补的方法,包括:获取原始加工轨迹曲线进行粗插补操作,得到粗插补参数;取粗插补参数中的一段微直线段进行精插补操作包括:设置起跳速度、进给步长表、加速度表,并计算进给速度表;根据进给速度表与进给步长表计算插补周期内的脉冲数与脉冲周期;将长短轴各自对应的脉冲数与脉冲周期写入对应的缓冲区;在同步信号的作用下,根据缓冲区中的脉冲数与脉冲周期,采用队列的方式利用STM32单片机的定时器完成脉冲的发送,从而实现对长短轴的同步控制。本发明能够自适应跟随微线段的长度动态调整加速度和拐弯速度约束,解决了商标模切机的过切问题,并且可控制两轴的同步运行。(The invention discloses a high-precision linkage interpolation method for a trademark die-cutting machine, which comprises the following steps: obtaining an original processing track curve to perform coarse interpolation operation to obtain coarse interpolation parameters; the fine interpolation operation of a section of micro straight line segment in the coarse interpolation parameter comprises the following steps: setting a take-off speed, a feeding step length meter and an accelerometer, and calculating a feeding speed meter; calculating the pulse number and the pulse period in the interpolation period according to the feeding speed table and the feeding step length table; writing the pulse numbers and pulse periods corresponding to the major axis and the minor axis into corresponding buffer areas; under the action of the synchronous signal, the sending of the pulse is completed by using a timer of an STM32 singlechip in a queue mode according to the pulse number and the pulse period in the buffer area, so that the synchronous control of the long axis and the short axis is realized. The invention can dynamically adjust the acceleration and the turning speed constraint in a self-adaptive way along with the length of the micro-line segment, solves the over-cutting problem of the trademark die-cutting machine and can control the synchronous operation of the two shafts.)

1. A method for high-precision linkage interpolation of a trademark die-cutting machine is characterized by comprising the following steps:

step 1, obtaining an original processing track curve to perform coarse interpolation operation to obtain coarse interpolation parameters;

step 2, taking a section of micro straight-line segment in the coarse interpolation parameter to perform fine interpolation operation, comprising the following steps:

step 2.1, setting a take-off speed, a feeding step length meter and an accelerometer, and calculating a feeding speed meter;

2.2, calculating the pulse number and the pulse period in the interpolation period according to the feeding speed table and the feeding step length table;

step 2.3, writing the pulse numbers and the pulse periods corresponding to the major axis and the minor axis into corresponding buffer areas;

step 2.4, under the action of the synchronous signal, according to the pulse number and the pulse period in the buffer area, sending the pulse by using a timer of an STM32 single chip microcomputer in a queue mode, so that the synchronous control of the long axis and the short axis is realized;

step 2.5, judging whether the long axis and the short axis reach the target point at the same time, and executing the step 3 if the long axis and the short axis reach the target point; otherwise, re-executing the step 2.2-2.5;

step 3, judging whether the current micro straight line segment is the last micro straight line segment or not, and if so, finishing linkage interpolation; otherwise, returning to the step 2.

2. The method for high-precision linkage interpolation of the trademark die-cutting machine according to claim 1, wherein the step 1 of obtaining an original processing track curve for rough interpolation operation comprises the following steps:

step 1.1, obtaining an original processing track curve and dispersing the original processing track curve into a plurality of sections of micro straight line segments;

step 1.2, judging whether a plurality of sections of micro straight line sections are effective one by one:

taking the starting point of the current micro straight line segment to be judged as A (x)a,ya) End point is B (x)b,yb) Therefore, the projection coordinate increment on each coordinate axis is Δ X ═ Xb-xa|,ΔY=|yb-ya|;

Establishing a judgment relation as follows:

[ΔX]<S&&[ΔY]<S (1)

if S is the maximum step number allowed in the fine interpolation operation;

if the projection coordinate increments delta X and delta Y meet the judgment relation of the formula (1), the projection coordinate increments are effective micro straight line segments; otherwise, the straight line segment is an invalid micro straight line segment;

and step 1.3, taking the invalid micro straight line segments, dispersing the wireless micro straight line segments into a plurality of smaller micro straight line segments, executing the step 1.2 again, and executing in a circulating mode until all the obtained micro straight line segments are the valid micro straight line segments.

3. The method for high-precision linkage interpolation of a trademark die cutting machine according to claim 1, wherein the step 2.1 of calculating a feed speed table comprises the following steps:

step 2.1.1, coordinate points of all micro-linear segments in the coarse interpolation parameters obtained by the coarse interpolation operation are taken, and motion directions and distances x _ Axislen and y _ Axislen of two axes are determined X, Y, where the motion directions depend on positive and negative values of x _ Axislen and y _ Axislen, and if the values of x _ Axislen and y _ Axislen are regular, they represent positive motion and negative motion, and the major axis in X, Y two axes is max ═ x _ Axislen, y _ Axislen }, and the minor axis is min { x _ Axislen, y _ Axislen }, where x _ isaxislen and y _ Axislen are given by formula (2):

Figure FDA0002526244360000021

wherein: xnextp is the abscissa of the next coordinate point, xcurrentp is the abscissa of the current coordinate point, ynextp is the ordinate of the next coordinate point, and ycurrentp is the ordinate of the current coordinate point;

step 2.1.2, using the tail end V corresponding to the tail end terminal of the coordinate buffer areaiAs a temporary origin, a length L is calculated forward according to equation (2), i.e.:

the feed step length table L can be obtained by analogy0,L1...,Li

Suppose the maximum length of a line segment in the feed step table is LmaxIf the length from the current point to the target point is L and L is greater than Lmax, the current line segment L needs to be divided into smaller line segments until L is less than or equal to Lmax, when the condition that L is less than or equal to Lmax is met, the current acceleration needs to be dynamically and adaptively adjusted according to the length L, and if the current acceleration is a, the dynamically adjusted acceleration is

Figure FDA0002526244360000023

Figure FDA0002526244360000024

Wherein k is a constant factor; if the stepping motor starts to be uniform after accelerating to a certain position of the line segment L, which is set as the maximum speed, and does not decelerate, the accelerometer is obtained by calculation according to the formula (4)

Figure FDA0002526244360000025

firstly, the maximum constraint speed at the turning point needs to be determined, and any three points P are assumedi-1,Pi,Pi+1The coordinates are respectively (x)i-1,yi-1),(xi,yi),(xi+1,yi+1) Set point Pi-1To PiThe final velocity at a point is VePoint p ofiTo pi+1Starting speed V ofsThe angle between the two vectors is delta thetaiIs provided withIt is possible to obtain:

Figure FDA0002526244360000027

further simplification obtains:

by using the cosine law of triangle, the change Delta V of the turning speed can be obtainedi

ΔVi 2=|Ve|2+|Vs|2-2|Ve|*|Vs|cosΔθ (7)

Using the basic inequality relationship to obtain:

namely: if and only if Ve=Vs=Vi,ΔViObtaining a minimum value:due to PiThe speed change is completed in an interpolation period T, and the maximum acceleration of the trademark die-cutting machine is set as amaxThus can obtainConstraint conditions of maximum cornering speed:

according toFurther simplification results in:

Figure FDA0002526244360000035

the maximum value V at each turning point can be obtained sequentially through the formula (10)sysmax(n)Considering that the trademark die cutting machine is not decelerated enough in the actual processing process due to the limitation of the length of the line segment, and excessive cutting is caused, the theoretical inflection point speed needs to be corrected:

if the stepping motor starts to be uniform after accelerating to a certain position of the line segment L, which is set as the maximum speed, and does not decelerate, the accelerometer is obtained by calculation according to the formula (4)Further obtaining the speed V of the next point1', i.e.:wherein V0' is the current initial speed, t is the acceleration time, and the accelerated speed must satisfy the maximum theoretical turning speed V set by equation (10)sysmax(1)I.e. V1=min{V1',Vsysmax(1)In which V1The smaller value of the calculated speed and the set speed is used as the speed of the previous point;

repeating the step 2.1.1 to the step 2.1.2 until the speed V reaches the positive end pointiObtaining the final target speed of all inflection points, namely obtaining the forward feeding speed meter V0,V1,...Vi

4. The method for high-precision linkage interpolation of the trademark die cutting machine according to claim 3, wherein in step 2.2, the pulse number and the pulse period in the interpolation period are calculated according to the feeding speed table and the feeding step table, and the method comprises the following steps:

using established feed step size table l0,l1...liAnd a feed rate meter V on the major axis0,V1,...ViObtaining the number n of pulses corresponding to the motor in the ith interpolation periodxiNamely: n isxi=li

Let the major axis be X-axis and the minor axis be Y-axis, and obtain the pulse number n corresponding to the minor axis Y in the ith interpolation period according to the included angle theta between the major axis X, the minor axis Y and the resultant motion vectoryi=nxiTan θ, extrapolated: thus, the ith interpolation period of the long axis can be calculated as:

wherein C is a constant of the corresponding interpolation period, and the corresponding interpolation period T is based on the long axisxi

Figure FDA0002526244360000042

Figure FDA0002526244360000043

due to VyiThe values are integers, so that a deviation Delta T exists in the corresponding periodyiNamely:

ΔTyi=Txi-Vyi.nyi(13)

the next interpolation period of the short axis can be obtained from the previous period difference according to equation (13):

therefore, the interpolation period of the long and short axes is calculated to be Txi

Figure FDA0002526244360000045

Technical Field

The application belongs to the technical field of industrial automation data, and particularly relates to a high-precision linkage interpolation method for a trademark die-cutting machine.

Background

The trademark die cutting machine is mainly used for stamping on the non-drying adhesive and cutting the non-drying adhesive into a certain shape to provide important processing equipment for sticking on a packing box. With the gradual maturity of the trademark die-cutting machine, users put forward more requirements on the design and development of the trademark die-cutting machine in terms of stability, cutting precision, cutting efficiency, convenience and price, and the key technical difficulty lies in realizing the reasonable acceleration and deceleration of multi-axis linkage interpolation and flexible translation.

The interpolation algorithm is a core technology in a numerical control system. From the principle of numerical control system, the essential problem of interpolation is to decompose any curve into a plurality of tiny curves, and when the decomposition of the curve reaches infinite level, each section of the curve becomes a tiny straight line segment. And then, replacing the straight line segment similar to the corresponding micro curve by using the straight line segment, and controlling the cutter to walk according to the straight line segment for processing to finish interpolation operation processing of the whole curve. In practical problems, it is impossible to resolve an arbitrary curve to infinity, and therefore there is always a corresponding error. In practical applications, tolerance to errors is limited, so that the curve decomposition is only performed under the condition of meeting the precision. The decomposition process of the curve is to densify the coordinate points, so that not only the precision is ensured, but also the decomposition process needs to be completed in a very short time. Limited by modern technology, the synchronization of the major axis and the minor axis in the trademark die-cutting machine is difficult to ensure in the interpolation process, and the problem of over-cutting is easy to occur.

Disclosure of Invention

The application aims to provide a high-precision linkage interpolation method for a trademark die-cutting machine, which solves the problem of over-cutting of the trademark die-cutting machine and can control synchronous operation of two shafts.

In order to achieve the purpose, the technical scheme adopted by the application is as follows:

a method for high-precision linkage interpolation of a trademark die-cutting machine comprises the following steps:

step 1, obtaining an original processing track curve to perform coarse interpolation operation to obtain coarse interpolation parameters;

step 2, taking a section of micro straight-line segment in the coarse interpolation parameter to perform fine interpolation operation, comprising the following steps:

step 2.1, setting a take-off speed, a feeding step length meter and an accelerometer, and calculating a feeding speed meter;

2.2, calculating the pulse number and the pulse period in the interpolation period according to the feeding speed table and the feeding step length table;

step 2.3, writing the pulse numbers and the pulse periods corresponding to the major axis and the minor axis into corresponding buffer areas;

step 2.4, under the action of the synchronous signal, according to the pulse number and the pulse period in the buffer area, sending the pulse by using a timer of an STM32 single chip microcomputer in a queue mode, so that the synchronous control of the long axis and the short axis is realized;

step 2.5, judging whether the long axis and the short axis reach the target point at the same time, and executing the step 3 if the long axis and the short axis reach the target point; otherwise, re-executing the step 2.2-2.5;

step 3, judging whether the current micro straight line segment is the last micro straight line segment or not, and if so, finishing linkage interpolation; otherwise, returning to the step 2.

Several alternatives are provided below, but not as an additional limitation to the above general solution, but merely as a further addition or preference, each alternative being combinable individually for the above general solution or among several alternatives without technical or logical contradictions.

Preferably, the step 1 of obtaining the original processing trajectory curve to perform a coarse interpolation operation includes:

step 1.1, obtaining an original processing track curve and dispersing the original processing track curve into a plurality of sections of micro straight line segments;

step 1.2, judging whether a plurality of sections of micro straight line sections are effective one by one:

taking the starting point of the current micro straight line segment to be judged as A (x)a,ya) End point is B (x)b,yb) Therefore, the projection coordinate increment on each coordinate axis is Δ X ═ Xb-xa|,ΔY=|yb-ya|;

Establishing a judgment relation as follows:

[ΔX]<S&&[ΔY]<S (1)

if S is the maximum step number allowed in the fine interpolation operation;

if the projection coordinate increments delta X and delta Y meet the judgment relation of the formula (1), the projection coordinate increments are effective micro straight line segments; otherwise, the straight line segment is an invalid micro straight line segment;

and step 1.3, taking the invalid micro straight line segments, dispersing the wireless micro straight line segments into a plurality of smaller micro straight line segments, executing the step 1.2 again, and executing in a circulating mode until all the obtained micro straight line segments are the valid micro straight line segments.

Preferably, the step 2.1 of calculating the feed rate table comprises the following steps:

step 2.1.1, coordinate points of all micro-linear segments in the coarse interpolation parameters obtained by the coarse interpolation operation are taken, and motion directions and distances x _ Axislen and y _ Axislen of two axes are determined X, Y, where the motion directions depend on positive and negative values of x _ Axislen and y _ Axislen, and if the values of x _ Axislen and y _ Axislen are regular, they represent positive motion and negative motion, and the major axis in X, Y two axes is max ═ x _ Axislen, y _ Axislen }, and the minor axis is min { x _ Axislen, y _ Axislen }, where x _ isaxislen and y _ Axislen are given by formula (2):

wherein: xnextp is the abscissa of the next coordinate point, xcurrentp is the abscissa of the current coordinate point, ynextp is the ordinate of the next coordinate point, and ycurrentp is the ordinate of the current coordinate point;

step 2.1.2, using the tail end V corresponding to the tail end terminal of the coordinate buffer areaiAs a temporary origin, a length L is calculated forward according to equation (2), i.e.:

the feed step length table L can be obtained by analogy0,L1...,Li

Suppose the maximum length of a line segment in the feed step table is LmaxIf the length from the current point to the target point is L, if L > LmaxThen, the current line segment L needs to be divided into smaller line segments until L is less than or equal to L max, and when L is less than or equal to LmaxWhen the condition is met, the current acceleration needs to be dynamically and adaptively adjusted according to the length L, and the current acceleration is assumed to be a, and the dynamically adjusted acceleration is

Figure BDA0002526244370000034

Wherein k is a constant factor; if the stepping motor starts to be uniform after accelerating to a certain position of the line segment L, which is set as the maximum speed, and does not decelerate, the accelerometer is obtained by calculation according to the formula (4)Furthermore, the feeding at each turning point needs to be obtained, and in order to avoid over-cutting, the speed of turning needs to be subjected to constraint planning;

firstly, the maximum constraint speed at the turning point needs to be determined, and any three points P are assumedi-1,Pi,Pi+1The coordinates are respectively (x)i-1,yi-1),(xi,yi),(xi+1,yi+1) Set point Pi-1To PiThe final velocity at a point is VePoint p ofiTo pi+1Starting speed V ofsThe angle between the two vectors is delta thetaiIs provided with

Figure BDA0002526244370000036

It is possible to obtain:

Figure BDA0002526244370000037

further simplification obtains:

Figure BDA0002526244370000038

by using the cosine law of triangle, the change Delta V of the turning speed can be obtainedi

ΔVi 2=|Ve|2+|Vs|2-2|Ve|*|Vs|cosΔθ (7)

Using the basic inequality relationship to obtain:

namely: if and only if Ve=Vs=Vi,ΔViObtaining a minimum value:

Figure BDA0002526244370000042

due to PiThe speed change is completed in an interpolation period T, and the maximum acceleration of the trademark die-cutting machine is set as amaxThen, the constraint condition that the maximum cornering speed can be obtained:

Figure BDA0002526244370000043

according toFurther simplification results in:

Figure BDA0002526244370000045

the maximum value V at each turning point can be obtained sequentially through the formula (10)sysmax(n)Considering that the trademark die cutting machine is not decelerated enough in the actual processing process due to the limitation of the length of the line segment, and excessive cutting is caused, the theoretical inflection point speed needs to be corrected:

if step motorWhen the speed is increased to a certain position of the line segment L, the target speed is set as the maximum speed, the constant speed is started, and the speed is not reduced, then the accelerometer is obtained by calculation according to the formula (4)

Figure BDA0002526244370000046

Further obtaining the speed V of the next point1', i.e.:

Figure BDA0002526244370000047

wherein V0' is the current initial speed, t is the acceleration time, and the accelerated speed must satisfy the maximum theoretical turning speed V set by equation (10)sysmax(1)I.e. V1=min{V1',Vsysmax(1)In which V1The smaller value of the calculated speed and the set speed is used as the speed of the previous point;

repeating the step 2.1.1 to the step 2.1.2 until the speed V reaches the positive end pointiObtaining the final target speed of all inflection points, namely obtaining the forward feeding speed meter V0,V1,...Vi

Preferably, the step 2.2 of calculating the number of pulses and the pulse period in the interpolation period according to the feeding speed table and the feeding step table comprises:

using established feed step size table l0,l1...liAnd a feed rate meter V on the major axis0,V1,...ViObtaining the number n of pulses corresponding to the motor in the ith interpolation periodxiNamely: n isxi=li

Let the major axis be X-axis and the minor axis be Y-axis, and obtain the pulse number n corresponding to the minor axis Y in the ith interpolation period according to the included angle theta between the major axis X, the minor axis Y and the resultant motion vectoryi=nxiTan θ, extrapolated: thus, the ith interpolation period of the long axis can be calculated as:

wherein C is a corresponding interpolation period constant, baseCorresponding interpolation period T for long axisxiThe pulse period is the short axis, so the current velocity of the short axis can be calculated:

due to VyiThe values are integers, so that a deviation Delta T exists in the corresponding periodyiNamely:

ΔTyi=Txi-Vyi.nyi(13)

the next interpolation period of the short axis can be obtained from the previous period difference according to equation (13):

Figure BDA0002526244370000053

therefore, the interpolation period of the long and short axes is calculated to be TxiThe pulse period corresponding to the long and short axes is Txi/nxi、Tyi/nyiIn the interpolation period calculation process, the calculation is started from the first interpolation period, and the like, and the pulse number and the pulse period in the subsequent interpolation period are repeated.

According to the high-precision linkage interpolation method for the trademark die cutting machine, the setting of the running speed of each shaft is actually the setting of pulse period parameters of each shaft according to the interpolation period of each shaft. In order to meet the requirements of high-speed and high-precision cutting of the die-cutting machine, reasonable flexible acceleration and deceleration control is required, the speed forward-looking planning is completed by utilizing a speed backtracking method and adaptively modifying acceleration according to the movement distance, and the over-cutting problem of the trademark die-cutting machine is solved. And simultaneously, considering the synchronous motion of the long shaft and the short shaft of the die-cutting machine, controlling the synchronous time error of the two shafts in a pulse period, referring to the interpolation period of the long shaft to obtain the interpolation period of the short shaft, decomposing the interpolation period of the short shaft, and iterating the interpolation period difference generated after the pulse number of the short shaft is integrated to the next interpolation period of the short shaft for compensation. In the calculation process, the calculation is started from the first interpolation period, and the pulse number and the pulse period in the subsequent interpolation period are analogized, and the master-slave double axes are controlled to synchronously run to complete the interpolation operation.

Drawings

FIG. 1 is a flow chart of a method for high-precision linkage interpolation of a trademark die cutting machine of the present application;

FIG. 2 is a schematic diagram of the present application illustrating the backtracking method for calculating the feed rate;

FIG. 3 is a schematic diagram of the present application in determining the maximum restraint velocity at an inflection point.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.

Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

In one embodiment, the method for high-precision linkage interpolation of the trademark die-cutting machine is provided, and the problem of over-cutting of the trademark die-cutting machine can be effectively solved.

As shown in fig. 1, the method for high-precision linkage interpolation of a trademark die-cutting machine in the embodiment includes the following steps:

step 1, obtaining an original processing track curve to perform rough interpolation operation, and obtaining rough interpolation parameters.

The rough interpolation operation is mainly used for dispersing an original processing track curve into micro straight line segments and finishing the track planning of the micro straight line segments, the motion direction of an axis and the distance between any two points are mainly determined in advance in the rough interpolation stage, and the position corresponding to any moment in the whole motion process can be obtained on the basis of the motion direction and the distance, so that rough interpolation parameters are generated, and therefore the rough interpolation parameters mainly comprise the micro straight line segments obtained after dispersion and coordinate points corresponding to all the micro straight line segments. Note that, in the coarse interpolation operation, a single pulse is not output in each interpolation period, but a straight line segment (position increment coordinate value) is output.

In general, the coarse interpolation operation may be performed by the STM32 controller, or may be performed by another controller in advance. In this embodiment, the coarse interpolation operation is performed completely off-line, for example, the operation is performed by an upper computer (PC software), so that the operation pressure on the fine interpolation operation caused by the real-time operation is avoided, the STM32 controller is used as a lower computer for obtaining the coarse interpolation parameters generated by the upper computer, and the fine interpolation operation is performed in real time based on the STM32 controller.

The coarse interpolation operation in the present embodiment is implemented based on the conventional coarse interpolation technology, and therefore, the coarse interpolation operation will not be described in detail. However, in order to ensure the validity of the micro-line segment generated in the coarse interpolation operation, in an embodiment, a method for verifying the validity of the micro-line segment is provided as follows:

step 1.1, obtaining an original processing track curve and dispersing the original processing track curve into a plurality of sections of micro straight line segments.

Step 1.2, judging whether a plurality of sections of micro straight line sections are effective one by one, wherein the specific judgment process is as follows:

taking the starting point of the current micro straight line segment to be judged as A (x)a,ya) End point is B (x)b,yb) Therefore, the projection coordinate increment on each coordinate axis (X axis and Y axis) is Δ X ═ Xb-xa|,ΔY=|yb-ya|。

Establishing a judgment relation as follows:

[ΔX]<S&&[ΔY]<S (1)

wherein, if S is the maximum step number allowed in the fine interpolation operation.

If the projection coordinate increments delta X and delta Y meet the judgment relation of the formula (1), the projection coordinate increments are effective micro straight line segments; otherwise, the result is an invalid micro straight line segment.

And step 1.3, taking the invalid micro straight line segments, dispersing the wireless micro straight line segments into a plurality of smaller micro straight line segments, executing the step 1.2 again, and executing in a circulating mode until all the obtained micro straight line segments are the valid micro straight line segments.

In the secondary interpolation algorithm, a series of micro straight-line segments, namely position increment coordinate values delta X and delta Y, are obtained in a coarse interpolation stage, step number conversion is carried out in a fine interpolation stage according to the position increment obtained in the coarse interpolation stage, the purpose of fine interpolation is to enable the trademark die-cutting machine to run more accurately between the starting point and the end point of a cutting track, and the specific operation of fine interpolation is as shown in step 2.

And 2, taking a section of micro straight line segment in the coarse interpolation parameter to perform fine interpolation operation.

In the fine interpolation stage, a feeding speed meter is mainly calculated according to the set take-off speed, the feeding step meter and the accelerometer, flexible feeding acceleration and deceleration control is performed, synchronous interpolation control is completed, and the influence of vibration of a shaft of the trademark die cutting machine on the cutting precision of label die cutting is avoided.

Specifically, the fine interpolation operation includes the following steps:

and 2.1, setting a take-off speed (the parameter corresponds to the take-off frequency of the stepping motor, wherein the take-off frequency is the highest frequency of the stepping motor which can be directly started to work without acceleration), a feeding step length meter and an accelerometer, and calculating a feeding speed meter.

And setting the takeoff speed, the feed step length table and the accelerometer according to the movement direction of the shaft determined in the coarse interpolation stage and the distance between any two points in a conventional operation manner in the interpolation algorithm, wherein the specific steps of the setting are not further limited.

Typically the feed rate meter is calculated from the takeoff speed, the feed step size meter and the accelerometer. Considering that the feeding speed meter has a relatively direct correlation with the flexible acceleration and deceleration control, in one embodiment, the calculation method for providing the feeding speed in the flexible acceleration and deceleration is as follows, as shown in fig. 2:

and 2.1.1, obtaining coordinate points of all micro straight-line segments in the coarse interpolation parameters obtained by the coarse interpolation operation, wherein the coordinates are analyzed by a curve processed by an upper computer (the curve is approximated by small line segments, and each small line segment has a starting point and an end point), and caching the processed coordinate points in a coordinate buffer area for standby in a coarse interpolation stage. Obtaining coordinate points, determining the moving direction and the distances X _ Axislen and Y _ Axislen of the two axes X and Y, wherein the moving direction depends on the positive and negative of the values X _ Axislen and Y _ Axislen, the moving direction represents positive moving if the values X _ Axislen and Y _ Axislen are regular, and represents negative moving, the major axis of the two axes X and Y is { X _ Axislen and Y _ Axislen }, and the minor axis thereof is min { X _ Axislen and Y _ Axislen }, wherein X _ Axislen and Y _ Axislen are given by the formula (2):

wherein: xnextp is the abscissa of the next coordinate point, xcurrentp is the abscissa of the current coordinate point, ynextp is the ordinate of the next coordinate point, and ycurrentp is the ordinate of the current coordinate point.

Step 2.1.2, using the tail end V corresponding to the tail end terminal of the coordinate buffer areaiAs a temporary origin, a length L is calculated forward according to equation (2), i.e. backward in the backtracking direction:

the feed step length table L can be obtained by analogy0,L1...,Li(i.e., the number of pulses to be transmitted).

Suppose the maximum length of a line segment in the feed step table is LmaxIf the length from the current point to the target point is L, if L > LmaxThen, the current line segment L needs to be divided into smaller line segments until L is less than or equal to L max, and when L is less than or equal to LmaxWhen the condition is met, the current acceleration needs to be dynamically and adaptively adjusted according to the length L, and the current acceleration is assumed to be a, and the dynamically adjusted acceleration is

Figure BDA0002526244370000083

Where k is a constant factor. It should be noted that the line segment L herein refers to a line segment with a length L, that is, the line segment L may be L0,L1...,LiI.e., any segment in the line segment to be calculated, has the same meaning as understood in formula (2), i.e., formula (2) is a general formula for calculating the length of the line segment.

If the stepping motor starts to be uniform after accelerating to a certain position of the line segment L, which is set as the maximum speed, and does not decelerate, the accelerometer is obtained by calculation according to the formula (4)Further, the feeding speed at each turning point needs to be obtained, and in order to avoid over-cutting, the turning speed needs to be subjected to constraint planning.

First, the maximum constrained velocity at the turning point needs to be determined, as shown in FIG. 3, assuming any three points Pi-1,Pi,Pi+1The coordinates are respectively (x)i-1,yi-1),(xi,yi),(xi+1,yi+1) Set point Pi-1To PiThe final velocity at a point is VePoint p ofiTo pi+1Starting speed V ofsThe angle between the two vectors is delta thetaiIs provided withIt is possible to obtain:

further simplification obtains:

by using the cosine law of triangle, the change Delta V of the turning speed can be obtainedi

ΔVi 2=|Ve|2+|Vs|2-2|Ve|*|Vs|cosΔθ (7)

Using the basic inequality relationship to obtain:

Figure BDA0002526244370000092

namely: if and only if Ve=Vs=Vi,ΔViObtaining a minimum value:

Figure BDA0002526244370000093

due to PiThe speed change is completed in an interpolation period T, and the maximum acceleration of the trademark die-cutting machine is set as amaxThen, the constraint condition that the maximum cornering speed can be obtained:

according toFurther simplification results in:

the maximum value V at each turning point can be obtained sequentially through the formula (10)sysmax(n)(wherein: n ═ 1.. i). Considering that the trademark die cutting machine is limited by the length of the line segment, the speed reducing distance is insufficient in the actual processing process, and the over-cutting is caused. Therefore, a theoretical knee velocity needs to be corrected.

If the stepping motor starts to be at a constant speed after accelerating to a certain position of the line segment L and setting the target speed as the maximum speed and does not decelerate, calculating according to the formula (4)Calculating to obtain an accelerometer

Figure BDA0002526244370000097

Further obtaining the speed V of the next point1', i.e.:wherein V0' is the current initial speed, t is the acceleration time, and the accelerated speed must satisfy the maximum theoretical turning speed V set by equation (10)sysmax(1)I.e. V1”=min{V1',Vsysmax(1)In which V1"is the speed of the previous point which is the smaller of the calculated speed and the set speed;

repeating the steps 2.1.1-2.1.2 until the speed V reaches the tail point of the forward direction (namely the cutting direction)i", obtaining the final target speed of all the inflection points, namely obtaining a new feeding forward feeding speed table V0”,V1”,...Vi". Thus, the trademark die-cutting machine can be guaranteed to reasonably decelerate to V when positively cuttingi-1And finally, the speed is reduced to 0, so that the purpose of pre-judging the speed is achieved, and the over-cutting action of the trademark die-cutting machine is avoided.

The speed look-ahead planning is completed by modifying the acceleration in a self-adaptive manner according to the movement distance through a speed backtracking method, and the problem of over-cutting of the trademark die-cutting machine in the forward cutting process is effectively avoided.

And 2.2, calculating the pulse number and the pulse period in the interpolation period according to the feed speed table, namely realizing track interpolation calculation (linkage interpolation).

In the high-precision linkage interpolation, the problem that each linkage shaft can simultaneously complete the operation of corresponding steps at a proper speed in the same time slice must be solved, such as: in this section of the micro straight line, the X-axis runs for 50 steps and the Y-axis runs for 60 steps, so that at the end of this time slice, the two axes must arrive at the corresponding positions at the same time at the corresponding rates, i.e. in synchronization. The core of the synchronization is position synchronization, and the speed in each pulse period is constant, so that the position synchronization can be realized by performing variable-period interpolation.

In one embodiment, the major axis is taken as the primary axis and is taken as the reference axis, and the minor axis is taken as the follow axis. Considering that the open-loop control of a stepping motor, the pulse period influences the rotating speed of the motor, the pulse number influences the actual rotating position of the motor, in order to better complete the real-time tracking of the short shaft, the synchronous time error of the X and Y shafts needs to be controlled in one pulse period, the interpolation period of the short shaft is obtained by referring to the interpolation period of the long shaft, the interpolation period of the short shaft is decomposed, and the interpolation period difference generated after the pulse number of the short shaft is integrated is iterated to the next interpolation period of the short shaft for compensation. In the calculation process, the calculation is started from the first interpolation period, and the like, and the pulse number and the pulse period in the subsequent interpolation period are repeated.

Specifically, in this embodiment, the calculating the number of pulses and the pulse period in the interpolation period according to the feeding speed table and the feeding step table includes:

using established feed step size table l0,l1...liAnd calculating the number n of pulses corresponding to the motor in the ith interpolation periodxiNamely: n isxi=li. Let the major axis be X-axis and the minor axis be Y-axis, and obtain the pulse number n corresponding to the minor axis Y in the ith interpolation period according to the included angle theta between the major axis X, the minor axis Y and the resultant motion vectoryi=nxiTan theta, using a feed velocity meter V set up well on the long axis0,V1,...VmAnd deducing that: thus, the ith interpolation period of the long axis can be calculated as:

wherein C is a constant of the corresponding interpolation period, and the corresponding interpolation period T is based on the long axisxi

Figure BDA0002526244370000102

The pulse period is the short axis, so the current velocity of the short axis can be calculated:

Figure BDA0002526244370000103

due to VyiThe values are integers, so that a deviation Delta T exists in the corresponding periodyiNamely:

ΔTyi=Txi-Vyi.nyi(13)

the next interpolation period of the short axis can be obtained from the previous period difference according to equation (13):

therefore, the interpolation period of the long and short axes is calculated to be TxiThe pulse period corresponding to the long and short axes is Txi/nxi、Tyi/nyi. In the calculation process, the calculation is started from the first interpolation period, and the like, and the pulse number and the pulse period in the subsequent interpolation period are repeated. In general, after the pulse number and the pulse period are obtained through calculation, the two axes can be controlled to perform corresponding movement to complete interpolation operation. And repeating the calculation steps until all the short straight lines are interpolated.

In the embodiment, the synchronous motion of the long shaft and the short shaft of the die-cutting machine is considered, the synchronous time error of the two shafts is controlled in one pulse period, the interpolation period of the short shaft is obtained by referring to the interpolation period of the long shaft, the interpolation period of the short shaft is decomposed, and the interpolation period difference generated after the pulse number of the short shaft is integrated is iterated to the next interpolation period of the short shaft for compensation, so that the effective synchronous operation of the two shafts is realized.

And 2.3, writing the pulse numbers and the pulse periods corresponding to the major axis and the minor axis into corresponding buffer areas.

And 2.4, under the action of the synchronous signal, sending pulses by using a timer of an STM32 single chip microcomputer in a queue mode according to the pulse number and the pulse period in the buffer area, and controlling the movement of the stepping motor, thereby realizing the synchronous control of the long shaft and the short shaft.

Step 2.5, judging whether the long axis and the short axis reach the target point at the same time, and executing the step 3 if the long axis and the short axis reach the target point; otherwise, the step 2.2-2.5 is executed again, namely before entering the next interpolation period, the control needs to recalculate the speed of the next interpolation period according to the acceleration and deceleration algorithm of the step 2.2-2.3 to control the flexible acceleration and deceleration of the cutting process.

Step 3, judging whether the current micro straight line segment is the last micro straight line segment or not, and if so, finishing linkage interpolation; otherwise, returning to the step 2.

The STM32 controller sends an interrupt signal after finishing fine interpolation of a section of micro straight line segment, informs a main program of refreshing a value of a parameter register (writing in an operation parameter of a next micro straight line segment), and starts fine interpolation of the next micro straight line segment until finishing fine interpolation operation of all micro straight line segments. The method has high interpolation speed and high real-time performance.

The high-precision linkage interpolation method for the trademark die cutting machine mainly performs two times of interpolation, namely coarse interpolation and fine interpolation. Particularly in the fine interpolation stage, the problem of over-cutting of the trademark die-cutting machine is avoided mainly by utilizing flexible acceleration and deceleration; and in the two-axis synchronization, storing the pulse number and the pulse period of the obtained two axes in each interpolation period into respective corresponding buffer areas, reading the respective buffer areas by the timers of the two axes under the action of a synchronization signal, and sending the pulse and the pulse period to the drivers of the X axis and the Y axis, so that the motor can be controlled to move, and the two-axis synchronous operation is completed. In the application, the coarse interpolation is completely performed off-line, while the fine interpolation adopts real-time control, and the coarse interpolation and the fine interpolation are coordinated to realize high-speed and high-precision synchronous position control of an X axis and a Y axis so as to complete set interpolation operation.

The method can be quickly realized on a cheap embedded device, and particularly in the aspect of a multi-axis motion controller, compared with a traditional interpolation method, the working efficiency and precision of the whole motion system can be greatly improved.

The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用于火焰切割数控系统的运动控制卡装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类