Page 1 of 1

Closed-loop motor control for better positioning

Posted: Thu Dec 10, 2015 10:50 pm
by 100ideas
Ben Weiss' masters Mech E thesis was on "Closed-Loop Control of a 3D Printer Gantry" (pdf).

He added linear encoders and independent controllers (based on teensy) to the x- and y-axes of a makerbot-style printer (MBot CUBE). His thesis contains detailed information about the background and implementation of his mod, including circuit and mechanical diagrams, and he has posted source code for his specialized single-axis drivers to github, as well as a modified marlin firmware to work with them.

Project overview here: ... op-control

From his thesis:

The Master Controller code runs on a standard Arduino Mega (1280 ADK or 2560), which is outfitted with a normal RAMPS shield. The Axis Controller runs on a PJRC Teensy 3.0/3.1. A wiring schematic is available in the Schematic folder of the Closed Loop Axis Controller codebase. The actual sensor used is an AMS AS5311 with 0.5um precision. A carrier board was designed by Matthew Sorensen and is available here, and follows closely the documentation in the AMS datasheet.

He concludes:

Even though attempts to implement complex controllers failed, a simple PI controller, roughly tuned, showed performance improvements that reduce path tracking error in circle and star trajectories by more than 40%, cut print time by up to 25% by increasing acceleration rate with only minimal loss of accuracy, and detected and recovered from skipped steps in a matter of millimeters. Further development and better tuning of the control algorithm should result in further improvements.

Also, his thesis provides lots of information on certain key Marlin firmware variables that aren't well documented elsewhere, such as movement speed, print speed, acceleration change (jerk), and cornering speed. If you are messing with those variables, check out his work.

Marlin and Sailfish both support varying acceleration and include code that could dynamically adjust the acceleration rate so that diagonal moves accelerate faster (both X and Y motors can share the torque load when accelerating diagonally), but the way the code is written this dynamic acceleration is only available if a_axis < a_max < sqrt(2*a_axis), where a_axis is the axis maximum acceleration and a_max is the system maximum acceleration. This kind of configuration is suggested neither in the documentation nor in Sailfish or Marlin firmware defaults. The accelerations reported in this section are a = min(a_axis, a_max).

Re: Closed-loop motor control for better positioning

Posted: Thu Dec 10, 2015 10:56 pm
by 100ideas
Also just discovered a page on the reprap wiki about a partially-documented closed-feedback project. ... l_feedback