 The investigators plan to prospectively randomize patients on mechanical ventilation at the point of weaning evaluation, to undergo spontaneous breathing trials with our current ventilatory mode Continuous Positive Airway Pressure or the new mode Automatic Tube Compensation. Based on predefined physiologic and clinical variables, clinicians will decide whether patients are ready to be removed from mechanical ventilation. The proportions of successful discontinuation no need to reinstitute mechanical ventilation and the duration of the weaning period in both groups will be compared. During the spontaneous breathing trials, respiratory variables will be measured and compared between patients with successful vs. non successful discontinuation in order to evaluate their predictive value for successful outcome. 