PeteLawler / BeagleBrew

A Beaglebone Black fork of a Raspberry Pi Temperature Controller for homebrewing and sous vide cooking
1 stars 1 forks source link

Divide by Zero #45

Open PeteLawler opened 7 years ago

PeteLawler commented 7 years ago

Seems that if one (at least) sets the cycle time to '0' and sends an 'auto PID' command, bad things happen....

python[14875]:   File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
python[14875]:     self.run()
python[14875]:   File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
python[14875]:     self._target(*self._args, **self._kwargs)
python[14875]:   File "/opt/BeagleBrew/beaglebrew.py", line 413, in tempControlProc
python[14875]:     pid = PIDController.pidpy(cycle_time, k_param, i_param, d_param) #init pid
python[14875]:   File "/opt/BeagleBrew/pid/pidpy.py", line 59, in __init__
python[14875]:     self.k1 = self.kc * self.td / self.ts
python[14875]: ZeroDivisionError: float division by zero