## When Tuning the PID Controller, the D Gain Has a Different Sign from the I Gain

When you design a controller using PID Tuner, the resulting derivative gain, D, can have a different sign from the integral gain I. PID Tuner always returns a stable controller, even if one or more gains are negative.

For example, the following expression gives the PID controller transfer function in `Ideal` form:

`$c=P\left(1+\frac{I}{s}+\frac{Ds}{\frac{s}{N}+1}\right)=P\frac{\left(1+DN\right){s}^{2}+\left(I+N\right)s+IN}{s\left(s+N\right)}$`

For a stable controller, all three numerator coefficients require positive values. Because N is positive, IN > 0 requires that I is also positive. However, the only restriction on D is (1 + DN) > 0. Therefore, as long as DN > –1, a negative D still yields a stable PID controller.

Similar reasoning applies for any controller type and for the `Parallel` controller form. For more information about controller transfer functions, see the PID controller block reference pages.