Method for the open-loop and closed-loop control of an internal combustion engine having an open-loop and closed-loop control device, in particular for the open-loop and closed-loop control of a diesel engine or gas engine, and having a generator and having an asynchronous machine, wherein the asynchronous machine is activated by means of a switch and the method comprises the steps of: - detecting at least one electrical characteristic variable of the generator, wherein the electrical characteristic variable is selected from current or voltage, - determining a change (Δ) in the electrical characteristic variable of the generator in a predetermined time interval, - comparing the change (Δ) in the characteristic variable with a first threshold value, - in the event that the change (Δ) in the characteristic variable is greater than the first limit value, changing over from standard speed control to feed-forward control of the open-loop and closed-loop control device of the internal combustion engine, wherein - the standard speed control comprises continuously determining a standard target injection quantity based on a comparison between the target speed (nSL) and the actual speed (nIST) of the internal combustion engine, and - the feed-forward control comprises determining an adjusted target injection quantity based on an extent of the change (Δ) in the characteristic variable, and - again determining the change (Δ) in the characteristic variable, - comparing the change (Δ) in the characteristic variable with a second limit value, which is smaller than the first limit value, and, - in the event that the change (Δ) in the characteristic variable is smaller than the second limit value, changing over from feed-forward control back to standard speed control. - detecting at least one electrical characteristic variable of the generator, wherein the electrical characteristic variable is selected from current or voltage, - determining a change (Δ) in the electrical characteristic variable of the generator in a predetermined time interval, - comparing the change (Δ) in the characteristic variable with a first threshold value, - in the event that the change (Δ) in the characteristic variable is greater than the first limit value, changing over from standard speed control to feed-forward control of the open-loop and closed-loop control device of the internal combustion engine, wherein - the standard speed control comprises continuously determining a standard target injection quantity based on a comparison between the target speed (nSL) and the actual speed (nIST) of the internal combustion engine, and - the feed-forward control comprises determining an adjusted target injection quantity based on an extent of the change (Δ) in the characteristic variable, and - the standard speed control comprises continuously determining a standard target injection quantity based on a comparison between the target speed (nSL) and the actual speed (nIST) of the internal combustion engine, and - the feed-forward control comprises determining an adjusted target injection quantity based on an extent of the change (Δ) in the characteristic variable, and - again determining the change (Δ) in the characteristic variable, - comparing the change (Δ) in the characteristic variable with a second limit value, which is smaller than the first limit value, and, - in the event that the change (Δ) in the characteristic variable is smaller than the second limit value, changing over from feed-forward control back to standard speed control.