Skip to content

Commit

Permalink
Update SwitchInternalPIDRegulation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Yagami-Jiang committed Jul 20, 2023
1 parent ed9562c commit 2cbcac2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ def pid_control(self):
sw_temp = self.exception_data_handling()
if not sw_temp:
return DUTY_MAX
if len(T_LIST) < 3:
if len(T_LIST) < 2:
T_LIST.append(float(sw_temp))
self.syslog.debug("Init PID Control T_LIST:%s" % T_LIST)
logging.info("Init PID Control T_LIST:%s" % T_LIST)
self.syslog.debug("Init Switch Internal PID Control T_LIST:%s" % T_LIST)
logging.info("Init Switch Internal PID Control T_LIST:%s" % T_LIST)
return PWM_LIST[0]

else:
Expand All @@ -147,6 +147,6 @@ def pid_control(self):
% (PWM_MAX, PWM_MAX))
pwm_k = PWM_MAX
PWM_LIST[0] = pwm_k
T_LIST.pop(0)
logging.info("Switch Internal PID: PWM=%d Temp list=%s" % (pwm_k, T_LIST))
T_LIST.pop(0)
return pwm_k

0 comments on commit 2cbcac2

Please sign in to comment.