Location instruction updating method and device, equipment and storage medium
By obtaining the position command of the EtherCAT synchronization cycle and determining the change rate based on its relationship with the position loop cycle, a planning curve is constructed to update the position command, which solves the mutation problem caused by the difference between the EtherCAT synchronization cycle and the servo drive position loop cycle, and improves the servo system control accuracy and stability.
Patent Information
- Application Number
- CN202410874499.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-25
AI Technical Summary
When the EtherCAT synchronization period is different from the position loop period of the servo drive, the resulting clock error and position loop cumulative error cause sudden changes or response delays in actual position control.
By obtaining the first and second position commands of the EtherCAT synchronization cycle, based on their multiple relationship with the position loop cycle, the initial value of the position command change rate and acceleration are determined, the position command planning curve is constructed, and the corresponding position loop is updated within the EtherCAT synchronization cycle. The third position command ensures the smooth change of the command.
It effectively avoids drastic mutations of position instructions, improves the control accuracy and stability of the servo system, and ensures the synchronization effect of the position loop.
Smart Images

Figure CN118838643A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of servo drives, and more specifically, to a position instruction updating method, device, equipment and storage medium. Background Art
[0002] With the upgrading and transformation of modern industry, the demand for servo systems continues to increase, which has promoted the rapid development of the servo system industry. At present, servo systems are increasingly used in the fields of intelligent manufacturing and industrial Internet, combining Ethernet for Control Automation Technology (EtherCAT) communication.
[0003] EtherCAT bus technology supports CiA402 (Device Profile Drivers and Motion Control) profile, which is mainly aimed at the functional logic of motion devices, such as servo drives, inverters, stepper motor drives, etc., and defines the object parameters and operation modes related to motion devices. Among them, the periodic synchronous position mode is the most commonly used operation mode.
[0004] However, under the previous periodic synchronous position mode control, since the EtherCAT synchronization period is often not equal to the position loop period in the servo drive, and there is also a deviation between the EtherCAT clock and the servo drive control chip clock, when the EtherCAT master periodically sends the planned position instructions, the accumulated clock error will cause the accumulated error of the position loop, resulting in sudden changes or response delays in actual position control. Summary of the invention
[0005] In view of this, the embodiments of the present application disclose a position instruction updating method, apparatus, device and storage medium to avoid sudden changes or response delays during actual position control and improve the control accuracy and stability of the servo system.
[0006] The technical solutions provided by the embodiments of this application are as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for updating a position instruction, the method comprising:
[0008] Obtain a first position instruction of a first Ethernet control automation technology EtherCAT synchronization cycle and a second position instruction of a second EtherCAT synchronization cycle; the second EtherCAT synchronization cycle is an EtherCAT synchronization cycle before the first EtherCAT synchronization cycle;
[0009] Determine an initial value of a position command change rate and an acceleration of a position command change rate based on a multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position command, and the second position command;
[0010] Determining a position instruction planning curve based on the position instruction change rate initial value and the position instruction change rate acceleration;
[0011] In the first EtherCAT synchronization cycle, a third position instruction corresponding to the position loop is updated based on the position instruction planning curve.
[0012] In a possible implementation, determining the initial value of the position command change rate and the acceleration of the position command change rate based on the multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position command, and the second position command includes:
[0013] When the first EtherCAT synchronization period is not an integer multiple of the position loop period, the position command change rate initial value and the position command change rate acceleration are determined based on the first position command, the second position command and the position loop period.
[0014] In a possible implementation, determining the position command change rate initial value and the position command change rate acceleration based on the first position command, the second position command and the position loop period includes:
[0015] The position command change rate initial value and the position command change rate acceleration are determined based on the following formula:
[0016]
[0017] T1=K2T2+t ′ ;
[0018] Wherein, a1 represents the initial value of the position command change rate, S1 represents the first position command, S2 represents the second position command, T2 represents the position loop period, K2 is a positive integer, Δa represents the acceleration of the position command change rate, T1 represents the first EtherCAT synchronization period, and t ′ is a positive integer, and the t ′ Smaller than T2.
[0019] In a possible implementation, determining the initial value of the position command change rate and the acceleration of the position command change rate based on the multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position command, and the second position command includes:
[0020] When the first EtherCAT synchronization period is an integer multiple of the position loop period, the position instruction change rate initial value and the position instruction change rate acceleration are determined based on the first position instruction, the second position instruction and the first EtherCAT synchronization period.
[0021] In a possible implementation, determining the position command change rate initial value and the position command change rate acceleration based on the first position command, the second position command and the first EtherCAT synchronization period includes:
[0022] The position command change rate initial value and the position command change rate acceleration are determined based on the following formula:
[0023]
[0024] Wherein, a1 represents the initial value of the position command change rate, S1 represents the first position command, S2 represents the second position command, T1 represents the first EtherCAT synchronization period, and Δa represents the acceleration of the position command change rate.
[0025] In a possible implementation, updating the third position instruction corresponding to the position loop based on the position instruction planning curve within the first EtherCAT synchronization cycle includes:
[0026] In the first EtherCAT synchronization cycle, determining a position command increment based on the position command planning curve;
[0027] A third position instruction corresponding to the position loop is updated based on the position instruction increment.
[0028] In a possible implementation, the position instruction planning curve is expressed as follows:
[0029]
[0030] Among them, the represents the position instruction planning curve, T1 represents the first EtherCAT synchronization period, a1 represents the initial value of the position instruction change rate, Δa represents the acceleration of the position instruction change rate, and t represents time.
[0031] In a second aspect, an embodiment of the present application provides a position instruction updating device, the device comprising:
[0032] An acquisition module is used to acquire a first position instruction of a first Ethernet control automation technology EtherCAT synchronization cycle and a second position instruction of a second EtherCAT synchronization cycle; the second EtherCAT synchronization cycle is an EtherCAT synchronization cycle before the first EtherCAT synchronization cycle;
[0033] A determination module, configured to determine an initial value of a position instruction change rate and an acceleration of a position instruction change rate based on a multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position instruction, and the second position instruction;
[0034] The determination module is further used to determine the position instruction planning curve based on the position instruction change rate initial value and the position instruction change rate acceleration;
[0035] An updating module is used to update a third position instruction corresponding to the position loop based on the position instruction planning curve within the first EtherCAT synchronization cycle.
[0036] In a third aspect, an embodiment of the present application provides a position instruction updating device, including:
[0037] A memory for storing instructions;
[0038] A processor is used to execute the instructions in the memory to execute the position instruction updating method described in any one of the first aspects above.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute the position instruction updating method described in any one of the first aspects above.
[0040] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the location instruction update method described in any one of the first aspects above.
[0041] Based on the above technical solution, this application has the following beneficial effects:
[0042] The embodiment of the present application discloses a method, device, equipment and storage medium for updating position instructions. The method includes: obtaining a first position instruction of a first EtherCAT synchronization cycle and a second position instruction of a second EtherCAT synchronization cycle; determining an initial value of the position instruction change rate and an acceleration of the position instruction change rate based on the multiple relationship between the first EtherCAT synchronization cycle and the position loop cycle, the first position instruction and the second position instruction; determining a position instruction planning curve based on the initial value of the position instruction change rate and the acceleration of the position instruction change rate; and updating a third position instruction corresponding to the position loop based on the position instruction planning curve within the first EtherCAT synchronization cycle. It can be seen that in the embodiment of the present application, for the case where the EtherCAT synchronization period is not equal to the position loop period of the servo drive, since the position instruction planning curve is determined based on the initial value of the position instruction change rate and the acceleration of the position instruction change rate, the instruction planning curve can characterize the change of the position instruction at any time within the first EtherCAT synchronization period. In this way, based on the position instruction planning curve, the third position instruction can be smoothly updated within the EtherCAT synchronization period to avoid causing drastic mutations in the third position instruction, and ensure that when the position loop interruption is triggered, the corresponding updated third position instruction has a good synchronization effect, thereby avoiding mutations or response delays during actual position control, and improving the control accuracy and stability of the servo system. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without paying any creative work.
[0044] Figure 1 A flow chart of a method for updating a position instruction disclosed in an embodiment of the present application;
[0045] Figure 2 A flowchart of another method for updating position instructions disclosed in an embodiment of the present application;
[0046] Figure 3 A schematic diagram for updating an existing position instruction;
[0047] Figure 4 A schematic diagram of a position instruction update corresponding to the position instruction update method disclosed in an embodiment of the present application;
[0048] Figure 5 A schematic diagram of the structure of a position instruction updating device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] See also Figure 1 , a flow chart of a method for updating a position instruction disclosed in an embodiment of the present application, the method comprising:
[0051] S101, obtaining a first position instruction of a first Ethernet control automation technology EtherCAT synchronization period and a second position instruction of a second EtherCAT synchronization period.
[0052] The second EtherCAT synchronization cycle is the EtherCAT synchronization cycle before the first EtherCAT synchronization cycle. For example, if the first EtherCAT synchronization cycle is the Nth EtherCAT synchronization cycle, then the second EtherCAT synchronization cycle is the N-1th EtherCAT synchronization cycle, where N is a positive integer.
[0053] In the embodiment of the present application, the first EtherCAT synchronization period and the second EtherCAT synchronization period can be obtained from the EtherCAT master station. The EtherCAT synchronization period is a period set by the user through the EtherCAT master station, and can be customized and adjusted according to actual needs. After the communication connection, the EtherCAT synchronization period can be obtained through the EtherCAT object parameters.
[0054] In the embodiment of the present application, the first position instruction and the second position instruction can be sent by the EtherCAT master station to the servo driver, and the servo driver obtains the first position instruction and the second position instruction.
[0055] S102, determining an initial value of a position command change rate and an acceleration of a position command change rate based on a multiple relationship between a first EtherCAT synchronization period and a position loop period, a first position command, and a second position command.
[0056] It should be noted that the multiple relationship between the first EtherCAT synchronization cycle and the position loop cycle may refer to whether the first EtherCAT synchronization cycle is an integer multiple of the position loop cycle. When the first EtherCAT synchronization cycle is an integer multiple of the position loop cycle, T1 = K1T2, T1 represents the first EtherCAT synchronization cycle, T2 represents the position loop cycle, and K1 is a positive integer; when the first EtherCAT synchronization cycle is not an integer multiple of the position loop cycle, T1 = K2T2+t ′ , T1 represents the first EtherCAT synchronization cycle, T2 represents the position loop cycle, K2 is a positive integer, t ′ is a positive integer, and t ′ Smaller than T2.
[0057] Among them, the position loop period of the servo drive is a drive parameter and is a factory setting value of the servo drive.
[0058] S103, determining a position instruction planning curve based on the position instruction change rate initial value and the position instruction change rate acceleration.
[0059] The position instruction planning curve in the embodiment of the present application can represent the position instruction increment at any time within the first EtherCAT synchronization cycle.
[0060] S104 . In the first EtherCAT synchronization cycle, a third position instruction corresponding to the position loop is updated based on the position instruction planning curve.
[0061] It should be noted that the first position instruction and the second position instruction issued by the EtherCAT master station are absolute positions, and the third position instruction processed by the internal position loop of the servo driver is a position increment. The third position instruction is updated at least once within the time interval triggered by each EtherCAT synchronization interrupt. For example: ① The first EtherCAT synchronization cycle is 10ms, and the position loop cycle is 1ms. In the first EtherCAT synchronization cycle, the servo driver will trigger 10 / 1=10 position loop interrupts, and will update the third position instruction 10 times based on the instruction rule curve, that is, the third position instruction is updated every 1ms. When t=10ms, the 10th position loop interrupt can be triggered. ② The first EtherCAT synchronization cycle is 10ms, and the position loop cycle is 3ms. In the first EtherCAT synchronization cycle, the servo driver will trigger 3 position loop interrupts, and will update the third position instruction 3 times based on the instruction rule curve, that is, the third position instruction is updated every 3ms. The last update is the 9th ms, and when t=9ms, the third position loop interrupt is triggered. It can be understood that the above is only an exemplary description and should not be understood as a limitation on the embodiments of the present application.
[0062] It can be seen that in the embodiment of the present application, for the case where the EtherCAT synchronization period is not equal to the position loop period of the servo drive, since the position instruction planning curve is determined based on the initial value of the position instruction change rate and the acceleration of the position instruction change rate, the instruction planning curve can characterize the change of the position instruction at any time within the first EtherCAT synchronization period. In this way, based on the position instruction planning curve, the third position instruction can be smoothly updated within the EtherCAT synchronization period to avoid causing drastic mutations in the third position instruction, and ensure that when the position loop interruption is triggered, the corresponding updated third position instruction has a good synchronization effect, thereby avoiding mutations or response delays during actual position control, and improving the control accuracy and stability of the servo system.
[0063] See also Figure 2 , a flow chart of another method for updating position instructions disclosed in an embodiment of the present application, the method comprising:
[0064] S201 , obtaining a first position instruction of a first EtherCat synchronization cycle and a second position instruction of a second EtherCat synchronization cycle.
[0065] The second EtherCat synchronization cycle is an EtherCat synchronization cycle before the first EtherCat synchronization cycle.
[0066] It is understandable that S201 is the same as the above-mentioned S101, so it is not described again.
[0067] S202: When the first EtherCat synchronization period is not an integer multiple of the position loop period, determine the initial value of the position command change rate and the acceleration of the position command change rate based on the first position command, the second position command and the position loop period.
[0068] Specifically, the initial value of the position command change rate and the acceleration of the position command change rate are determined based on the following formula:
[0069]
[0070] T1=K2T2+t ′ ;
[0071] Where a1 represents the initial value of the position command change rate, S1 represents the first position command, S2 represents the second position command, T2 represents the position loop period, K2 is a positive integer, Δa represents the acceleration of the position command change rate, T1 represents the first EtherCat synchronization period, t ′ is a positive integer, and t ′ Smaller than T2.
[0072] In the embodiment of the present application, specific calculation formulas for the initial value of the position command change rate and the acceleration of the position command change rate are given when the first EtherCat synchronization period is not an integer multiple of the position loop period, thereby ensuring that within the first EtherCat synchronization period, when the position loop interrupt is triggered for the last time, the third position command corresponding to the position loop is synchronized with the first position command issued by the EtherCAT master station.
[0073] In the embodiment of the present application, after each periodic synchronization signal is generated, that is, when the servo drive triggers the EtherCAT synchronization interrupt, the position loop interrupt counter can be cleared, so that the start time of the position loop can be consistent with the start time of this EtherCat synchronization cycle, avoiding the t left over from the previous EtherCat synchronization cycle. ′ This affects the calculation of the ratio (K1 or K2) between the EtherCat synchronization cycle and the position loop cycle during this EtherCat synchronization cycle, thereby further ensuring that the final third position instruction is synchronized with the first position instruction.
[0074] S203: When the first EtherCat synchronization period is an integer multiple of the position loop period, determine the position command change rate initial value and the position command change rate acceleration based on the first position command, the second position command and the first EtherCat synchronization period.
[0075] Specifically, the initial value of the position command change rate and the acceleration of the position command change rate are determined based on the following formula:
[0076]
[0077] Wherein, a1 represents the initial value of the position command change rate, S1 represents the first position command, S2 represents the second position command, T1 represents the first EtherCat synchronization period, and Δa represents the acceleration of the position command change rate.
[0078] In the embodiment of the present application, specific calculation formulas for the initial value of the position command change rate and the acceleration of the position command change rate are given when the first EtherCat synchronization period is an integer multiple of the position loop period, thereby ensuring that within the first EtherCat synchronization period, when the position loop interrupt is triggered for the last time, the third position command corresponding to the position loop is synchronized with the first position command issued by the EtherCAT master station.
[0079] It is understandable that the embodiment of the present application does not limit the execution order of S202 and S203. Depending on whether the first EtherCat synchronization period is an integer multiple of the position loop period, S202 or S203 is selected to be executed.
[0080] S204 . Determine a position instruction increment based on a position instruction planning curve within a first EtherCat synchronization cycle.
[0081] The position instruction planning curve in the embodiment of the present application can be expressed as follows:
[0082]
[0083] in, represents the position instruction planning curve, T1 represents the first EtherCAT synchronization cycle, a1 represents the initial value of the position instruction change rate, Δa represents the acceleration of the position instruction change rate, and t represents time. It can be understood that the embodiment of the present application selects the calculation formula of a1 and Δa in the above S202 or the calculation formula of a1 and Δa in the above S203 to determine the position instruction planning curve according to whether the first EtherCat synchronization cycle is an integer multiple of the position loop cycle.
[0084] In a possible implementation, multiple position instruction increments may be determined within the first EtherCat synchronization cycle based on the position instruction planning curve, the first EtherCat synchronization cycle, and the position loop cycle.
[0085] If the first EtherCat synchronization period is not an integer multiple of the position loop period, the position command increment can be determined based on the following formula:
[0086]
[0087] in, Indicates the position command increment, t indicates time, T1=K2T2+t ′ , T1 represents the first EtherCat synchronization cycle, T2 represents the position loop cycle, K2 is a positive integer, t ′ is a positive integer, and t ′ is less than T2, a1 and Δa are determined according to the calculation formula of a1 and Δa in the above S202.
[0088] When the first EtherCat synchronization period is an integer multiple of the position loop period, the position command increment can be determined based on the following formula:
[0089]
[0090] in, represents the position command increment, t represents time, T1=K1T2, T1 represents the first EtherCat synchronization cycle, T2 represents the position loop cycle, K1 is a positive integer, and a1 and Δa are determined according to the calculation formula of a1 and Δa in the above S203.
[0091] For example: the first EtherCAT synchronization cycle T1 is 60ms, the position loop cycle T2 is 15ms, K1=60 / 15=4, the first position instruction S1 is 1200, the second position instruction S2 is 600, the initial value of the position instruction change rate a1=2×(1200-600) / 60=20, the position instruction change rate acceleration Δa=20 / 60=1 / 3, and the position instruction planning curve is Correspondingly, the position command increment can include
[0092] ΔS1+ΔS2+ΔS3+ΔS4=262.5+187.5+112.5+37.5=600. It can be understood that the above is only an exemplary description and should not be construed as limiting the embodiments of the present application.
[0093] A specific calculation formula for the position instruction increment is given in the embodiment of the present application. Based on the specific calculation formula, the third position instruction corresponding to the position loop is updated by steadily increasing the corresponding position instruction increment, thereby avoiding drastic mutations in the third position instruction.
[0094] S205. Incrementally update the third position instruction corresponding to the position loop based on the position instruction.
[0095] The embodiment of the present application will update the third position instruction corresponding to the position loop once based on a position instruction increment.
[0096] The above ΔS1=262.5, ΔS2=187.5, ΔS3=112.5, ΔS4=37.5 are used as examples for further explanation. At 0 ms in T1, the third position instruction is 600; at 15 ms in T1, the third position instruction is updated to 600+262.5=862.5; at 30 ms in T1, the third position instruction is updated to 862.5+187.5=1050; at 45 ms in T1, the third position instruction is updated to 1050+112.5=1162.5; at 60 ms in T1, the third position instruction is updated to 1162.5+37.5=1200, at which time the third position instruction is the same as the first position instruction. It will be understood that the above is merely an exemplary description and should not be construed as a limitation on the embodiments of the present application.
[0097] See also Figure 3 , which is an existing position instruction update schematic diagram. Figure 3 In this case, when the next position loop is interrupted after the EtherCAT synchronization cycle is reached, the third position instruction corresponding to the position loop is updated immediately, that is, 600 is directly updated to 1200, which will cause a drastic mutation of the third position instruction.
[0098] See also Figure 4 , which is a schematic diagram of a position instruction update corresponding to the position instruction update method disclosed in the embodiment of the application. Figure 4 In the EtherCAT synchronization cycle, the third position instruction corresponding to the position loop is updated smoothly in a curve manner, gradually increasing the third position instruction, and finally updating the third position instruction to 1200.
[0099] It can be seen that in the embodiment of the present application, for the case where the EtherCAT synchronization period is not equal to the position loop period of the servo drive, the position instruction increment corresponding to the third position instruction is determined through the instruction planning curve each time the position loop interruption is triggered, so as to achieve stable multiple updates of the third position instruction within the EtherCAT synchronization period, avoid causing drastic mutations of the third position instruction, and make the synchronization effect of the updated third position instruction good, thereby avoiding mutations or response delays during actual position control, and improving the control accuracy and stability of the servo system.
[0100] See also Figure 5 , a schematic diagram of the structure of a position instruction updating device disclosed in an embodiment of the present application, the device comprising:
[0101] An acquisition module 501 is used to acquire a first position instruction of a first Ethernet control automation technology EtherCAT synchronization cycle and a second position instruction of a second EtherCAT synchronization cycle; the second EtherCAT synchronization cycle is an EtherCAT synchronization cycle before the first EtherCAT synchronization cycle;
[0102] A determination module 502 is used to determine an initial value of a position command change rate and an acceleration of a position command change rate based on a multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position command and the second position command;
[0103] The determination module 502 is further used to determine a position instruction planning curve based on the position instruction change rate initial value and the position instruction change rate acceleration;
[0104] The updating module 503 is used to update the third position instruction corresponding to the position loop based on the position instruction planning curve within the first EtherCAT synchronization period.
[0105] It can be seen that in the embodiment of the present application, for the case where the EtherCAT synchronization period is not equal to the position loop period of the servo drive, since the position instruction planning curve is determined based on the initial value of the position instruction change rate and the acceleration of the position instruction change rate, the instruction planning curve can characterize the change of the position instruction at any time within the first EtherCAT synchronization period. In this way, based on the position instruction planning curve, the third position instruction can be smoothly updated within the EtherCAT synchronization period to avoid causing drastic mutations in the third position instruction, and ensure that when the position loop interruption is triggered, the corresponding updated third position instruction has a good synchronization effect, thereby avoiding mutations or response delays during actual position control, and improving the control accuracy and stability of the servo system.
[0106] In one possible implementation, the determination module 502 in the position instruction updating device provided in the embodiment of the present application is specifically used to: when the first EtherCAT synchronization period is not an integer multiple of the position loop period, determine the initial value of the position instruction change rate and the acceleration of the position instruction change rate based on the first position instruction, the second position instruction and the position loop period.
[0107] In a possible implementation, the determination module 502 in the position instruction updating device provided in the embodiment of the present application is specifically used to determine the initial value of the position instruction change rate and the acceleration of the position instruction change rate based on the following formula:
[0108]
[0109] T1=K2T2+t ′ ;
[0110] Wherein, a1 represents the initial value of the position command change rate, S1 represents the first position command, S2 represents the second position command, T2 represents the position loop period, K2 is a positive integer, Δa represents the acceleration of the position command change rate, T1 represents the first EtherCAT synchronization period, and t ′ is a positive integer, and the t ′ Smaller than T2.
[0111] In a possible implementation, the determination module 502 in the position instruction updating device provided in the embodiment of the present application is also specifically used to: when the first EtherCAT synchronization period is an integer multiple of the position loop period, based on the first position instruction, the second position instruction and the first EtherCAT synchronization period, determine the initial value of the position instruction change rate and the acceleration of the position instruction change rate.
[0112] In a possible implementation, the determination module 502 in the position instruction updating device provided in the embodiment of the present application is further configured to: determine the position instruction change rate initial value and the position instruction change rate acceleration based on the following formula:
[0113]
[0114] Wherein, a1 represents the initial value of the position command change rate, S1 represents the first position command, S2 represents the second position command, T1 represents the first EtherCAT synchronization period, and Δa represents the acceleration of the position command change rate.
[0115] In a possible implementation, the updating module 503 in the position instruction updating device provided in the embodiment of the present application includes:
[0116] A determination unit, configured to determine a position instruction increment based on the position instruction planning curve within the first EtherCAT synchronization period;
[0117] An updating unit is used to incrementally update a third position instruction corresponding to the position loop based on the position instruction.
[0118] In a possible implementation, the position instruction planning curve in the position instruction updating device provided in the embodiment of the present application is expressed as follows:
[0119]
[0120] Among them, the represents the position instruction planning curve, T1 represents the first EtherCAT synchronization period, a1 represents the initial value of the position instruction change rate, Δa represents the acceleration of the position instruction change rate, and t represents time.
[0121] Furthermore, the embodiment of the present application also provides a position instruction updating device, comprising:
[0122] A memory for storing instructions;
[0123] A processor is used to execute instructions in the memory to execute any one of the implementation methods of the above-mentioned position instruction updating method.
[0124] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes any one of the implementation methods of the above-mentioned location instruction updating method.
[0125] Furthermore, an embodiment of the present application also provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any one of the implementation methods of the above-mentioned location instruction updating method.
[0126] It can be known from the description of the above implementation mode that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0127] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0128] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0129] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0130] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for updating a position instruction, characterized in that: The method comprises: Obtain a first position instruction of a first Ethernet control automation technology EtherCAT synchronization cycle and a second position instruction of a second EtherCAT synchronization cycle; the second EtherCAT synchronization cycle is an EtherCAT synchronization cycle before the first EtherCAT synchronization cycle; Determine an initial value of a position command change rate and an acceleration of a position command change rate based on a multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position command, and the second position command; Determining a position instruction planning curve based on the position instruction change rate initial value and the position instruction change rate acceleration; In the first EtherCAT synchronization cycle, a third position instruction corresponding to the position loop is updated based on the position instruction planning curve.
2. The method according to claim 1, characterized in that The determining of the initial value of the position command change rate and the acceleration of the position command change rate based on the multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position command and the second position command comprises: When the first EtherCAT synchronization period is not an integer multiple of the position loop period, the position command change rate initial value and the position command change rate acceleration are determined based on the first position command, the second position command and the position loop period.
3. The method according to claim 2, characterized in that The determining, based on the first position command, the second position command and the position loop period, the initial value of the position command change rate and the acceleration of the position command change rate comprises: The position command change rate initial value and the position command change rate acceleration are determined based on the following formula: T1=K2T2+t ′ ; Wherein, a1 represents the initial value of the position command change rate, S1 represents the first position command, S2 represents the second position command, T2 represents the position loop period, K2 is a positive integer, Δa represents the acceleration of the position command change rate, T1 represents the first EtherCAT synchronization period, and t ′ is a positive integer, and the t ′ Smaller than T2.
4. The method according to claim 1, wherein determining the initial value of the position command change rate and the acceleration of the position command change rate based on the multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position command and the second position command comprises: When the first EtherCAT synchronization period is an integer multiple of the position loop period, the position instruction change rate initial value and the position instruction change rate acceleration are determined based on the first position instruction, the second position instruction and the first EtherCAT synchronization period.
5. The method according to claim 4, characterized in that The determining, based on the first position instruction, the second position instruction and the first EtherCAT synchronization period, the initial value of the position instruction change rate and the acceleration of the position instruction change rate comprises: The position command change rate initial value and the position command change rate acceleration are determined based on the following formula: Wherein, a1 represents the initial value of the position command change rate, S1 represents the first position command, S2 represents the second position command, T1 represents the first EtherCAT synchronization period, and Δa represents the acceleration of the position command change rate.
6. The method according to any one of claims 1 to 5, characterized in that: The updating of the third position instruction corresponding to the position loop based on the position instruction planning curve within the first EtherCAT synchronization cycle includes: In the first EtherCAT synchronization cycle, determining a position command increment based on the position command planning curve; A third position instruction corresponding to the position loop is updated based on the position instruction increment.
7. The method according to any one of claims 1 to 5, characterized in that: The position instruction planning curve is expressed as follows: Among them, the dt represents the position instruction planning curve, T1 represents the first EtherCAT synchronization period, a1 represents the initial value of the position instruction change rate, Δa represents the acceleration of the position instruction change rate, and t represents time.
8. A position instruction updating device, characterized in that: The device comprises: An acquisition module is used to acquire a first position instruction of a first Ethernet control automation technology EtherCAT synchronization cycle and a second position instruction of a second EtherCAT synchronization cycle; the second EtherCAT synchronization cycle is an EtherCAT synchronization cycle before the first EtherCAT synchronization cycle; A determination module, configured to determine an initial value of a position instruction change rate and an acceleration of a position instruction change rate based on a multiple relationship between the first EtherCAT synchronization period and the position loop period, the first position instruction, and the second position instruction; The determination module is further used to determine the position instruction planning curve based on the position instruction change rate initial value and the position instruction change rate acceleration; An updating module is used to update a third position instruction corresponding to the position loop based on the position instruction planning curve within the first EtherCAT synchronization cycle.
9. A position instruction updating device, characterized in that: include: A memory for storing instructions; A processor, configured to execute the instructions in the memory to execute the position instruction updating method according to any one of claims 1 to 7.
10. A computer-readable storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the position instruction updating method according to any one of claims 1 to 7.
