Intervention: A pre-inclusion test (pressure support test) with a level of pressure support of ± 5 cmH2O of the P plateau, but no greater than 30 cmH2O (pressure-support level plus positive end-expiratory pressure), is performed to evaluate the patient's tolerance of this ventilation mode; the test is repeated daily until positive. The test could be stopped before 30 minutes if the patient showed evidence of respiratory distress (respiratory rate > 40 breaths per minute and FiO2 > 60% in order to obtain pulse oxymetry ≥ 95%). The test is considered positive when, after 30 minutes, the patient remained clinically stable with a respiratory rate lower than 40 breaths per minute and an expiratory tidal volume higher than 6 ml per kilogram of body weight within the authorized pressure-support range, with pulse oxymetry no lower than 95 percent when the fraction of inspired oxygen was no greater than 60 percent. When the pressure-support test is positive, the patient is randomized either to Arm 1 where the intervention is weaning with the support of Smartcare/PS or to Arm 2 where the intervention is weaning based on usual care. Both group are ventilated with the same ventilator: Evita XL.