Multi-axis synchronous error compensation method and system based on CANopen protocol

文档序号:1242015 发布日期:2020-08-18 浏览:11次 中文

阅读说明:本技术 一种基于CANopen协议的多轴同步误差补偿方法和系统 (Multi-axis synchronous error compensation method and system based on CANopen protocol ) 是由 董辉 葛天飞 仲济磊 吴祥 张成祥 唐旺山 于 2020-05-07 设计创作,主要内容包括:本发明公开了一种基于CANopen协议的多轴同步误差补偿方法和系统,包括主节点将目标轨迹曲线离散为连续的多个小直线段,各小直线段包含目标速度与距离信息;主节点依次取小直线段作为当前插补线段;主节点间隔发送同步信号至从节点伺服器,并接收各从节点伺服器返回的当前实际位置,计算当前实际位置到当前插补线段的距离作为轮廓误差,根据轮廓误差计算各从节点伺服器在下一同步控制周期中的插补目标位置;主节点将计算得到的各从节点伺服器在下一同步控制周期中的插补目标位置发送至对应从节点伺服器。本发明根据轮廓误差设置插补目标位置,保证每一次同步控制都能减小各轴的同步误差,显著提升了多轴同步控制的精度。(The invention discloses a multi-axis synchronous error compensation method and a multi-axis synchronous error compensation system based on a CANopen protocol, wherein a main node disperses a target track curve into a plurality of continuous small straight line segments, and each small straight line segment contains target speed and distance information; the main node sequentially takes small straight line segments as current interpolation line segments; the master node sends synchronous signals to the slave node servers at intervals, receives the current actual positions returned by the slave node servers, calculates the distance from the current actual position to the current interpolation line segment as a contour error, and calculates the interpolation target position of each slave node server in the next synchronous control period according to the contour error; and the master node sends the calculated interpolation target position of each slave node server in the next synchronization control period to the corresponding slave node server. According to the invention, the interpolation target position is set according to the contour error, so that the synchronous error of each shaft can be reduced by each synchronous control, and the precision of multi-shaft synchronous control is obviously improved.)

1. A multi-axis synchronous error compensation method based on a CANopen protocol is used for controlling the cooperative operation of a plurality of servers, and is characterized in that the CANopen protocol comprises a master node and slave nodes, the master node is a master controller, the plurality of servers are all used as slave node servers, and the multi-axis synchronous error compensation method based on the CANopen protocol comprises the following steps:

step S1, the main node acquires a target track curve, performs speed planning and coarse interpolation processing on the target track curve, and disperses the target track curve into a plurality of continuous small straight-line segments, wherein each small straight-line segment comprises target speed and distance information;

step S2, the main node sequentially takes the small straight line segments as the current interpolation line segment;

step S3, the master node sends synchronization signals to the slave node servers at intervals, receives the current actual positions returned by the slave node servers, calculates the distance from the current actual position to the current interpolation line segment as a contour error, and calculates the interpolation target position of each slave node server in the next synchronization control cycle according to the contour error, as follows:

a. if the contour error is zero, the target speed included in the current interpolation line segment is selected, the feeding amount of each slave node server in the next synchronous control period is calculated according to the target speed, the feeding amount is superposed on the current actual position of the corresponding slave node server, and the interpolation target position of each slave node server in the next synchronous control period is obtained;

b. if the contour error is within the error allowable range, calculating a compensation value corresponding to each slave node server according to the contour error, compensating the current actual position of each slave node server by using the compensation value, taking a target speed contained in the current interpolation line segment, calculating the feed amount of each slave node server in the next synchronous control period according to the target speed, and superposing the feed amount on the compensated current actual position of each slave node server to obtain the interpolation target position of each slave node server in the next synchronous control period;

c. if the profile error exceeds the error allowable range, taking the slave node servo with the motion condition as lag and the maximum lag distance, taking the average speed of the slave node servo in the last synchronous control period as the target speed of the slave node servo in the next synchronous control period, and calculating the feeding amount of each slave node servo in the next synchronous control period according to the target speed of the slave node servo;

calculating a compensation value corresponding to each slave node server according to the contour error, compensating the current actual position of each slave node server by using the compensation value, and superposing the feed amount on the compensated current actual position of each slave node server to obtain an interpolation target position of each slave node server in the next synchronous control period;

step S4, the master node sends the calculated interpolation target position of each slave node server in the next synchronous control period to the corresponding slave node server, and step S3 is executed periodically until the slave node server moves to the end of the current interpolation line segment;

step S5, the main node judges whether the current interpolation line segment is the last small straight line segment in the target track curve, if yes, the operation is finished and the operation is finished; if not, step S2 is executed again.

2. The CANopen protocol-based multi-axis synchronous error compensation method as claimed in claim 1, wherein the calculating of the compensation value corresponding to each slave node server according to the profile error at point b of step S3 includes:

and taking the compensation value corresponding to each slave node servo as the component of the contour error in the running direction of the motion axis controlled by each slave node servo.

3. The CANopen protocol-based multi-axis synchronous error compensation method as claimed in claim 1, wherein the compensating the current actual position of each slave node server with the compensation value at point b of step S3 comprises:

judging the motion condition of each slave node server according to the relative position of the current actual position and the current interpolation line segment, and if the motion condition of the slave node server is an advance, subtracting a corresponding compensation value from the current actual position of the slave node server; if the motion situation of the slave node servo is lag, the corresponding compensation value is added to the current actual position of the slave node servo.

4. The CANopen protocol-based multi-axis synchronous error compensation method as claimed in claim 1, wherein the step S3 of calculating the compensation value corresponding to each slave node server according to the profile error at point c comprises:

multiplying the contour error by a scaling coefficient to obtain a proportional error;

and taking the compensation value corresponding to each slave node servo as a component of the proportional error in the running direction of the motion axis controlled by each slave node servo.

5. The CANopen protocol-based multi-axis synchronous error compensation method of claim 4, wherein the scaling factor is a positive number not greater than 1.

6. The CANopen protocol-based multi-axis synchronous error compensation method as claimed in claim 1, wherein the compensating the current actual position of each slave node server with a compensation value at the c-th point of step S3 comprises:

judging the motion condition of each slave node server according to the relative position of the current actual position and the current interpolation line segment, and if the motion condition of the slave node server is an advance, subtracting a corresponding compensation value from the current actual position of the slave node server; if the motion situation of the slave node servo is lag, the corresponding compensation value is added to the current actual position of the slave node servo.

7. A CANopen protocol-based multi-axis synchronous error compensation system, comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the CANopen protocol-based multi-axis synchronous error compensation method according to any one of claims 1 to 6.

Technical Field

The application belongs to the technical field of multi-axis control, and particularly relates to a multi-axis synchronous error compensation method and system based on a CANopen protocol.

Background

The CANopen protocol is a high-level communication protocol based on a Controller Area Network (Can), and is a field bus commonly used for industrial control. The CANopen protocol has the advantages of reliable data link layer, high compatibility, low price and the like, so the CANopen protocol has wide application range in industrial control.

In industrial control multi-axis control, different motor servers can be uniformly configured through a CANopen protocol. There is a dedicated CiA402 protocol for the servo control system that specifies the communication mode of the server. However, the communication between servers is not specified in the protocol, the single CANopen protocol cannot achieve synchronization and interpolation control between servers, and cannot compensate for synchronization errors, so that normal operation is affected due to the fact that multiple axes cannot be synchronously controlled in the multi-axis control, or the yield of processed products is reduced, and the productivity of enterprises is directly affected. Therefore, how to realize synchronization error compensation of multi-axis synchronization control based on the CANopen protocol is a problem to be solved.

Disclosure of Invention

The application aims to provide a multi-axis synchronous error compensation method and system based on a CANopen protocol, and the synchronous precision of multi-axis cooperative operation is improved.

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

