A control device for controlling the amount of energy stored in a storage device, comprising: a control unit comprising a converter unit and a microcontroller, hereinafter MCU, adapted to: - receive a voltage signal (Vin), which indicates the amount of energy currently stored in the storage device; - adjust the power (Pin) received via an input of the control device, based on the amount of energy currently stored in the storage device, wherein the converter circuit is adapted to adjust the received power (Pin) based on control signals (CS1, CS2) received from the MCU, and adjusting the power (Pin) including adjusting a maximum current value of the converter circuit based on the amount of energy currently stored in the storage device, - output the adjusted power (Pout) via an output of the control device to the storage device, characterised in that the control signals (CS1, CS2) from the MCU comprise a first control signal for controlling a duty cycle of a switching device included in the converter circuit, and a second control signal for controlling the maximum current value of the converter circuit, wherein a current sensing device senses a current flowing through the switching device, and wherein the switching device is turned off when the current flowing through the switching device reaches a predetermined value while the duty cycle is still in turn-on time. a control unit comprising a converter unit and a microcontroller, hereinafter MCU, adapted to: - receive a voltage signal (Vin), which indicates the amount of energy currently stored in the storage device; - adjust the power (Pin) received via an input of the control device, based on the amount of energy currently stored in the storage device, wherein the converter circuit is adapted to adjust the received power (Pin) based on control signals (CS1, CS2) received from the MCU, and adjusting the power (Pin) including adjusting a maximum current value of the converter circuit based on the amount of energy currently stored in the storage device, - output the adjusted power (Pout) via an output of the control device to the storage device, characterised in that the control signals (CS1, CS2) from the MCU comprise a first control signal for controlling a duty cycle of a switching device included in the converter circuit, and a second control signal for controlling the maximum current value of the converter circuit, wherein a current sensing device senses a current flowing through the switching device, and wherein the switching device is turned off when the current flowing through the switching device reaches a predetermined value while the duty cycle is still in turn-on time. - receive a voltage signal (Vin), which indicates the amount of energy currently stored in the storage device; - adjust the power (Pin) received via an input of the control device, based on the amount of energy currently stored in the storage device, wherein the converter circuit is adapted to adjust the received power (Pin) based on control signals (CS1, CS2) received from the MCU, and adjusting the power (Pin) including adjusting a maximum current value of the converter circuit based on the amount of energy currently stored in the storage device, - output the adjusted power (Pout) via an output of the control device to the storage device, characterised in that the control signals (CS1, CS2) from the MCU comprise a first control signal for controlling a duty cycle of a switching device included in the converter circuit, and a second control signal for controlling the maximum current value of the converter circuit, wherein a current sensing device senses a current flowing through the switching device, and wherein the switching device is turned off when the current flowing through the switching device reaches a predetermined value while the duty cycle is still in turn-on time.