Design of a switched control system for a free-piston linear expander