A dynamic compensation method and system for treatment bed positioning error, and an electronic device
By establishing a position mapping and orientation compensation mapping relationship for the treatment bed, the positioning error of the treatment bed is dynamically compensated in real time, solving the problem of insufficient positioning accuracy in the existing technology and realizing high-precision positioning control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGJIU FLASH MEDICAL TECHNOLOGY CO LTD
- Filing Date
- 2026-03-09
- Publication Date
- 2026-06-09
AI Technical Summary
In the existing technology, the positioning system of the treatment bed has pitch error and backlash error, which makes it difficult to meet the positioning accuracy requirements of high-end medical equipment during dynamic reversal. Moreover, the existing compensation methods cannot effectively eliminate the positioning deviation.
By pre-establishing position mapping relationships and direction compensation mapping relationships when the treatment bed moves in different directions, the encoder feedback position and movement direction are obtained in real time. Combined with these mapping relationships, dynamic compensation is performed to achieve adaptive tracking and elimination of positioning errors.
It significantly improves the positioning accuracy of the treatment bed throughout its entire stroke range, especially effectively eliminating errors during reciprocating motion or mid-journey reversal, thus improving the availability and reliability of the system without requiring any hardware modifications.
Smart Images

Figure CN122177358A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of dynamic compensation for positioning errors of treatment beds, specifically to a method, system, and electronic equipment for dynamic compensation of positioning errors of treatment beds. Background Technology
[0002] In precision medical scenarios such as radiotherapy and surgical navigation, the positioning accuracy of the treatment bed directly affects the surgical outcome and patient safety. Treatment beds are typically driven by motors, achieving linear motion through transmission mechanisms such as belts. Due to factors such as manufacturing processes, assembly errors, and long-term wear, their positioning systems exhibit two main types of errors: one is the pitch error caused by errors in the straightness of the guide rails, which is position-dependent; the other is the backlash error (also known as return error) caused by factors such as transmission pair clearance, elastic deformation of the belt structure, and tension, which becomes apparent when the direction of movement changes.
[0003] To improve accuracy, existing technologies generally use fixed-value backlash compensation. For errors during reversal, traditional methods typically measure an average backlash value over the entire range and then add or subtract this fixed value each time a change in motion direction is detected. However, the backlash of actual mechanical systems is affected by factors such as load, position, and wear condition, and its value is not constant but varies with the stroke position. Using a single fixed value for compensation will lead to undercompensation or overcompensation in most motion ranges, and cannot effectively eliminate the positioning deviation introduced by direction switching. Especially when performing reciprocating motion or turning back midway, dynamic accuracy is difficult to guarantee.
[0004] In summary, existing technologies treat pitch error compensation and backlash compensation separately, and both use static, fixed models. This fails to construct a continuous, adaptive error model that simultaneously reflects both positional and directional dependence. Consequently, the overall positioning accuracy of the treatment bed across its entire travel range, especially during dynamic reversal processes, cannot meet the demands of increasingly sophisticated medical equipment. Therefore, a method is urgently needed to integrate pitch error and dynamically changing backlash error compensation to achieve high-precision, robust positioning control of the treatment bed.
[0005] Therefore, the existing technology still needs further development. Summary of the Invention
[0006] The purpose of this invention is to overcome the above-mentioned technical deficiencies and provide a dynamic compensation method, system, and electronic device for positioning errors of a treatment bed, so as to solve the problems existing in the prior art.
[0007] To achieve the above-mentioned technical objectives, according to a first aspect of the present invention, the present invention provides a dynamic compensation method for positioning errors of a treatment bed, comprising: S100. Establish in advance the position mapping relationship between the encoder feedback position and the actual measured position of the treatment bed when the treatment bed moves along the first direction, and the direction compensation mapping relationship between the encoder feedback position, the backlash value and the actual measured position when the treatment bed moves along the second direction opposite to the first direction. The backlash value is the difference between the actual measured position of the treatment bed at the same encoder feedback position when it moves along the first direction and along the second direction. S200: Real-time acquisition of the encoder feedback position and motion direction information of the treatment bed at the current moment; S300. Based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, the current encoder feedback position is compensated, and the actual position of the treatment bed after compensation is output.
[0008] Specifically, the method for pre-establishing a position mapping relationship between the encoder feedback position on the treatment bed and the actual measured position of the treatment bed when the treatment bed moves along a first direction includes: Multiple position calibration points are collected within a preset calibration interval when the treatment bed moves in the first direction. A piecewise mapping function between the encoder feedback position and the actual measured position of the treatment bed is established based on the multiple position calibration points. Each position calibration point includes an encoder feedback position value and its corresponding actual measured position value in the first direction.
[0009] Specifically, the method for pre-establishing a directional compensation mapping relationship between the encoder feedback position, the reverse backlash value, and the actual measurement position when the treatment bed edge moves in a second direction opposite to the first direction includes: Multiple position calibration points of the treatment bed are collected within a preset calibration interval when it moves in the second direction. A piecewise mapping function is established based on the multiple position calibration points to establish the directional compensation mapping relationship between the encoder feedback position, the backlash value, and the actual measurement position. The backlash value of each position calibration point is the difference between the actual measurement position at the same encoder feedback position when the treatment bed moves along the first direction and along the second direction.
[0010] Specifically, the method for compensating the current encoder feedback position based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, includes: If the direction of movement is the first direction, then the actual position of the treatment bed corresponding to the current encoder feedback position is calculated based on the position mapping relationship; If the direction of movement is a second direction opposite to the first direction, then the actual position of the treatment bed after compensation is determined based on the position mapping relationship and in combination with the direction compensation mapping relationship.
[0011] Specifically, if the direction of movement is a first direction, the method for calculating the actual position of the treatment bed corresponding to the current encoder feedback position based on the position mapping relationship includes: If the direction of motion is the first direction, then the first calibration interval to which it belongs is determined based on the encoder feedback position at the current moment, and the segmented mapping function corresponding to the first calibration interval is called to calculate the actual position of the treatment bed corresponding to the current encoder feedback position.
[0012] Specifically, if the direction of movement is a second direction opposite to the first direction, the method for determining the actual position of the treatment bed after compensation based on the position mapping relationship and in combination with the direction compensation mapping relationship includes: If the direction of motion is the second direction, then the second calibration interval to which it belongs is determined according to the encoder feedback position at the current time, and the segmented mapping function corresponding to the second calibration interval is called to calculate the first position output value; The encoder feedback position at the current moment is obtained, and the first reverse clearance value corresponding to the encoder feedback position at the current moment is calculated according to the direction compensation mapping relationship. Then, the actual position of the treatment bed corresponding to the current encoder feedback position is calculated according to the first position output value and the first reverse clearance value.
[0013] Specifically, the actual position of the treatment bed corresponding to the current encoder feedback position is calculated based on the first position output value and the first backlash value, including: Adding the first position output value to the first reverse gap value yields the actual position of the treatment bed corresponding to the current encoder feedback position.
[0014] Specifically, the method further includes: If the encoder feedback position at the current moment is less than the minimum encoder feedback position among all position calibration points, then the piecewise mapping function corresponding to the calibration interval where the minimum encoder feedback position is located is called to calculate the second position output value. If the current movement direction of the treatment bed is the first direction, the second position output value is the actual position of the treatment bed corresponding to the encoder feedback position at the current moment. If the current movement direction of the treatment bed is the second direction, then the actual position of the treatment bed corresponding to the encoder feedback position at the current moment is calculated based on the second position output value and the backlash value corresponding to the minimum encoder feedback position. If the encoder feedback position at the current moment is greater than the maximum encoder feedback position among all position calibration points, then the second segmented mapping function corresponding to the calibration interval where the maximum encoder feedback position is located is called to calculate the third position output value. If the current movement direction of the treatment bed is the first direction, the third position output value is the actual position of the treatment bed corresponding to the encoder feedback position at the current moment. If the current movement direction of the treatment bed is the second direction, then the actual position of the treatment bed corresponding to the encoder feedback position at the current moment is calculated based on the third position output value and the backlash value corresponding to the maximum encoder feedback position.
[0015] According to a second aspect of the present invention, a dynamic compensation system for positioning errors of a treatment bed is provided, comprising: Storage module: used to pre-establish a positional mapping relationship between the encoder feedback position and the actual measured position of the treatment bed when the treatment bed moves along a first direction, and a directional compensation mapping relationship between the encoder feedback position, the backlash value, and the actual measured position when the treatment bed moves along a second direction opposite to the first direction; the backlash value is the difference between the actual measured position at the same encoder feedback position when the treatment bed moves along the first direction and along the second direction. Acquisition module: used to acquire the encoder feedback position and motion direction information of the treatment bed in real time at the current moment; Compensation module: It is used to compensate the current encoder feedback position based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, and output the actual position of the treatment bed after compensation.
[0016] According to a third aspect of the present invention, an electronic device is provided, comprising: a memory; and a processor, wherein the memory stores computer-readable instructions, which, when executed by the processor, implement the above-described method for dynamic compensation of positioning errors of a treatment bed.
[0017] Beneficial effects: This invention provides a dynamic compensation method and system for positioning errors of a treatment bed. By pre-establishing position mapping relationships corresponding to the first direction of motion and the second direction of motion, and adaptively combining the two to compensate the encoder feedback position according to the actual motion direction of the treatment bed during real-time operation, it effectively overcomes the defects of the traditional fixed compensation value method with full-range averaging, which leads to stepped compensation curves and static compensation for backlash. It achieves a leap from segmented, discrete approximate compensation to continuous, smooth, and precise compensation, which can significantly improve the absolute positioning accuracy of the treatment bed throughout its entire stroke range. Especially in dynamic working conditions such as reciprocating motion or mid-journey reversal, it can effectively eliminate reversal errors caused by changes in mechanical backlash. Moreover, it requires no hardware modification, is low in cost, easy to integrate, and highly adaptable, greatly improving the usability and reliability of this invention. Attached Figure Description
[0018] Figure 1 This is a flowchart of a dynamic compensation method for positioning errors of a treatment bed provided in a specific embodiment of the present invention; Figure 2 This is a schematic diagram of the system composition of the dynamic compensation system for the positioning error of the treatment bed provided in a specific embodiment of the present invention; Figure 3 This is a graph showing the forward and reverse motion error of the treatment bed at encoder feedback positions of 0mm-500mm, obtained using a conventional method in a specific embodiment of the present invention. Figure 4 This is a diagram showing the forward and reverse motion error curves of the treatment bed obtained by conventional methods in a specific embodiment of the present invention, with the encoder feedback position ranging from 520mm to 1000mm. Figure 5 This is a schematic diagram of the positioning error of the test point after compensation by the forward and reverse composite compensation model provided in a specific embodiment of the present invention. Detailed Implementation
[0019] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Other similar embodiments obtained by those skilled in the art based on the embodiments in this application without creative effort should all fall within the scope of protection of this application. Furthermore, directional terms mentioned in the following embodiments, such as "up," "down," "left," and "right," are only for reference to the directions in the accompanying drawings; therefore, the directional terms used are for illustrative purposes and not for limiting the invention.
[0020] The present invention will be further described below with reference to the accompanying drawings and preferred embodiments.
[0021] Example 1 Please see Figure 1 This embodiment provides a dynamic compensation method for the positioning error of a treatment bed, including: pre-establishing a position mapping relationship between the encoder feedback position and the actual measured position of the treatment bed when the treatment bed moves along a first direction, and a direction compensation mapping relationship between the encoder feedback position, the backlash value, and the actual measured position when the treatment bed moves along a second direction opposite to the first direction; the backlash value is the difference between the actual measured position at the same encoder feedback position when the treatment bed moves along the first direction and along the second direction; real-time acquisition of the encoder feedback position and the movement direction information of the treatment bed at the current moment; compensation of the current encoder feedback position based on the movement direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, and outputting the actual position of the treatment bed after compensation.
[0022] It is understandable that the technical solution in this embodiment achieves dynamic tracking and compensation of the positioning error of the treatment bed by pre-constructing a mapping relationship under the bidirectional motion scenario. Traditional methods use a fixed average compensation value throughout the process, resulting in a stepped compensation curve that is prone to sudden changes in accuracy at the boundaries of the intervals. At the same time, if the direction is switched at any intermediate position during the movement, it will also lead to a significant decrease in accuracy. This embodiment establishes a complete mapping relationship under the bidirectional motion scenario, enabling the compensation model to continuously and smoothly fit the inherent nonlinear error of the mechanical system. More importantly, by introducing a dynamic compensation mapping bound to direction and position, the system can perceive changes in motion state in real time and automatically call the matching compensation strategy, thereby achieving adaptive tracking and elimination of positioning errors. This effectively avoids the problem of sudden drop in accuracy when the direction of movement changes or when turning back midway in traditional methods. That is, on the one hand, a mapping function is used to solve the problem of sudden changes in accuracy at the boundaries of the compensation interval caused by the traditional fixed compensation value problem. On the other hand, a direction compensation mapping relationship is used to solve the problem of significant decrease in accuracy caused by switching directions at any intermediate position during the movement. Before using the current technical solution, we attempted to improve system accuracy through unidirectional linear calibration. However, in practice, we found that the unidirectional linear calibration method could only guarantee accuracy in local areas during forward motion. Once reverse motion was involved, the accuracy would drop significantly. Based on this, we also tried to calibrate forward and reverse motion separately, forming two sets of calibration parameters. That is, the forward calibration table was called during forward motion, and the reverse calibration table was called during reverse motion. Through full-stroke calibration verification (i.e., a complete round trip), the accuracy of the forward and reverse motion calibration schemes was significantly improved compared to unidirectional calibration. However, further testing revealed that if the direction was switched multiple times during the motion, the accuracy would still drop significantly. Therefore, to solve the accuracy problem during direction switching, a fixed reverse backlash compensation value was introduced into the original scheme. However, due to the large actual forward and reverse backlash, the compensation effect of a single fixed value was limited. Therefore, we adjusted it to set specific reverse backlash values in each calibration interval. This significantly improved the accuracy, and the direction switching no longer caused significant accuracy loss. This solution integrates pitch error compensation (position mapping) and backlash error compensation (direction compensation) into a composite model. During forward movement, the pitch error is corrected through high-precision piecewise linear position mapping. During reverse movement, a backlash value that dynamically changes with the position is superimposed on the position mapping for compensation, accurately offsetting the backlash deviation caused by mechanical clearance and enhancing the bidirectional positioning accuracy of the treatment bed throughout its entire stroke range.
[0023] See Figure 1 The implementation steps of the dynamic compensation method for the positioning error of the treatment bed in this embodiment are as follows: S100. Establish in advance the position mapping relationship between the encoder feedback position and the actual measured position of the treatment bed when the treatment bed moves along the first direction, and the direction compensation mapping relationship between the encoder feedback position, the backlash value and the actual measured position when the treatment bed moves along the second direction opposite to the first direction. The backlash value is the difference between the actual measured position of the treatment bed at the same encoder feedback position when it moves along the first direction and along the second direction. It should be noted that during the reciprocating motion of the treatment bed, two sets of key data need to be collected. One is the encoder feedback position, which is read through the motor encoder or position sensor built into the treatment bed. The other is the actual measured position, which can be detected in real time by an independent and high-precision external measuring device, such as a laser interferometer, high-precision grating ruler, linear ruler, step gauge, laser distance sensor, capacitive inductive micrometer, laser tracker, etc. This external measuring device can be installed on the moving parts of the treatment bed to directly measure the absolute physical displacement of the treatment bed. In an ideal system with no backlash and no elastic variation in transmission, the laser interferometer reading should be the same when the forward and reverse movements are at the same encoder position. However, in reality, due to the existence of mechanical backlash or elastic deformation, the moving mechanism of the treatment bed will travel an extra distance before contacting the transmission surface or canceling out the elastic deformation during reverse movement. This results in the actual position of the treatment bed measured by the laser interferometer at the same encoder position being different from the current encoder feedback position. The difference between the actual measured position at the same encoder feedback position when the treatment bed moves in the forward direction and in the reverse direction is taken as the backlash value.
[0024] In the offline calibration stage of this embodiment, the aim is to establish a precise mapping from the encoder feedback position to the absolute position of the laser interferometer, as well as the precise quantification of the backlash value. Specifically, two calibration relationships need to be pre-established in the offline state: one is the positional mapping relationship between the encoder feedback position of the treatment bed and the actual measured position of the laser interferometer when the treatment bed moves along the first direction (forward movement); the other is the directional compensation mapping relationship between the encoder feedback position, the backlash value, and the actual measured position when the treatment bed moves along the second direction (reverse movement), as detailed below: In this embodiment, a method for pre-establishing a position mapping relationship between the encoder feedback position on the treatment bed and the actual measured position of the treatment bed when the treatment bed moves along a first direction includes: Multiple position calibration points are collected within a preset calibration interval when the treatment bed moves in the first direction. A piecewise mapping function between the encoder feedback position and the actual measured position of the treatment bed is established based on the multiple position calibration points. Each position calibration point includes an encoder feedback position value and its corresponding actual measured position value in the first direction.
[0025] In a preferred embodiment, the forward motion, i.e., the first direction motion, is used to collect the mapping point data of the position calibration points at fixed intervals. Preferably, a fixed interval of 20mm can be used. Then, using the mapping data collected in the forward motion as a reference, two adjacent points are divided into an independent interval, and the collected motor encoder feedback value is recorded as... The laser interferometer value is recorded as Name each sampling point according to the number of sampling points. , ... Then, a linear mapping function is established between every two adjacent mapping points, constructing a total of n-1 linear functions, where: The slope of the (n-1)th segment of the mapping function is : ; The intercept of the mapping function for the (n-1)th segment is : ; Substitution You will then receive: ; The expression for the mapping function of the (n-1)th segment is: ; Substituting the above and You will then receive: ; ; In this embodiment, a method for pre-establishing a directional compensation mapping relationship between the encoder feedback position, the reverse gap value, and the actual measurement position when the treatment bed edge moves in a second direction opposite to the first direction includes: Multiple position calibration points of the treatment bed are collected within a preset calibration interval when it moves in the second direction. A piecewise mapping function is established based on the multiple position calibration points to establish the directional compensation mapping relationship between the encoder feedback position, the backlash value, and the actual measurement position. The backlash value of each position calibration point is the difference between the actual measurement position at the same encoder feedback position when the treatment bed moves along the first direction and along the second direction.
[0026] In a preferred embodiment, at the same encoder position of the treatment bed, the difference between the actual measured position of the treatment bed when moving in the forward direction and when moving in the reverse direction is calculated, which reflects the positioning deviation caused by the backlash at that point. After the motion mechanism of the treatment bed completes the forward movement, it moves in the reverse direction, and the absolute position of the laser interferometer corresponding to the same encoder position point is recorded again in the same sampling method. The collected motor encoder feedback value is recorded as... The laser interferometer value is recorded as Name each sampling point according to the number of sampling points. , ... ; Because the encoder value of the motor reaching the sampling point is the same for both forward and reverse motion, therefore , , ..., During reverse motion, the difference between the actual measured position at the same encoder feedback position during forward and reverse motion of the treatment bed can be calculated, and this difference is defined as the reverse backlash value at that point. There are a total of n calculated backlash values. In calibration data acquisition, the encoder feedback position value acquired when the reverse motion and the forward motion reach the same point is theoretically the same value, that is... , ,……, .or , ,……, That is, c can be calculated using one of the two endpoints of the interval segment.
[0027] In one specific embodiment, the current encoder position and current motion direction (positive or negative) of the motion mechanism are monitored in real time. When the speed is positive or the target position value is greater than the current position value, the pre-planned motion is in the positive direction. Conversely, when the speed is negative or the target position value is less than the current position value, the pre-planned motion is in the negative direction. When the motion is stationary, it remains in the last motion state. Then, interval judgment is performed to determine the mapping interval to which the current encoder position belongs; Adaptive direction calculation: When the treatment bed is in forward motion, determine the current encoder position within the specified interval. The specific calculation process is as follows: When x n-1 ≤Encoder position <x n When the interval n-1 is reached, the mapping function is called: Its actual measurement location is: ; When the treatment bed is in reverse motion, the interval where the current encoder position is located is determined. The specific calculation process is as follows: When x n-1 ≤Encoder position <x n At that time, the mapping function for the corresponding interval n-1 and the corresponding reverse gap function for the corresponding interval are called: Its actual measurement location is: ; Right now: ; The final result is: ; In another specific embodiment, the fixed reverse gap value for each interval is further improved to a dynamic gap compensation that varies with position. The reverse gap value of two adjacent points is divided into a linear mapping function, wherein: The slope of the (n-1)th segment backlash function (i.e., the piecewise mapping function between the encoder feedback position and the backlash value) is : ; Substituting the above The expression can be obtained as follows: ; The intercept of the backlash function in the (n-1)th segment is : ; Substituting the above and The expression can be obtained as follows: ; The expression for the (n-1)th segment backlash function (i.e., the piecewise mapping function between the encoder feedback position and the backlash value) is: ; Substituting the above and The expression can be obtained as follows: ; The results were: ; Understandably, according to the above technical solution, by synchronously acquiring forward and reverse bidirectional position data through a complete reciprocating motion, not only is a precise encoder-position mapping established to compensate for pitch error, but more importantly, the characteristics of the reverse clearance dynamically changing with position are quantified and modeled for the first time. By using a piecewise mapping function to continuously model these two types of relationships, the compensation curve is smoothed, completely eliminating the abrupt change in accuracy at the interval boundary of traditional step compensation. Through real-time calculation with adaptive direction (forward calling position mapping, reverse superimposing dynamic clearance mapping), the defects of insufficient or over-compensated fixed clearance value compensation are effectively overcome, thus realizing high-precision positioning of the treatment bed throughout its entire stroke, especially during reversal, in a simple and reliable manner in engineering.
[0028] S200: Real-time acquisition of the encoder feedback position and motion direction information of the treatment bed at the current moment; S300. Based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, the current encoder feedback position is compensated, and the actual position of the treatment bed after compensation is output.
[0029] In this embodiment, the method for compensating the current encoder feedback position based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, includes: If the direction of movement is a first direction, the actual position of the treatment bed corresponding to the current encoder feedback position is calculated based on the position mapping relationship; if the direction of movement is a second direction opposite to the first direction, the actual position of the treatment bed after compensation is determined based on the position mapping relationship and in combination with the direction compensation mapping relationship. Specifically, if the direction of motion is the first direction, then the first calibration interval to which it belongs is determined based on the encoder feedback position at the current moment, and the segmented mapping function corresponding to the first calibration interval is called to calculate the actual position of the treatment bed corresponding to the current encoder feedback position. If the direction of motion is the second direction, then the second calibration interval to which it belongs is determined according to the encoder feedback position at the current time, and the segmented mapping function corresponding to the second calibration interval is called to calculate the first position output value; The encoder feedback position at the current moment is obtained, and the first reverse clearance value corresponding to the encoder feedback position at the current moment is calculated according to the direction compensation mapping relationship. Then, the actual position of the treatment bed corresponding to the current encoder feedback position is calculated according to the first position output value and the first reverse clearance value, that is, the first position output value and the first reverse clearance value are added together to obtain the actual position of the treatment bed corresponding to the current encoder feedback position.
[0030] It is understandable that the first calibration interval and the second calibration interval refer to the interval to which the current moment belongs during the judgment process, and are not pre-set calibration distinctions. The reason for using "first" and "second" is only to distinguish whether it is in the first direction or the second direction. They may be the same interval or different intervals.
[0031] In a preferred embodiment, during the online real-time compensation phase, the system dynamically selects a compensation strategy based on the current motion state. First, it performs state monitoring, i.e., real-time monitoring of the current encoder position and current motion direction (forward or reverse) of the treatment bed's motion mechanism. Pre-planned motion with a positive velocity or a target position value greater than the current position value is designated as the positive direction (forward motion), and vice versa. If the treatment bed is stationary, the last motion state is maintained. Second, it performs interval judgment, determining the mapping interval n-1 (calibration interval) to which the current encoder position belongs. The specific implementation process is as follows: When in a forward motion state, determine the current encoder position within the specified interval: when When this happens, the piecewise mapping function for the corresponding interval n-1 is called. The actual position of the treatment bed corresponding to the current encoder feedback position is as follows: ; When in reverse motion, determine the current encoder position within the specified interval: when The piecewise mapping function for the corresponding interval n-1 and the reverse gap function for the corresponding interval are called to obtain the treatment bed corresponding to the current encoder feedback position. The actual location is as follows: ; If the above dynamic backlash compensation is used, substituting it into the expression for c above, we get: ; In some specific embodiments, to enhance the robustness of the system, location points that exceed the calibration range should be handled, as follows: If the encoder feedback position at the current moment is less than the minimum encoder feedback position among all position calibration points, then the piecewise mapping function corresponding to the calibration interval where the minimum encoder feedback position is located is called to calculate the second position output value. If the current movement direction of the treatment bed is the first direction, the second position output value is the actual position of the treatment bed corresponding to the encoder feedback position at the current moment. If the current movement direction of the treatment bed is the second direction, then the actual position of the treatment bed corresponding to the encoder feedback position at the current moment is calculated based on the second position output value and the backlash value corresponding to the minimum encoder feedback position. If the encoder feedback position at the current moment is greater than the maximum encoder feedback position among all position calibration points, then the second segmented mapping function corresponding to the calibration interval where the maximum encoder feedback position is located is called to calculate the third position output value. If the current movement direction of the treatment bed is the first direction, the third position output value is the actual position of the treatment bed corresponding to the encoder feedback position at the current moment. If the current movement direction of the treatment bed is the second direction, then the actual position of the treatment bed corresponding to the encoder feedback position at the current moment is calculated based on the third position output value and the backlash value corresponding to the maximum encoder feedback position.
[0032] In a preferred embodiment, during actual operation, the treatment bed may occasionally move to areas outside the calibrated travel range (e.g., due to maintenance, debugging, or extreme conditions). To ensure the continuity and stability of the compensation system in such situations, this preferred embodiment designs the following boundary extrapolation strategy: when the encoder feedback position is acquired in real time... Exceeding the calibration range used when establishing the mapping relationship (i.e.) or ,in and When the encoder values corresponding to the minimum and maximum position calibration points are given respectively, the system cannot directly find the calibration interval to which it belongs. The above technical solution aims to provide continuous and usable compensation values through a reasonable extrapolation method, so as to avoid control interruption or loss of accuracy due to the inability to calculate.
[0033] (1) The current position is less than the lower limit of the position calibration range ( ) Current point Virtually assigned to the first calibration interval (i.e. [ , (Interval), call the piecewise mapping function corresponding to the first calibrated interval. ,Will Substituting the values into the calculation yields an extrapolated base position value (i.e., the second position output value); for backlash compensation, the nearest neighbor principle is also used, directly employing the first position calibration point. The corresponding backlash value As the current point The gap compensation amount is relatively stable near the calibration starting point, where the gap characteristics change gently. Using the gap value at the boundary point for compensation is a reliable and robust approximation. If the current direction of motion is the second direction (reverse motion), then the above extrapolated base position value and gap value are compared. Add them together to get the final actual position of the treatment bed. If it is the first direction (positive movement), the extrapolated base position value is directly output.
[0034] (2) The current position is greater than the upper limit of the calibration range ( ) Current point Virtually assigned to the last calibration interval (i.e. [ , (Interval), call the piecewise mapping function corresponding to the last calibrated interval. ,Will Substituting the values into the calculation, we obtain an extrapolated base position value (i.e., the third position output value). For gap compensation, the last position calibration point is used. The corresponding backlash value As the current point The amount of gap compensation. Similarly, whether to superimpose the gap value depends on the direction of motion. This is to obtain the final actual position of the treatment bed.
[0035] Understandably, through the above technical solution, when the encoder feedback position is less than the first mapping point or greater than the last mapping point, i.e., outside the calibrated travel range, the system automatically uses the linear mapping function relationship of the first or last segment and the backlash value to calculate the position, ensuring the continuity of the compensation function. This ensures that the compensation function can work continuously and uninterruptedly throughout the entire physical travel range of the treatment bed, regardless of whether it is within the calibration area, thus improving the availability and reliability of the system. The above solution utilizes boundary interval characteristics for extrapolation, providing compensation consistent with the trend of system error changes in the adjacent area outside the calibration range. Compared to directly zeroing or stopping compensation, it can more effectively maintain positioning accuracy, effectively expand the effective range of the compensation model, and enhance the robustness of this solution in the face of non-calibrated working conditions, which is a key guarantee for achieving high-reliability precision positioning.
[0036] See Figures 3-5 The following specific examples illustrate the implementation effects of this invention compared to traditional methods: This example uses a treatment bed as the implementation object, and adopts a compensation method with one reverse gap value corresponding to each interval. The design extension stroke is 1000mm. The specific implementation process is as follows: (1) Data collection and analysis using traditional methods: The treatment bed is controlled to reciprocate within a stroke of 0-1000mm. A sampling point is set every 20mm. During the forward (first direction) and reverse (second direction) movements, the encoder feedback position and the absolute position measured by the laser interferometer (considered as the true value of the actual position) corresponding to each sampling point are recorded synchronously. The core data collected are shown in Table 1. Table 1 Sampling Data Based on the data in Table 1, the positioning error of each sampling point was calculated (error = encoder position feedback value - laser interferometer measured position value), and the forward and reverse motion error curves were plotted as follows: Figure 3 and Figure 4 As shown, the continuity and directional differences of positioning error with position variation are illustrated. Figure 3 This is a positioning error curve for encoder feedback position ranging from 0mm to 500mm. Figure 4 This is a positioning error curve graph showing the encoder feedback position from 520mm to 1000mm. Figure 3 , Figure 4 As can be clearly observed from the data in Table 1, the forward and reverse error curves do not overlap, and there is a significant reverse gap. For example, there is a maximum positive and negative deviation value at the encoder feedback position of 460mm. The deviation between the measured positions in the forward and reverse directions reaches a maximum value of 0.83258mm. Traditional compensation methods usually use a fixed gap compensation value. The typical practice is to take the arithmetic mean of the maximum forward and reverse deviations, i.e., 0.83258 / 2≈0.41629mm. This means that even if compensation is performed, the theoretical minimum error fluctuation range of the system is still around ±0.42mm. The overall accuracy is limited to this level, which is difficult to meet the positioning requirements of high-end medical equipment for sub-millimeter or even higher precision.
[0037] (2) Implementation and effects of the method in this embodiment: Based on the complete data collected above (Table 1), perform the following steps: a) Establish a piecewise linear position mapping relationship from encoder position to actual position using forward motion data; b) Calculate the difference between the measured position value of the forward laser interferometer and the measured position value of the reverse laser interferometer at the same encoder feedback position when the treatment bed moves along the forward direction and along the reverse direction at each sampling point (same encoder position). This yields a series of dynamic reverse gap values that vary with position, and based on this, establishes a piecewise linear directional compensation mapping relationship from encoder position to dynamic gap value. The forward and reverse composite compensation model established in this embodiment is embedded into the treatment bed control system. Subsequently, multiple test points (including the middle and both ends of the travel range) are randomly selected within the travel range. The treatment bed is controlled to move to these points at different speeds and in different directions (including mid-journey reversal), and the final positioning results measured by the laser interferometer after compensation are recorded. Some of the test data after compensation are shown in Table 2 and... Figure 5 As shown, Figure 5 The horizontal axis represents the randomly selected position, and the vertical axis represents the compensated error. The compensation error for the random position test includes errors for both forward and reverse movement. That is, each data point in the graph represents an independent positioning test result with a clear direction of movement. If the position set value of the previous position test is greater than the position set value of the next position test, it is the compensation error for forward movement; otherwise, it is the compensation error for reverse movement. Figure 5 The table shows multiple randomly selected test points and their compensated errors. The data in Table 2 is analyzed. Figure 5 As can be seen, after dynamic compensation by the method in this embodiment, the absolute value of the positioning error of all test points is effectively controlled within 0.2mm, which is a significant improvement in accuracy compared with the theoretical accuracy limit of about 0.42mm of the traditional method.
[0038] Table 2. Randomly selected test points and their compensated errors It is understandable that traditional fixed gap compensation methods have theoretical limitations in compensation accuracy because they cannot characterize the dynamic characteristics of gap changes with position. The above-mentioned technical solution in this embodiment establishes a position-related dynamic gap compensation mapping and combines it with the position mapping relationship to perform directional adaptive compensation, which can accurately offset the nonlinear gap error that changes with position, thereby breaking through the accuracy limit of traditional methods. Actual test data has verified that the method in this embodiment can stably improve the positioning accuracy of the treatment bed to 0.2mm, which also fully demonstrates the effectiveness, advancement and engineering practical value of this solution.
[0039] It should be noted that this embodiment provides a dynamic compensation method for the positioning error of a treatment bed. By organically combining pitch error compensation (through piecewise linear mapping) and backlash compensation (through adaptive dynamic superposition), it achieves a leap from piecewise, stepwise approximate compensation to continuous, smooth, and adaptive precise compensation. This significantly improves the bidirectional positioning accuracy of the treatment bed in reciprocating motion, while effectively eliminating commutation errors. It achieves high-precision compensation across the entire stroke range, without requiring modification of existing hardware. It can be implemented solely through software algorithm upgrades, resulting in low cost and easy integration into existing CNC systems or motion controllers. This reduces dependence on the precision of hardware equipment and can rapidly improve the positioning reliability of the treatment bed in critical medical operations such as radiotherapy and interventional therapy, providing strong support for the implementation of precision medicine.
[0040] Example 2 Please see Figure 2 This embodiment provides a dynamic compensation system for the positioning error of a treatment bed. The system includes a storage module, an acquisition module, and a compensation module, wherein: Storage module 100: used to pre-establish a positional mapping relationship between the encoder feedback position and the actual measured position of the treatment bed when the treatment bed moves along a first direction, and a directional compensation mapping relationship between the encoder feedback position, the backlash value, and the actual measured position when the treatment bed moves along a second direction opposite to the first direction; the backlash value is the difference between the actual measured position at the same encoder feedback position when the treatment bed moves along the first direction and along the second direction. Preferably, the data can be calculated and generated based on the collected calibration data by an external computing device or calibration program, and then written and saved in the storage module. During the real-time compensation process, the main function of this module is to provide query and data reading services to the compensation module.
[0041] Acquisition module 200: used to acquire the encoder feedback position and motion direction information of the treatment bed at the current moment in real time; Compensation module 300: Used to compensate the current encoder feedback position based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, and output the actual position of the treatment bed after compensation.
[0042] Furthermore, during the operation of the dynamic compensation system for the positioning error of the treatment bed in this embodiment, the acquisition module inputs the real-time status into the compensation module, and the compensation module calls the corresponding mapping relationship parameters from the storage module to perform calculations based on the status. These three modules constitute a closed-loop information processing flow from status perception, model calling to real-time calculation, transforming the dynamic compensation method in Embodiment 1 into a stable and integrable entity system.
[0043] It should be noted that this embodiment provides a dynamic compensation system for the positioning error of a treatment bed, including a storage module 100, an acquisition module 200, and a compensation module 300. Complex calibration data and compensation algorithms are encapsulated in independent modules, enabling the high-precision dynamic compensation function to be easily integrated into the existing CNC system or motion controller of the treatment bed. This greatly improves the ease of engineering application of this technology. High-speed status acquisition by the acquisition module and efficient calculation by the compensation module ensure the real-time performance of the compensation calculation, keeping pace with the motion control cycle of the treatment bed. The storage module provides stable... Qualitative methods ensure the long-term reliability of the compensation model, and the entire system exhibits strong robustness. This effectively overcomes the shortcomings of traditional fixed-value compensation methods, such as stepped compensation curves and static compensation of backlash. It achieves a leap from piecewise, discrete approximate compensation to continuous, smooth, and precise compensation, significantly improving the absolute positioning accuracy of the treatment bed throughout its entire stroke. Especially under dynamic conditions of reciprocating motion or mid-journey reversal, it effectively eliminates reversal errors caused by changes in mechanical backlash. Furthermore, it requires no hardware modifications, is low-cost, easy to integrate, and highly adaptable, greatly enhancing the usability and reliability of this invention.
[0044] Example 3 In a preferred embodiment, this application also provides an electronic device, the electronic device comprising: The computer device includes a memory and a processor. The memory stores computer-readable instructions that, when executed by the processor, implement the dynamic compensation method for the positioning error of the treatment bed. This computer device can be broadly categorized as a server, terminal, or any other electronic device with the necessary computing and / or processing capabilities. In one embodiment, the computer device may include a processor, memory, network interface, communication interface, etc., connected via a system bus. The processor of the computer device can be used to provide the necessary computing, processing, and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and internal memory. The non-volatile storage medium may store an operating system, computer programs, etc. The internal memory can provide an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface and communication interface of the computer device can be used to connect and communicate with external devices via a network. When the computer program is executed by the processor, it performs the steps of the method of the present invention.
[0045] This invention can be implemented as a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, causes the steps of the methods of embodiments of the invention to be performed. In one embodiment, the computer program is distributed across multiple network-coupled computer devices or processors, such that the computer program is stored, accessed, and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, may be executed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations may be executed by one or more computer devices or processors, and one or more other method steps / operations may be executed by one or more other computer devices or processors. One or more computer devices or processors may execute a single method step / operation, or execute two or more method steps / operations.
[0046] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0047] The technical features described above can be combined arbitrarily. Although not all possible combinations of these technical features are described, any combination of these technical features should be considered to be covered by this specification, provided that such combination does not contain contradictions.
[0048] The specific embodiments of the present invention described above do not constitute a limitation on the scope of protection of the present invention. Any other corresponding changes and modifications made in accordance with the technical concept of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A method for dynamic compensation of positioning error of a treatment bed, characterized in that, include: S100. Establish in advance the position mapping relationship between the encoder feedback position and the actual measured position of the treatment bed when the treatment bed moves along the first direction, and the direction compensation mapping relationship between the encoder feedback position, the backlash value and the actual measured position when the treatment bed moves along the second direction opposite to the first direction. The backlash value is the difference between the actual measured position at the same encoder feedback position when the treatment bed moves along the first direction and along the second direction. S200: Real-time acquisition of the encoder feedback position and motion direction information of the treatment bed at the current moment; S300. Based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, the current encoder feedback position is compensated, and the actual position of the treatment bed after compensation is output.
2. The dynamic compensation method for positioning error of the treatment bed according to claim 1, characterized in that, The method for pre-establishing a position mapping relationship between the encoder feedback position on the treatment bed and the actual measured position of the treatment bed when the treatment bed moves along a first direction includes: Multiple position calibration points are collected within a preset calibration interval when the treatment bed moves in the first direction. A piecewise mapping function between the encoder feedback position and the actual measured position of the treatment bed is established based on the multiple position calibration points. Each position calibration point includes an encoder feedback position value and its corresponding actual measured position value in the first direction.
3. The dynamic compensation method for treatment bed positioning error according to claim 2, characterized in that, The method for establishing a pre-established directional compensation mapping relationship between the encoder feedback position, the backlash value, and the actual measured position when the treatment bed edge moves in a second direction opposite to the first direction includes: Multiple position calibration points of the treatment bed are collected within a preset calibration interval when it moves in the second direction. A piecewise mapping function is established based on the multiple position calibration points to establish the directional compensation mapping relationship between the encoder feedback position, the backlash value, and the actual measurement position. The backlash value of each position calibration point is the difference between the actual measurement position at the same encoder feedback position when the treatment bed moves along the first direction and along the second direction.
4. The dynamic compensation method for positioning error of the treatment bed according to claim 1, characterized in that, The method for compensating the current encoder feedback position based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, includes: If the direction of movement is the first direction, then the actual position of the treatment bed corresponding to the current encoder feedback position is calculated based on the position mapping relationship; If the direction of movement is a second direction opposite to the first direction, then the actual position of the treatment bed after compensation is determined based on the position mapping relationship and in combination with the direction compensation mapping relationship.
5. The dynamic compensation method for treatment bed positioning error according to claim 4, characterized in that, If the direction of motion is a first direction, then the method for calculating the actual position of the treatment bed corresponding to the current encoder feedback position based on the position mapping relationship includes: If the direction of motion is the first direction, then the first calibration interval to which it belongs is determined based on the encoder feedback position at the current moment, and the segmented mapping function corresponding to the first calibration interval is called to calculate the actual position of the treatment bed corresponding to the current encoder feedback position.
6. The dynamic compensation method for positioning error of the treatment bed according to claim 4, characterized in that, If the direction of movement is a second direction opposite to the first direction, then the method for determining the actual position of the treatment bed after compensation based on the position mapping relationship and in combination with the direction compensation mapping relationship includes: If the direction of motion is the second direction, then the second calibration interval to which it belongs is determined according to the encoder feedback position at the current time, and the segmented mapping function corresponding to the second calibration interval is called to calculate the first position output value; The encoder feedback position at the current moment is obtained, and the first reverse clearance value corresponding to the encoder feedback position at the current moment is calculated according to the direction compensation mapping relationship. Then, the actual position of the treatment bed corresponding to the current encoder feedback position is calculated according to the first position output value and the first reverse clearance value.
7. The dynamic compensation method for positioning error of the treatment bed according to claim 6, characterized in that, The actual position of the treatment bed corresponding to the current encoder feedback position is calculated based on the first position output value and the first backlash value, including: Adding the first position output value to the first reverse gap value yields the actual position of the treatment bed corresponding to the current encoder feedback position.
8. The dynamic compensation method for positioning error of the treatment bed according to claim 4, characterized in that, The method further includes: If the encoder feedback position at the current moment is less than the minimum encoder feedback position among all position calibration points, then the piecewise mapping function corresponding to the calibration interval where the minimum encoder feedback position is located is called to calculate the second position output value. If the current movement direction of the treatment bed is the first direction, the second position output value is the actual position of the treatment bed corresponding to the encoder feedback position at the current moment. If the current movement direction of the treatment bed is the second direction, then the actual position of the treatment bed corresponding to the encoder feedback position at the current moment is calculated based on the second position output value and the backlash value corresponding to the minimum encoder feedback position. If the encoder feedback position at the current moment is greater than the maximum encoder feedback position among all position calibration points, then the second segmented mapping function corresponding to the calibration interval where the maximum encoder feedback position is located is called to calculate the third position output value. If the current movement direction of the treatment bed is the first direction, the third position output value is the actual position of the treatment bed corresponding to the encoder feedback position at the current moment. If the current movement direction of the treatment bed is the second direction, then the actual position of the treatment bed corresponding to the encoder feedback position at the current moment is calculated based on the third position output value and the backlash value corresponding to the maximum encoder feedback position.
9. A dynamic compensation system for positioning errors of a treatment bed, characterized in that, include: Storage module: used to pre-establish the position mapping relationship between the encoder feedback position on the treatment bed and the actual measured position of the treatment bed when the treatment bed moves along the first direction, and the direction compensation mapping relationship between the encoder feedback position, the backlash value and the actual measured position when the treatment bed moves along the second direction opposite to the first direction. The backlash value is the difference between the actual measured position of the treatment bed at the same encoder feedback position when it moves along the first direction and along the second direction. Acquisition module: used to acquire the encoder feedback position and motion direction information of the treatment bed in real time at the current moment; Compensation module: It is used to compensate the current encoder feedback position based on the motion direction information of the treatment bed, combined with the position mapping relationship and the direction compensation mapping relationship, and output the actual position of the treatment bed after compensation.
10. An electronic device, characterized in that, include: Memory; The processor, wherein the memory stores computer-readable instructions that, when executed by the processor, implement the dynamic compensation method for positioning error of the treatment bed according to any one of claims 1 to 8.