A proton therapy rotating gantry motion control method, system, device and medium
By introducing a safety snapshot mechanism and hybrid fixed-angle determination logic into the proton therapy system, the problems of high coupling in the rotating gantry control architecture and fixed-angle positioning error were solved. This enabled high-precision, reliable, and safe control of the rotating gantry, simplified the troubleshooting process, and improved the maintainability and operational transparency of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN RUISIKE MEDICAL TECHNOLOGY CO LTD
- Filing Date
- 2026-06-23
- Publication Date
- 2026-07-21
AI Technical Summary
The control architecture of the rotating gantry in existing proton therapy systems has a high degree of coupling, a high risk of single-point failure, large errors in determining the fixed angle position, scattered safety interlocking mechanisms and a lack of unified semantics, non-standard emergency stop recovery procedures, a lack of large-stroke zeroing strategies, and incomplete software working limit and target angle checks.
A security snapshot mechanism based on a predefined data structure is introduced to synchronously collect multi-source heterogeneous security status, generate security snapshots and perform logical operations, adopt hybrid security angle determination logic, output standardized interlock signals, design a channel-specific emergency stop recovery process, verify the legality of the target rack angle and generate a position start pulse.
It reduces malfunctions caused by state asynchrony or signal jumps, improves rack positioning accuracy and reliability, simplifies the complexity of upper-level control logic, enhances the system's decision-making efficiency and reliability under high-concurrency safety constraints, shortens troubleshooting time, and ensures the safety and maintainability of proton therapy.
Smart Images

