An FPGA-based X-ray energy control method and system

By using an FPGA-based X-ray energy control method, the target tube current value is calculated and output in real time using the parallel processing capability of the FPGA. This solves the real-time and accuracy problems of tube current control in the prior art, and realizes stable image quality and optimized radiation dose during CT scanning.

CN122340688APending Publication Date: 2026-07-03SAINUO WEISHENG SCI & TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610336302.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-19
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing X-ray CT systems, tube current control technology is difficult to achieve real-time response and accurate calculation, resulting in unstable image quality and inaccurate radiation dose control, especially in complex scanning scenarios under high-speed rotating CT gantry.

Method used

An FPGA-based X-ray energy control method is adopted. By configuring scanning parameters, the scanning angle and position are obtained in real time. Utilizing the parallel processing capability of the FPGA, multiple tube current calculation strategies are selected to calculate the target tube current value and output it to the X-ray tube control system, achieving millisecond-level response and precise control.

Benefits of technology

It achieves image quality stability and radiation dose optimization during CT scanning, ensures consistent X-ray intensity received by the detector, and meets the real-time and control precision requirements of high-speed CT scanning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122340688A_ABST
    Figure CN122340688A_ABST
Patent Text Reader

Abstract

The application discloses an X-ray energy control method and system based on FPGA, and the method comprises the following steps: configuring scanning parameters, wherein the scanning parameters at least comprise a tube current control mode; acquiring real-time scanning parameters, wherein the real-time scanning parameters at least comprise a current scanning angle and a current scanning position; determining a target calculation strategy from a plurality of preset tube current calculation strategies according to the tube current control mode; calculating a target tube current value through FPGA logic operation based on the scanning parameters, the real-time scanning parameters and the target calculation strategy; and outputting the target tube current value to an X-ray tube control system to adjust the tube current of the X-ray tube. The flexible switching and millisecond-level real-time response of a plurality of control algorithms are realized, so that the radiation dose is effectively optimized while the stability of image quality is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical imaging equipment technology, and in particular to an FPGA-based X-ray energy control method and system. Background Technology

[0002] In X-ray computed tomography (CT) systems, tube current control of the X-ray tube is a crucial factor determining image quality and radiation dose optimization. Existing tube current control technologies typically rely on software programs, often employing fixed-value settings or simple linear adjustment strategies, which are ill-suited to the demands of complex scanning scenarios. Due to the inherent serial execution characteristics and high computational latency of software processing, current technologies cannot provide millisecond-level rapid responses and accurate calculations based on real-time changes in the scanning angle and the geometry of the scanned object when facing a high-speed rotating CT gantry. Furthermore, existing control schemes often support only a single control algorithm, lacking the ability to flexibly switch calculation strategies based on different scanning modes such as constant milliampere, angular models, or elliptical models. This results in lag or deviation in tube current adjustment when the X-ray penetration path length changes at different scanning positions and angles. This lack of real-time performance and the limitation of a single algorithm make it difficult to maintain consistent X-ray intensity received by the detector, thus affecting the stability of image quality and the precise control of radiation dose. Summary of the Invention

[0003] In view of this, the present invention proposes an FPGA-based X-ray energy control method and system, which can effectively optimize radiation dose while ensuring image quality stability. The present invention provides the following technical solution: An FPGA-based X-ray energy control method, characterized by comprising the following steps: Configure scanning parameters, which include at least the tube current control mode; Obtain real-time scanning parameters, which include at least the current scanning angle and the current scanning position; Based on the tube current control mode, a target calculation strategy is determined from a variety of preset tube current calculation strategies; Based on the scanning parameters, the real-time scanning parameters, and the target calculation strategy, the target tube current value is calculated through FPGA logic operations; The target tube current value is output to the X-ray tube control system to adjust the tube current of the X-ray tube.

[0004] Optionally, the tube current control mode includes constant milliampere mode, angle model mode, and elliptic model mode; The step of determining the target calculation strategy from a set of preset tube current calculation strategies according to the tube current control mode includes: When the tube current control mode is constant milliampere mode, the target calculation strategy is determined to be to directly call the base current value; When the tube current control mode is the angle model mode, the target calculation strategy is to obtain the gain coefficient by looking up a table based on the current scanning angle. When the tube current control mode is the elliptic model mode, the target calculation strategy is determined to be to calculate the equivalent path length and compensation coefficient based on the current scanning position and the current scanning angle.

