Thursday, January 19, 2023

XRF Exciter source using a Moxtek or Amptek Miniature X-Ray Tube (Part 1)

 I am working on a new XRF Exciter source, employing a pretty cool miniature, ceramic, 10W X-Ray tube with Tungsten transmission target by Moxtek (MAGNUM series). This source will deliver an immensely higher X-Ray flux compared to the Am-241 source I've been using, thus cutting down on the integration time during XRF analysis and bringing out peaks hiding in the noise.

The Moxtek X-Ray tube comes with a High-Voltage Power Supply module which allows for control of both, the tube voltage (-10kV to -50kV range) and the tube's emission current (0 to 200 uA). The maximum electrical power is 10W into the tube - here are the specs.

The brass housing of the X-Ray tube with the beryllium window aperture and the two high-voltage supply cables. The tube is in a Grounded Anode configuration and the two cables deliver both, High-Voltage to the Cathode and power to the filament. The brass housing is massive enough to dissipate plenty of heat. In its final configuration, the tube will mounted inside of 1+" thick lead shielding as some X-rays are generated in all directions besides the collimated main beam. These X-Rays are much attenuated but still a radiation hazard so proper shielding is mandatory.

My test setup. The HV PS has a very neat and straight-forward interface for controlling the tube's operational parameters of the tube. It is also very efficient when it comes to power - it requires 9V to 12V DC and about 1A of current. The efficiency is a little over 80% - around 12W input power which is fantastic.


While I am designing and prototyping the X-Ray tube controller (more on this later), just for a quick test I was driving the tube with my 3-channel power supply in a rather "manual" mode - Ch.1 is the main power, Ch.2 controls the HV - 0.8V to 4V are scaled to -10kV to -50kV range and Ch.3 sets the beam's emission current - 0 to 4V are scaled to the 0-200uA range.

The tube's module returns monitor signals - voltages with the same exact scaling factors as the control voltages in order to monitor the actual HV and Current straight from the HV module. A TTL level signal controls the beam state - ON/OFF and there is a FILAMENT READY return signal from the HV PS going HIGH when the filament is heated, and the beam is ON and stable.

One important requirement is that the beam should not be turned ON sooner than 2 seconds after it has been turned OFF to prevent damage to the tube's filament. For the same reason the tube should be turned ON for a minimum of 1 second and no less than that - all these requirements will be part of my design for the controller.

Prototyping the X-Ray tube controller on a breadboard, using nRF52840 MCU with ARM Cortex M4F, 24LC32 EEPROM for storing configurations, 12-bit MCP4728 Quad DAC for Tube control voltages, large high-contrast SHARP Memory display (400x240 pixels), bi-directional logic level shifter, Non-Latching Relay, MCP 9808 temperature sensor and a nifty I2C Rotary Encoder breakout.
There are various other components - voltage dividers, voltage regulator, power conditioning, piezo buzzer, pull-up and pull-down resistors, etc. located on the controller board - I designed the board with some thru-hole components so I can easily continue the development once I have the boards in hand and swap components as needed. 
If I ever make another version of the PCB it will be all SMD based to reduce size and cost.

Controller's User Interface
Top of the screen is the Status display, temperature reading (when sensor is plugged in) and the current timer display.
 Second section, below, is the Mode Selector and Timer Selector display - it also shows the Last Run Log, calculated X-Ray tube power, Tube Temperature while running and selected memory preset. 
Third section is the X-Ray tube's Parameter Set (S) configuration where the user can dial in the tube's High Voltage (-5kV to -50kV range (0.1kV steps)) and Tube's Emission Current (1uA to 200uA (0.1uA steps)).
 Bottom part is the Tube's Return Monitor (M) display, showing the measured return signals from the tube's power supply module - sampled with a 12-bit ADC.
 
All set parameters are persistent - Once dialed, they are stored in EEPROM and automatically loaded on startup. There are also two user-configurable Memory Presets with Tube parameters and Timers for quick switching between different sets of values for different experiments. I might eventually increase the number of presets to 3.

