A controller for controlling a flow of breathing gas provided to an airway of a patient via a patient circuit (56, 58), wherein the controller when in use is operatively connected with a pressurizing flow module (52, 60) coupled to the patient circuit (56, 58) and a carbon dioxide supplement system associated with the patient circuit (56, 58), wherein the pressurizing flow module (52, 60) generates the flow of breathing gas, and wherein the controller is configured to: communicate with a sensor (61, 62) adapted to monitor a characteristic of a breathing pattern of the patient, wherein an output of the sensor (61, 62) is provided to the controller, wherein the controller is further configured to: control the carbon dioxide supplement system to increase a fraction of inspired carbon dioxide in the patient circuit (56, 58) if the characteristic exceeds an upper threshold value, control the pressurizing flow module (52, 60) to provide servo-ventilation by supplying an increasing ratio of inspiratory pressure to expiratory pressure to the airway of the patient if the characteristic is less than a lower threshold value, and change the upper threshold value and the lower threshold value based on the monitored characteristic of the breathing pattern of the patient, characterized in that the lower threshold value for the characteristic is determined based on a mean value of the characteristic over a period of time; and the upper threshold value for the characteristic is determined by increasing or decreasing an initial value for the characteristic, the upper threshold value being decreased if a change in the mean value of the characteristic exceeds a predetermined limit, and the upper threshold value being increased if a frequency of a therapy supplied to the patient exceeds a predetermined frequency. communicate with a sensor (61, 62) adapted to monitor a characteristic of a breathing pattern of the patient, wherein an output of the sensor (61, 62) is provided to the controller, wherein the controller is further configured to: control the carbon dioxide supplement system to increase a fraction of inspired carbon dioxide in the patient circuit (56, 58) if the characteristic exceeds an upper threshold value, control the pressurizing flow module (52, 60) to provide servo-ventilation by supplying an increasing ratio of inspiratory pressure to expiratory pressure to the airway of the patient if the characteristic is less than a lower threshold value, and change the upper threshold value and the lower threshold value based on the monitored characteristic of the breathing pattern of the patient, control the carbon dioxide supplement system to increase a fraction of inspired carbon dioxide in the patient circuit (56, 58) if the characteristic exceeds an upper threshold value, control the pressurizing flow module (52, 60) to provide servo-ventilation by supplying an increasing ratio of inspiratory pressure to expiratory pressure to the airway of the patient if the characteristic is less than a lower threshold value, and change the upper threshold value and the lower threshold value based on the monitored characteristic of the breathing pattern of the patient, the lower threshold value for the characteristic is determined based on a mean value of the characteristic over a period of time; and the upper threshold value for the characteristic is determined by increasing or decreasing an initial value for the characteristic, the upper threshold value being decreased if a change in the mean value of the characteristic exceeds a predetermined limit, and the upper threshold value being increased if a frequency of a therapy supplied to the patient exceeds a predetermined frequency.