Well, there's a title that I guess a lot of people won't understand. So what the bejeezus is a "macro rail" and why would you use one for "focus stacking" (and more importantly, how do you create one?)
I am not going to go into microscopic details on some of the basic photography terms here but will provide some wiki links where appropriate.

Image taken by me
Depth of field
One of the inherent problems of macro photography is that you end up with a very shallow depth of field in your images. That can mean that the eye of the bug you are shooting is in focus but the rest of the body behind the bug and the head or antenna in front of the eyes are out of focus. You can mitigate that to a certain extent by stopping down your aperture but if you go too far you end up with other kinds of image quality issues such as diffraction. There is often a sweet spot for macro lenses around the f11-f16 area, but this still gives you a minuscule depth of field.
When you start heading into the microscopic level of details such as photographing the eyes of flies and spiders, your depth of field is so limiting that you cannot even get the whole of the eye in focus. This is the kind of thing im looking to do, hence my interest in the method described in this post.
So if you wanted to get the whole of a bug in focus from nose to tail, what do you do?
Focus stacking
The basic concept of focus stacking is shooting a collection of images but moving the focus backwards and forwards in each shot. Then afterwards, in photoshop or some other software, you can merge the images together to get a sharp image from the nearest point to the furthest.
An example image from the zerene stacker website showing how multiple images with a tiny DOF can be merged to form something that is very sharp throughout
So that seems pretty simple right; take a load of images at different focus points and let some software do the magic? If only it was that easy.
In the field
Focus stacking in the wild is not easy. It involves a lot of luck with regards to getting multiple images of a subject at different focal points without the subject moving. If the subject moves during the series of images then the stack is not going to work. As you can imagine, with insects this is near impossible other than at times first thing in the morning and last thing in the evening. Even then, manually moving the camera and getting enough quality images is very very tricky
In the studio
The other option is the one that I am looking into; focus-stacking in a studio environment. This more often than not means setting up deceased specimens (but it is possible with live specimens with the right equipment). Some macro photographers will either chill or freeze specimens but I find that somewhat ethically dubious so my intention is to find dead beasties or bring them indoors first thing in the morning or in the evening when they are least active and then put them back after the shoot.
Macro rails.
In the studio, you can use a neat bit of equipment called a "macro rail". It's a pretty simple concept; the camera is mounted to a linear guide rail. A stepper motor turns a threaded rod which in turn moves a carriage down the rail. This setup allows very small movements which you can calculate with the specifications of the rail and motor...
The stepper motor has a 1.8° step angle, which when you divide that into 360° (a full rotation) means you get 200 steps per turn of the motor.
The thread on the rod has a 2mm pitch which means that each full rotation will move the carriage 2mm.
So 2mm divided by 200 steps means that each step on the motor will move the carriage 0.01mm. An absolutely tiny amount - perfect for getting shots at lots of different focal points. You can also get threads with a 1mm pitch which gives twice the resolution and a 0.005mm movement per step. There is a bit of an accuracy limit on these rails, but that can be mitigated with various modifications which I will go into in another post.
Arduino controller
In order to control the camera both in terms of movement and shutter firing, I plan to use the trusty Arduino Uno. They are really cheap and are capable of controlling a multitude of things with some pretty basic coding. I have used an Arduino and stepper motor before when I built a custom timelapse rig using a very similar guide rail system. I also use the Arduino for my water drop system too. You can find details of both of those setups in my blog history.
I'll go into more detail about the electronic side of things in the next post where I'll demonstrate how to set up the Arduino with a simple stepper motor and use the Blynk app to be able to configure the system and control it.
Thanks for reading and stay tuned for the next part which is coming soon(ish)
Mark