Automatic detection of AutoPEEP during controlled mechanical ventilation