a multi-axis synchronous error compensation method based on a CANopen protocol is used for controlling the cooperative operation of a plurality of servers, the CANopen protocol comprises a master node and slave nodes, the master node is a master controller, the plurality of servers are all used as slave node servers, and the multi-axis synchronous error compensation method based on the CANopen protocol comprises the following steps:

step S1, the main node acquires a target track curve, performs speed planning and coarse interpolation processing on the target track curve, and disperses the target track curve into a plurality of continuous small straight-line segments, wherein each small straight-line segment comprises target speed and distance information;

step S2, the main node sequentially takes the small straight line segments as the current interpolation line segment;

step S3, the master node sends synchronization signals to the slave node servers at intervals, receives the current actual positions returned by the slave node servers, calculates the distance from the current actual position to the current interpolation line segment as a contour error, and calculates the interpolation target position of each slave node server in the next synchronization control cycle according to the contour error, as follows:

a. if the contour error is zero, the target speed included in the current interpolation line segment is selected, the feeding amount of each slave node server in the next synchronous control period is calculated according to the target speed, the feeding amount is superposed on the current actual position of the corresponding slave node server, and the interpolation target position of each slave node server in the next synchronous control period is obtained;

b. if the contour error is within the error allowable range, calculating a compensation value corresponding to each slave node server according to the contour error, compensating the current actual position of each slave node server by using the compensation value, taking a target speed contained in the current interpolation line segment, calculating the feed amount of each slave node server in the next synchronous control period according to the target speed, and superposing the feed amount on the compensated current actual position of each slave node server to obtain the interpolation target position of each slave node server in the next synchronous control period;

c. if the profile error exceeds the error allowable range, taking the slave node servo with the motion condition as lag and the maximum lag distance, taking the average speed of the slave node servo in the last synchronous control period as the target speed of the slave node servo in the next synchronous control period, and calculating the feeding amount of each slave node servo in the next synchronous control period according to the target speed of the slave node servo;

calculating a compensation value corresponding to each slave node server according to the contour error, compensating the current actual position of each slave node server by using the compensation value, and superposing the feed amount on the compensated current actual position of each slave node server to obtain an interpolation target position of each slave node server in the next synchronous control period;

step S4, the master node sends the calculated interpolation target position of each slave node server in the next synchronous control period to the corresponding slave node server, and step S3 is executed periodically until the slave node server moves to the end of the current interpolation line segment;

step S5, the main node judges whether the current interpolation line segment is the last small straight line segment in the target track curve, if yes, the operation is finished and the operation is finished; if not, step S2 is executed again.

Preferably, the calculating a compensation value corresponding to each slave node server according to the profile error at the point b of the step S3 includes:

and taking the compensation value corresponding to each slave node servo as the component of the contour error in the running direction of the motion axis controlled by each slave node servo.

Preferably, the compensating the current actual position of each slave node server by using the compensation value at the point b of step S3 includes:

judging the motion condition of each slave node server according to the relative position of the current actual position and the current interpolation line segment, and if the motion condition of the slave node server is an advance, subtracting a corresponding compensation value from the current actual position of the slave node server; if the motion situation of the slave node servo is lag, the corresponding compensation value is added to the current actual position of the slave node servo.

Preferably, the calculating a compensation value corresponding to each slave node server according to the profile error at the point c of step S3 includes:

multiplying the contour error by a scaling coefficient to obtain a proportional error;

and taking the compensation value corresponding to each slave node servo as a component of the proportional error in the running direction of the motion axis controlled by each slave node servo.

Preferably, the scaling factor is a positive number not greater than 1.

Preferably, the compensating the current actual position of each slave node server by using the compensation value at the c-th point of the step S3 includes:

judging the motion condition of each slave node server according to the relative position of the current actual position and the current interpolation line segment, and if the motion condition of the slave node server is an advance, subtracting a corresponding compensation value from the current actual position of the slave node server; if the motion situation of the slave node servo is lag, the corresponding compensation value is added to the current actual position of the slave node servo.

The application further provides a multi-axis synchronous error compensation system based on the CANopen protocol, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to realize the steps of the multi-axis synchronous error compensation method based on the CANopen protocol in any technical scheme.