[0005] Optionally, when the target calculation strategy is to obtain the gain coefficient by looking up a table based on the current scanning angle, the step of calculating the target transistor current value through FPGA logic operations includes: Convert the current scanning angle into an angle index value; The corresponding tube current gain coefficient is found in the preset angle parameter table based on the angle index value. The target tube current value is obtained by multiplying the configured base current value by the tube current gain coefficient.

[0006] Optionally, when the target calculation strategy is to calculate the equivalent path length and compensation coefficient based on the current scanning position and the current scanning angle, the scanning parameters also include an ellipse parameter table, which stores the major axis parameters and minor axis parameters of the ellipse corresponding to different scanning positions; The calculation of the target transistor current value through FPGA logic operations includes: Convert the current scan position into a position index value; The corresponding major and minor axis parameters of the ellipse are found in the ellipse parameter table based on the position index value.

[0007] Optionally, the calculation of the equivalent path length and compensation coefficient based on the current scanning position and current scanning angle further includes: The trigonometric function value corresponding to the current scanning angle is calculated using the CORDIC algorithm; Based on the major axis parameter of the ellipse, the minor axis parameter, and the trigonometric function values, calculate the equivalent path length of the X-ray in the elliptical section; Calculate the angle compensation coefficient based on the equivalent path length, the major axis parameter of the ellipse, and the minor axis parameter; The target tube current value is obtained by multiplying the configured base current value by the angle compensation coefficient.

[0008] Optionally, the formula for calculating the equivalent path length is: ,in, L Let be the equivalent path length of the X-ray in the elliptical cross section. a For the major axis parameter of the ellipse, b Here are the minor axis parameters of the ellipse.θ This is the current scanning angle.

[0009] Optionally, the formula for calculating the angle compensation coefficient is: ; The formula for calculating the target tube current value is: Where mA is the target tube current value. This is the base current value.

[0010] Optionally, before outputting the target tube current value to the X-ray tube control system, the method further includes: The calculated target tube current value is subjected to a rate-of-change limitation process. If the difference between the target tube current value and the previous output tube current value exceeds a preset threshold, the output tube current value is adjusted according to a preset rate of change to ensure smooth tube current changes.

[0011] This invention further discloses an FPGA-based X-ray energy control system, comprising: A parameter configuration module is used to configure scanning parameters, which include at least the tube current control mode. The parameter acquisition module is used to acquire real-time scanning parameters, which include at least the current scanning angle and the current scanning position. The strategy selection module is used to determine the target calculation strategy from a variety of preset tube current calculation strategies according to the tube current control mode. The current calculation module is used to calculate the target tube current value through FPGA logic operations based on the scanning parameters, the real-time scanning parameters, and the target calculation strategy. The control output module is used to output the target tube current value to the X-ray tube control system in order to adjust the tube current of the X-ray tube.

[0012] The present invention further discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.

[0013] According to the technical solution of the present invention, by configuring scanning parameters including tube current control mode and acquiring the current scanning angle and position in real time, the target strategy is determined from a variety of preset tube current calculation strategies based on the control mode using FPGA logic operations, and the target tube current value is calculated and output to the X-ray tube control system. Since the FPGA hardware architecture is used to realize the parallel processing and fast switching of multiple algorithms, not only is a millisecond-level real-time response achieved to meet the timeliness requirements of high-speed CT scanning, but also the tube current under different scanning positions can be accurately calculated based on the elliptical geometric model and angle compensation. Thus, while ensuring the consistency of the radiation intensity received by the detector and the stability of image quality, the radiation dose is dynamically adjusted according to the actual thickness of the scanned object, effectively solving the technical problems of single algorithm, insufficient real-time performance and low control accuracy in the prior art. Attached Figure Description

[0014] For illustrative and not limiting purposes, the present invention will now be described in conjunction with embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart illustrating the FPGA-based X-ray energy control method in an embodiment of the present invention. Figure 2 This is a schematic diagram of the constituent modules of the FPGA-based X-ray energy control system in an embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of the electronic device in an embodiment of the present invention; Figure 4 This is a schematic diagram of the angle model in an embodiment of the present invention; Figure 5 This is a schematic diagram of an elliptical model in an embodiment of the present invention. Detailed Implementation

[0015] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.

[0016] It should be noted that, where there is no conflict, the embodiments and features of the embodiments in this application can be combined with each other. The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0017] refer to Figure 1This embodiment discloses an FPGA-based X-ray energy control method, which is mainly applied in the field of medical imaging equipment technology, and is particularly suitable for real-time and precise control of X-ray tube current (mA) during CT scanning. The method is implemented through FPGA hardware logic, utilizing its parallel computing capabilities and pipelined architecture to meet the real-time requirements of high-speed CT scanning. The method includes the following steps: S100: Configure scanning parameters, which include at least the tube current control mode.

