Pilot valve with feedback of position