kopia lustrzana https://github.com/jbruce12000/kiln-controller
Porównaj commity
4 Commity
27c64b3209
...
8b39f96d39
Autor | SHA1 | Data |
---|---|---|
jbruce | 8b39f96d39 | |
Jason Bruce | 78f88ea418 | |
Chip Garner | 0485ed961a | |
Chip Garner | 5b1c516260 |
|
@ -9,3 +9,4 @@ thumbs.db
|
|||
#config.py
|
||||
.idea/*
|
||||
state.json
|
||||
venv/*
|
||||
|
|
16
config.py
16
config.py
|
@ -60,10 +60,11 @@ except NotImplementedError:
|
|||
### Thermocouple Adapter selection:
|
||||
# max31855 - bitbang SPI interface
|
||||
# max31856 - bitbang SPI interface. must specify thermocouple_type.
|
||||
max31855 = 1
|
||||
max31856 = 0
|
||||
# uncomment this if using MAX-31856
|
||||
#thermocouple_type = ThermocoupleType.S
|
||||
max31855 = 0
|
||||
max31856 = 1
|
||||
# uncomment these two lines if using MAX-31856
|
||||
import adafruit_max31856
|
||||
thermocouple_type = adafruit_max31856.ThermocoupleType.K
|
||||
|
||||
# here are the possible max-31856 thermocouple types
|
||||
# ThermocoupleType.B
|
||||
|
@ -116,7 +117,7 @@ stop_integral_windup = True
|
|||
#
|
||||
# Simulation parameters
|
||||
simulate = True
|
||||
sim_t_env = 255 # deg C
|
||||
sim_t_env = 65 # deg
|
||||
sim_c_heat = 500.0 # J/K heat capacity of heat element
|
||||
sim_c_oven = 5000.0 # J/K heat capacity of oven
|
||||
sim_p_heat = 5450.0 # W heating power of oven
|
||||
|
@ -124,7 +125,10 @@ sim_R_o_nocool = 0.5 # K/W thermal resistance oven -> environment
|
|||
sim_R_o_cool = 0.05 # K/W " with cooling
|
||||
sim_R_ho_noair = 0.1 # K/W thermal resistance heat element -> oven
|
||||
sim_R_ho_air = 0.05 # K/W " with internal air circulation
|
||||
sim_speedup_factor = 1000
|
||||
|
||||
# if you want simulations to happen faster than real time, this can be
|
||||
# set as high as 1000 to speed simulations up by 1000 times.
|
||||
sim_speedup_factor = 1
|
||||
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -14,9 +14,7 @@ from geventwebsocket.handler import WebSocketHandler
|
|||
from geventwebsocket import WebSocketError
|
||||
|
||||
try:
|
||||
sys.dont_write_bytecode = True
|
||||
import config
|
||||
sys.dont_write_bytecode = False
|
||||
except:
|
||||
print ("Could not import config file.")
|
||||
print ("Copy config.py.EXAMPLE to config.py and adapt it for your setup.")
|
||||
|
|
12
lib/oven.py
12
lib/oven.py
|
@ -289,12 +289,12 @@ class Max31856(TempSensorReal):
|
|||
TempSensorReal.__init__(self)
|
||||
log.info("thermocouple MAX31856")
|
||||
import adafruit_max31856
|
||||
adafruit_max31856.ThermocoupleType(config.thermocouple_type)
|
||||
self.thermocouple = adafruit_max31856.MAX31856(self.spi,self.cs)
|
||||
self.thermocouple = adafruit_max31856.MAX31856(self.spi,self.cs,
|
||||
thermocouple_type=config.thermocouple_type)
|
||||
if (config.ac_freq_50hz == True):
|
||||
self.thermocouple.noise_rejection(50)
|
||||
self.thermocouple.noise_rejection = 50
|
||||
else:
|
||||
self.thermocouple.noise_rejection(60)
|
||||
self.thermocouple.noise_rejection = 60
|
||||
|
||||
def raw_temp(self):
|
||||
# The underlying adafruit library does not throw exceptions
|
||||
|
@ -303,7 +303,7 @@ class Max31856(TempSensorReal):
|
|||
# dict for errors and raise an exception.
|
||||
# and raise Max31856_Error(message)
|
||||
temp = self.thermocouple.temperature
|
||||
for k,v in self.thermocouple.fault:
|
||||
for k,v in self.thermocouple.fault.items():
|
||||
if v:
|
||||
raise Max31856_Error(k)
|
||||
return temp
|
||||
|
@ -664,7 +664,7 @@ class RealOven(Oven):
|
|||
|
||||
def heat_then_cool(self):
|
||||
pid = self.pid.compute(self.target,
|
||||
self.board.temp_sensor.temperature +
|
||||
self.board.temp_sensor.temperature() +
|
||||
config.thermocouple_offset, datetime.datetime.now())
|
||||
|
||||
heat_on = float(self.time_step * pid)
|
||||
|
|
Ładowanie…
Reference in New Issue