Using encoder to find corner angles