I’m new to Raspberry Pi, or any modern micro and not a programmer either. I’m an old EE that designs chips (RF & Analog). I do understand general hardware/motors fairly well, but not so good with software/controllers. Would like to get a Raspberry Pi system up and running and learn to do some things that would be useful for my interest which is photographing the chips I’ve and others have designed. Macs are the main computers I have access to, and prefer to stay away from PCs if possible. I’ve ordered a Raspberry Pi development kit and add on stepper motor control PCB from another source before finding this site. From what I’ve seen here at Pololu, this seems aligned little closer to what my interests are in setting up a stepper motor control system, especially with the Tic stepper controllers boards and the DRV8825, and all the folks discussions.
One area of particular interest is macro photographing chips using focus stacking where a linear stage is driven by a stepper motor controlled by some computer. Focus stacking helps with the shallow depth of field in macro, and popular with insect macro-photography. The stage is usually driven by a NEMA 17 stepper motor which turns a screw thread moving the stage which holds the camera & lens, so focus stacking is achieved by moving the camera/lens rather than using the lens focus ring. I have a few of these setups now that use various dedicated computer/controllers from various vendors specializing in this and some that require an additional computer (PC, Mac, iPad, iPhone) for setting up the stacking parameters and running the system. These all work well for their intended purpose, running a single stacking session.
What I would like do is run a focus stacking session, then move the subject to a new location, run another stacking session and move the subject to another location and repeat. This will produce a panorama type macro where the single stacking session only covers a portion of the subject, resulting in multiple stacking sessions covering there entire subject. These individual stacking sessions will the focus stacked with dedicated software (Zerene for example), then the stacked image renderings “stitched” into a final macro-panoramic image in Photoshop or other dedicated software. I’ve done this successfully by hand few times (moving the subject) to realize that a dedicated system might be useful. Some commercial dedicated systems are available but most are out of my price range and some only work with PCs (I only have Macs).
So what I need to do is control the Vertical Z stage (stepper motor) which will hold the camera/lens setup for focus stacking, then move the subject which will be mounted to an XY stage orthogonal to the Z axis on the Horizontal base with a separate stepper motor for X and one for Y. The subject will be moved in X and Y directions, while the Z direction will be for focus stacking.
For setting up the overall stack and panorama session, I’ll need to define the stacking (Z) beginning, stack depth or end, number of stacks or step size, stepper movement (micro stepping, speed, backlash), wait times (for vibration settling), trigger camera & delayed trigger strobe/flash. Then will require the X movement and Y movement parameters. The X and Y movements don’t need the precision of the Z axis movements and are relatively coarse (many microns to a few mm), however the Z axis requires precise movements down to a ~ 1 micron. I already got linear rails (surplus THK KR20 for example) with 1mm thread pitch and 400 step NEMA 17 motors, thus producing 2.5 micron steps without micro-stepping. I have other rails that I can use for the less precise X and Y stages, these also have 400 step motors.
For an example, the subject might be a chip with 20mm by 14mm dimensions and the lens system has a field of view of ~6mm, but the chip is tilted to give a somewhat “3D” look and has a depth of ~2mm. The lens has a magnification of 5X and a depth of field (in focus area) of only 0.05mm. With overlap this will require 4 separate X stacking sessions and 3 separate Y stacking sessions, or 12 in total, and each Z stacking session will require about 50 separate images. Overall ~600 separate images will be collected. I’ve already done this a few times requiring ~6000 images by hand (moving the X & Y subject positions) and it’s quite tedious indeed!!
Anyway, I would like to start with a Raspberry Pi 3 system that will be eventually stand alone without the requirement for another computer (although initially another computer to sort things out and a Mac development computer is OK), can handle this effort described, has a display and possibly a means to enter data parameters (touch screen or remote keypad-board). Note the Raspberry Pi does not need to collect any image data, just control the stacking sessions Z axis (stepper motor) focus rail and the XY subject positioning rails (stepper motors), and allow setting up the various stacking session parameters.
I understand that Python is probably a good start. I’ve looked at some stepper motor tutorials and the code and have a general idea of how to directly control the motors (like turning ON, then OFF the I/O pins which drive the controller H bridge and cause the motor to make 1 step), but the detail code initial setup and such for communicating and loading the various libraries is still a little daunting, but I’m making some progress!!
Thanks for the time reading this initial long post and any help/guidance/assistance/recommendations are greatly appreciated.