Dynamic servo control method for servo driver PROFINETTechnical Field
The invention relates to the technical field of servo driver control, in particular to a servo driver PROFINET dynamic servo control method.
Background
With the continuous iteration of modern industrial automation, domestic servo manufacturers have recently begun to be involved in the development and commercialization of PROFINET servo drives, with PROFINET dynamic servo control technology being of particular interest. The existing servo driver PROFINET dynamic servo control method has the following two problems limited by objective factors:
1. The method ignores the influence of the application period multiplying power, and when the application period multiplying power Kcacf is more than or equal to 2, the actual industrial Ethernet control system can cause obvious degradation of the process shaft following error due to the limitation of objective factors, so that a design scheme with higher cost is passively selected;
2. The method ignores the influence of the reading time and the output time of an upper controller, and the industrial Ethernet control system can cause the degradation of the following error of the process shaft after changing the reading time and the output time due to the synchronous requirement, and can cause the consistency degradation of the following error of the process shaft even after changing the track planning speed.
Disclosure of Invention
The invention provides a servo driver PROFINET dynamic servo control method, which aims to overcome the defects of the prior art and avoid the problem of process shaft following error degradation caused by the change of an application period multiplying power or the change of a control system parameter.
The technical scheme of the invention is as follows:
a servo driver PROFINET dynamic servo control method comprises the following steps:
S1, calculating an interpolation starting point of a servo position loop instruction according to an application period multiplying power Kcacf and cache position information Posk
S2, calculating a time correction coefficient Ct according to the reading time Ti and the output time To of the upper controller and the servo position loop instruction period Tcasr;
S3, based on the current servo position loop instruction beat i and the beat number N, the time correction coefficient Ct, the buffer position information Posk and the servo position loop instruction interpolation starting pointCalculating servo position loop interpolation position instructions in real time
Further, step S1 indicates the interpolation starting point of the servo position loop commandThe calculation method of (1) is as follows:
wherein Posk=0 is the cache location information of the current application period, and Posk=1 is the cache location information of the previous application period.
Further, the calculation method of the time correction coefficient Ct in step S2 is as follows:
Ct=0.5×(Ti%Tcasr+To%Tcasr+2)
wherein, "%" represents the remainder operation.
Further, step S3 is a servo position loop interpolation position commandThe calculation method of (1) is as follows:
Wherein the position loop instructs the interpolation beat numberThe current servo position loop instruction beat i e 0, N-1.
Compared with the prior art, the method has the advantages that the method calculates the interpolation starting point of the servo position loop instruction according to the application period multiplying power Kcacf and the cached position information PoskWhen the application period multiplying power Kcacf is more than or equal to 2, the process shaft following error can be still ensured to be at a very high level, a time correction coefficient Ct is calculated according to the reading time Ti and the output time To of the upper controller and the servo position loop instruction period Tcasr, and the interpolation starting point is interpolated based on the current servo position loop instruction beat i and beat number N, the time correction coefficient Ct, the cache position information Posk and the servo position loop instructionCalculating servo position loop interpolation position instructions in real timeAfter the track planning speed is changed and the reading time and the output time of the upper controller are changed due to the synchronous requirement, the following error of the process shaft can be still ensured, and the method has good social and economic values.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a schematic diagram of the synchronization logic of the present invention.
Detailed Description
The technical scheme of the invention is described in detail below with reference to the accompanying drawings:
Referring to fig. 1, a servo driver PROFINET dynamic servo control method includes the following steps:
S1, calculating an interpolation starting point of a servo position loop instruction according to an application period multiplying power Kcacf and cache position information Posk
Wherein Posk=0 is the cache location information of the current application period, and Posk=1 is the cache location information of the previous application period.
S2, as shown in FIG. 2, in each synchronization period Tcyc, the PWM zero crossing point of the servo driver FPGA is synchronous with the PROFINET period synchronization pulse PNcyc, the servo driver CPU responds to the PNin pulse interrupt request of PROFINET and completes the Hostout period transmission before executing the speed loop, and after scanning the PNout pulse interrupt request mark of PROFINET, the servo driver CPU completes the Hostin period reception before executing the position loop instruction interpolation. In the figure, Tpwm is the servo driver FPGA PWM period, and period Tcacf=Kcacf×Tcyc is applied.
Calculating a time correction coefficient Ct according to the read time Ti and the output time To of the upper controller and the servo position loop instruction period Tcasr:
Ct=0.5×(Ti%Tcasr+To%Tcasr+2)
Wherein Ti、To and Tcasr are integer multiples of 125us, "%" represents remainder operation, and Ct is floating point number.
S3, based on the current servo position loop instruction beat i and the beat number N, the time correction coefficient Ct, the buffer position information Posk and the servo position loop instruction interpolation starting pointCalculating servo position loop interpolation position instructions in real time
Wherein the position loop instructs the interpolation beat numberThe current servo position loop instruction beat i e 0, N-1.
In the actual working process, a user can select different application period multiplying powers Kcacf according to objective factors, and after the reading time and the output time of the upper controller or the track planning are changed due to the process requirement, the following error of a process shaft can be still ensured.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and improvements could be made by those skilled in the art without departing from the inventive concept, which fall within the scope of the present invention.