Figure CN122431238A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of equipment motion control technology, specifically relating to a method, system, equipment, and medium for motion control of a proton therapy rotating gantry. Background Technology
[0002] In a proton therapy system, a rotating gantry is used to precisely guide the proton beam to the patient's tumor site. Its core control chain typically includes a treatment planning system, a treatment control system, and a field-programmable logic controller.
[0003] Existing technologies generally suffer from high architectural coupling, often concentrating gantry movement, planning analysis, and beam output control into a single upper-level program. This leads to a high risk of single-point failures and fails to meet the safety isolation requirements of medical equipment. Furthermore, the determination of angular positioning relies heavily on single discrete quantities, making it prone to misjudgments where signal changes occur but the physical position is not reached, potentially causing treatment deviations or even safety accidents. In addition, existing technologies suffer from fragmented safety interlocking mechanisms lacking unified semantics, and their emergency stop and recovery procedures are not standardized, often employing a one-button full reset mode, making troubleshooting difficult and prone to secondary risks. Moreover, there is a lack of clear strategy guidance for large-stroke homing scenarios, and the software's working limit and target angle checking mechanisms are inadequate. Therefore, a new proton therapy rotating gantry control scheme is urgently needed. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the purpose of this invention is to provide a method, system, device and medium for motion control of a proton therapy rotating gantry.
[0005] According to one aspect of this application, a method for motion control of a proton therapy rotating gantry is disclosed, the method comprising: In response to the acquired rack movement intention, a pre-movement safety check is performed on the field programmable logic controller, and multiple discrete input quantities and absolute angle feedback in the input registers are collected to generate a safety snapshot, which is represented in the form of a predefined data structure. If the security snapshot meets the preset motion prohibition conditions, the motion is refused and the reason for prohibition is output. If the safety snapshot does not trigger the motion prohibition condition, the target rack angle and velocity are written to the field programmable logic controller, and a rising edge pulse is applied to the position start coil; The system determines whether the rack is in position based on a hybrid safety angle determination logic. The hybrid safety angle determination logic is configured to: monitor the discrete quantity of the position mode operation within a predetermined grace period from the effective time of the position start pulse; if the discrete quantity is set and then cleared and the absolute angle feedback enters the target tolerance range, then the rack is determined to be in position; if the discrete quantity is not set within the predetermined grace period, then the system is downgraded to determining the rack is in position based solely on continuous sampling of the absolute angle feedback. Once the rack is in place, a standardized set of rack common interlock signals is output to the treatment control layer, and the rack is controlled to enter a stable standby state, so that the treatment control layer can calculate the proton beam exit permission based on the set of interlock signals.
[0006] In some embodiments, the step of performing a pre-motion safety check on the field-programmable logic controller in response to the acquired rack movement intention, collecting multiple discrete input quantities and absolute angle feedback from input registers, and generating a safety snapshot includes: Within a single control cycle, multi-source heterogeneous data covering emergency stop status, safety circuit status, air pressure status, mechanical limit status, and absolute angle feedback are collected simultaneously. A security snapshot data structure is predefined, the security snapshot data structure containing a status field that corresponds one-to-one with each of the multi-source heterogeneous data; The multi-source heterogeneous data is mapped to the corresponding fields of the security snapshot data structure, and logical operations are performed on the status field to generate an aggregated motion prohibition flag, which is then stored in the security snapshot data structure. The security snapshot is characterized by a security snapshot data structure that stores a motion prohibition flag.
[0007] In some embodiments, if the security snapshot meets the preset motion prohibition conditions, refusing to execute motion and outputting the prohibition reason includes: Parse the motion prohibition flag in the security snapshot data structure; If the motion prohibition flag is set, traverse each state field in the security snapshot data structure to identify and record the specific abnormal field that triggered the prohibition state. Output identification information containing the specific exception field as the reason for prohibition.
[0008] In some embodiments, the logic for determining the motion prohibition condition includes: Perform bitwise or logical operations on each field in the security snapshot data structure to generate aggregated motion prohibition flag bits; If the emergency stop status field indicates that any emergency stop circuit is disconnected, or the safety circuit status field indicates that the safety relay is not ready, or the air pressure status field indicates that the air pressure is abnormal, then the motion prohibition flag is set directly. or, Extract the absolute angle feedback value from the safety snapshot and calculate the difference between the current angle and the target rack angle; If the current angle or the target rack angle exceeds the preset software working limit range, or if the difference indicates that the rack needs to be rotated in the opposite direction at a large angle without going through the zero-finding process, then the motion prohibition flag is set.
[0009] In some embodiments, if the safety snapshot does not trigger the motion prohibition condition, writing the target rack angle and velocity setpoint to the field programmable logic controller and applying a rising edge pulse to the position activation coil includes: Based on the absolute angle feedback in the security snapshot, the legality of the target rack angle is verified, and it is confirmed that the target rack angle does not exceed the software limit range; After confirming its legitimacy, the target rack angle and speed command is sent to the field programmable logic controller. Generate and output a rising edge pulse signal of the position start coil with a preset pulse width to trigger the rack motor to enter the running state.
[0010] In some embodiments, before writing the target rack angle to the field-programmable logic controller, the method further includes a target angle verification step, comprising: Verify whether the target rack angle exceeds the preset software operating limit range; If the target angle out-of-range discrete value is read, and the target frame angle is out of range or the target angle out-of-range discrete value is valid, then the position start pulse is prohibited from being applied.
[0011] In some embodiments, the method further includes an emergency stop lane recovery step, comprising: Identify the specific channel that triggers the emergency stop, and wait for the emergency stop discrete quantity corresponding to that channel to change from valid to invalid; Confirm that all discrete values for all other emergency stop channels are invalid; A predetermined pulse sequence is sent to the fault reset coil, and the pre-motion safety check is re-executed after a delay.
[0012] According to another aspect of this application, a motion control system for a proton therapy rotating gantry is also disclosed, the system comprising: The safety snapshot generation module is used to perform a pre-motion safety check on the field programmable logic controller in response to the acquired rack movement intention, collect multiple discrete input quantities and absolute angle feedback in the input register, and generate a safety snapshot, which is represented in the form of a predefined data structure. The motion rejection module is used to refuse to execute motion and output the reason for rejection when the security snapshot meets the preset motion prohibition conditions. The data writing module is used to write the target rack angle and velocity setpoint to the field programmable logic controller when the motion prohibition condition is not triggered in the safety snapshot, and to apply a rising edge pulse to the position start coil; The positioning determination module is used to determine whether the rack is in position based on a hybrid safety angle determination logic. The hybrid safety angle determination logic is configured to: monitor the discrete quantity of the position mode operation within a predetermined grace period from the effective time of the position start pulse; if the discrete quantity is set and then cleared and the absolute angle feedback enters the target tolerance range, then the angle determination is made; if the discrete quantity is not set within the predetermined grace period, then the determination is downgraded to judging the angle determination based solely on continuous sampling of the absolute angle feedback. The standby control module is used to output a standardized set of rack common interlock signals to the treatment control layer after the rack is in place, and to control the rack to enter a standby state so that the treatment control layer can calculate the proton beam exit permission based on the set of interlock signals.
[0013] According to another aspect of this application, an electronic device is also disclosed, the electronic device including a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to perform various steps of the proton therapy rotating gantry motion control method as described in any of the preceding claims.
[0014] According to another aspect of this application, a computer-readable storage medium is also disclosed, on which instructions are stored, which, when executed by a processor, implement the steps of the motion control method for a proton therapy rotating gantry as described in any of the preceding claims.
[0015] The present invention includes, but is not limited to, the following beneficial effects: (1) By introducing a safety snapshot mechanism based on a predefined data structure before movement, this solution can synchronously collect and aggregate multi-source heterogeneous safety states within a single control cycle, transforming dispersed physical interlocks into a unified logical judgment benchmark, thereby reducing the occurrence of malfunctions caused by state asynchrony or signal jumps at the source; at the same time, by adopting a hybrid safety angle determination logic that combines discrete quantities and absolute angle feedback in a fusion position mode, the accuracy and reliability of rack positioning under various working conditions are improved through a dual-mode determination mechanism that combines dynamic and static elements; in addition, by providing treatment The control layer outputs a standardized set of common interlock signals for the rack and controls the rack to enter a stable standby state, realizing seamless coordination between the motion control system and the treatment beam output system. While ensuring treatment safety, it also provides a unified technical interface for system integration and cross-platform adaptation of equipment from different manufacturers, improving the accuracy and safety of motion control of the proton therapy rotating rack; (2) This scheme realizes the structured encapsulation of the rack safety status by synchronously collecting multi-source heterogeneous data covering emergency stop, safety loop, air pressure, mechanical limit and absolute angle feedback in a single control cycle and mapping it to a predefined safety snapshot data structure. This synchronization mechanism effectively reduces the risk of delayed safety status judgment or logical inconsistency that may be caused by traditional time-sharing sampling, and improves the integrity and real-time performance of safety decision-making basis under complex working conditions. At the same time, by performing logical operations on each state field to generate aggregated motion prohibition flags, the dispersed physical interlocking conditions are transformed into unified logical judgment results. This not only greatly simplifies the complexity of the upper-level control logic, but also makes the safety pre-inspection process more transparent and traceable through structured data representation, thereby significantly improving the system's judgment efficiency and reliability under high-concurrency safety constraints, and providing a solid and consistent safety decision-making basis for subsequent motion control. (3) After detecting that the motion prohibition flag is set, this scheme actively traverses each state field in the safety snapshot data structure, which can automatically identify and record the specific state source that triggers the abnormality (instead of just outputting a general prohibition signal). This not only provides operators and maintenance personnel with a clear direction for troubleshooting, greatly shortens the downtime diagnosis and recovery time, but also realizes a safety control closed loop from passive interception to active diagnosis, significantly improving the system maintenance efficiency and operational transparency, and ensuring the maintainability and rapid response capability of the proton therapy rack under complex safety constraints.(4) This solution verifies the legality of the target rack angle based on the absolute angle feedback in the safety snapshot before issuing motion commands to the field programmable logic controller (PLC) (confirming that it does not exceed the software limit range), and only issues the target angle and speed command and generates the rising edge pulse of the position start coil after confirming that it is legal. This achieves a secondary safety check before the motion command is issued. This mechanism embeds the software limit check into the motion triggering process, which not only avoids the illegal target angle (such as the angle exceeding the safety boundary) from triggering rack motion, but also improves the timing accuracy and operational reliability of rack motor starting through the standardized pulse signal triggering method. (5) This solution designs a complete closed loop for the recovery process after emergency stop triggering, including channel identification, discrete quantity monitoring, full channel confirmation, pulse sequence reset, and re-execution of pre-check: first, identify the specific channel that triggered the emergency stop and wait for its discrete quantity to fail, then confirm that all other emergency stop channel discrete quantities are invalid to avoid missing multi-channel faults, and finally send the pulse sequence and delay to re-execute the pre-motion safety check. This mechanism reduces the secondary faults or safety hazards caused by false reset and missed reset during the emergency stop recovery process through refined channel-level recovery management. ; Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0017] Figure 1 This is a flowchart of the motion control method for a proton therapy rotating gantry; Figure 2 This is a structural block diagram of the motion control system for a proton therapy rotating gantry; Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0018] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention 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 described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a 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.
[0019] For ease of understanding, the specific process of the embodiments of the present invention will be described below.Figure 1 This is a flowchart illustrating a motion control method for a proton therapy rotating gantry according to an embodiment of this application. (See attached document.) Figure 1 It includes the following steps: S100: In response to the acquired rack movement intention, performs a pre-movement safety check on the field programmable logic controller, collects multiple discrete input quantities and absolute angle feedback in the input registers, and generates a safety snapshot.
[0020] Security snapshots are represented in the form of predefined data structures.
[0021] For example, this step may specifically include: Within a single control cycle, multi-source heterogeneous data covering emergency stop status, safety circuit status, air pressure status, mechanical limit status, and absolute angle feedback are collected simultaneously.
[0022] Specifically, through a preset communication protocol (such as Modbus TCP), multi-source heterogeneous data covering emergency stop status, safety circuit status, air pressure status, mechanical limit status, and absolute angle feedback can be synchronously read within a single scan cycle with the PLC. Among them, the safety circuit status includes the status of the emergency stop button and the safety relay; the mechanical limit status includes positive limit, negative limit, and origin limit; and the absolute angle feedback includes reading the current absolute angle value from the PLC input register for subsequent angle calibration.
[0023] A predefined security snapshot data structure is provided, which contains a status field that corresponds one-to-one with each heterogeneous data source.
[0024] Multi-source heterogeneous data is mapped to the corresponding fields of the security snapshot data structure, and logical operations are performed on the status field to generate aggregated motion prohibition flags, which are then stored in the security snapshot data structure.
[0025] Understandably, to achieve unified management and logical judgment of the aforementioned multi-source data, a safety snapshot mechanism is introduced. This mechanism is represented by a predefined data structure. For example, this data structure can be defined as a struct or class containing status fields that correspond one-to-one with each of the multi-source heterogeneous data. Further, the collected multi-source heterogeneous data is mapped to the corresponding fields in the safety snapshot data structure, and logical operations are performed on the status fields (e.g., setting movement prohibition if any emergency stop is valid; setting movement prohibition if air pressure is insufficient; setting movement prohibition if the soft limit is exceeded, etc.), ultimately generating an aggregated movement prohibition flag. This flag, as the core output field of the safety snapshot, is stored in the safety snapshot data structure.
[0026] Security snapshots are represented using a security snapshot data structure that stores motion prohibition flags.
[0027] For example, if the motion prohibition flag is invalid (i.e. no prohibition condition is triggered), the safety pre-check is considered to have passed; otherwise, it is determined that there is a safety risk and subsequent motion commands are prohibited.
[0028] In one example, to prevent overtravel impacts or mechanical damage to the rack due to improper target position settings, a target angle verification step is introduced before writing the target rack angle to the field programmable logic controller (PLC). This verification step serves as a necessary safety gate before issuing motion commands, improving the operational safety of the target rack angle.
[0029] The target angle verification steps include: Verify whether the target rack angle exceeds the preset software operating limit range.
[0030] Specifically, the target rack angle to be entered is compared with the preset software operating limit range. This software operating limit range is a threshold range preset based on the rack's mechanical design limits and safety margins. If the target rack angle exceeds this range, it is determined to be an illegal target.
[0031] If the target angle exceeds the range or the target angle exceeds the range and the discrete value is valid, then the position start pulse should not be applied.
[0032] Specifically, the target angle out-of-range discrete value is read (this discrete value is usually used to characterize the degree or direction of the target angle deviating from the safe zone). If the target frame angle is out of range, or the target angle out-of-range discrete value is in a valid state (i.e., indicating that there is an out-of-limit risk), the safety protection mechanism is triggered.
[0033] When any of the above conditions are met (i.e., the target angle exceeds the limit or the discrete value is valid), the application of a position start pulse to the PLC will be prohibited. At this time, the PLC will not receive any trigger signal to enable movement, thereby ensuring that the frame will never perform physical rotation if the target angle verification fails, effectively avoiding the risk of mechanical overrun caused by misoperation or program abnormality.
[0034] By introducing dual judgment (range comparison + discrete quantity monitoring) in the verification stage, not only is a rigid constraint on the target angle achieved, but also a more granular safety early warning capability is provided through discrete quantity signals, laying a reliable foundation for subsequent safe angle determination and motion execution.
[0035] S102. If the security snapshot meets the preset motion prohibition conditions, refuse to execute the motion and output the reason for prohibition.
[0036] For example, this step may specifically include: Parse the motion prohibition flag in the security snapshot data structure.
[0037] Specifically, the motion prohibition flag in the security snapshot data structure is read and parsed. If the flag is set (e.g., a logical value of "1" or "True"), it indicates that there is at least one security conflict in the current system, triggering the motion prohibition logic.
[0038] If the motion prohibition flag is set, iterate through each status field in the security snapshot data structure, identify and record the specific abnormal field that triggered the prohibition state.
[0039] Specifically, after confirming the location of the prohibition sign, the system iterates through each status field in the safety snapshot data structure (such as emergency stop status, safety circuit status, air pressure status, mechanical limit status, absolute angle feedback, etc. mentioned earlier). By comparing the current value of each field with the preset prohibition threshold or status, the system identifies and records the specific abnormal field that triggered the prohibition status. For example, if the emergency stop status field shows as valid, or the air pressure status field shows as below the safety lower limit, then that field will be marked as an abnormal source.
[0040] The output includes identification information containing specific exception fields as the reason for prohibition.
[0041] Specifically, the identification information (such as field name, error code, status value, etc.) containing specific abnormal fields is packaged and output as the reason for the prohibition. This output can be recorded in a log file, displayed as a pop-up message on the interface, or sent as status feedback to the upper-level control module (such as TCS), so that operators or maintenance personnel can quickly know the root cause of the movement prohibition, thereby carrying out targeted troubleshooting and reducing the secondary risks caused by blind resets or repeated attempts.
[0042] In some examples, the logic for determining motion prohibition conditions includes: Perform bitwise or logical operations on each field in the security snapshot data structure to generate aggregated motion prohibition flags; If the emergency stop status field indicates that any emergency stop circuit is disconnected, or the safety circuit status field indicates that the safety relay is not ready, or the air pressure status field indicates that the air pressure is abnormal, then the motion prohibition flag will be set directly.
[0043] That is, if the emergency stop status field in the safety snapshot indicates that any emergency stop circuit is disconnected, or the safety circuit status field indicates that the safety relay is not ready, or the air pressure status field indicates that the air pressure is abnormal, the system determines that there is an insurmountable safety risk and directly sets the motion prohibition flag.
[0044] in: An emergency stop circuit disconnection indicates that the operator has triggered the emergency stop button or that an external emergency stop device has been activated, and the system must immediately stop all movement. A safety relay not being ready indicates that the safety chain is not closed and the control loop has not been authorized for safety. Abnormal air pressure usually refers to the air pressure in the drive system or braking system being lower than the safety threshold, which may lead to mechanical loss of control.
[0045] If any of the above conditions are met, it is considered a hard prohibition, and no further positional logic judgment is required.
[0046] Furthermore, in another example, the logic for determining the motion prohibition condition also includes: Extract the absolute angle feedback value from the safety snapshot and calculate the difference between the current angle and the target rack angle; If the current angle or target rack angle exceeds the preset software working limit range, or if the difference indicates that the rack needs to be rotated in the opposite direction at a large angle without going through the zero-finding process, then the motion prohibition flag is set.
[0047] That is, if the basic safety loop is normal, the system will further extract the absolute angle feedback value from the safety snapshot and calculate the difference between the current angle and the target rack angle (i.e., the angle deviation). If the current angle or target rack angle exceeds the preset software working limit range, or if the difference indicates that the rack needs to be rotated in the opposite direction at a large angle without going through the zero-finding process, then the motion prohibition flag will also be set.
[0048] in: Exceeding the software's operating limits is to prevent the rack from operating beyond its physical limits and to protect the mechanical structure from impacts. Large-angle reverse rotation without a zero-finding process refers to a situation where, in a rotating frame, if a zero-finding operation is not performed, the absolute angle encoder may experience power-off drift or loss of multi-turn counts. In this case, directly performing large-angle reverse movement can easily lead to loss of position control or mechanical collision. Therefore, the system mandates that such movements be prohibited until zero-finding is completed.
[0049] Through the aforementioned dual-judgment logic, this solution not only ensures the basic physical safety of the equipment but also strengthens the logical constraints on complex motion trajectories, thereby improving the accuracy of risk identification in various abnormal scenarios.
[0050] S104. If the safety snapshot does not trigger the motion prohibition condition, write the target rack angle and speed setting to the field programmable logic controller and apply a rising edge pulse to the position start coil.
[0051] For example, this step may specifically include: Based on the absolute angle feedback in the security snapshot, the legality of the target rack angle is verified, confirming that the target rack angle does not exceed the software limit range.
[0052] Specifically, based on the absolute angle feedback value in the security snapshot, the legality of the target rack angle to be written is verified. This step aims to confirm that the target rack angle does not exceed the preset software limit range. Although step S101 has already made a preliminary judgment, confirming it again before the instruction is officially issued can effectively reduce the risk of exceeding the limit due to communication delays or sudden changes in state.
[0053] After confirming its legitimacy, the system sends the target rack angle and speed command to the field programmable logic controller.
[0054] Specifically, after confirming the target angle is valid, the target frame angle and speed command are sent to the field programmable logic controller (PLC) via a preset communication protocol (such as Modbus TCP). The target frame angle serves as the setpoint for the position loop, indicating the final angular position the frame needs to reach; the speed setpoint serves as the setpoint for the speed loop, limiting the maximum rotational speed of the frame during movement to ensure smooth movement within a safe speed range.
[0055] Generate and output a rising edge pulse signal of the position start coil with a preset pulse width to trigger the rack motor to enter the running state.
[0056] Specifically, the pulse signal acts on the PLC's input point to trigger the PLC's internal motion control logic, causing the frame motor to switch from a stationary state to a running state. Using a rising edge pulse instead of a continuous level effectively prevents repeated starts or unexpected actions caused by signal sticking or false triggering, improving the system's anti-interference capability and operational reliability.
[0057] S106. Determine whether the rack is in place based on the hybrid safety fixed angle determination logic.
[0058] Specifically, the hybrid safety angle determination logic is configured as follows: starting from the effective time of the position start pulse, monitor the discrete quantity of the position mode operation within a predetermined grace period; if the discrete quantity is set and then cleared and the absolute angle feedback enters the target tolerance range, then the angle determination is determined to be in place; if the discrete quantity is not set within the grace period, then the determination is downgraded to judging the angle determination based solely on continuous sampling of the absolute angle feedback.
[0059] For example, from the moment the position start pulse takes effect (i.e., the instant the PLC receives the rising edge pulse and starts the motor), the system initiates a predefined monitoring window. The duration of this window is a predetermined grace period (e.g., 500ms or dynamically adjusted according to mechanical inertia and control cycle). Within the predetermined grace period, the system continuously monitors the discrete values during position mode operation (these discrete values are usually output by the PLC in position control mode, indicating whether the system is still in a dynamic adjustment process, such as: the absolute value of the position error is greater than a certain threshold, or the speed is not zero). If the discrete value was set and then cleared, it indicates that the frame was in an unsteady state during movement (e.g., acceleration, deceleration, overshoot), but subsequently entered a stable state; and the absolute angle feedback is within the target tolerance range: that is, the absolute value of the difference between the current absolute angle and the target frame angle is less than the preset tolerance value (e.g., ±0.1°), then it is determined that the frame has reached the set angle.
[0060] If the discrete value remains unset within the grace period, it indicates that the frame may not have undergone significant dynamic adjustment (e.g., the target angle is very close to the current angle, or the motor fails to start / does not actually rotate). In this case, the system degrades to determining the fixed angle position solely based on continuous sampling of the absolute angle feedback. That is, if the absolute angle feedback remains stable within the target tolerance range for N consecutive control cycles (e.g., 3 cycles), it is still determined to be in position, avoiding misjudgments or deadlocks caused by the lack of dynamic discrete values.
[0061] This example introduces a hybrid safety fixed angle determination logic after successfully triggering the rack motor to enter the running state. By integrating dynamic discrete quantities and absolute angle feedback during operation, the reliability of positioning confirmation is improved.
[0062] S108. After the rack is in place, a standardized rack common interlock signal set is output to the treatment control layer, and the rack is controlled to enter a stable standby state so that the treatment control layer can calculate the proton beam exit permission based on the interlock signal set.
[0063] Specifically, the common interlock signal set contains a series of Boolean status flags to characterize the current rack operating status (such as "angle in place", "operating normally", "safety loop closed", "emergency stop not triggered", etc.). The TCS performs logical operations based on this interlock signal set and ultimately decides whether to grant proton beam exit permission to improve treatment safety.
[0064] Furthermore, among other feasible solutions, the method also includes an emergency stop lane restoration step, including: Identify the specific channel that triggers the emergency stop, and wait for the corresponding emergency stop discrete quantity to change from valid to invalid.
[0065] Specifically, channels can include, but are not limited to, physical emergency stop buttons (such as those on the control panel, rack body, or shielded door); external safety interfaces (such as interlock door switches or radiation monitor triggers); and internal safety circuits (such as safety relay malfunctions or excessive air pressure). Unique identifiers for each channel (such as channel number, I / O address, or logical tag) can be recorded in an internal cache for subsequent targeted monitoring.
[0066] After identifying a specific channel, continuously poll or interrupt monitoring the corresponding emergency stop discrete quantity (usually a digital input signal, such as a PLC input point) to see if it changes from valid to invalid. A valid state indicates that the channel is currently in a triggered state (e.g., button pressed, loop open, signal high level "1"); an invalid state indicates that the channel has returned to a normal untriggered state (e.g., button released, loop closed, signal low level "0").
[0067] Confirm that all discrete values for all other emergency stop channels are invalid.
[0068] Based on a predefined list of safety channels (e.g., channels 1 to N), exclude the specific channel that has been identified and restored, and check all remaining channels one by one. For each non-triggered channel, read its corresponding emergency stop discrete input value (usually a PLC digital input point) and determine if it is currently in an invalid state (i.e., not triggered, no alarm, signal is low level "0" or logic "false"). The discrete values of all other emergency stop channels must be invalid simultaneously. Only when all channels meet this condition is the next step allowed. If any other channel is still in an "valid" state, the safety will remain locked, and an alarm may be triggered to prevent forced restoration while some safety circuits are still abnormal.
[0069] A predetermined pulse sequence is sent to the fault reset coil, and a pre-motion safety check is re-executed after a delay.
[0070] Specifically, after confirming that all emergency stop channels have been restored to an invalid state, a control signal is output to the PLC (Programmable Logic Controller) to drive the fault reset coil. The predetermined pulse sequence is a pulse signal with specific parameters, typically containing a specific pulse width (e.g., 100ms high level + 50ms low level alternation) or frequency, serving as a standard reset handshake signal in the safety logic. After sending the reset pulse, the system does not immediately enter the running state; instead, a delay period (e.g., 500ms) is introduced. This delay aims to establish a stable level for the fault reset circuit, allow the PLC's internal logic to complete the clearing operation, avoid transient interference, and further provide sufficient time for state synchronization between the upper control system (PGM) and the lower-level hardware (PLC, driver). After the delay, the pre-motion safety pre-check (i.e., the aforementioned step S101 and its included software limit, state verification, interlock detection, and other safety checks) is re-executed. Its purpose is to ensure that after the reset operation, the system's hardware and software environment still meets the prerequisites for safe operation, preventing safety conditions from failing due to accidents during the reset process.
[0071] Furthermore, Figure 2 This is a structural block diagram of a motion control system for a proton therapy rotating gantry, as described in the embodiment of the application. Figure 2 As shown, the system includes: The safety snapshot generation module is used to perform a pre-motion safety check on the field programmable logic controller in response to the acquired rack movement intention, collect multiple discrete input quantities and absolute angle feedback in the input register, and generate a safety snapshot. The safety snapshot is represented in the form of a predefined data structure. The motion rejection module is used to refuse to execute motion and output the reason for the rejection if the security snapshot meets the preset motion prohibition conditions. The data writing module is used to write the target rack angle and velocity setpoint to the field programmable logic controller when the motion prohibition condition is not triggered in the safety snapshot, and to apply a rising edge pulse to the position start coil; The positioning determination module is used to determine whether the rack is in position based on the hybrid safety angle determination logic. The hybrid safety angle determination logic is configured as follows: from the moment the position start pulse takes effect, monitor the discrete quantity of the position mode operation within a predetermined grace period; if the discrete quantity is set and then cleared and the absolute angle feedback enters the target tolerance range, then the angle determination is made. If the discrete quantity is not set within the grace period, then the determination is downgraded to judging the angle determination based solely on continuous sampling of the absolute angle feedback. The standby control module is used to output a standardized set of rack common interlock signals to the treatment control layer and control the rack to enter a standby state so that the treatment control layer can calculate the proton beam exit permission based on the set of interlock signals.
[0072] The application of the relevant modules of the system in this example can be found in the above introduction to the principles of the method, and will not be repeated here.
[0073] above Figure 2 The motion control system of a proton therapy rotating gantry in this embodiment of the invention is described in detail from the perspective of modular functional entities. The electronic equipment in this embodiment of the invention is described in detail from the perspective of hardware processing.
[0074] Figure 3 This is a schematic diagram of the structure of an electronic device 300 provided in an embodiment of the present invention. The electronic device 300 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 310 (e.g., one or more processors) and a memory 320, and one or more storage media 330 (e.g., one or more mass storage devices) for storing application programs 333 or data 332. The memory 320 and storage media 330 can be temporary or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the electronic device 300. Furthermore, the processor 310 may be configured to communicate with the storage media 330 and execute the series of instruction operations in the storage media 330 on the electronic device 300.
[0075] Electronic device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input / output interfaces 360, and / or one or more operating systems 331, such as Windows Server, MacOSX, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 3 The illustrated electronic device structure does not constitute a limitation on electronic devices and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0076] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of any of the above-described proton therapy rotating gantry motion control methods.
[0077] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0078] If the integrated unit is implemented as 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 this invention, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0079] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for motion control of a proton therapy rotating gantry, characterized in that, The method includes: In response to the acquired rack movement intention, a pre-movement safety check is performed on the field programmable logic controller, and multiple discrete input quantities and absolute angle feedback in the input registers are collected to generate a safety snapshot, which is represented in the form of a predefined data structure. If the security snapshot meets the preset motion prohibition conditions, the motion is refused and the reason for prohibition is output. If the safety snapshot does not trigger the motion prohibition condition, the target rack angle and velocity are written to the field programmable logic controller, and a rising edge pulse is applied to the position start coil; The system determines whether the rack is in position based on a hybrid safety angle determination logic. The hybrid safety angle determination logic is configured to: monitor the discrete quantity of the position mode operation within a predetermined grace period from the effective time of the position start pulse; if the discrete quantity is set and then cleared and the absolute angle feedback enters the target tolerance range, then the rack is determined to be in position; if the discrete quantity is not set within the predetermined grace period, then the system is downgraded to determining the rack is in position based solely on continuous sampling of the absolute angle feedback. Once the rack is in place, a standardized set of rack common interlock signals is output to the treatment control layer, and the rack is controlled to enter a stable standby state, so that the treatment control layer can calculate the proton beam exit permission based on the set of interlock signals.
2. The motion control method for a proton therapy rotating gantry according to claim 1, characterized in that, The process of responding to the acquired rack movement intention by performing a pre-movement safety check on the field-programmable logic controller (FPGA), collecting multiple discrete input quantities and absolute angle feedback from input registers, and generating a safety snapshot includes: Within a single control cycle, multi-source heterogeneous data covering emergency stop status, safety circuit status, air pressure status, mechanical limit status, and absolute angle feedback are collected simultaneously. A security snapshot data structure is predefined, the security snapshot data structure containing a status field that corresponds one-to-one with each of the multi-source heterogeneous data; The multi-source heterogeneous data is mapped to the corresponding fields of the security snapshot data structure, and logical operations are performed on the status field to generate an aggregated motion prohibition flag, which is then stored in the security snapshot data structure. The security snapshot is characterized by a security snapshot data structure that stores a motion prohibition flag.
3. The motion control method for a proton therapy rotating gantry according to claim 1, characterized in that, If the security snapshot meets the preset motion prohibition conditions, the motion will be refused and the reason for prohibition will be output, including: Parse the motion prohibition flag in the security snapshot data structure; If the motion prohibition flag is set, traverse each state field in the security snapshot data structure to identify and record the specific abnormal field that triggered the prohibition state. Output identification information containing the specific exception field as the reason for prohibition.
4. The motion control method for a proton therapy rotating gantry according to claim 1, characterized in that, The logic for determining the motion prohibition condition includes: Perform bitwise or logical operations on each field in the security snapshot data structure to generate aggregated motion prohibition flag bits; If the emergency stop status field indicates that any emergency stop circuit is disconnected, or the safety circuit status field indicates that the safety relay is not ready, or the air pressure status field indicates that the air pressure is abnormal, then the motion prohibition flag is set directly. or, Extract the absolute angle feedback value from the safety snapshot and calculate the difference between the current angle and the target rack angle; If the current angle or the target rack angle exceeds the preset software working limit range, or if the difference indicates that the rack needs to be rotated in the opposite direction at a large angle without going through the zero-finding process, then the motion prohibition flag is set.
5. The motion control method for a proton therapy rotating gantry according to claim 1, characterized in that, If the safety snapshot does not trigger the motion prohibition condition, writing the target rack angle and velocity to the field programmable logic controller and applying a rising edge pulse to the position start coil includes: Based on the absolute angle feedback in the security snapshot, the legality of the target rack angle is verified, and it is confirmed that the target rack angle does not exceed the software limit range; After confirming its legitimacy, the target rack angle and speed command is sent to the field programmable logic controller. Generate and output a rising edge pulse signal of the position start coil with a preset pulse width to trigger the rack motor to enter the running state.
6. The motion control method for a proton therapy rotating gantry according to claim 1, characterized in that, Before writing the target rack angle to the field-programmable logic controller, the method further includes a target angle verification step, comprising: Verify whether the target rack angle exceeds the preset software operating limit range; If the target angle out-of-range discrete value is read, and the target frame angle is out of range or the target angle out-of-range discrete value is valid, then the position start pulse is prohibited from being applied.
7. The motion control method for a proton therapy rotating gantry according to claim 1, characterized in that, The method also includes an emergency stop channel recovery step, including: Identify the specific channel that triggers the emergency stop, and wait for the emergency stop discrete quantity corresponding to that channel to change from valid to invalid; Confirm that all discrete values for all other emergency stop channels are invalid; A predetermined pulse sequence is sent to the fault reset coil, and the pre-motion safety check is re-executed after a delay.
8. A motion control system for a proton therapy rotating gantry, characterized in that, The system includes: The safety snapshot generation module is used to perform a pre-motion safety check on the field programmable logic controller in response to the acquired rack movement intention, collect multiple discrete input quantities and absolute angle feedback in the input register, and generate a safety snapshot, which is represented in the form of a predefined data structure. The motion rejection module is used to refuse to execute motion and output the reason for rejection when the security snapshot meets the preset motion prohibition conditions. The data writing module is used to write the target rack angle and velocity setpoint to the field programmable logic controller when the motion prohibition condition is not triggered in the safety snapshot, and to apply a rising edge pulse to the position start coil; The positioning determination module is used to determine whether the rack is in position based on a hybrid safety angle determination logic. The hybrid safety angle determination logic is configured to: monitor the discrete quantity of the position mode operation within a predetermined grace period from the effective time of the position start pulse; if the discrete quantity is set and then cleared and the absolute angle feedback enters the target tolerance range, then the angle determination is made; if the discrete quantity is not set within the predetermined grace period, then the determination is downgraded to judging the angle determination based solely on continuous sampling of the absolute angle feedback. The standby control module is used to output a standardized set of rack common interlock signals to the treatment control layer after the rack is in place, and control the rack to enter a standby state so that the treatment control layer can calculate the proton beam exit permission based on the set of interlock signals.
9. An electronic device, characterized in that, The electronic device includes a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to perform the various steps of the proton therapy rotating gantry motion control method as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the various steps of the motion control method for a proton therapy rotating gantry as described in any one of claims 1-7.