Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
brew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
João Lino
brew
Commits
fe9b974d
Commit
fe9b974d
authored
Aug 24, 2015
by
João Lino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calibration of the temperature sensors.
parent
3cc06f21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
25 deletions
+26
-25
brew.ino
brew.ino
+26
-25
No files found.
brew.ino
View file @
fe9b974d
...
...
@@ -24,18 +24,18 @@
#define PT100_BASE_DEFAULT_ADC_VMAX 1.1
#define PT100_BASE_DEFAULT_VS 5.0
#define PT100_BASE_DEFAULT_R1_RESISTENCE 608.99
#define PT100_BASE_DEFAULT_LINE_RESISTENCE 0.
5408314
#define PT100_BASE_DEFAULT_R1_RESISTENCE 60
5.2 //60
8.99
#define PT100_BASE_DEFAULT_LINE_RESISTENCE 0.
0
#define PT100_BASE_DEFAULT_OPERATION_RESISTENCE 0.0
#define PT100_UP_DEFAULT_ADC_VMAX 1.1
#define PT100_UP_DEFAULT_VS 5.0
#define PT100_UP_DEFAULT_R1_RESISTENCE 618.1
#define PT100_UP_DEFAULT_LINE_RESISTENCE 0.
5408314
#define PT100_UP_DEFAULT_R1_RESISTENCE 61
5.6 //621 //620 //61
8.1
#define PT100_UP_DEFAULT_LINE_RESISTENCE 0.
0
#define PT100_UP_DEFAULT_OPERATION_RESISTENCE 0.0
#define PT100_DOWN_DEFAULT_ADC_VMAX 1.1
#define PT100_DOWN_DEFAULT_VS 5.0
#define PT100_DOWN_DEFAULT_R1_RESISTENCE 617.2
#define PT100_DOWN_DEFAULT_LINE_RESISTENCE 0.
5408314
#define PT100_DOWN_DEFAULT_R1_RESISTENCE 61
8.6 //619.3 //61
7.2
#define PT100_DOWN_DEFAULT_LINE_RESISTENCE 0.
0
#define PT100_DOWN_DEFAULT_OPERATION_RESISTENCE 0.0
// ++++++++++++++++++++++++ Mixer ++++++++++++++++++++++++
...
...
@@ -190,9 +190,9 @@ int iPumpSpeed; // Time frame to operate in
LiquidCrystal_I2C
lcd
(
LCD_I2C_ADDR
,
LCD_EN_PIN
,
LCD_RW_PIN
,
LCD_RS_PIN
,
LCD_D4_PIN
,
LCD_D5_PIN
,
LCD_D6_PIN
,
LCD_D7_PIN
);
// +++++++++++++++++++++++ PT100 +++++++++++++++++++++++
PT100
basePT100
(
"base"
,
PT100_BASE_OUTPUT_PIN
,
PT100_BASE_INPUT_PIN
,
PT100_BASE_TIME_BETWEEN_READINGS
,
PT100_BASE_DEFAULT_ADC_VMAX
,
PT100_BASE_DEFAULT_VS
,
PT100_BASE_DEFAULT_R1_RESISTENCE
,
PT100_BASE_DEFAULT_LINE_RESISTENCE
,
PT100_BASE_DEFAULT_OPERATION_RESISTENCE
);
PT100
upPT100
(
"up"
,
PT100_UP_OUTPUT_PIN
,
PT100_UP_INPUT_PIN
,
PT100_UP_TIME_BETWEEN_READINGS
,
PT100_UP_DEFAULT_ADC_VMAX
,
PT100_UP_DEFAULT_VS
,
PT100_UP_DEFAULT_R1_RESISTENCE
,
PT100_UP_DEFAULT_LINE_RESISTENCE
,
PT100_UP_DEFAULT_OPERATION_RESISTENCE
);
PT100
downPT100
(
"down"
,
PT100_DOWN_OUTPUT_PIN
,
PT100_DOWN_INPUT_PIN
,
PT100_DOWN_TIME_BETWEEN_READINGS
,
PT100_DOWN_DEFAULT_ADC_VMAX
,
PT100_DOWN_DEFAULT_VS
,
PT100_DOWN_DEFAULT_R1_RESISTENCE
,
PT100_DOWN_DEFAULT_LINE_RESISTENCE
,
PT100_DOWN_DEFAULT_OPERATION_RESISTENCE
);
PT100
basePT100
(
"base"
,
PT100_BASE_OUTPUT_PIN
,
PT100_BASE_INPUT_PIN
,
PT100_BASE_TIME_BETWEEN_READINGS
,
PT100_BASE_DEFAULT_ADC_VMAX
,
PT100_BASE_DEFAULT_VS
,
PT100_BASE_DEFAULT_R1_RESISTENCE
,
PT100_BASE_DEFAULT_LINE_RESISTENCE
,
PT100_BASE_DEFAULT_OPERATION_RESISTENCE
,
0.0
,
0.0
);
PT100
upPT100
(
"up"
,
PT100_UP_OUTPUT_PIN
,
PT100_UP_INPUT_PIN
,
PT100_UP_TIME_BETWEEN_READINGS
,
PT100_UP_DEFAULT_ADC_VMAX
,
PT100_UP_DEFAULT_VS
,
PT100_UP_DEFAULT_R1_RESISTENCE
,
PT100_UP_DEFAULT_LINE_RESISTENCE
,
PT100_UP_DEFAULT_OPERATION_RESISTENCE
,
0.112329092
,
-
3.57
);
PT100
downPT100
(
"down"
,
PT100_DOWN_OUTPUT_PIN
,
PT100_DOWN_INPUT_PIN
,
PT100_DOWN_TIME_BETWEEN_READINGS
,
PT100_DOWN_DEFAULT_ADC_VMAX
,
PT100_DOWN_DEFAULT_VS
,
PT100_DOWN_DEFAULT_R1_RESISTENCE
,
PT100_DOWN_DEFAULT_LINE_RESISTENCE
,
PT100_DOWN_DEFAULT_OPERATION_RESISTENCE
,
0.22
,
-
5.5
);
// ######################### INTERRUPTS #########################
void
isr
()
{
// Interrupt service routine is executed when a HIGH to LOW transition is detected on CLK
...
...
@@ -395,7 +395,7 @@ void setup() {
boilTime
=
5400
;
coolingTime
=
120
;
startpointTemperature
=
33
;
//30;
startpointTemperature
=
50
;
//30;
betaGlucanaseTemperature
=
40
;
debranchingTemperature
=
40
;
proteolyticTemperature
=
50
;
...
...
@@ -1017,7 +1017,7 @@ void xCountTheTime( int temperatureRange ) {
// Calculate the remaining time on the clock
clockCounter
=
cookTime
*
1000
-
(
now
-
clockStartTime
-
clockIgnore
);
#ifdef DEBUG
#ifdef DEBUG
_OFF
debugPrintFunction
(
"xCountTheTime"
);
debugPrintVar
(
"millis()"
,
now
);
debugPrintVar
(
"cookTime"
,
cookTime
);
...
...
@@ -1056,21 +1056,21 @@ bool xRegulateTemperature() {
// turn it off
wattage
=
0.0
;
}
else
{
if
(
difference
<=
1
)
{
if
(
difference
<=
0.
1
)
{
// turn it off
wattage
=
0.0
;
}
else
{
if
(
difference
<=
3
)
{
if
(
difference
<=
1
)
{
// pulse lightly at 500 watt
wattage
=
500.0
;
}
else
{
if
(
difference
<=
6
)
{
if
(
difference
<=
3
)
{
// pulse moderately at 1000 watt
wattage
=
1000.0
;
}
else
{
if
(
difference
<=
9
)
{
if
(
difference
<=
6
)
{
// pulse hardly at 2000 watt
wattage
=
2000.0
;
wattage
=
2000.0
;
}
else
{
//pulse constantly at HEATING_ELEMENT_MAX_WATTAGE watt
wattage
=
HEATING_ELEMENT_MAX_WATTAGE
;
...
...
@@ -1087,20 +1087,20 @@ bool xRegulateTemperature() {
// Apply wattage to the element at the right time
if
(
ulWattToWindowTime
(
wattage
)
>
(
millis
()
-
windowStartTime
)
)
{
//
digitalWrite(HEATING_ELEMENT_OUTPUT_PIN,HIGH);
digitalWrite
(
HEATING_ELEMENT_OUTPUT_PIN
,
HIGH
);
}
else
{
digitalWrite
(
HEATING_ELEMENT_OUTPUT_PIN
,
LOW
);
}
#ifdef DEBUG_OFF
debugPrintFunction
(
"xRegulateTemperature"
);
//
debugPrintFunction("xRegulateTemperature");
debugPrintVar
(
"difference"
,
difference
);
debugPrintVar
(
"overTemperature"
,
overTemperature
);
//
debugPrintVar("overTemperature", overTemperature);
debugPrintVar
(
"wattage"
,
wattage
);
debugPrintVar
(
"ulWattToWindowTime( wattage )"
,
ulWattToWindowTime
(
wattage
)
);
debugPrintVar
(
"millis()"
,
millis
());
debugPrintVar
(
"windowStartTime"
,
windowStartTime
);
debugPrintVar
(
"test"
,
ulWattToWindowTime
(
wattage
)
>
(
millis
()
-
windowStartTime
)
);
//
debugPrintVar("ulWattToWindowTime( wattage )", ulWattToWindowTime( wattage ) );
//
debugPrintVar("millis()", millis());
//
debugPrintVar("windowStartTime", windowStartTime);
//
debugPrintVar("test", ulWattToWindowTime( wattage ) > (millis() - windowStartTime) );
#endif
}
...
...
@@ -1109,9 +1109,9 @@ bool xRegulatePumpSpeed() {
if
(
iPumpSpeed
)
{
//basePT100.setPower( PT100_BASE_DARLINGTON_ADC_VMAX, PT100_BASE_DARLINGTON_VS );
basePT100
.
setMeasuredTemperatureDeviation
(
-
1.0
0
);
basePT100
.
setMeasuredTemperatureDeviation
(
-
0.9
0
);
upPT100
.
setMeasuredTemperatureDeviation
(
-
1.00
);
downPT100
.
setMeasuredTemperatureDeviation
(
-
1.
0
0
);
downPT100
.
setMeasuredTemperatureDeviation
(
-
1.
1
0
);
}
else
{
//basePT100.setPower( PT100_BASE_DEFAULT_ADC_VMAX, PT100_BASE_DEFAULT_VS );
...
...
@@ -1301,6 +1301,7 @@ void operateMachine() {
basePT100
.
measure
();
upPT100
.
measure
();
downPT100
.
measure
();
Serial
.
println
(
" "
);
//analogWrite(6, iPumpSpeed);
// If cooking is done, return (this is a nice place to double check safety and ensure the cooking parts aren't on.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment