Synchronous calibration method and device for gantry bus system
By obtaining the asynchronous clock deviation between the main shaft and the slave shaft in the gantry bus system, counting compensation and adjustment, and using the adjustment filter gain to suppress interference, clock synchronization between the gantry dual axes is achieved, the control accuracy problem caused by asynchronous clock deviation is solved, and the control accuracy and stability are improved.
Patent Information
- Application Number
- CN202510034987.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-01-09
AI Technical Summary
The asynchronous clock deviation between the spindle and slave shaft in the gantry bus system makes it difficult to meet the needs of high-precision application scenarios.
By obtaining the asynchronous clock deviation when the main shaft communicates with the slave shaft, latch the count value during communication, performing count compensation and adjustment, and using the adjustment filter gain to suppress interference, clock synchronization between the gantry two axes is achieved.
The control accuracy of the gantry dual-axis servo is improved, the error introduced by asynchronous clock deviation is reduced, and the control abnormality problem of excessive adjustment of count value is avoided.
Smart Images

Figure CN119788230A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automation control technology, and in particular to a synchronous calibration method and device for a gantry bus system. Background Art
[0002] With the rapid development of industry and intelligent manufacturing, the control accuracy requirements for gantry machinery of high-end equipment such as semiconductors are constantly increasing. An important factor restricting the high-speed and high-precision performance of gantry control is the clock deviation of gantry synchronous communication. At present, the dual-axis servos of the gantry bus system use asynchronous communication, and asynchronous communication will inevitably lead to asynchronous clock deviation between the dual axes of the gantry. This asynchronous clock deviation is unpredictable and cannot be ignored, which makes it difficult for the current gantry dual-axis servo to meet the control needs in high-precision application scenarios. Summary of the invention
[0003] The purpose of this application is to provide a synchronous calibration method and device for a gantry bus system, which is used to improve the control accuracy of the gantry dual-axis servo to meet the control needs of the gantry bus system in high-precision application scenarios.
[0004] In order to solve the above technical problems, the present application provides a synchronous calibration method of a gantry bus system, wherein the gantry bus system includes a master axis and a slave axis; the method is applied to the slave axis; the method includes:
[0005] Get the asynchronous clock deviation when communicating with the spindle;
[0006] Get the communication latch count value; wherein the communication latch count value is the current count value of the latched timing counter when receiving the data frame sent by the spindle;
[0007] According to the asynchronous clock deviation, the count setting value of the timing counter is compensated to obtain a compensated count parameter compensation value;
[0008] Determine the counting deviation value according to the counting parameter compensation value and the communication latch counting value;
[0009] Determining a count adjustment increment according to a count deviation value and a preset adjustment filter gain;
[0010] The communication latch count value is adjusted based on the count adjustment increment.
[0011] In a possible embodiment, adjusting the communication latch count value based on the count adjustment increment includes:
[0012] If the count adjustment increment is less than or equal to the preset adjustment threshold, the communication latch count value is adjusted according to the count adjustment increment.
[0013] In a possible embodiment, adjusting the communication latch count value based on the count adjustment increment includes:
[0014] If the count adjustment increment is greater than the preset adjustment threshold, the communication latch count value is adjusted according to the adjustment threshold.
[0015] In a possible embodiment, after adjusting the communication latch count value based on the count adjustment increment, the method further includes:
[0016] Determine whether the adjusted communication latch count value is equal to the count parameter compensation value;
[0017] If not, return to the step of determining the counting deviation value according to the counting parameter compensation value and the communication latch counting value.
[0018] In a possible embodiment, the filter gain is adjusted to 2 -k ; Wherein, k is any positive integer;
[0019] The count adjustment increment is determined based on the count deviation value and the preset adjustment filter gain, including:
[0020] The count deviation value is right-shifted by k bits to obtain the count adjustment increment.
[0021] In a possible embodiment, before adjusting the communication latch count value based on the count adjustment increment, the method further includes:
[0022] If the counting deviation value satisfies the first condition and the counting adjustment increment satisfies the second condition, the counting adjustment increment is adjusted to a preset value.
[0023] In a possible embodiment, determining the counting deviation value according to the counting parameter compensation value and the communication latch counting value includes:
[0024] Select the counting parameter compensation values that are adjacent to the communication latch count value and correspond to two different counting cycles;
[0025] Determine the difference between the two counting parameter compensation values and the communication latch counting value respectively, and obtain two intermediate deviation values;
[0026] Take the middle deviation value with the smallest absolute value among the two middle deviation values as the counting deviation value;
[0027] The direction in which the communication latch count value points to the count parameter compensation value is used as the adjustment direction corresponding to the count adjustment increment.
[0028] In a possible embodiment, obtaining the asynchronous clock deviation when communicating with the main axis includes:
[0029] Obtain an asynchronous clock deviation once when the Gantry bus system is powered on;
[0030] Obtaining the communication latch count value includes:
[0031] The communication latch count value is periodically acquired, and whenever a new communication latch count value is acquired, a step of determining a count deviation value according to a count parameter compensation value and a communication latch count value is triggered.
[0032] In a possible embodiment, the slave axis further includes a delay module;
[0033] Get the asynchronous clock deviation when communicating with the spindle, including:
[0034] Transmitting the delay detection frame between the master axis and the slave axis, and taking the transmission delay of the transmission process as the delay measurement result;
[0035] Under the condition that a delay link is injected into the communication between the master axis and the slave axis through the delay module, the delay detection frame is transmitted between the master axis and the slave axis, and the transmission delay of the transmission process is used as the second transmission delay;
[0036] If the second transmission delay is greater than the delay measurement result, the current delay measurement result is used as the asynchronous clock deviation.
[0037] In a possible embodiment, the method further includes:
[0038] If the second transmission delay is less than or equal to the delay measurement result, the second transmission delay is used as a new delay measurement result;
[0039] Increase the number of delay links injected by the delay module;
[0040] If the number of times the delay link is increased does not exceed the preset search number threshold, the process returns to the step of transmitting the delay detection frame between the master axis and the slave axis under the condition that the delay link is injected into the communication between the master axis and the slave axis through the delay module, and the transmission delay of the transmission process is used as the second transmission delay;
[0041] If the number of delay links is increased for a number of times exceeding the search number threshold, the current delay measurement result is used as the asynchronous clock deviation.
[0042] In order to solve the above technical problems, the present application also provides a synchronous calibration method of a gantry bus system, the gantry bus system includes a main axis and a slave axis; the method is applied to the main axis; the method includes:
[0043] Get the asynchronous clock deviation when communicating with the slave axis;
[0044] Get the communication latch count value; where the communication latch count value is the current count value of the latched timing counter when receiving the data frame sent by the slave axis;
[0045] According to the asynchronous clock deviation, the count setting value of the timing counter is compensated to obtain a compensated count parameter compensation value;
[0046] Determine the counting deviation value according to the counting parameter compensation value and the communication latch counting value;
[0047] Determining a count adjustment increment according to a count deviation value and a preset adjustment filter gain;
[0048] The communication latch count value is adjusted based on the count adjustment increment.
[0049] In order to solve the above technical problems, the present application also provides a synchronous calibration device for a gantry bus system, comprising:
[0050] Memory for storing computer programs;
[0051] A processor is used to implement the steps of the synchronous calibration method of the gantry bus system as described above when executing the computer program.
[0052] The present application provides a synchronous calibration method for a gantry bus system, which compensates the count setting value of the timing counter by the asynchronous clock deviation during communication between the gantry dual axes, thereby realizing clock synchronization between the gantry dual axes. Furthermore, for asynchronous communication between the gantry dual axes, the method obtains a communication latch count value by latching the count value of the timing counter at the current moment when the slave axis receives the data frame sent by the main axis. The communication latch count value represents the moment when the slave axis receives the data frame sent by the main axis. In addition, since the count setting value of the slave axis is compensated by the asynchronous clock deviation before, the clock synchronization between the main axis and the slave axis is realized. At this time, the count deviation value between the compensated count setting value in the slave axis and the communication latch count value also represents the communication delay required for the main axis to send the data frame to the slave axis. This method not only adjusts the communication latch count value of the slave axis by obtaining the count adjustment increment through the count deviation value to realize the communication synchronization between the master axis and the slave axis, but also introduces the adjustment filter gain when determining the count adjustment increment to effectively filter out the interference part in the count deviation value and avoid the situation where a single adjustment is too large, thereby realizing the smoothing of the count value adjustment process during the timing synchronization process, better avoiding the control abnormality problems that may occur during the adjustment process, and finally improving the control accuracy of the gantry dual-axis servo.
[0053] Another synchronous calibration method of a gantry bus system and a synchronous calibration device of a gantry bus system provided in the present application correspond to the above method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. 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.
[0055] Figure 1 It is a timing counting diagram of the servo gantry communication bus;
[0056] Figure 2 A flowchart of a synchronous calibration method for a gantry bus system provided by an embodiment of the present invention;
[0057] Figure 3 A schematic diagram of counting deviation calibration provided by an embodiment of the present invention;
[0058] Figure 4 A flowchart of a counting increment adjustment method provided by an embodiment of the present invention;
[0059] Figure 5 A timing diagram before correction of a timing count value provided by an embodiment of the present invention;
[0060] Figure 6 A timing diagram after the timing count value is corrected provided by an embodiment of the present invention;
[0061] Figure 7 A schematic diagram of the architecture of a gantry bus system provided by an embodiment of the present invention;
[0062] Figure 8 A flowchart of an asynchronous clock deviation measurement method provided by an embodiment of the present invention;
[0063] Fig. 9 A timing principle diagram of an asynchronous clock deviation measurement method provided by an embodiment of the present invention;
[0064] Fig.10 A timing diagram before the injection delay link provided by an embodiment of the present invention;
[0065] Fig.11 A timing diagram after a delay link is injected provided by an embodiment of the present invention;
[0066] Fig.12 A structural diagram of a synchronous calibration device for a gantry bus system provided by the present invention. DETAILED DESCRIPTION
[0067] 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.
[0068] The core of this application is to provide a synchronous calibration method and device for a gantry bus system.
[0069] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0070] In the related art, in order to realize data communication between the two axes of the gantry, a bus communication function is added to the gantry servo system of the main axis and the slave axis respectively. In this way, the communication between the main axis gantry servo system and the slave axis gantry servo system (hereinafter referred to as the communication between the main axis and the slave axis) is realized. This overall system that realizes communication between the main axis and the slave axis through the bus is called a gantry bus system. Furthermore, in order to solve the problem of asynchronous communication between the main axis and the slave axis in the gantry bus system, the method currently adopted is to add the servo internal clock count synchronization function to the communication bus protocol of the gantry servo system of the main axis and the slave axis. The synchronization between the main axis and the slave axis is achieved by forcibly aligning the count values of the timing counters of the two gantry servo systems.
[0071] Specifically, Figure 1 As shown in the figure, the timing counter of the gantry servo system consists of two parts: up counting and down counting. The two parts together constitute a counting interval (also called a counting cycle). The up counting stage is when the value of the timing counter counts from 0 to the preset count setting value (i.e. Figure 1 The next counting stage is when the value of the timing counter counts down from the count setting value to 0 (i.e. Figure 1 The communication between the two axes of the gantry is carried out in the down counting phase, and data packets are sent to each other at the starting point of the down counting.
[0072] Based on the above, when the gantry dual-axis receives a data packet sent by the other party, it can perform synchronization calibration by sending a synchronization calibration frame to the other party. Specifically, when the synchronization calibration frame of the other party is received, the communication delay can be calculated according to the time when the data packet is sent by itself and the time when the synchronization calibration frame is received, and then the timing counter is adjusted and compensated to align the count values of the gantry dual-axis to achieve timing synchronization.
[0073] However, this calibration scheme has many problems:
[0074] 1. There is a large current interference in the working scene of the gantry servo system. If the starting position of the next counting stage is disturbed during the calibration of the above-mentioned hard pull counting method, it will cause abnormal adjustment. This will cause the control timing of the servo system to be chaotic, and in severe cases, it will cause a runaway alarm.
[0075] 2. Since the clocks of the gantry dual axes are asynchronous, there will be a problem of cumulative deviation over time. Therefore, it is necessary to continuously adjust the timing counter inside the servo, and the safety hazards brought about by the above problem 1 need to be paid more attention.
[0076] 3. In addition, the counting calibration of the above scheme requires that after the main axis sends a data packet to the slave axis, the slave axis returns a synchronous calibration frame to the main axis for synchronous calibration. This involves one communication from the main axis to the slave axis and one communication from the slave axis to the main axis. Each communication between the main axis and the slave axis will introduce an asynchronous clock deviation, and two communications between the main axis and the slave axis will introduce two asynchronous clock deviations. Compared with one asynchronous clock deviation, two asynchronous clock deviations will bring greater errors, which will affect the accuracy of calibration.
[0077] To solve the above problems, the present application provides a synchronous calibration method for a gantry bus system, which is applied to the gantry bus system. The gantry bus system includes a master axis and a slave axis. The method is specifically applied to the slave axis, such as Figure 2 As shown, the method includes:
[0078] S10: Get the asynchronous clock deviation when communicating with the spindle.
[0079] S20: Get the communication latch count value.
[0080] The communication latch count value is the current count value of the latched timing counter when the data frame sent by the spindle is received. The communication latch count value represents the moment when the slave axis receives the data frame sent by the spindle.
[0081] S30: Compensating the count setting value of the timing counter according to the asynchronous clock deviation to obtain a compensated count parameter compensation value.
[0082] S40: Determine the counting deviation value according to the counting parameter compensation value and the communication latch counting value.
[0083] S50: Determine the count adjustment increment according to the count deviation value and the preset adjustment filter gain.
[0084] S60: Based on the count adjustment increment, the communication latch count value is adjusted.
[0085] It should be noted that step S10 and step S20 can be implemented in parallel or in sequence. And when they are implemented in sequence, there is no order requirement between them. Among them, this embodiment does not limit the implementation of step S10, and the measurement of asynchronous clock deviation can be achieved in the manner described in the relevant technical part above. Or another measurement method can be provided in the subsequent embodiments of the present application. For the implementation of step S20, as described above, the communication latch count value is obtained by latching the count value of the current timing counter when receiving a data frame sent by another axis. Among them, the above-mentioned data frame can be any data frame sent by the main axis to the slave axis, and this embodiment does not limit the format of the data frame and the content contained in the data frame.
[0086] In addition, this embodiment also provides another possible implementation scheme:
[0087] The above step S10 is executed once when the Gantry bus system is powered on; step S20 is performed periodically, and whenever step S20 obtains a new communication latch count value, step S30 is triggered.
[0088] It should be noted that the cycle of executing step S20 in this embodiment can be freely set according to actual needs, and the duration of this cycle is not limited in this embodiment. And this cycle specifically refers to the time interval for repeatedly executing step S20, which has nothing to do with the counting cycle in the above description.
[0089] That is, this embodiment provides a closed-loop control method, using the communication latch count value as the feedback amount to realize the closed-loop count value calibration. In this way, even if the cumulative count deviation occurs during the continuous operation of the gantry dual axis, it can be sensed in time, and the count value is recalibrated based on the newly determined communication latch count value, thereby solving the cumulative count deviation problem. In addition, since the asynchronous clock deviation between the gantry dual axes is usually not easy to change, in order to reduce resource usage and improve calibration efficiency, this embodiment adopts a strategy of only performing it once when the communication gantry bus system is powered on.
[0090] As for step S30, it can be known from the description of the above related technical part that there is an asynchronous clock deviation between the master and the slave. Therefore, for the slave, the time when it sends a data packet (when the count value of the timing counter reaches the count setting value) is not equal to the time when the master sends a data packet. Therefore, step S30 compensates the count setting value by the asynchronous clock deviation obtained in step S10 to obtain the count value corresponding to the actual master sending the data packet, that is, the count parameter compensation value.
[0091] Wherein, step S30 can be expressed by the following formula (1):
[0092] (1);
[0093] is the counting parameter compensation value, Set the value for the count. Asynchronous clock deviation The corresponding count value.
[0094] Exemplarily, this embodiment provides a possible scenario schematic diagram of determining the communication latch count value and the count parameter compensation value in the above step S20 and step S30, such as Figure 3 shown. Figure 3 The deviation between the communication latch count value and the count parameter compensation value is the count deviation value determined in step S40, which is also the count value part that needs to be calibrated in this method. In other words, the ultimate purpose of this method is to adjust Figure 3 The marked line segment where the communication latch count value is located is overlapped with the marked line segment where the count parameter compensation value is located. However, it should be noted that step S30 corresponds to adjusting the set count value of the slave axis timing counter, the purpose of which is to achieve synchronization of the clock cycles between the main axis and the slave axis, that is, the time when the timing counters of the main axis and the slave axis reach the set count value (the time when the data frame is sent) is the same. Step S60 corresponds to adjusting the count value latched when the slave axis timing counter receives the data frame sent by the main axis, that is, the communication latch count value. Under the premise of maintaining the clock synchronization of the main axis and the slave axis, the timing of the main axis sending the data frame and the slave axis receiving the data frame is also synchronized, solving the problem of low control accuracy caused by the timing asynchrony and communication asynchrony between the gantry dual axes.
[0095] For step S40, the adjustment filter gain is used to suppress the portion of the count deviation value caused by interference. In general, the "suppression" effect can be achieved when the absolute value of the adjustment filter gain is less than 1. That is, by multiplying by a number whose absolute value is less than 1, the absolute value of the count deviation value becomes smaller (that is, the count adjustment increment obtained in step S50), and the portion of the count deviation value caused by interference also becomes smaller. The introduction of the adjustment filter gain can effectively suppress the large deviation caused by interference such as large current in the gantry dual-axis working environment, that is, avoid a single large adjustment caused by a large deviation, and can avoid control problems caused by excessive single adjustment of the count value of the timing counter.
[0096] It should also be noted that the count setting value refers to the maximum value that the timing counter can reach in a counting cycle, which is also the midpoint of the entire counting cycle. Therefore, after compensating the count setting value, there is a moment in each counting cycle when the count value of the timing counter reaches the compensated count setting value (i.e., the counting parameter compensation value). When adjusting the communication latch count value, such as Figure 3As shown, the straight line segment corresponding to the communication latch count value can be adjusted to coincide with the straight line segment corresponding to the count parameter compensation value in any count cycle, thereby achieving communication synchronization between the master axis and the slave axis.
[0097] However, considering that the adjustment of the count value is always aimed at minimizing the adjustment amount, when selecting the count parameter compensation value as the adjustment target, Figure 3 As shown, generally one of the counting parameter compensation values in two adjacent counting cycles of the communication latch count value is selected as the adjustment target, because the counting parameter compensation value with the smallest corresponding counting deviation value is always generated in these two counting cycles adjacent to the communication latch count value.
[0098] Furthermore, when adjusting the count value of the timing counter, there are two adjustment directions: increase (forward) and decrease (reverse), which correspond to the two cases where the count deviation value is positive and negative. It should be noted that the increase and decrease of the timing count value also correspond to the direction of the timing direction. The increase of the count value corresponds to the positive direction of the timing, that is, to the negative direction of the timing. Figure 3 Similarly, the decrease of the count value corresponds to the reverse direction of the timing, that is, to Figure 3 In the left direction. In particular, Figure 3 As shown, since one communication latch count value has two adjacent count parameter compensation values in different count cycles, it is necessary to pay attention to the existence of two adjustment directions, forward and reverse, when making adjustments. These two adjustment directions can be freely selected according to actual needs, and this embodiment does not limit this.
[0099] Therefore, in order to avoid changing the adjustment direction of the adjustment filter gain, a positive number can be selected as the value of the adjustment filter gain. In summary, the adjustment filter gain can take any value less than 1 and greater than 0 based on the above two selection conditions for the adjustment filter gain.
[0100] The above adjustment process can be expressed as follows:
[0101] (2);
[0102] (3);
[0103] in, is the counting deviation value; is the positive distance; is the reverse distance; To adjust the direction, 1 is positive and 0 is negative.
[0104] In view of this, this embodiment also provides a possible implementation scheme for the specific implementation of step S40:
[0105] S41: Select the counting parameter compensation values adjacent to the communication latch count value and located in two different counting cycles.
[0106] S42: respectively determining the difference between the two counting parameter compensation values and the communication latch count value to obtain two intermediate deviation values.
[0107] S43: The intermediate deviation value with the smallest absolute value among the two intermediate deviation values is taken as the counting deviation value.
[0108] And corresponding to step S50, this embodiment further includes:
[0109] The direction in which the communication latch count value points to the count parameter compensation value is used as the adjustment direction corresponding to the count adjustment increment.
[0110] In such Figure 3 In the example shown, it can be found that the forward distance is greater than the reverse distance. Figure 3 In one example shown, the intermediate deviation value selected as the counting deviation value in step S43 is Figure 3 The reverse distance in . And the adjustment direction corresponding to the count adjustment increment is in the reverse direction, that is, Figure 3 In this case, the communication latch count value is adjusted to the left to coincide with the count parameter compensation value on the left side of the communication latch count value.
[0111] As can be seen from the above, this embodiment further optimizes the two possible adjustment directions that actually exist when calibrating the count value. Taking the adjustment distance as a reference, the direction with a shorter adjustment distance is selected as the adjustment direction, and the intermediate deviation value corresponding to the adjustment direction is also the count deviation value that is finally involved in the adjustment. The adjustment scheme provided in this embodiment can reduce the adjustment amount of the count value, which can complete the calibration faster on the one hand, and can also better avoid the control abnormality problem caused by excessive adjustment amount on the other hand.
[0112] Furthermore, this embodiment further provides a possible embodiment for adjusting the communication latch count value, and step S60 includes:
[0113] S61: If the count adjustment increment is less than or equal to the preset adjustment threshold, the communication latch count value is adjusted according to the count adjustment increment.
[0114] It can be seen that this embodiment provides a limiting mechanism, which limits the adjustment amount of a single adjustment of the communication latch count value (that is, limits the size of the count adjustment increment) through a pre-set adjustment threshold. The communication latch count value is adjusted by the count adjustment increment only when the count adjustment increment is less than or equal to the adjustment threshold. Based on the setting of the adjustment threshold, it can be ensured that the adjustment amount of the communication latch count value at this time is not too large, that is, the "limiting" of the count value adjustment is achieved, avoiding the control abnormality problem caused by a single adjustment that is too large.
[0115] Furthermore, regarding how to adjust the communication latch count value when the count adjustment increment is greater than the adjustment threshold, this embodiment also provides a possible implementation scheme, and step S60 includes:
[0116] S62: If the count adjustment increment is greater than a preset adjustment threshold, the communication latch count value is adjusted according to the adjustment threshold.
[0117] Similar to the previous embodiment, this embodiment also provides a limiting mechanism, the difference is that this embodiment and the above embodiment are targeted at different situation branches. The previous embodiment focuses on ensuring that when the communication latch count value is adjusted by the count adjustment increment, the count adjustment increment is not too large. This embodiment is about how to adjust the communication latch count value when the count adjustment increment is too large. This embodiment directly adjusts the communication latch count value with the limiting condition, that is, the maximum acceptable adjustment amount, when the count adjustment increment is greater than the adjustment threshold, so as to achieve the purpose of adjusting the communication latch count value to achieve communication synchronization as much as possible, while avoiding control abnormality problems caused by excessive single adjustment.
[0118] In summary, after the count adjustment increment is determined in step S50, there are two possible branches based on the size relationship between the count adjustment increment and the preset adjustment threshold, corresponding to step S61 and step S72 respectively. The adjustment threshold in the above embodiment is a limiting condition, that is, limiting the maximum value of the count value of the single adjustment timing counter to avoid control problems caused by excessive single adjustment.
[0119] Furthermore, based on the setting of the limiting condition and the adjustment filter gain, the deviation between the communication latch count value and the count parameter compensation value may not be adjusted once, so this embodiment also provides another possible implementation scheme. After step S61 and step S62, the above method further includes:
[0120] S70: Determine whether the adjusted communication latch count value is equal to the count parameter compensation value, if not, return to step S40.
[0121] That is, this embodiment provides a loop mechanism, which ensures that the count deviation between the communication latch count value and the count parameter compensation value can be eliminated by continuously looping through the multiple adjustments of steps S40 to S70, that is, the timing synchronization of the data frame reception and transmission between the gantry dual axes is achieved. It is easy to understand that the above loop can be exited except that the exit loop condition (i.e., the branch in step S70) is reached, and a new loop can be entered when a new communication latch count value that needs to be adjusted is obtained in step S20. At this time, the old loop can be exited, or the adjustment of the old loop and the new loop can be carried out in parallel, and this embodiment does not limit this.
[0122] On the other hand, this embodiment also provides a further implementation scheme for adjusting the filter gain:
[0123] Adjust the filter gain to 2 -k . Where k is any positive integer.
[0124] And the above step S50 is:
[0125] The count deviation value is right-shifted by k bits to obtain the count adjustment increment.
[0126] First, when the filter gain is adjusted to a value obtained by dividing 1 by any positive integer other than 1, the method can complete a calibration by adjusting the count value an integer number of times. In other words, for a communication latch count value determined in step S20, the calibration can be completed by looping steps S40 to S80 an integer number of times.
[0127] Furthermore, the present embodiment also limits the adjustment filter gain to a negative exponential power of 2, with an exponent of k. In this way, the calculation of the count adjustment increment can be realized by a shift algorithm. It should be noted that this method can be implemented by a field programmable gate array (FPGA) in an actual communication gantry bus system. To facilitate FPGA calculation, shift calculation is used instead of multiplication or division calculation, thereby further improving the calibration efficiency.
[0128] In one possible embodiment, the filter gain is adjusted to 2 -3 =0.125. At this time, step S32 can be implemented by right shifting by 3 bits, as shown in the following formula (4):
[0129] (4);
[0130] in, Adjust the increment for the count.
[0131] For the above steps S60 and S70. In practice, when limiting an adjustment, it is generally expressed in terms of the duration corresponding to the adjustment increment. For example, in one possible example, the limiting condition is that the adjustment increment is less than 1us. At this time, it is necessary to convert the time unit into a counting unit. For a counter with a counting frequency of 50M, the count value corresponding to 1us is 50. Therefore, the above 1us limiting condition can be converted into 50 counting units, that is, the adjustment threshold = 50.
[0132] In addition, this embodiment also provides a further implementation scheme based on the previous embodiment. Before step S60, the method further includes:
[0133] S80: If the counting deviation value satisfies the first condition and the counting adjustment increment satisfies the second condition, the counting adjustment increment is adjusted to a preset value.
[0134] Optionally, the first condition may specifically be: the counting deviation value is not 0; the second condition may specifically be: the counting adjustment increment is 0; at this time, the preset value is 1.
[0135] It should be noted that the first condition and the second condition can be set according to actual needs, which is not limited in this embodiment.
[0136] It is easy to know that computers, FPGAs, etc. generally ignore remainders when performing division operations. In particular, when the above embodiment implements step S50 through a shift algorithm, the remainder will be ignored. However, taking the adjustment filter gain = 0.125 in the above example as an example, if the count deviation value is any positive integer from 1 to 7, the count adjustment increment obtained after the shift calculation is 0. However, at this time, since the count deviation value is actually not 0, at least one count unit adjustment is required (that is, the technical adjustment increment is 1). Therefore, a corresponding implementation scheme is provided in this method for this situation, which effectively solves the problem of missing adjustment caused by the loss of remainders when the computer and FPGA perform division and right shift operations when the method is implemented in the underlying code.
[0137] Based on the specific implementation schemes proposed in the above embodiments for the count adjustment increment, this embodiment also provides a schematic diagram of the overall process of determining the count adjustment increment, such as Figure 4 shown. Figure 4 In the above example, the limit condition is 1us, the counting frequency of the counter is 50M, so the threshold is adjusted to 50. And the count adjustment increment obtained after the shift calculation Afterwards, as Figure 4 The process shown in the figure is used to obtain the final count adjustment increment for calibration. .
[0138] In one possible example, the dual-axis timing before gantry bus synchronization calibration is as follows: Figure 5 After calibration by this method, the dual-axis timing is as follows Figure 6 shown.
[0139] In summary, the synchronous calibration method of a servo gantry communication bus provided by the present application can realize the timing synchronization between the gantry dual axes, thereby solving the control problem caused by communication asynchrony. In addition, the communication synchronization realized by the present method only requires one-way data transmission from the main shaft to the slave shaft, and only introduces one asynchronous clock deviation. Compared with the two asynchronous clock deviations introduced by the need for reciprocating communication between the main shaft and the slave shaft in the related art, the error introduced by the present method is less, so it can bring higher control accuracy. In addition, the present method also introduces an adjustment filter gain when determining the count adjustment increment, which can effectively reduce the part of the count deviation value caused by interference. It can avoid the situation where a single adjustment is too large, and it can also realize the smoothing of the count value adjustment process during the timing synchronization process, and better avoid the control abnormality problems that may occur during the adjustment process.
[0140] On the other hand, regarding how to measure the asynchronous clock deviation, this embodiment also provides a corresponding implementation scheme, such as Figure 7 As shown: the communication gantry bus system includes a master axis and a slave axis, both of which include a 485 transceiver module to achieve communication. The slave axis also includes a delay module and a communication measurement module.
[0141] The delay module is used to inject a delay link Tdelay when the slave axis returns the transmission delay detection frame (DCF) to the spindle. That is, after the delay module is turned on, the slave axis will no longer immediately return the DCF frame to the spindle when it receives the DCF frame sent by the spindle, but will return the DCF frame after a certain delay link. The delay module can be implemented by an inverter, and the purpose of controlling the delay time is achieved by controlling the path length between the two inverters that are selected. The minimum delay unit that the delay module can delay is called a delay link Tdelay.
[0142] The communication measurement module is specifically the execution body of the method provided in this embodiment on the slave axis side, and can be implemented based on devices such as FPGA.
[0143] Specifically, Figure 8 As shown, the above step S10 specifically includes:
[0144] S11: Transmitting a delay detection frame between the master axis and the slave axis, and taking the transmission delay of the transmission process as the first transmission delay.
[0145] S12: Taking the first transmission delay as the delay measurement result Td1.
[0146] S13: Under the condition that a delay link is injected into the communication between the master axis and the slave axis through the delay module, a delay detection frame is transmitted between the master axis and the slave axis, and the transmission delay of the transmission process is used as the second transmission delay.
[0147] S14: If the second transmission delay is greater than the delay measurement result, the current delay measurement result is used as the asynchronous clock deviation.
[0148] The asynchronous clock deviation measurement principle implemented in the above steps is as follows: Fig. 9 As shown in the figure, Mtx represents the main axis sending timing, SRx represents the slave axis receiving timing, STx represents the slave axis sending timing, and MRx represents the main axis receiving timing. Indicates the total time taken to transmit one DCF frame back and forth. represents the measured transmission delay, The sending delay of each DCF.
[0149] Before describing the measurement scheme provided by this embodiment, the measurement scheme proposed in the related art is described first: Fig. 9 As shown, in the related art, the DCF frame is sent from the master axis to the slave axis, and the slave axis immediately returns the DCF frame to the master axis after receiving the DCF frame sent by the master axis. At this point, the round-trip transmission of a DCF frame is completed, and the total time consumed for the round-trip transmission of one DCF frame can be measured. Due to the transmission delay of DCF frame Known, based on and The transmission delay can be calculated , and the transmission delay As the final measured asynchronous clock deviation.
[0150] However, it is not difficult to know that the above measurement process is affected by the clock frequency of the master axis and the slave axis. Fig.10 As shown in the figure, there can be a maximum error of one clock cycle between the start time when the spindle actually receives the DCF frame and the start time when the spindle recognizes the DCF frame and latches it. However, due to the performance and cost of the 485 chip, the individual difference of the factory communication delay of most 485 chips is 30-60ns, which cannot be compensated by a fixed value. In addition, the current servo system FPGA product-level stable clock mostly uses 50MHz, so the asynchronous clock deviation increases by 20ns.
[0151] In view of the above, this method compensates for the deviation of the dual-axis asynchronous clock by adding a delay link. As can be seen from the above description of the delay module, the delay module can implement a delay link injection with a smaller time granularity based on an inverter to fill the gap in the clock cycle in the gantry servo system. Further, this embodiment also provides a possible implementation plan based on this, and the above step S10 also includes:
[0152] S15: If the second transmission delay is less than or equal to the delay measurement result, the second transmission delay is used as a new delay measurement result.
[0153] S16: Increase the number of delay links injected by the delay module.
[0154] S17: If the number of delay links increased does not exceed the preset search number threshold, return to step S13.
[0155] As can be seen from the above, this embodiment continuously injects delay links, and when entering the branch where step S15 is located, Fig.10 Can be filled as Fig.11 The timing diagram is shown in Fig.11 It is not difficult to see that the injection based on the delay link can reduce the deviation between the receiving time and the latching time to no more than one delay link. Since the delay module can achieve a delay with a finer time granularity, the transmission delay measured by this method is The deviation from the actual transmission delay is also smaller. After a large number of experiments and simulations, the asynchronous clock deviation measurement implemented by this method can reach an accuracy of 3ns, which is significantly better than the measurement solution provided in the related technology.
[0156] Furthermore, since the loop formed by the above steps S13 to S16 generally has an upper limit on the number of loops in practical applications, that is, the transmission delay measurement process of the injection delay link is convergent. However, considering special circumstances and ensuring the closed loop of the control logic, this embodiment provides a loop exit mechanism when the transmission delay measurement does not converge through step S17, so as to avoid the calibration process entering an infinite loop under special circumstances.
[0157] In this embodiment, based on the upper limit of the number of cycles determined during design (such as Figure 8 As shown, the upper limit value in one example is 9), and the execution of step S113 is regarded as a search, the number of searches Scnt is counted, and it is determined whether the number of searches Scnt exceeds the preset search number threshold. If so, the loop is exited and the current delay measurement result Tdl is used as the final asynchronous clock deviation. It should be noted that the situation corresponding to step S116 is an extremely special application scenario. And even in this scenario, this method injects a delay link whose number reaches the search error number threshold, although it does not reach the optimal situation corresponding to step S115 (that is, the deviation between the control receiving time and the latching time is within one delay link). However, compared with before the delay was injected, the deviation is greatly reduced (the deviation of the search error number threshold delay link is reduced), and the measurement accuracy is still higher than that of the measurement scheme proposed in the related art.
[0158] On the other hand, for the detection of the first transmission delay and the second transmission delay in the above steps S11 and S13, this embodiment also provides a possible implementation scheme:
[0159] The delay detection frame is transmitted between the master axis and the slave axis for multiple times, and the transmission delays in the multiple transmission processes are averaged to obtain the first transmission delay / the second transmission delay.
[0160] Specifically, the measurement scheme provided in this embodiment can be expressed by the following equations (5) and (6):
[0161] (5);
[0162] (6);
[0163] Here, n is the number of times the DCF frame is transmitted back and forth. In a possible embodiment, the value of n is 3. It is the total time taken to transmit n DCF frames back and forth. It is measured without injecting delay link. That is the first transmission delay, which serves as the initial delay measurement result Tdl.
[0164] This embodiment further reduces the measurement error in the transmission delay measurement process by averaging multiple measurements, thereby improving the measurement accuracy. In addition, after the delay link is injected in step S13, the second transmission delay Td can be obtained by the following formula (7):
[0165] Td = -Tdelay*0.5(7).
[0166] On the other hand, the synchronous calibration method of the gantry bus system provided in the above embodiment uses the slave axis in the gantry bus system as the execution subject for synchronous calibration. The reason is that in the communication process of the gantry dual-axis, the slave axis is more of a data receiver, and it is easier to achieve and more accurate to perform calibration on the receiving side to achieve communication synchronization. However, it should be noted that this does not mean that the synchronous calibration method of the gantry bus system provided in this application cannot be implemented on the main axis. Based on this, this embodiment also provides a synchronous calibration method for the gantry bus system with the main axis as the execution subject, which is also applied to the gantry bus system including the main axis and the slave axis, and the execution subject is the main axis. The method includes:
[0167] Get the asynchronous clock deviation when communicating with the slave axis.
[0168] Get the communication latch count value.
[0169] The communication latch count value is the current count value of the latched timing counter when the data frame sent by the slave axis is received.
[0170] According to the asynchronous clock deviation, the count setting value of the timing counter is compensated to obtain a compensated count parameter compensation value.
[0171] The counting deviation value is determined based on the counting parameter compensation value and the communication latch counting value.
[0172] The count adjustment increment is determined based on the count deviation value and the preset adjustment filter gain.
[0173] The communication latch count value is adjusted based on the count adjustment increment.
[0174] It is not difficult to see from the above that the method steps provided in this embodiment are only the actions required for the exchange between the master and slave axes, relative to the method applied to the slave axis provided in the above embodiment, and there is no difference. Therefore, the further embodiment of the synchronous calibration method of the gantry bus system applied to the master axis provided in this embodiment can refer to the above embodiment of the method applied to the slave axis, and this embodiment will not be repeated here.
[0175] Fig.12 A structural diagram of a synchronous calibration device for a gantry bus system provided in another embodiment of the present application, such as Fig.12 As shown, a synchronous calibration device for a gantry bus system includes: a memory 10 for storing a computer program;
[0176] The processor 11 is used to implement the steps of a synchronous calibration method of a gantry bus system (which can be a method corresponding to a slave axis or a method corresponding to a main axis) as described in the above embodiment when executing a computer program.
[0177] The synchronous calibration device of the gantry bus system provided in this embodiment may include but is not limited to a mobile terminal, a personal computer, a workstation, etc.
[0178] Among them, the processor 11 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 11 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 11 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 11 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 11 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0179] The memory 10 may include one or more computer-readable storage media, which may be non-transitory. The memory 10 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 10 is at least used to store the following computer program 101, wherein, after the computer program is loaded and executed by the processor 11, it can implement the relevant steps of a synchronous calibration method for a servo gantry communication bus disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 10 may also include an operating system 102 and data 103, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 102 may include Windows, Unix, Linux, etc. Data 103 may include but is not limited to a synchronous calibration method for a servo gantry communication bus, etc.
[0180] In some embodiments, a synchronous calibration device for a gantry bus system may further include a display screen 12 , an input / output interface 13 , a communication interface 14 , a power supply 15 , and a communication bus 16 .
[0181] Those skilled in the art will understand that Fig.12 The structure shown in the figure does not constitute a limitation on the synchronous calibration device of a gantry bus system, and may include more or less components than those shown in the figure.
[0182] A synchronous calibration device for a gantry bus system provided in an embodiment of the present application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a synchronous calibration method for a gantry bus system.
[0183] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0184] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0185] The above is a detailed introduction to a synchronous calibration method and device for a gantry bus system provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can refer 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 refer to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
[0186] It should also be noted that, in this specification, 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 "comprise", "include" 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, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A synchronous calibration method for a gantry bus system, characterized in that: The gantry bus system includes a master axis and a slave axis; the method is applied to the slave axis; the method includes: Obtaining an asynchronous clock deviation when communicating with the spindle; Acquire a communication latch count value; wherein the communication latch count value is the current count value of the latched timing counter when receiving the data frame sent by the spindle; According to the asynchronous clock deviation, the count setting value of the timing counter is compensated to obtain a compensated count parameter compensation value; Determine a counting deviation value according to the counting parameter compensation value and the communication latch counting value; Determining a count adjustment increment according to the count deviation value and a preset adjustment filter gain; The communication latch count value is adjusted based on the count adjustment increment.
2. The synchronous calibration method of the gantry bus system according to claim 1, characterized in that: The adjusting the communication latch count value based on the count adjustment increment includes: If the count adjustment increment is less than or equal to a preset adjustment threshold, the communication latch count value is adjusted according to the count adjustment increment.
3. The synchronous calibration method of the gantry bus system according to claim 1, characterized in that: The adjusting the communication latch count value based on the count adjustment increment includes: If the count adjustment increment is greater than a preset adjustment threshold, the communication latch count value is adjusted according to the adjustment threshold.
4. The synchronous calibration method of the gantry bus system according to claim 1, characterized in that: After adjusting the communication latch count value based on the count adjustment increment, the method further includes: Determining whether the adjusted communication latch count value is equal to the count parameter compensation value; If not, return to the step of determining the counting deviation value according to the counting parameter compensation value and the communication latch counting value.
5. The synchronous calibration method of the gantry bus system according to claim 1, characterized in that: The adjustment filter gain is 2 -k ; Wherein, k is any positive integer; The step of determining the count adjustment increment according to the count deviation value and a preset adjustment filter gain includes: The count deviation value is right-shifted by k bits to obtain a count adjustment increment.
6. The synchronous calibration method of the gantry bus system according to claim 1, characterized in that: Before adjusting the communication latch count value based on the count adjustment increment, the method further includes: If the count deviation value satisfies the first condition and the count adjustment increment satisfies the second condition, the count adjustment increment is adjusted to a preset value.
7. The synchronous calibration method of the gantry bus system according to claim 1, characterized in that: The determining of the counting deviation value according to the counting parameter compensation value and the communication latch counting value comprises: Selecting counting parameter compensation values that are adjacent to the communication latch count value and correspond to two different counting cycles; respectively determining the difference between the two counting parameter compensation values and the communication latch count value to obtain two intermediate deviation values; Take the intermediate deviation value with the smallest absolute value among the two intermediate deviation values as the counting deviation value; The direction in which the communication latch count value points to the count parameter compensation value is used as the adjustment direction corresponding to the count adjustment increment.
8. The synchronous calibration method of the gantry bus system according to claim 1, characterized in that: The acquiring of the asynchronous clock deviation when communicating with the spindle comprises: Acquiring the asynchronous clock deviation once when the gantry bus system is powered on; The acquiring of the communication latch count value comprises: The communication latch count value is periodically acquired, and whenever a new communication latch count value is acquired, the step of determining the count deviation value according to the count parameter compensation value and the communication latch count value is triggered.
9. The synchronous calibration method of the gantry bus system according to any one of claims 1 to 8, characterized in that: The slave axis also includes a delay module; The obtaining of the asynchronous clock deviation when communicating with the spindle includes: Transmitting a delay detection frame between the master axis and the slave axis, and taking the transmission delay of the transmission process as a delay measurement result; Under the condition that a delay link is injected into the communication between the master axis and the slave axis through the delay module, a delay detection frame is transmitted between the master axis and the slave axis, and the transmission delay of the transmission process is used as a second transmission delay; If the second transmission delay is greater than the delay measurement result, the current delay measurement result is used as the asynchronous clock deviation.
10. The synchronous calibration method of the gantry bus system according to claim 9, characterized in that: The method further comprises: If the second transmission delay is less than or equal to the delay measurement result, taking the second transmission delay as the new delay measurement result; Increasing the number of delay links injected by the delay module; If the number of times the delay link number is increased does not exceed the preset search number threshold, then return to the step of transmitting the delay detection frame between the master axis and the slave axis under the condition that the delay link is injected into the communication between the master axis and the slave axis through the delay module, and taking the transmission delay of the transmission process as the second transmission delay; If the number of times the delay link quantity is increased exceeds the search number threshold, the current delay measurement result is used as the asynchronous clock deviation.
11. A synchronous calibration method for a gantry bus system, characterized in that: The gantry bus system includes a main axis and a slave axis; the method is applied to the main axis; the method includes: Acquire an asynchronous clock deviation when communicating with the slave axis; Acquire a communication latch count value; wherein the communication latch count value is the current count value of the latched timing counter when receiving the data frame sent by the slave axis; According to the asynchronous clock deviation, the count setting value of the timing counter is compensated to obtain a compensated count parameter compensation value; Determine a counting deviation value according to the counting parameter compensation value and the communication latch counting value; Determining a count adjustment increment according to the count deviation value and a preset adjustment filter gain; The communication latch count value is adjusted based on the count adjustment increment.
12. A synchronous calibration device for a gantry bus system, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the synchronous calibration method of the gantry bus system as described in any one of claims 1 to 11 when executing the computer program.
Citation Information
Patent Citations
Method of controlling encoder principle axis speed synchronization
CN106404032A
Gantry type dual-drive control device and method and medium
CN114488905A
Distributed gantry synchronous servo system and method based on active optical network
CN118138178A
Maintaining the correct time when counter values are transferred between clock domains
US20200285265A1
Microprocessor controlled reproducing apparatus having asynchronous reproducing capability
US4635138A