Firmware for 3d printer