PID control in real robots

CS 480: Robotics & 3D Printing Lecture, Dr. Lawlor

PID controllers have 3 gain factors:
The ardupilot user interface actually has a graphical user interface entry for tuning PID parameters.

If you open pronterface, you can manually interact with the printer firmware via direct gcode commands.  Most printer firmware supports modifying PID settings.

The M301 command will show the PID parameters for the hotend.

The M303 command will automatically tune PID for the hotend.  This can improve heat-up time, and temperature consistency.  The code for this is in Marlin/temperature.cpp:PID_autotune, the underlying math is here, but the basic idea is to run an experiment to compute the time period for the system's oscillations, Tu, and the maximum stable proportional gain Ku, from which we can calculate the Kp, Ki, and Kd parameters.

The
M503 command can report your printer's current motion control settings.  Stepper motor motion control is "open loop", meaning there is no feedback error command for PID, but the velocity, acceleration, and jerk limitations are similar to a second-order PIDD scheme.