Respiratory failure is a typical clinical issue which needs immediate help with mechanical ventilation while the hidden reason is recognized and treated. Mechanical ventilation can damage the lungs if not used properly. It is desirable to provide the desired blood levels of CO2 and oxygen with limited pressure to avoid causing the lung injury. This paper uses the adaptive inverse dynamics control technique to control a two-compartment modeled respiratory system. Based on the nonlinear respiratory model and desired respiratory pressures, the inverse dynamics control method was applied and computer simulations were conducted to evaluate the performance of the control method. Our preliminary results indicate that the tracking errors can be improved if the parameter values associated with the control scheme are properly used. More extensive computer simulations and performance robustness are currently under investigation.