Systems and methods of providing a breathing gas are provided. The method includes, for example, sensing a parameter associated with the delivery of a breathing gas, changing a valve position in response to a change in the sensed parameter, determining a breathing state based on the valve position, and causing a change in the sensed parameter of the breathing gas based on the determined breathing state.