Focus Stacking with a Raspberry Pi – Design Refinements

    focus stackerThe parts for making the lighting control box arrived and I was spurred into action before Christmas to modify the rig to accommodate the revised lighting controls and to build the light control box itself. In the end it took a whole day as I decided to take the opportunity to remove some redundant wiring and to reallocate the push buttons on the sledge mounted control box. I also updated the wiring diagrams to keep track of what I had done.

    Focus stacker light control box
    The focus stacker light control box and the “STOP” remote

    So now I have a lighting control box that sits behind and below the camera; there is also a momentary switch to operate the camera shutter so that I can make a blank exposure between stacks very easily.

    The remote camera shutter is now a remote stop button for the stage which makes it much easier to control the set up of near and far focus points, eyes on the camera and remote in hand.

    focus stacker electrical connections
    Focus stacker electrical connections

    The lights are plug and socket connected to the sledge as is the control box, for easy dismantling and storage. When I need to work on the main module I can quickly disconnect it from everything, and there are no trailing wires getting in the way.

    The redundant 6v lights switch on the sledge mounted control box has been replaced by a push button to operate the camera shutter – mainly to put something useful there instead of having a hole!

    Focus Stacker
    The light diffusion box – now with removable top and back – much better.

    The light diffusion box has also been modified to enable the top and back to be taken off leaving the front and the camera/lens set-up undisturbed. This makes it much easier to tweak the specimen during set up and after successive stacks.

    I am still not totally satisfied with the light diffusion box and may make yet another one, even bigger. I am finding it fiddly to get at the lab jack even with the removable top and back, and the lights would ideally be sited a bit further away from the subject to allow for more diffusion and baffling.

    I have forgotten to manually enter the time and date on at least one occasion, and have given up on the software solution to updating Pi time as too difficult, and so I recently obtained an Adafruit real time battery operated clock module (RTC). It is very compact and is supplied with its battery. It sits neatly in the junction box under the rack where the two wires that need to connect it to the Pi are already present and unused having been taped back originally at the time of build “for a rainy day” – there was a stroke of good luck!  It also needs Pi 5v and GRND which were both there too. The assembly and installation was easy. Modifying the config files on the Pi was not difficult. Installing the drivers for the RTC was impossible………. why, because…… need the Pi to be connected to the internet. If it was connected to the internet I wouldn’t need the RTC, would I?  The driver goes by the name of i2c and enables one chip to talk to another.  There is, apparently, no reliable way to download the correct version of i2c (there are many and various!) and install it without being connected to the internet, which is a bit daft. There are plenty of people wanting to do this judging by the forum talk on the web, but the experts issue dire warnings of workarounds messing up your PI configuration big time. Later versions of Debian whatever, have the drivers in the supplied library. But not mine. Back to square one for the time being.

    focus stacker
    Overall set-up
    focus stacker
    focus stacker- the new light control box handily located behind the camera.

    Focus Stacking with a Raspberry Pi – Specimen Adjustment for Easier Framing and Composition

    Focus stacker
    Focus stacker without light box. The lab jack visible beneath the specimen.

    Over the past month I have made some further improvements to make life easier to set up the specimen and to take the stacks.

    Finally a simple manual lab jack arrived from China which will give me 5mm of vertical adjustment. This is so small that it fits neatly on the stage, having a footprint of just 25mm x 25mm and weighing next to nothing.

    On top of this I have mounted a thin steel plate. All my plastic specimen mounting cards now have a very thin button magnet glued to them, which holds them tightly to the top of the jack while allowing rotation in the horizontal plane and z-y movement.

    lab jack
    lab jack

    At the camera end of the business there is now a second rail mounted laterally which allows fine adjustment in this direction to frame the image. This came from one of the many suppliers of such things on Ebay. It is not a precision item like the lab jack, but will do the job required at very reasonable cost.

    There is an additional light fitted at the front which is used to illuminate the stage while setting-up and provides enough light for the camera to see the specimen and to enable fine tuning of the camera and specimen positions. The main lights are now fixed to the equipment chassis and not the underframe which makes adjustment of the equipment chassis position relative to the camera much easier.

    macro rail
    macro rail

    More software changes have been incorporated to speed up and automate certain functions. For example, there are now three options that can be pre-selected to decide what happens at the end of the shot sequence – stay put, go back to park, or return to the first image. And there is now no need to go back to the park position to commence a shoot. I had put that into the software so that it would force a reset of the counter to allow for errors in positioning, however I have found the setup to be repeatable in this respect and so that precaution was unnecessary and just time consuming.

    All that remains is to make the control of the lights easier from the working position behind the camera, which entails a little more construction work and some wiring alterations. Then we will be done (perhaps!).

    By now you will have guessed that I get as much fun out of the construction of the rig as I do from taking pictures!

    Focus Stacking with a Raspberry Pi – New Light Box and Backlight Display

    Green Bottle Fly
    Green Bottle Fly

    I have made great strides in the last week, having devoted a serious amount of time to fine tuning the set up. And now I have been able to produce an image of a green bottle fly that I am reasonably happy with. (see picture on left).

    This was taken using a Nikkor 50mm f2.8 enlarger lens reversed onto a Minolta 135mm MD lens using an NEX7 camera with the new light box and display.

    The focus stacker system
    The focus stacker system

    I am really pleased with backdrop arrangement that I now have operational. It was much easier than I thought. I have had this old PC monitor lying around for some time and now it has a purpose in life!

    I have made a series of colour jpeg images in Photoshop – some flat and some grads. These are in a folder on the desktop and when opened using the windows photo viewer, I have it set up to provide a backdrop of roughly the right size. I can scroll through them to see what gives the best effect and adjust the size of the displayed window to suit the magnification I am using and get the gradient where it needs to be.

    Looking inside the light box
    Looking inside the light box

    The new light box was constructed and tested over an afternoon earlier this week week. It is about half as big again as the original one and is doing a much better job at diffusing the light. Inside there are some removable baffles to limit the back lighting.

    Stacker arrangement with new light box and pc display
    Stacker arrangement with new light box and pc display

    The light box extends further forward than the original one, and so can throw more light on the front of the subject. There are still a few hot spots and I am thinking about an inner diffuser made of white tissue paper like a tunnel over the specimen, to give more diffusion. This is also likely to demand a longer exposure so it will require some compromise.

    Nikkor enlarger lens reversed onto Minolta 135mm MD lens
    Nikkor enlarger lens reversed onto Minolta 135mm MD lens

    Also on my list was to play around with different focus increments on the same subject with the same lens configuration. The jury is still out on that, as it is quite a lengthy process to take the images, then process them and try to evaluate sharpness etc. I am getting there.

    I think that the rig is now 95% of where it needs to be – There are some minor changes required to the software for the Raspberry Pi that would help to speed things up a bit between shots and deal with a few bugs (software variety!) – nothing serious and a job for a rainy winter day.

    Stacker arrangement showing light box platform and lights - set up for double fly shot
    Stacker arrangement showing light box platform and lights – set up for double fly shot

    What now needs sorting out is my ability to prepare the specimens – particularly cleaning, and arranging the legs but there are other things too which I will cover at a later date. I am also looking at optical jacks that come in very small sizes for making minute adjustments to the height of the specimen when on the rig, for accurate framing. There are some relatively inexpensive ones available in the USA (of course) but the required postage to the UK is prohibitive.


What’s it all about?

Here are my jottings about my photographic projects and activities. I have been working on a focus stacking macro photography rig. There are quite a few posts about that. In addition I write about other photographic activities as and when!


Category Specific RSS


Warning: A non-numeric value encountered in /home/public/mhp_blog/wp-content/plugins/ultimate-social-media-icons/libs/sfsi_widget.php on line 238