The requirement is for the two rails to be absolutely parallel, both horizontally and vertically. To deal with the second of these first - I ensured that the two rails both sat on "perfectly" level surfaces. This meant that I could adjust each side separately because "level" is a measurable quantity. I actually used a precision level bought from eBay for the purpose. Probably a bit more sensitive (and therefore more difficult to use) than necessary, but it needs to be better than you can achieve with a builder's level. I had used epoxy on my rails, but did not achieve a perfectly level surface all the way along so i ended up using shims to compensate. With the aid of the precision level, this was not too difficult. Note that I have talked about leveling each side individually. I deliberately built in the capability of dealing with two rail surfaces that were not coplanar. Other people talk about using a bridge between rails to achieve coplanar surfaces which is a good idea if you can do it; I preferred to allow for a small error in height (about 1mm, measured with a builder's level).

The other requirement is that the rails are parallel in the horizontal plane. Actually, getting them parallel is the easy part. The difficult part is bolting down the first rail absolutely straight. I used a straightedge as best I could, although it was not the full length of the rail. However, for a woodworking machine I decided that this was good enough. If I figure out how I can do better, I can always adjust it again. Once the first rail is in place, you can use the gantry to set the position of the second rail. Lightly bolt it in place so that it can move sideways, set up the gantry, and slide it along. This will bring the second rail into alignment and you can tighten the bolts as you go. This is actually one of the methods described in the Hiwin catalogue, if you cannot machine accurate reference edges into the machine structure. When you have finished, you should be able to move the gantry the whole length of the rails with very little effort. Note that the bearings actually move more smoothly if they have some load on them. These profile rails and bearings are amazing. When I was setting up my machine, at one point I had the bearings fitted to one end of the gantry while I was adjusting the second rail. I tried to support the gantry weight while the second rail was not in place but I realised that I had forgotten to do this. The end of the gantry (probably roughly 20kg?) sagged by no more than a couple of millimetres, while it was held at one end only by two Hiwin bearing carriages.

I also spent some time aligning the ballnuts and ballscrews. I started by ensuring that the ballscrews when held in the ballnut were parallel to the rails both vertically and horizontally. Gantry in the middle of its travel and ballscrew screwed into the ballnut so that it was more-or-less balanced, and no bearings fitted. I could then measure the level of the ballscrew (spirit level) and distance from the frame (as the rail was pretty much parallel to the side of the frame). I then converted these measurements into the size of shims I needed behind the ballnut mounting plate to bring the ballscrew into alignment. Once this was done I could fit and adjust the bearings at each end by turning the ballscrew (I actually used a cordless drill to wind it backwards and forwards) to bring the ballnut as close as possible to the bearing, then tightening the bearing mounting plate fixings with the bearing positioned by the ballscrew. Repeat at each end, then test. It took a while to achieve all this, but it did work.