The OnShape project for the 3D Printed parts is here:
The GitHub repo is here. The rotary encoders are connected to an arduino that communicates over serial to a computer. A python program is running that calculates the appropriate motor action using a combination of energy-shaping and LQR controller. Check out the code and see Blog posts for more explanation.
There is an initialization procedure that uses limit switches to determine the end positions of the rail.
There are some things here that may be applicable for other projects. We printed the linear rail carriage. It turns out that a greased 3D printed part on a linear rail actually works really well. It can come out a little loose or tight from the printer. Put the PLA carriage in some boiling water for a few moments and then squeeze hard working it up and down the rail and it comes out reeeeeeaaaalll good.
Also we printed our gears for the belt. Despite some people's (understandable) categorical rejection of online platforms, OnShape has some really sweet gear production macros.
Now that we have a good platform, the goal is to try new control schemes. On the docket:
Neural Network based Reinforcement Learning
Model Predictive Control