@fcwilt It's a torch height controller (THC) for a cnc plasma. They're quite common for plasma cutters, they read the arc voltage and move the Z axis up and down accordingly to keep the arc voltage (and thus cutting height) consistent.
dc42 told me about the height following mode in reprap firmware, but the documentation on it isn't too detailed. I'm not sure how the target value is set. The external controller does a few other things which I don't see a way to do on the mainboard.
The way a cnc plasma starts a cut is the machine first probes for the material height, moves up to a pierce height, fires the torch, waits for the material to be fully pierced, then moves down to a cut height before starting to cut the given shape.
The THC is alerted when the machine reaches the cut height via an output pin from the mainboard. It then starts a short timer to allow the machine to move aware from the pierce location and the arc voltage to stabilize to the cut height before it is sampled (the arc voltage at the pierce location is higher than what it would normally be at the cut height, because the pierce creates a wide hole which means the arc needs to be longer to reach the material). I've tried implementing this in gcode with the current smoothie setup, by putting M10 (what I use for the THC on gcode, M11 for off) in at some point after the torch has moved away from the pierce location, but this creates a noticeable stutter/stop-start where it is placed between G1 moves.
This timer delay is the first need for a separate MCU. The second reason for separate MCU is that it also runs some logic with regards to setting the cut height, and what to do in edge cases, that a simple PID controller cannot do. When the timer runs out, the THC takes a few dozen samples of the arc voltage and takes the average, and sets that as the target voltage. It also has a minimum/maximum arc voltage threshold programmed in, so that if there is any issue with the initial readings it doesn't cause the machine to just climb or dive the Z axis. The minimum/maximum allowable z values in the height follower mode cannot replace this function, since the material is almost never flat, and warps while cutting, so you could start at a high point and have to dive into negative Z values in order to follow the surface of the material. There is also handling of edge cases such as if the cut goes off the edge of the sheet or getting too high off the material, or if the torch ends up touching the material being cut (material can sometimes buckle up or down quickly and violently from the heat warping it), and these need to be handled in a way other than a PID controller.
TLDR; It can take a bunch of measurements from the plasma cutter arc voltage and take the average to use for the target z height. It can implement a delay so that the target voltage is measured once the machine has moved away from the pierce point (which would otherwise give a reading that is too high). And it can handle edge cases which a PID controller can't.