Position instruction subdivision interpolation processing method and device, electronic equipment and storage medium
By adopting the position instruction subdivision interpolation processing method in the servo drive, the problems of speed instruction discontinuity and filter delay are solved, high response speed and high precision motor control are achieved, and the stability and robustness of the system are enhanced. .
Patent Information
- Application Number
- CN202411315147.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, when the servo driver uses the position command sent by the main station for position control, the speed command will be discontinuous, causing motor jitter. The filter will introduce delay when used to smooth the speed command, reducing the system response speed and positioning accuracy. , lack of an effective compensation mechanism when communication abnormalities, resulting in violent fluctuations in speed commands.
The position instruction subdivision interpolation processing method is adopted. By receiving the latest position instruction sent by the main station in each communication cycle, if it is not received, it is estimated, calculates the displacement increment and counts in each position loop control cycle. Distribute displacement increments evenly to generate interpolated position instructions, avoid filter delays, and ensure high system response speed and high accuracy.
It realizes smooth speed commands, reduces motor speed fluctuations, avoids delays caused by filters, ensures high response speed and high-precision positioning of the system, and improves the stability and robustness of the servo system.
Smart Images

Figure CN119292188A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of servo control systems, and in particular to a position instruction subdivision interpolation processing method, device, electronic device and storage medium. Background Art
[0002] With the development of industrial bus technology, servo drives with real-time industrial buses such as EtherCat have been widely used in automation equipment. As a high-performance, low-latency Ethernet communication protocol, EtherCat can provide fast, real-time communication support, greatly improving the performance and efficiency of automation equipment.
[0003] However, since the communication cycle of the master station is usually longer than the position loop control cycle of the servo drive, if the position command sent by the master station is used directly for position control, the speed command will cause step jumps and discontinuities, causing the motor to jitter. This jitter not only affects the stability of the system, but also reduces the accuracy of the equipment.
[0004] In order to solve the above problems, the prior art usually uses a first-order low-pass filter or a sliding average filter to re-plan the position command received from the master station. Although these filtering methods can smooth the speed command and reduce the motor speed fluctuation, they will also introduce delays, resulting in a lower response speed of the servo system and a longer positioning time.
[0005] In addition, in actual applications, communication anomalies occasionally occur, such as communication data loss. When the servo drive fails to obtain the latest position command from the master station and does not perform appropriate compensation, the speed command will suddenly jump to zero, causing the motor speed to fluctuate more violently, further affecting the stability and accuracy of the system.
[0006] Therefore, the existing technology mainly has the following technical problems: directly using the master station position command will cause discontinuous speed command, causing motor jitter. Using filters to smooth the position command will introduce delays, reduce system response speed and positioning accuracy. There is a lack of effective compensation mechanism when communication is abnormal, resulting in drastic fluctuations in speed command. Summary of the invention
[0007] In view of this, an embodiment of the present application provides a position instruction subdivision interpolation processing method, device, electronic device and storage medium to solve the problem of discontinuous speed instructions in the prior art, which causes motor speed fluctuations and reduces the system's response speed and positioning accuracy.
[0008] In a first aspect of an embodiment of the present application, a position instruction subdivision interpolation processing method is provided, which is applied to a servo drive control system, including: when the task of each communication cycle arrives, receiving the latest position instruction sent by the master station, if the latest position instruction is not received in the current communication cycle, estimating the position instruction of the current communication cycle; calculating the displacement increment in the current communication cycle according to the position instruction of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle; counting in each position loop control cycle, when the position loop control cycle arrives, incrementing based on the count of the previous position loop control cycle to obtain a final count value; according to the displacement increment and count value of the current communication cycle, evenly distributing the displacement increment to each position loop control cycle to generate an interpolated position instruction for the current position loop control cycle.
[0009] According to a second aspect of an embodiment of the present application, a position instruction subdivision interpolation processing device is provided, which is applied to a servo drive control system, and includes: a receiving module, configured to receive the latest position instruction sent by the master station when the task of each communication cycle arrives, and if the latest position instruction is not received in the current communication cycle, the position instruction of the current communication cycle is estimated; a calculation module, configured to calculate the displacement increment in the current communication cycle according to the position instruction of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle; a counting module, configured to count in each position loop control cycle, and when the position loop control cycle arrives, increment the count of the previous position loop control cycle to obtain a final count value; a generation module, configured to evenly distribute the displacement increment to each position loop control cycle according to the displacement increment and count value of the current communication cycle, and generate an interpolated position instruction for the current position loop control cycle.
[0010] According to a third aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the computer program.
[0011] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0012] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0013] By receiving the latest position instruction sent by the master station when the task of each communication cycle arrives, if the latest position instruction is not received in the current communication cycle, the position instruction of the current communication cycle is estimated; according to the position instruction of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle, the displacement increment in the current communication cycle is calculated; counting is performed in each position loop control cycle, and when the position loop control cycle arrives, it is incremented based on the count of the previous position loop control cycle to obtain the final count value; according to the displacement increment and count value of the current communication cycle, the displacement increment is evenly distributed to each position loop control cycle, and the interpolation position instruction of the current position loop control cycle is generated. This application can not only smooth the speed instruction and reduce the motor speed fluctuation, but also avoid the delay caused by the filter, ensuring the high response speed and high-precision positioning of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0015] Figure 1 It is a flow chart of a position instruction subdivision interpolation processing method provided in an embodiment of the present application;
[0016] Figure 2 It is a structural schematic diagram of a position instruction subdivision interpolation processing device provided in an embodiment of the present application;
[0017] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0019] In current automation equipment, servo drives usually receive position commands from the master station to control the operation of the motor. However, the communication cycle of the master station is often longer than the position loop control cycle of the servo drive. If the position command sent by the master station is used directly for position control, it will cause step jumps and discontinuities in the speed command, which will cause jitter in the motor operation. This jitter will affect the stability and accuracy of the system.
[0020] In order to alleviate this problem, the prior art usually uses a first-order low-pass filter or a sliding average filter to re-plan the position command received from the master station. The function of the filter is to smooth the speed command and reduce the fluctuation of the motor speed. However, these filtering methods will introduce a certain delay, resulting in a lower response speed of the servo system and a longer positioning time. In addition, the delay of the filter will also affect the precise control of the system, making the system perform poorly in scenarios where rapid response is required.
[0021] There are several major problems in current technology:
[0022] 1. Discontinuous speed command: Since the communication cycle of the master station and the position loop control cycle of the servo drive are not synchronized, directly using the position command of the master station will cause discontinuity and step jumps in the speed command, thereby causing jitter in the motor operation.
[0023] 2. Delay introduced by filters: Although filters can smooth speed commands and reduce motor speed fluctuations, they also introduce delays, resulting in reduced servo system response and longer positioning times. This is particularly noticeable in applications that require fast response.
[0024] 3. Impact of communication anomalies: During the movement process, if communication anomalies occur occasionally, such as data loss, the servo drive fails to obtain the latest position command from the master station and does not compensate for the position command, which will cause the speed command to jump to zero in a step manner, further aggravating the motor speed fluctuation and affecting the system stability and accuracy.
[0025] These problems limit the application effect of existing servo drives in high-precision and high-real-time control. An improved method is needed to solve these problems and improve the performance and reliability of servo drives.
[0026] In view of the problems existing in the prior art, the present application proposes a position instruction subdivision interpolation processing method, device and electronic device. This solution aims to smooth the speed instruction, reduce the motor speed fluctuation, and avoid filtering delay, so as not to affect the response and positioning time of the servo system.
[0027] The servo position instruction subdivision interpolation system involved in the technical solution of the present application includes a position instruction acquisition module, a displacement increment calculation module, a counter module and an interpolation instruction calculation module. Among them, the position instruction acquisition module is used to receive the latest position instruction sent by the master station when each communication cycle arrives. If the master station instruction is not received within a predetermined period, the position instruction of the current period is calculated based on the position instructions of the previous three communication cycles. The displacement increment calculation module is used to calculate the displacement increment within the current communication cycle. The counter module is used to count within each position loop control cycle to prepare for interpolation calculation. The interpolation instruction calculation module is used to calculate the interpolation position instruction within each position loop control cycle based on the displacement increment and the value of the counter.
[0028] Based on the structure of the above-mentioned servo position instruction subdivision interpolation system, the contents of the technical solution of the present application are described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0029] Figure 1 It is a flow chart of the position instruction subdivision interpolation processing method provided in an embodiment of the present application. Figure 1 The position instruction subdivision interpolation processing method can be executed by the servo control system. Figure 1 As shown, the position instruction subdivision interpolation processing method may specifically include:
[0030] S101, when the task of each communication cycle arrives, receiving the latest position instruction sent by the master station, if the latest position instruction is not received in the current communication cycle, estimating the position instruction of the current communication cycle;
[0031] S102, calculating the displacement increment in the current communication cycle according to the position instruction of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle;
[0032] S103, counting is performed in each position loop control cycle, and when the position loop control cycle is reached, the count of the previous position loop control cycle is incremented to obtain a final count value;
[0033] S104, according to the displacement increment and count value of the current communication cycle, the displacement increment is evenly distributed to each position loop control cycle, and an interpolation position instruction of the current position loop control cycle is generated.
[0034] In some embodiments, when a task of each communication cycle arrives, the latest position instruction sent by the master station is received. If the latest position instruction is not received in the current communication cycle, the position instruction of the current communication cycle is estimated, including:
[0035] When the task of each communication cycle arrives, determine whether the communication task flag is set. When the communication task flag is set, the latest position instruction sent by the master station is used as the position instruction of the current communication cycle; when the communication task flag is not set, the position instruction of the current communication cycle is estimated.
[0036] Specifically, every communication cycle T c When a task arrives, the system first receives the latest position command sent by the master station. c If the latest position command is not received within the current period T c First, when the task of each communication cycle arrives, the system will determine whether the communication task flag is set. The communication task flag is used to indicate the current communication status, that is, whether the communication is normal.
[0037] Furthermore, if the communication task flag is set (i.e., the flag is 1), this indicates that the communication is normal. The system will directly receive the latest position command P sent by the master station. Tc , and use this instruction as the position instruction P of the current communication cycle k .
[0038] Furthermore, if the communication task flag is not set (ie, the flag is 0), this indicates that a communication abnormality occurs and the system cannot directly receive the latest position instruction.
[0039] Furthermore, in the case of abnormal communication, the system needs to c The specific process is as follows:
[0040] Get historical position instructions: The system first gets the historical position instructions in several communication cycles before the current communication cycle. These historical data are used for subsequent calculations.
[0041] Estimated speed and acceleration: Based on the historical position commands obtained, the system estimates the speed and acceleration of the motor. By analyzing the position command changes in the previous few cycles, the system can estimate the operating trend of the motor.
[0042] Estimation of current position command: Based on the calculated speed and acceleration, the system estimates the position command of the current communication cycle. This estimation process takes into account the speed change and acceleration of the motor to ensure the accuracy and consistency of the position command.
[0043] By using the method of the present embodiment described above, the system can effectively obtain or estimate the position command when each communication cycle task arrives. This not only ensures the stable operation of the servo drive under abnormal communication conditions, but also reduces motor speed fluctuations and improves the overall stability and accuracy of the system. By using this method, the system can smoothly transition when dealing with communication anomalies and maintain smooth operation of the motor.
[0044] In some embodiments, estimating the position instruction of the current communication cycle includes:
[0045] The historical position instructions corresponding to several communication cycles before the current communication cycle are obtained, the speed and acceleration are calculated according to the historical position instructions, and the position instruction of the current communication cycle is estimated according to the calculated speed and acceleration.
[0046] Specifically, the system first obtains several communication cycles T before the current communication cycle c The corresponding historical position instructions. These historical position instructions can reflect the movement trajectory of the motor in the past period of time and are the basic data for speed and acceleration calculation.
[0047] Further, according to the previous communication cycles T c The system calculates the motor speed based on the position command. The speed is calculated by analyzing the trend of the position command. For example, the motor speed can be estimated by calculating the difference between consecutive position commands.
[0048] Furthermore, based on the obtained speed, the acceleration of the motor is further estimated. The acceleration is estimated by analyzing the change trend of the speed, for example, by calculating the change between consecutive speeds to estimate the acceleration of the motor.
[0049] Furthermore, after obtaining the speed and acceleration, the system estimates the position command of the current communication cycle based on these inferred data. The estimated position command takes into account the movement trend of the motor to ensure its smoothness and accuracy.
[0050] Furthermore, if the latest position command is not received in the current cycle, the system will use the position commands of the previous three communication cycles for estimation. In this case, the system estimates the speed and acceleration of the motor by analyzing the position commands of the previous three cycles, and then estimates the position command of the current cycle based on these estimated values.
[0051] For example, in one example, the position instruction of the current cycle can be estimated using the following formula:
[0052] P k =3×(P k-1 -P k-2 )+Pk-3
[0053] If the latest position command sent by the master is not received during the current communication cycle, the system will obtain the position commands of the previous three communication cycles. By analyzing the position data of these three cycles, the system calculates the speed and acceleration of the motor during this period. Assuming that the position commands of the previous three cycles are P1, P2, and P3, the system will calculate the speed and acceleration of the motor based on these three position commands, and then use these calculated data to estimate the position command of the current cycle.
[0054] Through the method of the present embodiment described above, even in the case of abnormal communication tasks, the system can make reasonable estimates based on historical data to ensure the running stability of the motor and reduce speed fluctuations and positioning errors caused by communication interruptions. This method improves the robustness of the servo drive in the case of abnormal communication and ensures the overall performance of the system.
[0055] In some embodiments, the displacement increment in the current communication cycle is calculated according to the position instruction of the current communication cycle and the interpolated displacement of the last position loop control cycle in the previous communication cycle, including:
[0056] The displacement of the current communication cycle is determined according to the position instruction of the current communication cycle, the difference between the displacement of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle is calculated, and the difference is used as the displacement increment in the current communication cycle.
[0057] Specifically, in order to calculate the displacement increment in the current communication cycle, the system needs to combine the position command of the current communication cycle and the interpolation displacement P of the last position loop control cycle in the previous communication cycle. N First, when the task of each communication cycle arrives, the system receives and determines the position instruction of the current communication cycle. This position instruction can be the latest instruction directly obtained from the master station, or in the case of abnormal communication, the instruction estimated based on historical data.
[0058] Furthermore, the system obtains the interpolation displacement P of the last position loop control cycle in the previous communication cycle. N The interpolation displacement refers to the cumulative displacement value of each position loop control cycle generated by subdividing the position command in the previous communication cycle.
[0059] Furthermore, according to the position instruction of the current communication cycle, the system determines the displacement P of the current communication cycle. k The displacement refers to the total distance the motor should move in the current communication cycle.
[0060] Furthermore, in order to determine the displacement increment of the current communication cycle, the system subtracts the interpolation displacement of the last position loop control cycle of the previous communication cycle from the position instruction of the current communication cycle. In this way, the difference obtained is the displacement increment of the current communication cycle.
[0061] For example, in one example, the displacement increment in the current communication cycle can be calculated using the following formula:
[0062] ΔP k =P k -P N
[0063] Among them, ΔP k Indicates the displacement increment in the current communication cycle, P k Indicates the displacement of the current communication cycle, P N Indicates the interpolation displacement of the last position loop control cycle in the previous communication cycle.
[0064] In each communication cycle, the system first determines the current position command by receiving or estimating. For example, the position command of the current communication cycle is P k Next, the system obtains the interpolation displacement P of the last position loop control cycle of the previous communication cycle. N In this case, by calculating P k Subtract P N , the system can obtain the displacement increment of the current communication cycle.
[0065] The displacement increment reflects the additional displacement that the motor should move during the current communication cycle. This calculation ensures that even in the case of abnormal communication, the system can still accurately track and control the position change of the motor, maintaining the smoothness and accuracy of the motor operation.
[0066] Through the method of the present embodiment described above, the system can effectively calculate the displacement increment in the current communication cycle, ensuring that the motor can be accurately controlled in each communication cycle, thereby improving the overall performance and reliability of the servo system. This method overcomes the problems of discontinuous displacement instructions and speed fluctuations caused by communication anomalies in the prior art, and provides a more stable and efficient position control solution.
[0067] In some embodiments, counting is performed in each position loop control cycle. When the position loop control cycle is reached, the count of the previous position loop control cycle is incremented to obtain a final count value, including:
[0068] When each communication cycle is reached, the counter unit is assigned an initial value. In each position loop control cycle, a fixed value is added to the value of the counter unit until the value of the counter unit is accumulated to the preset value to obtain the final count value.
[0069] Specifically, in order to ensure the accuracy and stability of motor control, counting is performed in each position loop control cycle so as to perform accurate interpolation calculations in the current position loop control cycle. c At the beginning of the communication cycle, the system assigns the counter unit to the initial value. For example, in each new communication cycle T c When it arrives, the counter unit is initialized to 1. This initialization process ensures that the counter unit starts counting from a certain reference value.
[0070] Furthermore, in each position loop control cycle T p When it arrives, the system increments the counter unit based on the count of the previous position loop control cycle. For example, if the value of the counter in the previous position loop control cycle is N, the value of the counter in the current position loop control cycle is C. i Will increment to N+1.
[0071] Furthermore, the counter unit increments by a fixed value in each position loop control cycle until the value C of the counter unit reaches i Accumulate to a preset value. This preset value is usually related to the number of position loop control cycles, ensuring that the counter unit can accurately count within a complete communication cycle.
[0072] For example, in one example, when each communication cycle is reached, the system first assigns an initial value of 1 to the counter unit. Next, in each position loop control cycle, the counter unit adds 1 to the count of the previous position loop cycle. For example, if the initial value of the counter in a communication cycle is 1, when the first position loop control cycle is reached, the value of the counter is 1; when the second position loop control cycle is reached, the value of the counter increases to 2, and so on, until the preset count value is reached.
[0073] It should be noted that, usually, the communication cycle T c is the position loop control period T p An integer multiple of N, that is, T c =N×T p .
[0074] Through the method of the present embodiment described above, the system can accurately count in each position loop control cycle. This counting method ensures that the interpolation calculation of each position loop control cycle has a high degree of accuracy, thereby ensuring the smooth operation of the motor in each position loop control cycle. This incrementing method of the counter unit not only ensures the stability of the system, but also improves the accuracy of motor control.
[0075] This method achieves precise control of the motor position in each position loop control cycle through precise counting and incrementing, thereby improving the performance and reliability of the entire servo system. Through this precise control method, the system can effectively cope with various operating conditions and ensure that the motor operates with high accuracy and high stability.
[0076] In some embodiments, according to the displacement increment and count value of the current communication cycle, the displacement increment is evenly distributed to each position loop control cycle, and the interpolation position instruction of the current position loop control cycle is generated, including:
[0077] In the current communication cycle, the interpolation displacement value of each position loop control cycle is calculated according to the displacement increment; in each position loop control cycle, the interpolation position instruction of the current position loop control cycle is calculated according to the count value of the counter unit;
[0078] The displacement increment of the current communication cycle is evenly distributed to each position loop control cycle to generate the corresponding interpolation position command; when each position loop control cycle arrives, the calculated interpolation position command is applied to update the running status of the motor.
[0079] Specifically, in order to generate accurate interpolation position instructions in each position loop control cycle, the system evenly distributes the displacement increment to each position loop control cycle based on the displacement increment and count value of the current communication cycle. In the current communication cycle, the system first calculates the interpolation displacement value of each position loop control cycle based on the displacement increment. This calculation takes into account the total displacement increment of the current communication cycle and the number of position loop control cycles to ensure that the displacement increment can be evenly distributed.
[0080] Furthermore, in each position loop control cycle, the system calculates the current count value C of the counter unit according to the current count value C of the counter unit. i , calculate the interpolation position command of the position loop control cycle. The count value of the counter unit reflects the position of the current position loop control cycle in the entire communication cycle, ensuring the accuracy of the calculation of the interpolation position command.
[0081] Furthermore, the system calculates the displacement increment ΔP of the current communication cycle k Evenly distributed to each position loop control cycle. This distribution process ensures that the displacement of the motor is smooth and continuous throughout the communication cycle, avoiding sudden changes in speed instructions.
[0082] Further, based on the above calculation, the system generates the interpolation position command P for each position loop control cycle. i These instructions are used to accurately control the position of the motor so that it runs according to the expected trajectory within each position loop control cycle.
[0083] Furthermore, at the arrival of each position loop control cycle, the system applies the calculated interpolated position command to update the motor's operating status in real time. In this way, the motor can run smoothly and maintain high-precision motion control.
[0084] In actual applications, at the beginning of each communication cycle, the system uses the interpolation instruction calculation module to evenly subdivide the displacement increment into each position loop control cycle according to the displacement increment of the current communication cycle and the count value of the counter unit. For example, if the displacement increment in the current communication cycle is a fixed value, the system will evenly distribute the value to each position loop control cycle, thereby generating multiple subdivided interpolation position instructions.
[0085] For example, in one example, in each position loop control cycle, the system gradually increases the value of the interpolation position command according to the count value of the counter unit to ensure the uniform distribution of the displacement increment. For example, in the first position loop control cycle, the interpolation position command may be 1 / 10 of the displacement increment; in the second position loop control cycle, the interpolation position command may be 2 / 10 of the displacement increment, and so on, until the end of the entire communication cycle.
[0086] Through the method of the present embodiment described above, the system realizes accurate control of the displacement within each position loop control cycle, ensures the smooth operation of the motor within the entire communication cycle, and reduces the speed fluctuation problem caused by discontinuous or abnormal communication. Such a design improves the stability and control accuracy of the system and ensures the efficient operation of the servo drive.
[0087] In some embodiments, the interpolation position command of the current position loop control cycle is calculated using the following formula:
[0088]
[0089] Among them, P i Indicates the interpolation position command of the current position loop control cycle, P N Indicates the interpolation displacement of the last position loop control cycle in the previous communication cycle, C i Indicates the count value of the counter unit, ΔP k Indicates the displacement increment of the current communication cycle.
[0090] Specifically, the interpolation instruction calculation module can use the displacement increment ΔP of the current communication cycle according to the above formula k and the count value C of the counter unit i , the displacement increment is evenly subdivided into each position loop control cycle, where the interpolation position instruction of the current position loop control cycle is P i , the count value of the counter unit is C i .
[0091] According to the technical solution provided in the embodiments of the present application, the technical solution of the present application has at least the following advantages:
[0092] The technical solution of the present application provides an effective method for estimating position instructions when solving communication task anomalies. Specifically, by using the position instructions in the previous communication cycle, the speed and acceleration of the motor are calculated, and the position instructions of the current communication cycle are estimated based on these estimated values. This technical means avoids the problem of the speed instruction suddenly jumping to zero, which causes the motor speed to jump violently, and ensures the smooth operation of the motor. In addition, the calculation amount of speed and acceleration is small, and the CPU resources occupied are less, which realizes efficient estimation and compensation processing.
[0093] At the same time, the present application evenly subdivides the displacement increment of each communication cycle into each position loop control cycle, and specifically through the function of the counter unit, makes the change of the speed command more uniform and continuous. This processing method makes the speed operation of the servo motor smoother, avoids the delay problem introduced by the traditional filtering method, and realizes the command response without delay.
[0094] In addition, in the case of abnormal communication, this solution can estimate the position command through the subdivision interpolation processing method, effectively avoiding the speed command jump and motor jitter caused by the lack of position command. By subdividing the displacement increment in each position loop control cycle, a smooth transition of the speed command is achieved, thereby reducing the motor speed fluctuation. This technical measure not only improves the response speed of the servo system, but also significantly improves the positioning accuracy of the system.
[0095] In summary, the technical solution provided in this application achieves efficient and precise control while ensuring the smooth operation of the motor by optimizing the processing method of the position command, thereby greatly improving the performance and reliability of the servo system.
[0096] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0097] Figure 2 1 is a schematic diagram of the structure of a position instruction subdivision interpolation processing device provided in an embodiment of the present application, and the device is applied in a servo drive control system. Figure 2 As shown, the position instruction subdivision interpolation processing device includes:
[0098] The receiving module 201 is configured to receive the latest position instruction sent by the master station when the task of each communication cycle arrives, and if the latest position instruction is not received in the current communication cycle, estimate the position instruction of the current communication cycle;
[0099] The calculation module 202 is configured to calculate the displacement increment in the current communication cycle according to the position instruction of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle;
[0100] The counting module 203 is configured to count in each position loop control cycle, and when the position loop control cycle is reached, the counting is incremented based on the count of the previous position loop control cycle to obtain a final counting value;
[0101] The generation module 204 is configured to evenly distribute the displacement increment to each position loop control cycle according to the displacement increment and count value of the current communication cycle, and generate an interpolation position instruction of the current position loop control cycle.
[0102] In some embodiments, Figure 2 The receiving module 201 determines whether the communication task flag is set when the task of each communication cycle arrives. When the communication task flag is set, the latest position instruction sent by the master station is used as the position instruction of the current communication cycle; when the communication task flag is not set, the position instruction of the current communication cycle is estimated.
[0103] In some embodiments, Figure 2 The receiving module 201 obtains historical position instructions corresponding to several communication cycles before the current communication cycle, calculates the speed and acceleration according to the historical position instructions, and estimates the position instruction of the current communication cycle according to the calculated speed and acceleration.
[0104] In some embodiments, Figure 2 The calculation module 202 determines the displacement of the current communication cycle according to the position instruction of the current communication cycle, calculates the difference between the displacement of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle, and uses the difference as the displacement increment in the current communication cycle.
[0105] In some embodiments, Figure 2 The counting module 203 assigns the counter unit to an initial value when each communication cycle is reached, and adds a fixed value to the value of the counter unit in each position loop control cycle until the value of the counter unit is accumulated to a preset value to obtain a final count value.
[0106] In some embodiments, Figure 2The generation module 204 calculates the interpolation displacement value of each position loop control cycle according to the displacement increment in the current communication cycle; calculates the interpolation position instruction of the current position loop control cycle according to the count value of the counter unit in each position loop control cycle; evenly distributes the displacement increment of the current communication cycle to each position loop control cycle, and generates the corresponding interpolation position instruction; when each position loop control cycle arrives, the calculated interpolation position instruction is applied to update the running state of the motor.
[0107] In some embodiments, Figure 2 The generation module 204 uses the following formula to calculate the interpolation position instruction of the current position loop control cycle:
[0108]
[0109] Among them, P i Indicates the interpolation position command of the current position loop control cycle, P N Indicates the interpolation displacement of the last position loop control cycle in the previous communication cycle, C i Indicates the count value of the counter unit, ΔP k Indicates the displacement increment of the current communication cycle.
[0110] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0111] Figure 3 Schematic diagram of an electronic device 3 provided in an embodiment of the present application. Figure 3 As shown, the electronic device 3 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program 303, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 301 executes the computer program 303, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0112] The electronic device 3 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 The electronic device 3 is merely an example and does not limit the electronic device 3 , and may include more or less components than those shown in the figure, or different components.
[0113] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0114] The memory 302 may be an internal storage unit of the electronic device 3, for example, a hard disk or memory of the electronic device 3. The memory 302 may also be an external storage device of the electronic device 3, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 3. The memory 302 may also include both an internal storage unit of the electronic device 3 and an external storage device. The memory 302 is used to store computer programs and other programs and data required by the electronic device.
[0115] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0116] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0117] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A position instruction subdivision interpolation processing method, applied to a servo drive control system, characterized in that: include: When the task of each communication cycle arrives, the latest position instruction sent by the master station is received. If the latest position instruction is not received in the current communication cycle, the position instruction of the current communication cycle is estimated; Calculating the displacement increment in the current communication cycle according to the position instruction of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle; Counting is performed in each of the position loop control cycles, and when the position loop control cycle is reached, the count of the previous position loop control cycle is incremented to obtain a final count value; According to the displacement increment and the count value of the current communication cycle, the displacement increment is evenly distributed to each of the position loop control cycles to generate an interpolation position instruction for the current position loop control cycle.
2. The method according to claim 1, characterized in that When the task of each communication cycle arrives, the latest position instruction sent by the master station is received. If the latest position instruction is not received in the current communication cycle, the position instruction of the current communication cycle is estimated, including: When the task of each communication cycle arrives, it is determined whether the communication task flag is set. When the communication task flag is set, the latest position instruction sent by the master station is used as the position instruction of the current communication cycle; when the communication task flag is not set, the position instruction of the current communication cycle is estimated.
3. The method according to claim 2, characterized in that The estimating the position instruction of the current communication cycle includes: The historical position instructions corresponding to several communication cycles before the current communication cycle are obtained, the speed and acceleration are calculated according to the historical position instructions, and the position instruction of the current communication cycle is estimated according to the calculated speed and acceleration.
4. The method according to claim 1, characterized in that: The calculation of the displacement increment in the current communication cycle according to the position instruction of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle includes: The displacement of the current communication cycle is determined according to the position instruction of the current communication cycle, the difference between the displacement of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle is calculated, and the difference is used as the displacement increment in the current communication cycle.
5. The method according to claim 1, characterized in that The counting is performed in each position loop control cycle, and when the position loop control cycle is reached, the count of the previous position loop control cycle is incremented to obtain a final count value, including: When each communication cycle is reached, the counter unit is assigned an initial value, and in each position loop control cycle, a fixed value is added to the value of the counter unit until the value of the counter unit is accumulated to a preset value to obtain a final count value.
6. The method according to claim 1, characterized in that The method of evenly distributing the displacement increment to each of the position loop control cycles according to the displacement increment and the count value of the current communication cycle, and generating the interpolation position instruction of the current position loop control cycle, comprises: In the current communication cycle, the interpolation displacement value of each position loop control cycle is calculated according to the displacement increment; in each position loop control cycle, the interpolation position instruction of the current position loop control cycle is calculated according to the count value of the counter unit; The displacement increment of the current communication cycle is evenly distributed to each position loop control cycle to generate a corresponding interpolation position instruction; when each position loop control cycle arrives, the calculated interpolation position instruction is applied to update the running state of the motor.
7. The method according to claim 6, characterized in that The interpolation position command of the current position loop control cycle is calculated using the following formula: Among them, P i Indicates the interpolation position command of the current position loop control cycle, P N Indicates the interpolation displacement of the last position loop control cycle in the previous communication cycle, C i Indicates the count value of the counter unit, ΔP k Indicates the displacement increment of the current communication cycle.
8. A position instruction subdivision interpolation processing device, applied to a servo drive control system, characterized in that: include: The receiving module is configured to receive the latest position instruction sent by the master station when the task of each communication cycle arrives, and if the latest position instruction is not received in the current communication cycle, estimate the position instruction of the current communication cycle; A calculation module, configured to calculate a displacement increment in the current communication cycle according to the position instruction of the current communication cycle and the interpolation displacement of the last position loop control cycle in the previous communication cycle; A counting module is configured to count in each position loop control cycle, and when the position loop control cycle is reached, increment the count of the previous position loop control cycle to obtain a final count value; The generation module is configured to evenly distribute the displacement increment to each of the position loop control cycles according to the displacement increment and count value of the current communication cycle, and generate an interpolation position instruction of the current position loop control cycle.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Periodic synchronous position interpolation control method and system for servo driver
CN121722055A