Low-cost closed-loop control of a 3D printer gantry