According to the multi-axis synchronous error compensation method and system based on the CANopen protocol, the interpolation target position with the proper next synchronous control period is set according to the contour error, so that the synchronous error of each axis can be reduced by each time of synchronous control, and the precision of multi-axis synchronous control is obviously improved.

Drawings

Fig. 1 is a flowchart of a multi-axis synchronous error compensation method based on a CANopen protocol according to the present application;

FIG. 2 is a schematic diagram of speed planning and coarse interpolation operation in embodiment 1 of the present application;

FIG. 3 is a schematic diagram of the embodiment 1 of the present application when the profile error is zero;

FIG. 4 is a schematic diagram of the case where the profile error is smaller than the allowable error range in embodiment 1 of the present application;

FIG. 5 is a schematic diagram of the case where the profile error exceeds the allowable error range in embodiment 1 of the present application;

fig. 6 is a timing chart of CANopen communication for error compensation in embodiment 1 of the present application.

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, a multi-axis synchronous error compensation method based on a CANopen protocol is provided, and is used for controlling the cooperative operation of a plurality of servers and realizing the cooperative control of multiple motion axes.

The CANopen protocol is a high-level communication agreement CANopen protocol based on Can bus and comprises a master node and a slave node. In this embodiment, a master node is set as a master controller, where the master controller is understood to be a device capable of being in communication connection with each server, and the master controller may be an independent computer or a master control device for controlling multi-axis motion in industrial control. And a plurality of servers are arranged as slave node servers, and each slave node server needs to be pre-configured before error compensation. In one embodiment, the pre-processing procedure provided is as follows:

the main node sends a broadcast signal to enable the slave node servers to enter a pre-operation mode, and all the slave node servers are configured by combining an object dictionary: setting a node CANopen synchronous communication period as TSYNC, wherein the period is a synchronous control period of the whole system; setting RPDO and TPDO object mapping; and setting the motion mode of the servo to be a position interpolation mode. After configuration is completed, the master node sends a broadcast instruction to enable the slave node server to enter an operation mode.

And the slave node server entering the operation mode completes pre-configuration, and at the moment, the slave node server is in a state to be operated, and multi-axis synchronous control can be performed according to the instruction of the master node to realize the tracking of the target track.

As shown in fig. 1, the multi-axis synchronous error compensation method based on the CANopen protocol provided in this embodiment includes:

and step S1, the main node acquires a target track curve, performs speed planning and coarse interpolation processing on the target track curve, and disperses the target track curve into a plurality of continuous small straight-line segments, wherein each small straight-line segment contains target speed and distance information. It should be noted that the speed planning and coarse interpolation processing are conventional processing methods of the synchronous interpolation control algorithm, and will not be described herein.

And step S2, the main node sequentially takes the small straight line segments as the current interpolation line segment.

Step S3, the master node sends synchronization signals to the slave node servers at intervals, receives the current actual positions returned by the slave node servers, calculates the distance from the current actual position to the current interpolation line segment as a contour error, and calculates the interpolation target position of each slave node server in the next synchronization control cycle according to the contour error, as follows:

a. and if the contour error is zero, the target speed included in the current interpolation line segment is selected, the feeding amount of each slave node server in the next synchronous control period is calculated according to the target speed, the feeding amount is superposed on the current actual position of the corresponding slave node server, and the interpolation target position of each slave node server in the next synchronous control period is obtained.

It should be noted that the process of calculating the advance according to the target speed of the current interpolation line segment is a conventional calculation process in the field of synchronous interpolation control, and details are not repeated here.

b. If the contour error is within the error allowable range, calculating a compensation value corresponding to each slave node server according to the contour error, compensating the current actual position of each slave node server by using the compensation value, taking a target speed contained in the current interpolation line segment, calculating the feeding amount of each slave node server in the next synchronous control period according to the target speed, and superposing the feeding amount on the compensated current actual position of each slave node server to obtain the interpolation target position of each slave node server in the next synchronous control period.

