A controller for a positive airway pressure ventilator includes a processor and is coupled to a sensor to detect spontaneous breathing of the patient and a ventilation generation device and controls the ventilation of the patient so that: a first machine breath is initiated as a function of an initial timing threshold when a spontaneous breath is not detected (20, 24, 26), the initial timing threshold is modified 28 if a continued absence of a spontaneous breath is detected, and a second machine breath is initiated as a function of the modified timing threshold during the continued absence of the detection of a spontaneous breath.