I didn’t want to take the original thread off topic, and it is a bit old.
5628 bytes for PID line following? Sure, there should be a little library overhead, but that seems like an awful lot.
For reference, I’ve programmed a full PIC 16F882 coprocessor. You control is serially, and it drives a TB6612FNG with multiple different control schemes, controls 11 analog inputs, all of which can be read directly, and 5 of which are setup to return a digital 1/0 compared to a calibration value. As an odd useful bit, it also does it’s own PID line following routine, based off of the 5 digitized bits of line array data. The entire code is 3033bytes, or 1733 (14bit) words. All of the PID variables are signed ints, so the (8bit) chip is doing 16bit math.
When you say you stripped out all of the LCD and buzzer code, do you mean from the example? or the entire project (libraries + user code)?