Image sub-pixel measurement algorithm for linear motor rotor position detection