close encoder