| 
									
										
										
										
											2013-11-29 23:13:06 +00:00
										 |  |  | import logging | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-07 10:27:34 +00:00
										 |  |  | ######################################################################## | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #   General options | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### Logging | 
					
						
							| 
									
										
										
										
											2013-11-29 23:13:06 +00:00
										 |  |  | log_level = logging.INFO | 
					
						
							|  |  |  | log_format = '%(asctime)s %(levelname)s %(name)s: %(message)s' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-07 10:27:34 +00:00
										 |  |  | ### Server | 
					
						
							| 
									
										
										
										
											2013-12-06 22:16:51 +00:00
										 |  |  | listening_ip = "0.0.0.0" | 
					
						
							| 
									
										
										
										
											2014-12-19 11:11:01 +00:00
										 |  |  | listening_port = 8081 | 
					
						
							| 
									
										
										
										
											2013-12-06 22:16:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-08 04:41:06 +00:00
										 |  |  | ### Cost Estimate | 
					
						
							| 
									
										
										
										
											2018-11-27 16:18:40 +00:00
										 |  |  | kwh_rate        = 0.18  # Rate in currency_type to calculate cost to run job | 
					
						
							|  |  |  | currency_type   = "$"   # Currency Symbol to show when calculating cost to run job | 
					
						
							| 
									
										
										
										
											2016-07-08 04:41:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-07 10:27:34 +00:00
										 |  |  | ######################################################################## | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #   GPIO Setup (BCM SoC Numbering Schema) | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #   Check the RasPi docs to see where these GPIOs are | 
					
						
							|  |  |  | #   connected on the P1 header for your board type/rev. | 
					
						
							|  |  |  | #   These were tested on a Pi B Rev2 but of course you | 
					
						
							|  |  |  | #   can use whichever GPIO you prefer/have available. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### Outputs | 
					
						
							|  |  |  | gpio_heat = 11  # Switches zero-cross solid-state-relay | 
					
						
							| 
									
										
										
										
											2016-04-07 14:51:46 +00:00
										 |  |  | heater_invert = 0 # switches the polarity of the heater control | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-01 00:48:39 +00:00
										 |  |  | ### Thermocouple Adapter selection: | 
					
						
							|  |  |  | #   max31855 - bitbang SPI interface | 
					
						
							|  |  |  | #   max31855spi - kernel SPI interface | 
					
						
							|  |  |  | #   max6675 - bitbang SPI interface | 
					
						
							| 
									
										
										
										
											2017-12-01 00:58:47 +00:00
										 |  |  | max31855 = 1 | 
					
						
							| 
									
										
										
										
											2014-12-19 11:11:01 +00:00
										 |  |  | max6675 = 0 | 
					
						
							| 
									
										
										
										
											2017-12-02 00:59:07 +00:00
										 |  |  | max31855spi = 0 # if you use this one, you MUST reassign the default GPIO pins | 
					
						
							| 
									
										
										
										
											2014-12-19 08:59:20 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-01 00:48:39 +00:00
										 |  |  | ### Thermocouple Connection (using bitbang interfaces) | 
					
						
							| 
									
										
										
										
											2013-11-29 23:13:06 +00:00
										 |  |  | gpio_sensor_cs = 27 | 
					
						
							|  |  |  | gpio_sensor_clock = 22 | 
					
						
							|  |  |  | gpio_sensor_data = 17 | 
					
						
							| 
									
										
										
										
											2013-12-06 22:16:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-01 00:48:39 +00:00
										 |  |  | ### Thermocouple SPI Connection (using adafrut drivers + kernel SPI interface) | 
					
						
							|  |  |  | spi_sensor_chip_id = 0 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-01 00:58:47 +00:00
										 |  |  | ### amount of time, in seconds, to wait between reads of the thermocouple | 
					
						
							| 
									
										
										
										
											2018-11-27 16:18:40 +00:00
										 |  |  | sensor_time_wait = 2 | 
					
						
							| 
									
										
										
										
											2017-12-01 00:58:47 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-07 10:27:34 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ######################################################################## | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #   PID parameters | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pid_ki = 0.1  # Integration | 
					
						
							|  |  |  | pid_kd = 0.4  # Derivative | 
					
						
							|  |  |  | pid_kp = 0.5  # Proportional | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ######################################################################## | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #   Simulation parameters | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | sim_t_env      = 25.0   # deg C | 
					
						
							|  |  |  | sim_c_heat     = 100.0  # J/K  heat capacity of heat element | 
					
						
							| 
									
										
										
										
											2018-11-27 16:18:40 +00:00
										 |  |  | sim_c_oven     = 5000.0 # J/K  heat capacity of oven | 
					
						
							|  |  |  | sim_p_heat     = 9450.0 # W    heating power of oven | 
					
						
							| 
									
										
										
										
											2013-12-07 10:27:34 +00:00
										 |  |  | sim_R_o_nocool = 1.0    # 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 | 
					
						
							| 
									
										
										
										
											2016-07-08 04:41:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ######################################################################## | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #   Time and Temperature parameters | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-27 16:18:40 +00:00
										 |  |  | temp_scale          = "f" # c = Celsius | f = Fahrenheit - Unit to display  | 
					
						
							|  |  |  | time_scale_slope    = "h" # s = Seconds | m = Minutes | h = Hours - Slope displayed in temp_scale per time_scale_slope | 
					
						
							|  |  |  | time_scale_profile  = "m" # s = Seconds | m = Minutes | h = Hours - Enter and view target time in time_scale_profile | 
					
						
							| 
									
										
										
										
											2016-07-08 04:41:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-28 20:42:04 +00:00
										 |  |  | # emergency shutoff the kiln if this temp is reached. | 
					
						
							|  |  |  | # when solid state relays fail, they usually fail closed.  this means your | 
					
						
							|  |  |  | # kiln receives full power until your house burns down. | 
					
						
							|  |  |  | # this should not replace you watching your kiln or use of a kiln-sitter | 
					
						
							|  |  |  | emergency_shutoff_temp = 2250 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # not used yet | 
					
						
							|  |  |  | # if measured value is N degrees below set point | 
					
						
							|  |  |  | warning_temp_low = 5 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # not used yet | 
					
						
							|  |  |  | # if measured value is N degrees above set point | 
					
						
							|  |  |  | warning_temp_high = 5 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # not used yet | 
					
						
							|  |  |  | # thermocouple offset | 
					
						
							|  |  |  | # If you put your thermocouple in ice water and it reads 36F, you can | 
					
						
							|  |  |  | # set set this offset to -4 to compensate.  This probably means you have a | 
					
						
							|  |  |  | # cheap thermocouple.  Invest in a better thermocouple. | 
					
						
							|  |  |  | thermocouple_offset=0 |