Method and arrangement for providing an energy converter that includes a combustion system (1) including at least one piston (2, 3), at least one combustion chamber (6, 7) having at least one inlet (11, 13) and at least one outlet (10, 12) with inlet and outlet valves (14, 15, 16, 17). At least one controllable inlet valve and at least one outlet valve is also provided. A fuel supply is provided (18, 19) for supplying fuel and a medium containing oxygen is provided for induction into the combustion chamber (6, 7). An electric machine (9) is arranged to interact directly or indirectly with the piston (2, 3) in an electromagnetic manner such that it produces electrical energy from the piston movements, as well as uses electrical energy to affect the piston movement. A control unit (30) controls the combustion system (1) and the electric machine (9).The energy converter is arranged to adapt its power output depending on the required load of the energy converter. The invention also relates to a method for starting an energy converter.