At first I was using the 2400dpi mode of the printer. I now switched to
the native resolution of 1200dpi because the results are way better. The
2400dpi mode can still be used if a #define in config.h is changed.
I started getting paper jam errors which was likely to be caused by
communication between printer controller board and operator's panel
toggling the tapped data line and therefore resetting the MCU board's
state to the idle state while printing. If the state is reset before the
signal sequence is completed, the printer of course will not get the
sensor signals it is expecting.
The line had been commented out because it had caused some weird
problems in the past. For example, my printer now needs a hard reset
after each print because it refuses to print a second time. As I think
not being able to print at all is worse than that, I put the line back
into the code.