TL;DR: SIMULATED ANNEALING.

Heuristic calibration routine was deleted and replaced with an experimental "simulated annealing" setup. Rather than probe-test-probe-test forever, we simulate the axis positions generated by an "ideal" (perfectly aligned and calibrated) printer using inverse kinematics. We then depth-map the print surface (or generate test depths using a simulator) and then use a variation on "simulated annealing" to locate the settings most likely to produce the observed (or simulated) depths. This is still a work in progress, but the simulator works - at least partially.

find_optimal_config() added: Uses a binary search to figure out the simulated forward kinematics with the lowest deviation (energy) for a given variable.

move_randomly_towards() added: Moves a value a random distance in the direction of an optimum. The distance reduces over time in accordance with simulated annealing. If the move would overshoot the optimum, the distance is divided by a number (I find 2 is good). This helps reduce "boiling," in which the annealing gets stuck at undesirably high energy levels.

calc_energy() added: Measures the energy (average of a depth map's Z-values from zero) of all points in a depth map.

simulate_IK() and simulate_FK_and_get_energy() added: Allows us to directly use the printer's forward and inverse kinematics solvers to simulate virtual printer configurations.

"Pretty printing" of depth maps (real or simulated) moved out of depth_map_print_surface() into its own method, print_depths().

Kinematics getters and setters can now optionally _not_ update the printer's kinematics. We often update lots of kinematics at the same time and we don't need the printer to re-calculate all the kinematics until after the last update.

New KinematicSettings class for saving and loading kinematics.

New TestConfig class for managing test configurations.

print_kinematics() added: Can print either the current kinematics, or a KinematicSettings.

calc_statistics() added: Calculates min, max, mu (mean) and sigma (standard deviation) on an array of floats.

Replaced the old, separate calibration routines for endstops and delta radius with a new "iterative" calibration routine that converges endstops and delta radius at the same time. It usually runs MUCH faster than calling the old routines separately, and unlike doing them separately, this routine doesn't leave either in a less-than-perfect state. (Calibrating the endstops and then calibrating the delta radius leaves the endstops slightly askew.)