Previously, the authors have proposed a novel strategy called trajectory based combustion control for the free piston engine (FPE) where the shape of the piston trajectory between top and bottom dead centers is used as a control input to modulate the chemical kinetics of the fuel-air mixture inside the combustion chamber. It has been shown that in case of a hydraulic free piston engine (HFPE), using active motion control, the piston inside the combustion chamber can be forced to track any desired trajectory, despite the absence of a crankshaft, providing reliable starting and stable operation. This allows the use of optimized piston trajectory for every operating point which minimizes fuel consumption and emissions. In this work, this concept is extended to an electrical free piston engine (EFPE) as a modular power source. A dynamic model of a linear electrical free piston engine unit has been developed which consists of a single phase linear generator driven by a single cylinder engine. The linear generator unit not only provides the required electromagnetic force to ensure precise trajectory tracking for the piston in the combustion chamber, but also efficiently extracts the combustion energy to charge the battery. The concept has been experimentally validated in a hardware-in-loop setup. The combustion data corresponding to a predetermined piston trajectory is obtained from a controlled trajectory rapid compression and expansion machine (CT-RCEM) and the dynamic model is used to evaluate the electrical output corresponding to the combustion data.