Marlin works with optical senses jsut fine, both my CNC PCB cutter and my laser cutter have optical endstops and RAMPS.