A positive airway pressure apparatus includes a flow generator (30), a controller (80), and a pressure sensor (50) configured to sense pressure. Several input signals are provided for the controller, which regulates pressure in the apparatus by sensing pressure in the apparatus and adjusting the pressure of gas produced by the flow generator to provide a comfortable application of pressurized gas during a breathing cycle.