• Image offsets, ancient scrolls, broken shutters

    Ahron Wayne4 days ago 2 comments

    Don't worry, I'm not planning on running the x-rays like this. The cover had to come off because it was probe-y probe-y time again, as we try to fix the shutter (seriously? Again?) which I blew up by accident a few days ago. Actually just the driver board, thankfully.  

    I've spent the last couple of days haaaaaaaaaaaaaating the shutter server, again, with a passion that burns within all of my soul. Basically, since I destroyed the replacement driver board, I wanted to at least try again to get the original to work. And why not? It's perfectly tuned for the motor already... you just CAN'T CONNECT TO IT !@$@$@$%@%@$#%#%! 

    There's the box that controls the motor, which it turns out even has an encoder. Which would mean it could be used for such very useful and safe things such as moving the tungsten shutter to cover the source when you want it to. We know the motor can be held in position and stably, thanks to some knowledge gleaned while trying to connect to the shutter server, but if we get into that we'll be here all day. Sigh.

    I don't think we had much of a warranty anyway. Daniel knew about all the stuff that was inside here, but unfortunately even he didn't spot the magic analog make it go whirr and how fast button. 

    Before the current state of machine malaise, I did some reading and experimenting with calibration, recon settings, and scan acquisition. I think the coolest .exe power I got is applying offset images. You can see in this (FULL RESOLUTION 1X1 binning!!) image, squee, that the detector over the years has sustained a bit of damage: 

    This is still kind of an awesome image IMO. It's 1x1 binning, and the detail of the detector backing, or fiber optics, is actually pretty cool. To take a 1x1 bin image needs a long exposure time, but our shutter couldn't be ramped down that slow. So instead we just average 10 times, which results in the same SNR as a full exposure image pretty much. 

    But yeah, that pattern! And the peeling, yikes! the color is all different! It's practically dirty! What's that gonna do the scans of this round thing?

    Not much, if you just apply the blank picture of the detector as an offset image. 

    Like a cheat code for image processing. There's a lot of chasing the last little bit of quality like by taking multiple references, spaced out through the scan, but 99 percent of the benefit is from just doing it at all. Even JPEG knows how much cleaner this image is; it's only 30 percent of the size of the uncorrected one. 


    There's more, for sure! The machine had already started proving useful to an applied research task. I'm not sure if I mentioned this yet or not, but this project was born partially out of the Vesuvius Challenge, a very cool and suspiciously side-quest-y goal to read some ancient scrolls that fell into a volcano using x-rays. I've been doing experiments with carbonization to simulate scrolls, with the intent of scanning them. This is now a reality. 


    Cross section of carbonized papyrus, inside bamboo tube! 

    So here's to the future --- we're there, nearly, with just the occasional setback! To ancient scrolls! To image offsets! To a working shutter, eventually. 

  • It's officially a computed tomography scanner!

    Ahron Wayne09/04/2023 at 21:58 0 comments

    Yay! 

    Since the last post: 

    The shutter has been made less crappy using a dedicated BLDC driver for motors with hall effect sensors. It's not set up right still, but the shutter is moving slowly enough to do real exposures of about a second long. 

    So let's do a scan! 

    First we have to choose our protocol, where we define the exact parameters for the scan. Since we're sticking with 4x4 binning (or pixel ganging), we don't need that many projections or exposure time or averaging, which is perfect for us. For my initial testing, I'm using a voltage of 60 kv and a current of '30' uamps, which actually leads to about 16-20 microamps. And I'm placing the object at such a position to get a voxel size of about 50 microns. Lastly, I am, for instance, taking 200 projections --- a rule of thumb is 1 projection for each pixel in x/y the object crosses while rotating, but in practice you can still get a lot of info from less than that. The scan lasts about 7 minutes.  

    As an aside, the program is really annoying in that it won't let you run unless the X-rays have been warmed up in the last 15 minutes (to a higher voltage than I actually want to run which I don't think helps the tube). So I hack it to run anyway by just changing the system time to when it was last warmed up according to it. Yolo. 

    And to my surprise, you hit that "scan" button and it just starts going. I was worried that the the motors would be asynchronized with the shutter, but for once it seems like something with the shutter works correctly. 

    After the scan is done, it turns off the x-rays automatically (we'll see what I can do about that) and then prompts you to remove the sample for taking bright and dark field images. These are images with nothing in the way and can be used to mitigate various things like, a damaged scintillator or dead pixels. 

    Goodbye, peeling scintillator! 

    This is a huge boost to quality just with that offset difference. Like an image processing miracle in my opinion. 

    Now, after my first scan was run, I hit "recon" and nothing happened. Used to bugs and happy with the progress I had made I went home and came back the next day to sort it out. Found that there's some kind of reconstruction server as well as a command line utility; after a restart, both work, with the command line utility being more ancient and robust but slower.

    And finally... after hitting recon. It does some filtered back projection and, ta-daaaaah, we have our reconstructed scans. 

    And then there's the 3D scanning aspect of 3D, computed tomography, where in the simplest form you just pick a greyscale value threshold that forms a surface and which can be exported as an STL.

    This is just one example, but it exemplifies the kinds of scans we'll be able to do with the machine. 

    So there you have it! Exactly three months from picking up the machines to getting one working! Let's see how much we can improve it, now. 

  • The original computer solves not all of the problems

    Ahron Wayne08/31/2023 at 16:32 1 comment

    Since our last post I changed the entire computer (again, I suppose). An HP-XW8400: Found on ebay at a decent price finally, this was what was originally used by the SP after upgraded from Windows 2000 to XP. 

    I hooked everything up and... problems.

    i mean, the recon interface hadn't worked before, either, but why not? So I then re-cloned the hard drive image, to this old physical hard disk, with the idea that I would be way more careful and methodical this time. Even that process involved fixing a bunch of small bugs --- like the hard drive image (160 gb) being too big for the hard drive (160 gb). 

    So let's take a step back at our little CT nook:

    The place is a mess. Most of the screws on the panels are off, as is the extra shielding. There are tools and allen wrenches everywhere. Four hard drives, a few computers, thousands of pages of documents, the old x-ray source, and every cable you can imagine. I've taken the machine apart and put it back together again, I've connected motors to external controllers, tracked down capture cards and service engineers and now finally I have most of the original hardware, and all the original software, on an original hard drive clone.

    And now the reconstruction utility opens! And like before I can move the motors. I can fire x-rays. I can see images. Everything seems to work. Everything but the shutter server. 

    It's supposed to be on port 3. Why isn't it on port 3? Why does the registry say it's supposed to be on port 3, when that's where the x-ray and motor controller is? Why doesn't it work on ports 4-6 either, which are the only other ports that another working system has registered? Why doesn't it even try to communicate with those ports when they're open? HOW COULD IT BE ON PORT 3 IF THE X-RAY MOTOR CONTROLLER IS THERE???

    ARGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH 

    The funny thing is --- I figured out that with the frame capture software, there's actually settings that will let it take images without the shutter at all, which confuses me to no end --- with all that trouble, why did they even bother with it? As an example, here's a blurry phone-shot live-view video of what appears to be a parasite in my acorn. 

    Unfortunately, the triggering for the camera and all the software still requires a physically rotating shutter. If the frame grabber software were better, perhaps I would forgo the shutter entirely, but the easiest path forward still looks like using the original scan and recon software, which is annoying for other reasons like that it makes you "warm up" the x-rays all the way to 90 kv even if you only plan on doing 60 kv scans which is bad for it. 

    And so this weekend I'll try to build a better shutter controller that works with the hall effect sensors hopefully, so I can drive it slowly and take real scans. 

  • "Sunday's Shutter Server"

    Ahron Wayne08/20/2023 at 23:12 0 comments

    The motor is a Brushless DC, which can mean a lot of things. This one runs on three phases. And it uses hall effect sensors. It took a lot of reviewing brushless motors and motors in general to understand that much, and I still can't drive it properly. 

    can, however, drive it inconsistently and badly by connecting the three phases to an electronic speed controller for drones and completely ignore the hall effect sensors. The result is a slightly jerky but moooostly stable at speed rotation, though it can't be run slowly. Also it makes a scary noise sometimes. Also also also, you have to crank start it by hand like an old plane propeller (really). It'll keep going but won't start back up if the power goes out and comes back on. 

    Pretty janky part of the setup, but compared to not turning at all..? I'll properly use the hall effect sensors will allow it to be driven slowly and precisely at some point (maybe while solving a bunch of other things simultaneously --- stay tuned). But for now, it does what it needs to, and lets me way more easily take images!

    There's my head! It's 3D printed and is made of glass. 

    This is a picture of an acorn! 

    In fact I've been able to do some crude scans while rotating --- set "Fluoro" to take 100 images while using a different program to set the part rotating. In theory, I should be able to take this info and guesstimate a few parameters for a crude reconstruction. 

  • First Images: Acquired

    Ahron Wayne08/16/2023 at 02:24 0 comments

    It started with the arrival of the rare and mythical, ancient ATMEL LVDS capture card that fit the custom 50 pin connector to the camera. Thanks, Trifoil, for sending a spare! 

    After installing, I was able to open up both Comcamm (for sending serial commands to the camera) and the FGT frame grabber program (for actually reading the images. Try as I might, though, all I got were blank images and occasionally something seriously buggy. 


    I was hoping I could set it to continuous readout mode and get some images, but apparently this very old CMOS sensor is unable to read out data while receiving new signal --- and the source is not capable of ramping on and off that quickly. In other words, there needs to be a shutter (in this case one that physically blocks x-rays) for it to work properly.

     The shutter in this system is a block of 2mm thick sintered tungsten-copper (insider knowledge), attached to a geared, brushless DC motor, placed in between the source and the object and also passing through a little optical interrupt switch. The switch, motor, and control unit are then connected in a mess of wires back and forth to the camera, the machine control, and a direct connection to the computer that has never triggered. The shutter seems to be what the whole system is built around, almost --- like a little heart beat --- and nothing will work right if the shutter doesn't run.

    So you can imagine my frustration where, despite trying different cables, different ports, different rates, different operating systems, monitoring the ports, monitoring the program, and so many kinds of turn it off and on again, still getting some variation of the above error when starting the shutter controller. What else can I do? Corner the person who designed it 25 years ago? 

    Hmmm... there's an idea... 

    Anyway, there's also a native program called "Fluoro" for getting a live view of what the camera is seeing. Thankfully, it would open despite the shutter not initializing, and I was able to confirm that the camera is, in fact, communicating info with this program. By making the shutter rotate manually, I could get some images of "snow" (dark current) to pop up on the screen --- and the longer I'd let it "expose", the more snow there would be. 

    A great sign! Now... how to try with the x-rays?

    In the long-term I can just drive that motor and its possible encoder with my own electronics. But in the short term --- that is, in the past few days --- I just wanted to get an image at all. Something to prove that the system works all together, that the scintillator hadn't peeled off or the cables hadn't run out of carburetor, or something. 

    Let's just say I found a way. So say hello to my first couple of proof-of-concept images.  

    That's some rolled-up papyrus (long story) and the blade of a random tool I had lying around. And I must say, I was surprised to see them look so good and sharp! I was expecting a terribly warped image or stripy lines that would normally be corrected for in a specific machine. But looking at these, this is functional for so many things right out of the gate --- and it'll only get better as I work my way through the calibration process. 

    But hey! I'd say I deserve a bit of a victory lap! About 10 straight weekends and a bunch of evenings, and of course, help from strangers and friends alike. We're getting there.  

  • Datasheets for PXS5-925 KEVEX Thermo-electron Thermo-fisher SCIENTIFIC X-Ray Sources

    Ahron Wayne08/12/2023 at 15:11 0 comments

    These datasheets were astonishingly difficult to get, and then all of a sudden they were here. They've been uploaded to the main files, again with as many keywords as I can muster to help any weary and lost souls that may follow.

    Main takeaways:

    • It's got oil
    • 2 differences between EA and EA-RR variant are just the size of the spot (at half power: 9 microns, vs. 7 microns) and then the bigger spot size can nominally heat up slightly faster, which makes sense. Spot size is dependent on power and is bigger at 8 vs. 4 watts (so there must be focusing electronics) . The replacement is the one with the slightly bigger focal spot size, EA-RR.
    • Can control with either potentiometer or external voltage, which I knew, but now I know exactly how. Sensing is just voltage too. A few volts. 
    • The cone of illumination is approximately 40 degrees.
    • There are 2 signals: Stand-by to keep warm, and actual power. Do not turn off standby, while actual power is on! 
    • "not user servicable" 
    • Turn it up slowly 
    • Apparently some people can detect radiation by static tingle. Do not rely on this
    • It shuts off at 120 percent set power
    • If it arcs, that's bad, run the warmup again but more slowly
    • Not focused/constant below 20 kv
    • Don't run current below 5kv
    • Rated for 45 kv 180 uamps, 90 kv at 90 uamps. 
    • above 70 kv is the especially careful zone. (So 60 seems like a safe middle ground)

    So yeah! A lot of useful info. Still unknowns I'm curious about, like the actual contents of the tube, and especially potential servicability (maybe not in vacuum itself, but if there's arcing and it's out the tube...) 

    I'm back from oklahoma (with a sore throat) so this weekend will be trying the ancient LVDS capture card that just arrived. And seeing real 2D images --- possibly distorted, but hopefully nothing too serious. Assuming I can get the camera to connect at all!  

  • We Have X-Rays

    Ahron Wayne08/06/2023 at 01:32 0 comments

    Watch as much as you want, but a few minutes into a 13-minute conditioning process, we got x-rays. And a much higher voltage than I was planning to reach for a while. 88 kV! 20 or so microamps! That's more than a watt! 

    Also, I put my handy dandy graphical radiation detector inside the machine directly in the path of the beam. First I did 40 kv, but not microamps, and was surprised to see 600 counts per minute. 

    This is about 10 times background --- the same level as if you place it on an old thorium gas mantle. 

    Then I tried it with 10 (9) microamps of current. In other words, we are at slightly less than half a watt of power, about 1% of which is actually x-rays. 

    Now THOSE are x-rays. You definitely don't want to be putting anything in your body directly in the path of this beam. It is not an incredibly huge total amount of x-rays compared to medical imaging. But it is very concentrated for something directly in the path of the beam. 

    Just a wild theory, but I wonder if the x-ray counts when no current switched could be used as a proxy for how rarefied the tube is --- in other words, is this leakage current through gunk and stuff in the tube? Or alternatively, is this the cathode filament staying at a "maintenance" temperature --- just not hot enough to emit significant electrons, but it still does a little bit? 

    Anyway, woo hoo. Capture card comes this week, while I will be in oklahoma. Next weekend... Gosh willing, we might be able to take some images. 

  • Changing the Source

    Ahron Wayne08/05/2023 at 00:40 0 comments

    Thanks, Ebay! Thanks, Ebayer who gave me a good deal! 

    Is this thing from a video game or what? 

    There are four large screws that hold the retaining block onto the main structure. This block holds the source and shutter motor, along with some electronics. Once that's loose, you have to unscrew the source itself from the underside, and there is also reference to "loosening and tightening the back screw ones from underneath" as opposed to tilting it and then taking it out. 

    So empty! 

    You can see on the old source that indeed, behind the collimator plate, the lexan window had all but disintegrated. Behind it is the intact beryllium window.

    I didn't try to replace the lexan window, as i don't plan on touching the beryllium window. I did, however, try to cover the gap up between the source and the collimator window, as presumably the window would have also protected somewhat against dust or anything else in the air stream directly pointed at it.  

    Source back in place, I decided to just go ahead and put all the shielding back (rather than put the case on and test it, in case something was wrong). Along the way, I left many traces that it was an unprofessional who had to shim the shielding or use twisty ties instead of zip ties. Also, no screws made it back into the same location. 


    Finally, there was just the case left... and I looked around and it was the evening! Everyone had gone home! And you need 2 or 3 people to lug the case around! Gosh dangit to heck! 

    I really want to get the source tested before I go to oklahoma for work this week... 

  • Reaching The Source

    Ahron Wayne07/31/2023 at 00:04 0 comments

    So as a recap, first she was unwrapped:

    Then it turned out there was an extra 2-part 'bonus' case:

    Underneath which was the handsome original case:

    About 50 pounds of side panels and 100+ pounds of main case comes off:

    And then, off comes 40 pound lead back shielding panel, lead left shielding panel, Filter wheel, lead source front shielding panel, lead source back shielding panel, and finally, the lead cover over the source. 

    And we get to the source. 


    Look how far we've come (and removed) from this machine. But here is it --- pretty much everything we've taken off, and the machine would still work. It would not be good for fragile human beings, but it would work. Everything that's left, though --- apart from another jillion little panels of lead shielding --- is essential.

    Especially the source.


    There she is, and what first surprised me was the manufactured 2011. That and confusion as it whether it is thermo-electron, thermo-kevex, or thermo-fisher scientific. I may honestly just go visit that address the next time I am in the area, and find out for myself.

    Something weird is the cooling pipe, which faces at the general vicinity of the output and not (as I would expect) fit into some kind of opening on the source shell. 

    Maybe it's fine... 

    What's definitely not fine is, peering into the collimator plate, it looks like something is totally fried:


    My best guess is that, in between the beryllium tube envelope and the metal collimator plate, the 'lexan window' (as service manual says) has been fried. Somewhere else is a field service upgrade that instructs to remove the window, so maybe it was identified as a cause of concern. Regardless, that is not likely to be the cause of the arcing. 

    And in any case, a working one will soon take its place. 

  • The Case Comes Off

    Ahron Wayne07/23/2023 at 23:27 0 comments

    Taking off the case was hard because the case is heavy. "two or three people are needed to safely lift it out of the way", the service manual says. It was definitely three people. You need to remove four bolts and some cabling, and then it can be slid and lifted out of the way of the internals. 

    And here she is, after a bit of a vacuum and wipedown with a wet shammy: 

    Source is on the left, motors are in the middle, detector is on the right. NBD. The vast majority of the screws and everything is for shielding. The right side is more heavily shielded and there were some misc. pieces of lead that were literally taped on to I guess weak spots. Some of them had fallen off. Not concerning at all --- or at least, not until my x-rays start to freaking work. 

    Speaking of that, I took a look in the registry and found flags for "automatic control on" as well as references to the shutter servers being on port 3 (the same as the main controller, for some reason). Unfortunately, flipping these values didn't do anything, at least as far as I can see. Still can't connect to the shutter server, and still can't switch the x-ray control to manual. I would REALLY like to be able to try and get the x-rays to turn on before pulling it out, as a full replacement will be a big (and not cheap) ordeal. 

    .

    Along with cleaning it, I also greased up the motors and door with some teflon lube (trifoil) that was mentioned in the manual. The only one I'm not sure if I did correctly is the rotary stage, since it can't be turned by hand/screws and stuff aren't visible. 

    Here's a gallery of the inside that wasn't visible before:

    There's some kind of control box, lots of pass-through connectors, and also knobs for adjusting pretty much each axis, as well as the source. 

    Finally in terms of experimentation for the day, there was a cable that I thought plugged into the shutter (why you no work), but putting a few volts on that didn't do anything. Hmm. 

    Traveling for work again this week --- the machine will be just covered by a tarp. I'll take another look next weekend, and probably take the rest of the shielding off so I can take a look at the source and see if there's anything super duper obvious (unlikely), which will also serve as practice since I plan on taking the definitely bad source out of the other machine.