Double-acting pneumatic cylinder with magnetic sensors