Wednesday, July 31, 2019

"Full spectrum" camera modification.

Recently I have become interested in infrared photography. Got myself a screw-on filter set, dug out my old tripod, made some photos, some of them turned out pretty cool. But pretty soon I got tired of having to drag my tripod with me, since in most cases I need a 1+ minute long exposure with a standard camera (Canon 200D in my case). Tripod bumped, someone walks in front of it - get ready to set it all again. Forget about taking photos of moving objects, so anything other than still life is out of the question. And the whole procedure is tedious - since IR pass-through filters cut most of the visible spectrum, there is no auto-focus and you can't use the viewfinder. Camera must be focused first, only then filter is screwed on. Live view can be used instead, but it's not reliable, and some cameras don't have it.

So IR photography enthusiasts generally recommend modifying the camera by removing the internal IR/UV cut filters, thus significantly decreasing exposure times. Commonly referred to as "full spectrum mod", although the result is actually just "extended spectrum" - camera sensors have some sensitivity to near UV and IR ranges.
Sounds daunting, but the procedure is actually fairly straightforward. There are various guides online - especially for the purpose of astro-photography. They often have a need to increase the range of camera sensitivity and apply various exotic filters to get photos of celestial objects. Since I got a new camera, I decided to modify my 10 year-old Canon 450d, which, apparently, is one of the most popular cameras for this sort of procedure because it is really cheap by this point. I followed the guide by Gary Honis, which is really detailed - all you need is to be careful when following it since insides of the camera are quite delicate. And look out for dust. I swear, exposed sensor like a dust magnet.

After doing some research, I decided to get Astronomik MC Clear glass to replace internal filters. Yes, it's expensive. But it has a transmission curve that allows both UV, visible and IR, it is cut to replace native UV/sensor cleaner precisely, and has anti-reflective coating. The only other alternative I could find is a glass piece from Aliexpress, which, according to the sales rep is Chinese K9 glass. So it cuts UV, most definitely doesn't have AR coating, and costs nearly 32 EUR plus shipping. Might as well get Astronomik piece. I've also researched high-transmission glass to cut it myself but couldn't find anything that is sold not in industrial sizes. So in the end I shelled out about 50 EUR for the expensive option.
But if you don't care about UV, you can definitely cut your own glass from a screw-on UV lens filter or something like that. It generally transmits IR just fine. Having no glass is also an option, but auto-focus will not work on a DSLR, and your sensor is exposed to all dust and dirt that gets inside the camera when the lenses are changed. Auto-focus on mirrorless cameras will also work just fine without a filter or clear glass since they use image sharpness to see if an object is in focus.

I also decided that I might as well replace the old sensor unit entirely and ordered a replacement on Ali for about 17 EUR. I'm pretty sure it was a defective unit that was either pulled from a camera or after factory QC. There was some dust behind the built-in filters that was clearly visible on photos after replacement. Good thing I replaced the filters anyway and had a chance to clear it out. Additionally, I can definitely see some horizontal brighter pixel lines in dark spots on the pictures. But I can't rule out that it's just due to increased sensitivity after modification procedure and wouldn't have happened to the original sensor.

Now, the trickiest part part of the modification is replacing internal shims. Sensor needs to be at a certain distance away from the lens for auto-focus feature to work. Some cameras have adjustable screws with a spring, so it's easy. Most DSLR cameras have these little metal bits called shims that are placed between the sensor and the housing to adjust the distance. They are not just metal circles, but have a fairly complicated shape and are fractions of a millimeter thick. Old and replacement filters need to be measured exactly using a multi-meter and a special formula is used to calculate the thickness of the replacement. And no, it's not possible to just order these things online, at least as far as I know.
The guide I linked above actually contains a page about re-shimming procedure, but frankly, it just doesn't provide any info on how to actually manufacture the replacements yourself, so it's not very useful. It tells you how to calculate replacement thickness (which in my case was 2x0.25mm and 1x0.3mm), and that the best bet is to get a feeler gauge set, that is allegedly commonly sold in car shops. Which might be true in the US, but absolutely isn't in my case, where I visited several places over a number of days until I got referred to a specialty tool shop that had them in store. Previously, since I wasn't sure what I was getting, a large home improvement store sold me screw pitch gauge instead, and I felt really stupid afterwards. Honestly, probably easier to order these things online. Also, calculate your new shim thickness beforehand and make sure the set you are buying has necessary parts.
In any case, there is also little to no info about cutting new shims out of these little metal sheets online in general. I improvised:

