Drilled holes in shelf and attached rack gear. It looks pretty good. Now I just need to find time to finish building the cart and get it all mounted on the shelf.
The first picture is the entire shelf with the rack mounted flush to the front edge. The second picture shows a closeup where the rack gear is attached to the aluminum bar using bolts, and the aluminum bar is attached to the shelf using wood screws.
This picture gives you an idea of what the whole system will look like once the cart is completely assembled and the linear bearing is mounted to the shelf. Of course, the second encoder will be moved to the new bracket on top of the cart once I make it.





