The miniaturization of electrical equipment and the popularity of portable devices drive the development of small thermal engines. However, as the size of engines shrinks, problems that can be neglected at conventional scales become prominent in micro-compact heat engines. Micro free-piston generators, with their flexible piston trajectories, present innovative solutions to common problems and hold great potential for enhancing performance. Therefore, this paper proposes the design principles of the MFP system controller, determines a hierarchical control scheme for piston trajectory tracking and a dual state SISO controller. Through numerical simulation and experimental research under controlled and uncontrolled conditions, the effectiveness of the proposed controller in trajectory tracking and performance enhancement is demonstrated. The results show that, the position steady-state tracking error of feedforward feedback composite PID control is less than ±10 μm, improved by 77 % compared to traditional PID control; the step response of fuzzy PID control is more sensitive, the overshoot is less than 0.3 %; throughout the entire cycle, with a tracking error of no more than 1 mm, the actual cyclic displacement following error below 1.5 mm; the optimized piston trajectories lead to a power generation efficiency increase from 2.37 % to 2.72 %, reflecting a 14.8 % improvement.