A switched controller was designed so that the power output of a free-piston linear expander is almost constant during a stroke cycle. The control system consists of an open loop system that accelerates the piston, a quadratic neural network controller which maintains the output power constant for most of the non-linear gas expansion process and a state feedback controller that decelerates the piston at the end of the cycle. The quadratic neural network is implemented to predict the dynamics of the system and to determine the required electromagnetic load force for constant power during the isentropic expansion. Its results are compared with two optimal controllers, for continuous time and discrete time models. The focus of the control is on the electromagnetic force and its calculation, leading to the determination of the states and input trajectories that yield the desired value of power. The design of the power electronics drive to generate the force is out of the scope of the thesis. The additional use of an energy storage system (ESS) reduces the drop of power during the change of stroke. Simulation results show the effectiveness of the proposed methodology.