A gas delivery system that provides positive airway pressure therapy. A mask couples to a patients face to deliver pressurized gas to an airway of the patient. The mask includes a flow generator system disposed on the mask and that pressurizes the gas, the flow generator including at least one motor. A controller controls the at least one motor.