The filament detector is used to detect whether there is filament at the extruder position, which can effectively prevent the printer from printing empty.