A follow up on this post this post
I needed controller for the Magnum series 50kV / 10W MOXTEK X-Ray source and as it turns out the FTC-200 controller, once sold by MOXTEK is no longer available - it was discontinued due components availability and the Moxtek sales engineer told me - "We expect customers to develop their own solutions."
This was not a big deal - their FTC-200 controller has very basic functionality anyways, and it is lacking some features that I really needed, so I went ahead and developed my own design to control the MOXTEK X-Ray tube.
Currently, MOXTEK tubes are available in one of 3 configuration - built-in USB controller, I2C interface and Analog Interface. The MAGNUM tube I am using is equipped with the analog interface, but it should be quite easy to add the I2C control capabilities to the controller design as well.
One of my design goals is to have a stand-alone unit with no PC required. I don't want to fumble with numerous PC applications while doing XRF and prefer to have a piece of hardware with actual buttons and dials to adjust the X-ray tube parameters and to operate it. For the fairly simple functionality the controller affords, there is no real benefit from running it with a PC.
I was pleasantly surprised to find out that the AMPTEK Mini-X2 tube uses the same electrical interface as the MOXTEK Magnum series of X-Ray tubes so my controller will work for AMPTEK Mini-X2 just as well which makes it even more versatile.
Update: As it turns out Newton Scientific X-Ray tubes are also equipped with the same analog interface or at least have a connector option for it. (thanks Matteo!)
Simplified block-diagram of XTC-2000
My source controller is based on the nRF52840 System-on-a-Chip (SoC) using Cortex M4F processor and employs 6 control channels as required by the x-ray source interface - 4 Analog and 2 digital channels. Of these 6 channels, there are 2 Analog outputs (driven by precision 12-bit precision DACs), used for setting up tube's High Voltage and Emission Current parameters and 1 digital output (5V TTL signal) to turn the source ON / OFF. There are also 2 Analog inputs (sampled with a multiplexed 12-bit ADC) to monitor the x-ray tube's working parameters as they are returned by the Moxtek HV module and a digital input (5V TTL signal) to report when the beam is ON and stable (The filament is fully heated and ready).
I had to employ Logic Level shifters as the nRF52840 is a 3.3V chip and the MOXTEK module has standard 5V TTL levels for the digital signals. Furthermore, the voltage ranges on the Analog output channels range 0-to-4VDC and I have to use the 4.096V internal DAC reference voltage which means the DAC must be powered with a 5V rail. In reality, the reference is 2.048V and the output op-amp buffer of the DAC is switched to 2X GAIN mode, but still 5VDC DAC power is required.
(I am playing with the idea to dynamically switch DAC's output buffer op-amp GAIN based on the needed DAC output, using 1X GAIN when output less than 2.024V is required (up to 25kV and 100uA) and automatically switching to 2X GAIN for higher DAC output. This should make the output even more precise.)
For the Analog inputs, I used precision voltage dividers to bring down the Monitor / Return channel voltages in the range of 0-to-3VDC and then used the built-in ADC reference of 0.6V with gain of 5x.
There is also a 5th Analog Input channel, internal to the controller, with its own voltage divider, used to monitor the Low-Voltage Main Input Power and to inhibit controller operation if the controller's and tube's input voltage is not within the nominal range.
OSH Park service delivered again beautiful, high-quality PCBs. The ordering process is very simple and a pure joy - I almost feel sorry I don't have more PCB projects to order.
The PCB design was done with Autodesk Eagle but I am not big fan of what Autodesk is doing with Eagle (it used to be my favorite PCB app) and very likely to switch over to KiCad in the near future.
The assembled and ready X-Ray Source controller - XTC-2000 (a.k.a. "X-Ray Tube Commander 2000" :-)
(Chat GPT suggestion :-)
Using a rotary encoder with a pushbutton makes the UI really quick and intuitive. The button (knob-press) is used to enter adjustment mode, and the user can dial first the whole number and then the tenths after the decimal point for each parameter separately.
After entering Set mode, the encoder's push-button scrolls through different digit positions, indicated by a blinking cursor and spinning the knob changes the value.
The rotary encoder is equipped with its own microcontroller (Atmel SAM D09) which takes care of all of the quadrature input stuff - counts, phase-detection, timing, etc. and just reports the actual tick count, delta, etc. over I2C bus to the MCU. This makes the Encoder really fast and easy to use and I can reset the tick counter with a command if needed. The encoder breakout can also generate interrupt on button press or encoder rotation.
The complete and working controller during bench-testing and DAC/ADC non-linearity compensation and alignment.
Testing was done by looping the DAC outputs to the ADC inputs and monitoring the loop with a calibrated 6 1/2 digits benchtop DMM. The linearity corrections made sure that both, output and input agree with the voltmeter thru the entire range.
The white (unpopulated in this picture) 4-pin JST connector near the encoder is AUX I2C expansion connector, used for the X-ray tube's temperature sensor or controlling a tube with I2C interface.
Currently, the code is complete and mature, the core functionality is all done and bug-free thus "Version 1.0" release
.
In the unlikely event of some commercial interest, I might write a more elaborate menu system for setting up various tube types, internal parameters and calibration values, but even at this stage, XTC-2000 has a lot more features, better functionality and better ergonomics than both, the discontinued Moxtek FTC-200 controller and the entirely software-controlled Amptek solution. It also has more safety features and should take better care of the tube's health and operating conditions.
As for the user-interface, in a nutshell - there are 3 modes of operation - MOMENTARY (X-Ray is emitted only while the OPERATE button is pressed), TOGGLE (X-Ray beam is latched, on/off with each press of the OPERATE button) and COUNTDOWN (the user can dial duration in seconds for the beam and start the Timer)
There are many safety features implemented - hardware lockout, software lockout, preventing accidental exposure, emergency beam shutdown, control voltages power-down, tube shut-off watchdog and so on.
In addition, there is a number of features looking after the tube's health as minimum emission time, cooling timeout, temperature alerts, isopower curve ensuring maximum power is never exceeded, mains voltage drop and many more.
When the working parameters are dialed in, the calculated power is immediately displayed on-screen. If the calculated output power exceeds tube's maximum permissible output power for the particular type of tube, the controller will scale the Emission Current to the edge of the permissible power curve and will indicate the change in the calculated power display. This will prevent the tube from being operated at excessive power levels.
While the X-Ray tube is powered on, the controller will also display the actual power level calculated from the Tube's return channels.
As part of the safety and tube's health features, I added external temperature sensing and monitoring using MCP9809 chip.
While designing the PCB, I added an extra I2C bus connector for future expansion such as temperature sensing and control of an I2C tube.
The temperature sensor I am using is MCP9808 - a very accurate and precise chip with I2C interface. Resolution is actually much better than 0.25°C but for my purpose 1° Celsius is completely sufficient and allows faster sample time.
The controller constantly monitors the temperature of the tube, and it will shut it off if temperature exceeds +60°C. The tube will not be re-enabled until it cools down to below +55°C. With 10W of total electrical power and a massive brass housing this is unlikely to occur, but it offers another level of safety.
The temperature sensor presence is auto-detected on startup - if the I2C cable is not plugged in, the controller will work normally, just without any temperature related features.
The critical part of attaching the sensor is the connection cable between the controller and the MCP9808 breakout board - the cable must be fully shielded due to the proximity to the tube's HV cables and must be of very low capacitance as the I2C bus does not tolerate high capacitance on the signal lines or the useable bus speed will begin to drop. At 70cm cable length the sensor works perfectly well. The cable I used was foil-shielded 4-conductor USB cable.
The last thing, currently pending on my development list is a suitable enclosure.
Update: As part of the tube's diagnostics, I added a check for deviation from the requested parameters - if the controller detects a difference between what is requested from the tube and what is returned, it will generate "Tube Error" message with a 3-digit error code - each digit represents one of the 3 critical parameters (Filament ready, High Voltage and Emission Current) and the value represents the type of deviation. This makes it really easy and quickly to understand what is going on with the x-ray tube. The check begins 2 seconds after the tube is turned on, allowing time for all parameters to stabilize. There is an option for the user to turn off temporarily this check if needed.
No comments:
Post a Comment