Disclosure of Invention
The present disclosure addresses the above issues by providing a method and apparatus for over-quadrant compensation based on fieldbus speed feedforward.
In order to solve at least one of the above technical problems, the present disclosure proposes the following technical solutions:
in a first aspect, an over-quadrant compensation method of speed feedforward based on a field bus is provided, wherein a compensation period is set in an upper computer of a numerical control system, and each compensation period comprises the following steps,
acquiring a command position and a command speed;
judging whether the command speed passes through a quadrant or not according to the command speed;
if the speed feedforward model exceeds the quadrant, calculating speed feedforward according to the speed feedforward compensation model; if the quadrant is not passed, the speed feedforward is marked as 0;
command position, velocity feedforward and control words are sent to the servo motor via the fieldbus.
In a second aspect, an over-quadrant compensation device for fieldbus-based velocity feedforward is provided, which includes an acquisition unit for acquiring a command position and a command velocity;
the judging unit is used for judging whether the command speed passes through a quadrant or not according to the command speed;
the calculating unit is used for presetting a speed feedforward compensation model and calculating speed feedforward according to the speed feedforward compensation model when the over-quadrant occurs;
and the communication unit is used for sending the command position, the speed feedforward and the control word to the servo motor through a field bus.
The method has the advantages that the speed feedforward compensation model is arranged, the speed feedforward is calculated according to the command position acquired by the upper computer of the numerical control machine, the speed loop acting on the servo motor is compensated, the compensation is closer to the actual model of the friction force than the compensation of the position loop, and more processing scenes can be adapted; the track deformation caused by friction force is reduced, the error is reduced, and a more ideal processing effect is achieved; meanwhile, the complexity of the physical model is reduced, the realization is easier, the engineering application is further adapted, and various servos are adapted.
In addition, in the technical solutions of the present disclosure, the technical solutions of the present disclosure can be implemented by adopting conventional means in the art, unless otherwise specified.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of some, but not all, embodiments of the disclosure and are not to be considered as limiting the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1:
referring to the accompanying drawings 1-3, the over-quadrant compensation method based on the speed feedforward of the field bus provided by the embodiment of the application is shown, and the method sets compensation periods in the upper computer of the numerical control system, and comprises the following steps in each compensation period,
s101: acquiring a command position and a command speed;
specifically, the command position is calculated by an upper computer of the numerical control system. In an optional embodiment, the command position is obtained by the upper computer of the numerical control system according to the NC file analysis interpolation calculation.
Specifically, the command velocity may be obtained by subtracting the command positions of two adjacent compensation periods. For example, the commanded velocity for the current compensation cycle is obtained by subtracting the commanded position for the current cycle from the commanded position for the immediately preceding cycle.
S102: and judging whether the quadrant is passed or not according to the command speed.
In an alternative embodiment, determining whether to over-quadrant based on the commanded speed may include,
acquiring a sign of a command speed of a current compensation period and a sign of a command speed of an adjacent previous compensation period;
comparing the symbols;
if the signs of the command speeds are the same, the quadrant is not passed;
if the sign of the commanded speed is different, then the quadrant is crossed.
S103: if the speed feedforward model exceeds the quadrant, calculating speed feedforward according to the speed feedforward compensation model; if the quadrant is not crossed, the velocity feedforward is recorded as 0.
A speed feedforward compensation model is preset in an upper computer of the numerical control system.
In an alternative embodiment, the velocity feedforward compensation model is,
wherein V is velocity feed forward; s is the command position; s0A command position for quadrant-crossing start; v0To be at position S0Velocity feedforward of (d); s1A command position V with the maximum deviation distance from the feedback position after passing through the quadrant without compensation1To be at position S1Velocity feedforward of (d); s2To compensate for the ending commanded position.
In an alternative embodiment, the commanded position S for the start of over-quadrant is determined in a velocity feedforward compensation model0Set to 0, position S1And position S2All are the positions S where the over-quadrant starts0The velocity feedforward compensation model, at this time,
wherein V is velocity feed forward; s is the command position; s0A command position for quadrant-crossing start; v0To be at position S0Velocity feedforward of (d); s1A command position V with the maximum deviation distance from the feedback position after passing through the quadrant without compensation1To be at position S1Velocity feedforward of (d); s2To compensate for the ending commanded position.
Therefore, the speed feedforward compensation model is simplified, the compensation requirement of speed feedforward is completed through a simple physical model, and the practicability is higher.
In an alternative embodiment, at location S0Velocity feedforward V of0And in position S1Velocity feedforward V of1The determination method comprises the following steps:
acquiring command positions and feedback positions at different moments and drawing a curve graph, wherein the feedback positions are uncompensated feedback positions, and referring to the attached figure 4 of the specification, the ordinate of the curve graph is position, and the abscissa of the curve graph is time;
determining the position S on the graph0Position S1And position S2Wherein position S0A command position at which the over-quadrant starts, i.e., a position at which the command position starts to deviate from the feedback position; position S1The command position with the maximum deviation from the feedback position is obtained; position S2After passing the quadrant, the command position is superposed with the feedback position for the first time;
setting V0=V1X, wherein X may be in the range of 300-. Adding speed feedforward compensation in the numerical control system to make V0Keeping the same and adjusting V1Size, order S1To S2The command position and the feedback position curve are coincided to obtain the V at the moment1=X1;
Then let V1Keeping the same and adjusting V0Size, make S0To S1The command position and the feedback position curve coincide to obtain the V at the moment0=X0。
Thereby, V in the velocity feedforward compensation model is obtained0And V1The method is simple and easy to implement, has high adaptability, can meet the requirements of various servo motors and industrial fields, achieves good compensation effect, and enables the processing effect to be better.
S104: command position, velocity feedforward and control words are sent to the servo motor via the fieldbus.
In an alternative embodiment, the fieldbus is an EtherCat bus. Therefore, the EtherCat bus can support real-time writing speed feedforward, and is more convenient to use and better in real-time effect.
The method has the advantages that the speed feedforward compensation model is arranged, the speed feedforward is calculated according to the command position acquired by the upper computer of the numerical control machine, the speed loop acting on the servo motor is compensated, the compensation is closer to the actual model of the friction force than the compensation of the position loop, and more processing scenes can be adapted; the track deformation caused by friction force is reduced, the error is reduced, and a more ideal processing effect is achieved; meanwhile, the complexity of the physical model is reduced, the realization is easier, the engineering application is further adapted, and various servos are adapted.
Example 2:
referring to the specification and fig. 5, there is shown an over-quadrant compensation apparatus for fieldbus based speed feedforward according to an embodiment of the present application, for performing the method in the above method embodiment, the apparatus includes,
an acquisition unit 11 for acquiring a command position and a command speed;
a judging unit 12, configured to judge whether the command speed passes through a quadrant;
the calculating unit 13 is used for presetting a speed feedforward compensation model and calculating speed feedforward according to the speed feedforward compensation model when the over-quadrant occurs;
a communication unit 14 for sending command position, velocity feedforward and control words to the servo motor via the field bus.
In an alternative embodiment, in the judging unit 12, it is judged whether the over-quadrant is included or not according to the command speed,
acquiring a sign of a command speed of a current compensation period and a sign of a command speed of an adjacent previous compensation period;
comparing the symbols;
if the signs of the command speeds are the same, the quadrant is not passed;
if the sign of the commanded speed is different, then the quadrant is crossed.
In an alternative embodiment, the velocity feedforward compensation model is,
wherein V is velocity feed forward; s is the command position; s0A command position for quadrant-crossing start; v0To be at position S0Velocity feedforward of (d); s1A command position V with the maximum deviation distance from the feedback position after passing through the quadrant without compensation1To be at position S1Speed of (2)Degree feed-forward; s2To compensate for the ending commanded position.
In an alternative embodiment, the commanded position S for the start of over-quadrant is determined in a velocity feedforward compensation model0Set to 0, position S1And position S2All are the positions S where the over-quadrant starts0The velocity feedforward compensation model, at this time,
wherein V is velocity feed forward; s is the command position; s0A command position for quadrant-crossing start; v0To be at position S0Velocity feedforward of (d); s1A command position V with the maximum deviation distance from the feedback position after passing through the quadrant without compensation1To be at position S1Velocity feedforward of (d); s2To compensate for the ending commanded position.
In an alternative embodiment, at location S0Velocity feedforward V of0And in position S1Velocity feedforward V of1The determination method comprises the following steps:
acquiring command positions and feedback positions at different moments and drawing a curve graph, wherein the feedback positions are uncompensated feedback positions, and referring to the attached figure 4 of the specification, the ordinate of the curve graph is position, and the abscissa of the curve graph is time;
determining the position S on the graph0Position S1And position S2Wherein position S0A command position at which the over-quadrant starts, i.e., a position at which the command position starts to deviate from the feedback position; position S1The command position with the maximum deviation from the feedback position is obtained; position S2After passing the quadrant, the command position is superposed with the feedback position for the first time;
setting V0=V1X, wherein X may be in the range of 300-. Adding speed feedforward compensation in the numerical control system to make V0Keeping the same and adjusting V1Size, order S1To S2The command position and the feedback position curve are coincided to obtain the V at the moment1=X1;
Then let V1Keeping the same and adjusting V0Size, make S0To S1The command position and the feedback position curve coincide to obtain the V at the moment0=X0。
In an alternative embodiment, the field bus in the communication unit 14 is an EtherCat bus.
The method has the advantages that the speed feedforward compensation model is arranged, the speed feedforward is calculated according to the command position acquired by the upper computer of the numerical control machine, the speed loop acting on the servo motor is compensated, the compensation is closer to the actual model of the friction force than the compensation of the position loop, and more processing scenes can be adapted; the track deformation caused by friction force is reduced, the error is reduced, and a more ideal processing effect is achieved; meanwhile, the complexity of the physical model is reduced, the realization is easier, the engineering application is further adapted, and various servos are adapted.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
The sequence of the embodiments in this specification is merely for description, and does not represent the advantages or disadvantages of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present disclosure and is not intended to limit the present disclosure, which is to be construed in any way as imposing limitations thereon, such as the appended claims, and all changes and equivalents that fall within the true spirit and scope of the present disclosure.