I have now completed the new control box for the focus rail that I described how to build in a post I made a year or two ago. Actually, the new control box is capable of a great deal more than controlling a focus rail. The current version is set up to control three motors so that the X, Y and Z position of the camera/object can be set in 3D space. Thus, the control box can be used for both Z stacking and stitching images. Further, the number of motors can easily be expanded to 5 allowing control of rotation in 2 planes with the object of making macro stereo photographs. The box includes 8 opto-coupled outputs arranged to allow the triggering of 4 cameras/flashes (only 4 because 2 outputs are used per camera to activate pre-focus and the shutter). Unused at the moment, but already incorporated, are 8 analogue/digital inputs that could either be used to trigger motor movements, or allow cameras and flashes to respond to external events, or one or more could be used to stop the motors when a limit is reached.
The menu system is driven by a rotary encoder and incorporates a ‘click sensitivity’ option that allows the encoder to increase any variable by between 1 and X for each rotational click. The use of the encoder provides for a much more responsive and versatile interface than a button pad. There is a switch to turn off power to the motors that is useful both when testing, to prevent heating of the motor, and also as an emergency stop! An LED indicates when the motor is active and there is an external button to reset the microprocessor. I have used an Arduino Mega 2560 because it is significantly more capable than an Uno. Further expansion would not be a problem bar finding room in the control box and having the abilities of a spider where routing the wiring is concerned. EasyDriver boards (http://www.schmalzhaus.com/EasyDriver/) control the motors and commercially available opto-coupler boards are used for the flash and camera output control signals. In theory, the design could easily be used to control a pan and tilt system for hyper-resolution photography and/or virtual 3D. The programming leans heavily on an interrupt-based encoder library that enables the encoder to be read while the sketch is busy doing other things (see http://www.pjrc.com/teensy/td_libs_Encoder.html). The current sketch is about 600 lines including comments etc.
The approximate cost of all the hardware, assuming a Mega clone such as a Funduino is employed, is about £35. Because all the components are available as finished boards, the only difficult things are the point-to-point wiring between them, and between the boards and the sockets etc. Mostly, the wiring can be done using Dupont jumper cables.
The little video of the prototype below shows the bare bones of the project in action. The mechanics of the X&Y axes have yet to be constructed – they could simply be repeats of the design I published earlier but my intention is to motorize an old microscope mechanical stage and incorporate on it a rotary table rather like the one I also described in a previous post. When I am happy with the code, I will publish the sketch that will control the mechanical gubbins. Meantime, it functions very well as an alternative to the push-button control box that I made for my focus rail.
By way of cheering up those, including myself, that make stupid mistakes, the reason the control box is shown powered from both a USB input and an external power supply, is because I blew the Arduino’s external psu circuitry by connecting its 5V output to the 5V output on an EasyDriver!