There are 3 Operational Modes - MOMENTARY when beam is ON while the OPERATE button is pressed and turned OFF when the button is released. 
The second mode is TOGGLE - pressing the OPERATE button turns ON the beam and starts a count-up timer. Second press of the OPERATE button turns OFF the beam and logs the elapsed time. Sequential ON/OFF will integrate the beam time in the "Last Run time" until a RESET action is executed. 
The third mode is COUNTDOWN timer - the user can dial desired beam time and OPERATE button STARTS/PAUSES the countdown. The X-Ray beam is turned OFF when the timer expires but it can be PAUSED, STOPPED or CANCLED at any time. The user can also spin the rotary encoder to add or remove time from the initial timer setting while the beam is ON in 5 seconds steps.

I have added many safety features!
 When the beam is turned OFF there is a 2 seconds blackout period while the filament is cooling. During this time the beam cannot be re-engaged. It is not possible also to run the tube for less than 1 second - if any such attempt is made, the controller will automatically "pad" the time for a total of 1 second. 
This is a requirement by the x-ray tube to maintain filament health.

There is an INTERLOCK detection feature which inhibits any operation unless the interlock switch on the door/lid of the XRF enclosure is closed or overridden with a key. 
In COUNTDOWN and TOGGLE mode, pressing on the TIMER RESET / MODE button or the Rotary Encoder button acts as an EMERGENCY SHUT-OFF.

 In TOGGLE mode there is also a Timeout feature which will turn OFF the tube after a period of time if left unattended. 
The controller also constantly monitors the Low Voltage power supply and disables the tube if under-voltage / over-voltage condition occurs. 
Tube temperature is monitored with an external sensor attached to the tube housing and the tube is disabled if temperature reaches 60C.

Control voltages for the HV and the Emission Current are always kept at 0VDC when the tube is OFF to prevent the tube from firing up due to a transient on the TTL "tube enable" signal during controller power-up and shut-down. These control voltages go up to the programmed levels just before the X-ray tube is turned ON and are dropped again to 0VDC shortly after (200ms) the tube is turned OFF.

Another safety feature is a "parameter watchdog" - 2 seconds after the x-ray tube is turned ON, and the beam is stable, the controller will start actively monitoring for a difference between the set control voltages and the return monitor voltages - if a specified tolerance between what is requested and what is received is exceeded, the controller will turn OFF the tube and will report the Tube error detected.

External device control is available via a relay with NO/NC contacts used for control of various types of external equipment - X-Ray ON warning indicator, beam shutter system, XRF acquisition system, etc

The nRF52840 BLE will allow me to implement a Bluetooth connection to another host device (Smart phone for example) and control everything remotely. 

 The PCB design for the controller board.
 Critical modules are socketed and can be replaced easily. There is a terminal block and a DB-9 connector directly compatible with the Moxtek DB-9 on the Magnum series tubes and auxiliary 2-pin power connector used for tubes with higher than 4W power. The Tube module plugs in directly with the supplied Moxtek control cable.

For testing, I looped the DAC outputs used to Set the x-ray tube control parameters (the "S" display line on the display) to the ADC inputs for monitoring the tube's return (the bottom, "M" display line) and whatever is programmed as SET tracks perfectly on the MONITOR. The ADCs exhibit a small non-linearity up to about 1.2V (they run with 3.00V reference). I plotted voltage set vs. voltage read and created a curve in the firmware to correct it, which improved the measurement accuracy quite a bit.


The internal ADC inputs of nRF52840 are configured for 12-bit resolution and using the built-in 3.0V (0.6V at 5X Gain) voltage reference. The ADC noise is very typical for these chips - around ~3mV swing as seen on the plot. 
To improve on the noise, I use Interquartile Mean (IQM) when sampling, tossing out the Min and Max values for each data set, while averaging the samples in an attempt to get a more stable readout and this aproach works quite well - now the least significant digit on the readout exhibits some infrequent ADC noise of +/- 1 digit but overall it is fairly stable, also due to the over-sampling conversation I am performing.