[0018] Specifically, this step is performed before the CT scan begins or when the scan protocol is switched, by writing the preset scan parameters into the FPGA's internal registers or storage units through an external controller.

[0019] The scanning parameters specifically include voltage (kV), current (mA), mode, angle parameter table (theta_table), and ellipse parameter table (ab_table). The specific definitions and configuration methods for each parameter are as follows: Voltage (kV): The tube voltage of the X-ray tube, measured in kilovolts. This parameter is used to determine the basic energy level of the X-rays.

[0020] Current (mA): The base tube current for configuring the X-ray tube, measured in milliamperes. In this embodiment, this parameter serves as the baseline value for subsequent algorithm calculations (i.e., the base current value scan_mabase in the claims).

[0021] Mode: Configures the transistor current control mode, used to instruct the FPGA which algorithm strategy to select for transistor current calculation. In this embodiment, the transistor current control mode includes three types: Constant milliampere mode (MODE_CONSTANT): corresponds to mode value 0 (or 2'b00). In this mode, the system directly uses the configured base current value as the target tube current without angle or geometric compensation.

[0022] Angle Model Mode (MODE_ANGLE): Corresponds to mode value 1 (or 2'b01). In this mode, the system will look up the gain coefficient in a table based on the current scanning angle and adjust the base current accordingly.

[0023] Elliptical Model Mode (MODE_ELLIPSE): Corresponds to mode value 2 (or 2'b10). In this mode, the system will calculate the equivalent path length and compensation coefficient based on the elliptical geometry of the scanned object and the scanning angle, and dynamically adjust the tube current.

[0024] Angle parameter table (theta_table): This parameter table is stored in the FPGA's storage resources (such as Block RAM) and is used for angle model mode. The table stores the angle values ​​corresponding to different scan positions and their corresponding tube current gain coefficients. In this embodiment, the gain coefficients are typically defined as values ​​such as 0.9, 1.0, or 1.1, and stored in a fixed-point format (such as Q8.8 format) to reduce hardware resource consumption and improve computation speed.

[0025] Ellipse parameter table (ab_table): This parameter table is stored in the FPGA's storage resources and is used for ellipse model mode. The table stores the major axis parameter (a) and minor axis parameter (b) of the ellipse corresponding to different scan positions. In this embodiment, the ellipse parameters are stored in a high-precision fixed-point number format (such as Q16.16 format) to ensure the accuracy of geometric calculations.

[0026] In addition to configuring the scanning parameters, real-time parameters are also initialized. These real-time parameters include the current angle, current bed position, set mA, and feedback mAresp. During initialization, the current angle, current bed position, set mA, and feedback mAresp are all set to 0. The unit for the current angle is degrees, and the unit for the current bed position is micrometers.

[0027] At the FPGA hardware implementation level, the configuration scan parameter step is completed through the FPGA's internal configuration interface. The external controller writes the aforementioned parameters into the FPGA's internal configuration register via a bus interface. Upon receiving the configuration completion signal, the FPGA logic loads the transistor current control mode into the state machine control unit and loads the angle parameter table and ellipse parameter table into the corresponding lookup table storage units, preparing for subsequent real-time calculations.

[0028] Through the above configuration steps, the present invention realizes a unified management mechanism for scanning parameters, solves the problem of complex parameter management in the prior art, and lays the foundation for selecting the most suitable algorithm according to different scanning scenarios.

[0029] S200: Obtain real-time scanning parameters, which include at least the current scanning angle and the current scanning position.

[0030] Specifically, this step continues to be executed after the scanning parameters are configured, as the CT gantry rotates and the scanning bed moves. The FPGA acquires signals from the CT system's motion control unit or sensors in real time through a hardware interface and converts them into a data format that can be processed by the internal logic.

[0031] The specific methods for obtaining and defining the real-time scanning parameters are as follows: Current scanning angle: This parameter represents the current rotation angle of the CT gantry. In this embodiment, the current scanning angle is acquired in real time by a gantry angle encoder, and the unit is degrees (°). To enable efficient computation within the FPGA, the current scanning angle is stored and transmitted in a fixed-point format. Specifically, the Q8.8 fixed-point format is used, meaning the total data width is 16 bits, where the high 8 bits represent the integer part and the low 8 bits represent the fractional part. For example, an angle value of 90.5 degrees is represented internally by the FPGA as the corresponding Q8.8 encoded value. The FPGA logic extracts the high 8 bits of this 16-bit data to obtain the integer part of the angle as the angle index value (angle_index) for subsequent table lookup or calculation, i.e., indexing and positioning with 1 degree as the smallest unit.

[0032] Current scan location: This parameter represents the current axial position of the scanning bed, i.e., the current table position. In this embodiment, the current scanning position is acquired in real time by the scanning bed position sensor, and the unit is micrometers (μm). The current scanning position is stored and transmitted in 32-bit integer format. To match the index precision of the elliptic parameter table, the FPGA logic divides the current scanning position by 1000 after obtaining it to convert it into a position index value (table_index). This means that the position index uses millimeters (mm) as the smallest unit; that is, the position index increases by 1 for every 1000 micrometers of movement. This index value is used to look up the corresponding elliptic geometric parameters in the elliptic parameter table.

[0033] Other real-time parameters: In addition to the current scanning angle and current scanning position mentioned above, the real-time scanning parameters also include setting milliamperes (mA) and feedback milliamperes (mAresp). The setting milliampere is the tube current value required by the current command, measured in milliamperes; the feedback milliampere is the actual output tube current value fed back in real time from the X-ray tube high-voltage generator, also measured in milliamperes. The feedback milliampere is used for closed-loop monitoring and anomaly detection of the system, ensuring that the actual output matches the calculated target.

[0034] At the FPGA hardware implementation level, the real-time scanning parameter acquisition step is completed through the FPGA's input pins or a high-speed serial interface. The external motion controller synchronously sends the encoded angle and position data to the FPGA's `ma_algorithm` module. The FPGA's internal registers update the values ​​of the current scanning angle (`realtime_angle`) and current scanning position (`realtime_table`) in real time. Due to the parallel processing characteristics of the FPGA, this acquisition process has extremely low latency, ensuring that parameter acquisition and updating are completed within milliseconds, meeting the stringent real-time requirements of high-speed CT scanning.

[0035] Through the above acquisition steps, this implementation method achieves accurate capture of dynamically changing parameters during the scanning process, providing a reliable data foundation for subsequent selection of calculation strategies based on real-time status and accurate calculation of the target tube current value. Simultaneously, the unified data format definition simplifies the internal computational logic of the FPGA and improves the system's processing efficiency.

[0036] S300: Based on the tube current control mode, determine the target calculation strategy from a variety of preset tube current calculation strategies.

[0037] Specifically, this step is triggered each time the calculation enable signal (calc_en) is valid. The state machine control unit inside the FPGA decodes the scan mode signal and jumps to the corresponding algorithm execution state.

[0038] In this embodiment, the transistor current control mode is identified by a two-bit binary signal (scan_mode). Several preset transistor current calculation strategies include a constant milliampere calculation strategy, an angle model calculation strategy, and an elliptic model calculation strategy. The FPGA logic determines the target calculation strategy based on the specific value of the transistor current control mode as follows: Strategy determination in constant milliampere mode: When the tube current control mode is constant milliampere mode (e.g., mode value 0 or 2'b00), the FPGA logic determines the target calculation strategy as directly calling the base current value. Under this strategy, the system does not need to perform complex geometric compensation or table lookup operations, and directly uses the base current value (scan_mabase) configured in step S1 as the basis for calculating the target tube current. The state machine transitions from the idle state (IDLE) to the constant milliampere calculation state (CALC_CONSTANT).

[0039] Strategy determination under the angle model mode: When the tube current control mode is the angle model mode (e.g., mode value 1 or 2'b01), the FPGA logic determines the target calculation strategy as obtaining the gain coefficient based on a lookup table of the current scan angle. Under this strategy, the system needs to use the current scan angle obtained in step S2 to perform an index lookup in the angle parameter table. The state machine transitions from the idle state (IDLE) to the angle lookup table state (CALC_ANGLE_LOOKUP), and then enters the angle multiplication state (CALC_ANGLE_MULT).

[0040] Strategy determination under elliptic model mode: When the tube current control mode is the elliptic model mode (e.g., mode value 2 or 2'b10), the FPGA logic determines the target calculation strategy as calculating the equivalent path length and compensation coefficient based on the current scan position and current scan angle. Under this strategy, the system needs to comprehensively utilize the current scan angle and current scan position obtained in step S2, combined with the elliptic parameter table, to perform geometric calculations. The state machine transitions from the idle state (IDLE) to the elliptic lookup state (CALC_ELLIPSE_LOOKUP), and then sequentially enters the path calculation state (CALC_ELLIPSE_PATH), the compensation coefficient calculation state (CALC_ELLIPSE_RATIO), and the elliptic multiplication state (CALC_ELLIPSE_MULT).

[0041] Exception mode handling: If the value of the transistor current control mode is not within the preset range (e.g., mode value is 3 or 2'b11), the FPGA logic considers it an invalid mode. In this case, the state machine remains in the idle state (IDLE) or jumps to the error state, does not execute any transistor current calculation strategy, and sets the calculation error flag (calc_error) to prevent the system from outputting abnormal current values ​​due to incorrect mode configuration.

[0042] At the FPGA hardware implementation level, the process of determining the target computation strategy is completed collaboratively by combinational logic circuits and sequential logic circuits. The scan mode signal (scan_mode), as the core input condition of the state machine, directly determines the transition direction of the next state (next_state). Due to the parallel processing characteristics of the FPGA, mode decoding and state transition can be completed within one clock cycle, ensuring the real-time performance of strategy determination.

[0043] Through the above steps, this implementation achieves the function of flexibly selecting the control algorithm according to the scanning scenario. When the scanned object has a regular geometry and does not require angle compensation, the constant milliampere mode can be selected to reduce computational resource consumption; when dose optimization is required for a specific angle, the angle model mode can be selected; when the scanned object exhibits elliptical geometry and requires high-precision dose control, the elliptical model mode can be selected. This multi-strategy determination mechanism effectively solves the problem of algorithm monotony in existing technologies and improves the system's adaptability and control accuracy.

[0044] S400: Based on the scanning parameters, the real-time scanning parameters, and the target calculation strategy, the target tube current value is calculated through FPGA logic operations.

[0045] refer to Figure 4 and Figure 5Based on the target calculation strategy determined in step S300, and combined with the scanning parameters configured in step S100 and the real-time scanning parameters obtained in step S200, specific arithmetic operations are performed to calculate the target tube current value. Due to the advantages of FPGA's parallel processing and pipelined architecture, the logical operations in this step can be completed within milliseconds, ensuring that the real-time requirements of CT scanning are met. Depending on the target calculation strategy, this step is specifically divided into the following three implementation scenarios: 1. Calculation Implementation in Constant Milliampere Mode When the target calculation strategy is to directly call the base current value, the FPGA logic is in a constant mA calculation state. In this state, the base current value (scan_mabase) configured in step S100 is directly assigned to the target transistor current register (calc_ma). This process does not involve complex arithmetic operations, but is implemented only through register transfer, thus minimizing time consumption. The calculation formula is as follows: mA = mA base Where mA is the target transistor current value, mA base The base current value configured.

[0046] 2. Calculation Implementation under Angle Model Mode When the target calculation strategy is to obtain the gain coefficient based on a lookup table of the current scanning angle, the FPGA logic sequentially enters the angle lookup table state and the angle multiplication state. The specific calculation process is as follows: First, the angle index is calculated. Since the current scanning angle (realtime_angle) obtained in step S200 is stored in Q8.8 fixed-point format, the FPGA logic extracts the high 8 bits of this data as the integer part to obtain the angle index value (angle_index). That is, with 1 degree as the smallest unit, the formula is: , where angle is the current scanning angle.

[0047] Next, a gain coefficient lookup is performed. The FPGA logic uses the angle index value as the address to look up the corresponding tube current gain coefficient (theta_gain) in the angle parameter table (theta_table) stored in BlockRAM. The angle parameter table contains 360 cells, corresponding to 0 to 359 degrees, and the gain coefficients are stored in Q8.8 fixed-point format.

[0048] Finally, the transistor current is calculated. The FPGA logic multiplies the configured base current value by the transistor current gain coefficient. Since both are in fixed-point format (base current is an integer, gain coefficient is Q8.8), the result needs to be right-shifted by 8 bits after the multiplication to restore the correct magnitude. The calculation formula is as follows: Where gain is the tube current gain coefficient obtained from the lookup table, and ≫8 indicates a right shift operation of 8 bits.

[0049] 3. Calculation Implementation under Elliptic Model Mode When the target calculation strategy is to calculate the equivalent path length and compensation coefficient based on the current scan position and current scan angle, the FPGA logic sequentially enters the elliptic lookup table state, path calculation state, compensation coefficient calculation state, and elliptic multiplication state. The specific calculation process is as follows: First, the position index is calculated and parameters are looked up. The FPGA logic divides the current scan position (realtime_table, in micrometers) obtained in step S2 by 1000 to obtain the position index value (table_index), which is in millimeters as the smallest index unit. The formula is: Subsequently, the FPGA logic uses the location index value as the address to look up the corresponding major axis parameter (aa) and minor axis parameter (bb) of the ellipse in the ellipse parameter table (ab_table). The ellipse parameters are stored in Q16.16 fixed-point format to ensure the accuracy of geometric calculations.

[0050] Next, trigonometric function calculations are performed. The CORDIC algorithm module instantiated inside the FPGA starts up, converting the current scanning angle into radians ( ), and calculate the corresponding sine value ( ) and cosine value ( The angle conversion formula is: .

[0051] Next, the equivalent path length is calculated. Based on the major axis parameter, minor axis parameter, and trigonometric function values ​​output by the CORDIC module, the FPGA logic calculates the equivalent path length (L) of the X-ray in the elliptical section. In this embodiment, the formula for calculating the equivalent path length is: Where L is the equivalent path length. a For the major axis parameter of the ellipse, b Here are the minor axis parameters of the ellipse. θ This is the current scanning angle.

[0052] Next, the angle compensation coefficient is calculated. The FPGA logic calculates the angle compensation coefficient (ratio) based on the equivalent path length, the major axis parameter of the ellipse, and the minor axis parameter. The calculation formula is: .

[0053] Finally, the target transistor current value is calculated. The FPGA logic multiplies the configured base current value by the angle compensation coefficient to obtain the final target transistor current value. The calculation formula is: In actual hardware operations, if the ratio is in Q16.16 format, the multiplication result needs to be truncated to the high 16 bits or subjected to corresponding shifting to obtain an integer milliampere value.

[0054] 4. FPGA Hardware Operation Details During the above calculations, the FPGA logic is scheduled through an internal state machine. The state machine includes an idle state, a parameter lookup state, an operation state, and an output state. In different states, the FPGA's internal arithmetic logic units (ALUs), multipliers, dividers, and CORDIC modules are enabled in an orderly manner.

[0055] Furthermore, to ensure a balance between computational efficiency and resource consumption, a unified fixed-point arithmetic mechanism is employed in this step. Angle parameters and gain coefficients use a first fixed-point format (e.g., Q8.8), while ellipse parameters and path lengths use a second fixed-point format (e.g., Q16.16). During cross-format operations, the FPGA logic automatically performs bit-width expansion or shift alignment operations.

[0056] Through the above FPGA logic operations, the present invention can complete complex geometric model calculations within a single scan cycle, avoiding the computational delay in traditional software solutions and ensuring the real-time performance and accuracy of the target tube current value calculation.

[0057] S500: Outputs the target tube current value to the X-ray tube control system to adjust the tube current of the X-ray tube.

[0058] Specifically, this step is performed after the target tube current value has been calculated and verified to be valid, and the digital control signal is sent to the high voltage generator or X-ray tube control unit through the physical output pin or communication interface of the FPGA.

[0059] The specific implementation method for the output target tube current value is as follows: Data output interface: The target tube current value inside the FPGA is output via a parallel data bus or a high-speed serial communication interface. In this embodiment, the target tube current value is represented in 16-bit unsigned integer format, with the unit being milliamperes (mA). The FPGA's output port is electrically connected to the input port of the X-ray tube control system. When the FPGA's internal state machine transitions to the output state, it drives the target tube current value latched in the calculation register to the output pin.

[0060] Handshake signal control: To ensure reliable data transmission, the FPGA simultaneously outputs a calculation result valid signal (calc_valid). When the target tube current value is calculated and the data is stable, the FPGA sets the calculation result valid signal high, notifying the X-ray tube control system to read the target tube current value on the current data bus. After detecting the valid edge of the calculation result valid signal, the X-ray tube control system latches the target tube current value and uses it as the tube current setpoint for the current cycle. Subsequently, the FPGA resets the calculation result valid signal and waits for the enable signal for the next calculation cycle.

[0061] Tube current regulation execution: After receiving the target tube current value, the X-ray tube control system adjusts the filament heating voltage or grid control signal of the high-voltage generator to change the electron emission of the X-ray tube, thereby making the actual output tube current approximate the target tube current value. Due to the extremely low computational latency (milliseconds) of the FPGA, this adjustment process can closely follow the rotation angle of the CT gantry and the position changes of the scanning bed, achieving dynamic dose modulation.

[0062] Real-time feedback and closed-loop monitoring: While outputting the target tube current value, the system performs a real-time feedback step. The X-ray tube control system acquires the actual tube current value output by the X-ray tube and transmits this actual tube current value back to the FPGA via the feedback interface. The parameter acquisition module inside the FPGA reads the feedback milliampere value in real time and stores it in the real-time parameter register.

[0063] The feedback milliampere value is used for closed-loop monitoring and anomaly detection of the system. The FPGA logic compares the target transistor current value with the feedback milliampere value. If the difference between the two exceeds a preset error threshold, it is determined that the transistor current output is abnormal, triggering the error flag (calc_error) and stopping the output or switching to a safe mode. In addition, the feedback milliampere value can also serve as a reference for the calculation of the next cycle to achieve more accurate closed-loop control.

[0064] Rate of change limit: In another embodiment, to protect the X-ray tube from sudden current surges, a rate-of-change limiting process is applied to the calculated target tube current value before it is output to the X-ray tube control system. Specifically, the FPGA internally compares the currently calculated target tube current value with the previously output tube current value. If the difference exceeds a preset threshold, the final output tube current value is adjusted according to a preset rate-of-change slope to ensure smooth tube current changes. This processing step can be implemented by inserting a slope limiting state (RATE_LIMIT) before the output state of the state machine.

[0065] Through the above output steps, this invention realizes a complete control link from FPGA logic computation to physical actuators. Utilizing the high-speed I / O capabilities and deterministic timing characteristics of the FPGA ensures that control commands are accurately and timely delivered to the X-ray tube control system. Combined with a real-time feedback mechanism, this further improves system safety and control accuracy, ultimately achieving automatic adjustment and optimization of X-ray energy.

[0066] refer to Figure 2 This embodiment further discloses an FPGA-based X-ray energy control system, including: The parameter configuration module 21 is used to configure scanning parameters, which include at least the tube current control mode. Specifically, it includes a voltage configuration unit, a current configuration unit, a mode configuration unit, and a parameter table storage unit. The parameter table storage unit utilizes the FPGA's Block RAM resources to store angle parameter tables and elliptic parameter tables. This module is also responsible for transmitting the tube current control mode signal to the strategy selection module and transmitting the base current value to the current calculation module.

[0067] The parameter acquisition module 22 is used to acquire real-time scanning parameters, which include at least the current scanning angle and the current scanning position. It includes an angle acquisition unit and a position acquisition unit. The angle acquisition unit reads the current scanning angle through an encoder interface and converts it into a Q8.8 fixed-point format; the position acquisition unit reads the current scanning position through a sensor interface, in micrometers. The acquired real-time parameters are updated in real-time to the FPGA's internal registers and used as input signals for the current calculation module.

[0068] The strategy selection module 23 is used to determine the target calculation strategy from a variety of preset tube current calculation strategies based on the tube current control mode. A state machine control unit is provided, which decodes the input mode signal. When the mode is constant milliampere mode, the state machine jumps to the constant milliampere calculation state; when the mode is angle model mode, the state machine jumps to the angle lookup table state; when the mode is elliptical model mode, the state machine jumps to the elliptical path calculation state. This module is also responsible for generating a calculation enable signal to start the current calculation module.

[0069] The current calculation module 24 is used to calculate the target tube current value through FPGA logic operations based on the scanning parameters, the real-time scanning parameters, and the target calculation strategy. It includes an index calculation unit, a lookup table unit, a CORDIC calculation unit, and an arithmetic operation unit. In angle model mode, the index calculation unit converts angles into indices, the lookup table unit obtains the gain coefficient from the angle parameter table, and the arithmetic operation unit performs fixed-point multiplication. In elliptic model mode, the CORDIC calculation unit calculates trigonometric function values, and the arithmetic operation unit calculates the equivalent path length and angle compensation coefficient based on the ellipse's major and minor axes and the trigonometric function values. This module also includes a rate-of-change limiting unit to smooth the calculation results before output, ensuring that the tube current change rate does not exceed a preset threshold.

[0070] The control output module 25 is used to output the target tube current value to the X-ray tube control system to adjust the tube current of the X-ray tube. It includes a data latch unit and an interface driver unit. When the calculation result valid signal is valid, the data latch unit locks the target tube current value, and the interface driver unit sends this value to the high-voltage generator via a parallel bus or serial communication interface. In addition, this module also includes a feedback acquisition unit for receiving the actual tube current value fed back by the X-ray tube and transmitting it back to the parameter acquisition module to form a closed-loop monitoring system.

[0071] The modules described above are interconnected via the FPGA's internal bus structure, and data is transmitted in a pipelined manner under the synchronization of clock signals. Through hardware parallel processing, the system can complete the entire process from parameter acquisition to current output within milliseconds.

[0072] Figure 3 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 3 As shown, the electronic device 50 includes: a processor 501, a memory 502, and a bus 503; The processor 501 and the memory 502 communicate with each other via the bus 503; the processor 501 is used to call the program instructions in the memory 502 to execute the methods provided in the above-described embodiments.

[0073] This embodiment provides a non-transitory computer-readable storage medium that stores computer instructions that cause a computer to execute the methods provided in the above-described embodiments.

[0074] Those skilled in the art will understand that all or part of the steps of the above-described method implementation can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above-described method implementation. The aforementioned storage medium includes various storage media capable of storing program code, such as ROM, RAM, magnetic disk, or optical disk.

[0075] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0076] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.

[0077] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An FPGA-based X-ray energy control method, characterized by, Includes the following steps: Configure scanning parameters, which include at least the tube current control mode; Obtain real-time scanning parameters, which include at least the current scanning angle and the current scanning position; Based on the tube current control mode, a target calculation strategy is determined from a variety of preset tube current calculation strategies; Based on the scanning parameters, the real-time scanning parameters, and the target calculation strategy, the target tube current value is calculated through FPGA logic operations; The target tube current value is output to the X-ray tube control system to adjust the tube current of the X-ray tube.

2. The X-ray energy control method according to claim 1, wherein, The tube current control modes include constant milliampere mode, angle model mode, and elliptic model mode; The step of determining the target calculation strategy from a set of preset tube current calculation strategies according to the tube current control mode includes: When the tube current control mode is constant milliampere mode, the target calculation strategy is determined to be to directly call the base current value; When the tube current control mode is the angle model mode, the target calculation strategy is to obtain the gain coefficient by looking up a table based on the current scanning angle. When the tube current control mode is the elliptic model mode, the target calculation strategy is determined to be to calculate the equivalent path length and compensation coefficient based on the current scanning position and the current scanning angle.

3. The X-ray energy control method of claim 2, wherein, When the target calculation strategy is to obtain the gain coefficient by looking up a table based on the current scanning angle, the calculation of the target transistor current value through FPGA logic operations includes: Convert the current scanning angle into an angle index value; The corresponding tube current gain coefficient is found in the preset angle parameter table based on the angle index value. The target tube current value is obtained by multiplying the configured base current value by the tube current gain coefficient.

4. The X-ray energy control method of claim 2, wherein, When the target calculation strategy is to calculate the equivalent path length and compensation coefficient based on the current scanning position and the current scanning angle, the scanning parameters also include an ellipse parameter table, which stores the major axis parameters and minor axis parameters of the ellipse corresponding to different scanning positions. The calculation of the target transistor current value through FPGA logic operations includes: Convert the current scan position into a position index value; The corresponding major and minor axis parameters of the ellipse are found in the ellipse parameter table based on the position index value.

5. The X-ray energy control method according to claim 4, characterized in that, The calculation of the equivalent path length and compensation coefficient based on the current scan position and current scan angle also includes: The trigonometric function value corresponding to the current scanning angle is calculated using the CORDIC algorithm; Based on the major axis parameter of the ellipse, the minor axis parameter, and the trigonometric function values, calculate the equivalent path length of the X-ray in the elliptical section; Calculate the angle compensation coefficient based on the equivalent path length, the major axis parameter of the ellipse, and the minor axis parameter; The target tube current value is obtained by multiplying the configured base current value by the angle compensation coefficient.

6. The X-ray energy control method of claim 5, wherein, The formula for calculating the equivalent path length is: ,in, L Let be the equivalent path length of the X-ray in the elliptical cross section. a For the major axis parameter of the ellipse, b For the minor axis parameter of the ellipse, θ This is the current scanning angle.

7. The X-ray energy control method of claim 5, wherein, The calculation formula of the angle compensation coefficient is: ; The calculation formula of the target tube current value is: where mA is the target tube current value, is the base current value.

8. The X-ray energy control method of claim 1, wherein, Before outputting the target tube current value to the X-ray tube control system, the method further includes: The calculated target tube current value is subjected to a rate-of-change limitation process. If the difference between the target tube current value and the previous output tube current value exceeds a preset threshold, the output tube current value is adjusted according to a preset rate of change to ensure smooth tube current changes.

9. An FPGA-based X-ray energy control system, characterized by, include: A parameter configuration module is used to configure scanning parameters, which include at least the tube current control mode. The parameter acquisition module is used to acquire real-time scanning parameters, which include at least the current scanning angle and the current scanning position. The strategy selection module is used to determine the target calculation strategy from a variety of preset tube current calculation strategies according to the tube current control mode. The current calculation module is used to calculate the target tube current value through FPGA logic operations based on the scanning parameters, the real-time scanning parameters, and the target calculation strategy. The control output module is used to output the target tube current value to the X-ray tube control system in order to adjust the tube current of the X-ray tube.

10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method of any one of claims 1-8.