Wherein, the compensation value corresponding to each slave node servo is calculated according to the contour error, and one mode is as follows: and taking the compensation value corresponding to each slave node servo as the component of the contour error in the running direction of the motion axis controlled by each slave node servo.

The compensation value calculated in the mode has high correlation degree with each slave node server, and the compensation size is proper. Of course, in other embodiments, the profile error may be multiplied by a preset multiple to serve as a compensation value for the slave node servo.

The method comprises the following steps of compensating the current actual position of each slave node server by using a compensation value, wherein the compensation method comprises the following steps: judging the motion condition of each slave node server according to the relative position of the current actual position and the current interpolation line segment, and if the motion condition of the slave node server is an advance, subtracting a corresponding compensation value from the current actual position of the slave node server; if the motion situation of the slave node servo is lag, the corresponding compensation value is added to the current actual position of the slave node servo.

Wherein, the advance is to be understood as a line parallel to the motion direction passing through the current actual position in the motion direction of the motion axis corresponding to the slave node server, and the intersection point of the line and the current interpolation line segment is behind the current actual position; hysteresis is understood to mean that a line parallel to the direction of motion is drawn through the current actual position in the direction of motion of the motion axis corresponding to the slave node servo, the intersection of this line with the current interpolated line segment being in front of the current actual position.

c. And if the profile error exceeds the error allowable range, taking the slave node servo with the motion situation as lag and the maximum lag distance, taking the average speed of the slave node servo in the last synchronous control period as the target speed of the slave node servo in the next synchronous control period, and calculating the feeding amount of each slave node servo in the next synchronous control period by using the target speed of the slave node servo.

It should be noted that the process of calculating the feed amounts of all the servers at the target speed of one server is a conventional calculation process of synchronous interpolation control, and details are not repeated here.

Because the profile error is large, after the feed amount is determined, the current actual position of each slave node servo also needs to be compensated, and the specific compensation operation is as follows: and calculating a compensation value corresponding to each slave node server according to the contour error, and compensating the current actual position of each slave node server by using the compensation value.

In order to adapt to the change of the target speed of the next synchronous control period, the contour error used in the compensation is adjusted to reduce the synchronous error: firstly, multiplying the contour error by a proportionality coefficient to obtain a proportional error; and then taking the compensation value corresponding to each slave node servo as the component of the proportional error in the running direction of the motion axis controlled by each slave node servo.

The proportionality coefficient is a positive number not greater than 1, and the proportionality coefficient may be a preset fixed value or a coefficient which is obtained according to a control algorithm such as a PID control algorithm, fuzzy control and the like and is changed along with the error magnitude.

When the compensation value is obtained through calculation, the current actual position is compensated according to the following modes: judging the motion condition of each slave node server according to the relative position of the current actual position and the current interpolation line segment, and if the motion condition of the slave node server is an advance, subtracting a corresponding compensation value from the current actual position of the slave node server; if the motion situation of the slave node servo is lag, the corresponding compensation value is added to the current actual position of the slave node servo.

And finally, the feeding amount is superposed on the compensated current actual position of each slave node server to obtain the interpolation target position of each slave node server in the next synchronous control period.

It is easy to understand that the current actual position of each slave node server is actually a whole, and when the current actual position of one slave node server is explored, the current actual position of other slave node servers is limited. For example, a point (x, y) in a two-axis coordinate system, when x is described, its actual position is limited by y, but y is not 0.

Step S4, the master node sends the calculated interpolation target position of each slave node server in the next synchronization control period to the corresponding slave node server, and periodically executes step S3 until the slave node server moves to the end of the current interpolation line segment.

Step S5, the main node judges whether the current interpolation line segment is the last small straight line segment in the target track curve, if yes, the operation is finished and the operation is finished; if not, step S2 is executed again.

In order to facilitate understanding of the multi-axis synchronous error compensation method based on the CANopen protocol, the following description will take linear synchronous interpolation of two XY axes as an example.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种宏微结合的多精度智能数控系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!

技术分类