- Place an original shim on top of the feeler and while holding it in place trace it with a permanent marker. This will get you a visual indicator of where to cut.
- File or cut the metal using available tools. I have a dremel tool, and it was incredibly useful for this purpose. But I suppose you could use a handheld metal file, it would just take a really long time.
I used a small cutting disc (like one of those for angle grinders, but tiny) to gradually eat away at the metal, as well as small metal pointy abrasive bits to drill holes. I tried a screw gun for drilling, but it is really hard to keep in place. Maybe a hand-held drill can do a better job but I don't have one. Also, I would recommend to drill holes while the new shim is still attached the rest of the feeler - this way it's easier to hold it in place.
Obviously, a dremel is a power tool that can and will damage you or surrounding items and furniture if you don't know how to use it. So if your arms don't grow from the right place, you don't have any experience with this tool, and you like your fingers still attached to your hand - opt for old-school tools.
- After cutting the new shim free and trimming all the edges make sure to sand it with fine sandpaper. Cutting/filing process will bend the metal around the edges, increasing overall thickness - I checked with the micrometer. So sanding will get rid of unevenness and restore the desired dimensions.

To be honest, I was surprised with how well they turned out. Manufacturing the replacements took about half an hour and they fit in the sensor assembly perfectly. Wasn't particularly hard either.

Now, the screw-ups. I definitely screwed a few things up. Overall, I de- and re-assembled the camera three times. First time to replace the sensor to test if it works at all. Second time when replacement glass arrived to remove internal filters and install the new one. During that time one of the hinges on the ribbon cable socket snapped in half, but luckily it was still strong enough to hold the cable. Assembled the camera and it would not read the memory card. I decided to disassemble the camera the third time to re-seat all ribbon cables, but as it turned out the tiny screws are not designed to be fiddled with so many times, and the top on one of them got stripped. Ended up filing the head of the screw with an abrasive dremel bit to pry away the back cover. Additionally, a couple screw holes had plastic thread that got stripped as well. So now some of camera outer body parts are only partially attached. Everything worked fine after re-seating the cables so I was really relieved.
And apparently the camera revision that the guide author used had a slightly different screw length configuration, because I definitely reassembled everything as was stated in it, but the last few screws were wrong length. Oh well, they still do the job.

So the camera works really well after the mod despite all the abuse I put it through. One thing I found out after the fact is that there are still some caveats about auto-focus. When using IR filter, the view-finder still can't be used, since it lets very little visible light through. So live-view is used instead. And turns out that since 450D is an older model, live-view is entirely separate from multiple-point fast auto-focus. AF only works after enabling it (Menu -> Settings 3 -> Custom Functions -> 8 -> Live mode), and then the * button in top right works as the focus. But then it uses image center to focus, and it's really slow and not very smart. "Quick mode" setting can be used, but then the camera switches out of the live view for a couple seconds, and result is unreliable in my experience. All in all, a huge pain in the butt. Apparently newer Canons might not have this issue, but it depends on the model.

So, was it worth it? Yea, I guess. The process was fun and a bit off beaten path, I learned a lot in the process. My old camera got a second life. And now I can take pictures of people and other moving objects through a variety of filters to get interesting results. Even still life can be made to look very unusual with the right filters. But I will write about that some other time.

Using model offset to fix partial 3d prints.

I've been doing some 3d printing for cosplay in the past couple of years. And as every 3d printer owner knows, stuff happens and prints sometimes get screwed for unforeseen reasons. I mean, so many factors can cause a problem it's not even funny or annoying to me anymore, I just sigh and try again after re-checking everything.
One of the common issues, especially with long prints (I'm talking dozen of hours and more) is when the filament runs out and you don't manage to swap it in time, or there is a power failure, and print outright stops midway. I'm sure it has happened to most 3d printing hobbyists at least once. Normally you would just swear a lot and write the spent filament off, but there is actually a way to salvage the print. Provided that it's the sort of print that you have planned to sand/paint anyway. The idea is to print only the remaining bit and then stick two parts together.

- Take micrometer calipers and measure the height of the printed part. Try to be as precise as possible.
- Go back to your model slicer and lower your model below the print base by the height of the printed part. I use S3D, but I assume it will work in other slicers as well - it should only slice the model above printing surface. So when you print it, you will end up only with a part that wasn't printed.
- Print the remaining part, and the glue the unfinished and new parts together. Since, in my experience, most plastic prints will deform slightly, you will likely need to fill the gap and sand it to get smooth surface. I prefer acrylic wood filler since it dries fast into a relatively hard and somewhat elastic substance, but still easy to sand. Then paint the model to get uniform color.

The same method can be used to print complex shapes without using supports. Most of my prints are going to be sanded and painted anyway, so I don't see this as extra work, and it saves filament. You can decide on the vertical offset, slice one part, then flip the model over and slice the other half.

I read about this trick on some facebook troubleshooting group, but fb is terrible for looking up information, so I'm putting this in a more static form. Hopefully it's going to be useful for someone.