fixed critical bug in pid_1d. Added constraint for i-Term. Scaled error in i-Term according to dt.