The present invention includes a
system for delivering energy to an
airway wall of a
lung comprising an energy delivering apparatus and a
PID controller having one or more variable
gain factors which are rest after energy deliver has begun. The energy delivering apparatus may include a flexible elongated member and a distal expandable basket having at least one
electrode for transferring energy to the
airway wall and at least one temperature sensor for measuring temperature. The
PID controller determines a new power
set point base on an error between a preset temperature and the measured temperature. The
algorithm can be Pi+1=Pi+G(αei+βei−1+γei−2) where α, β and γ are preset values and α is from 1 to 2; βis from −1 to −2; and γ is from −0.5 to 0−5. In another variation, the controller is configured to
shut down if various measured parameters are exceeded such as, for example, energy, impedance, temperature, temperature differences, activation time and combinations thereof. Methods for treating a target medium using a PID
algorithm are also provided.