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
9181a3b8
Commit
9181a3b8
authored
Jun 24, 2017
by
João Lino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wattage logging
wattage logging
parent
e9dd297a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
brew.ino
brew.ino
+16
-13
No files found.
brew.ino
View file @
9181a3b8
...
...
@@ -260,6 +260,7 @@ void setup() {
bStatusElement
=
false
;
windowStartTime
=
millis
();
dWattPerPulse
=
HEATING_ELEMENT_MAX_WATTAGE
/
HEATING_ELEMENT_AC_FREQUENCY_HZ
;
dWattage
=
0.0
;
// ++++++++++++++++++++++++ Mixer ++++++++++++++++++++++++
...
...
@@ -439,7 +440,7 @@ double ulWattToWindowTime( double ulAppliedWatts ) {
bool
xRegulateTemperature
(
boolean
bMaximumOfUpDown
)
{
double
difference
=
0
;
bool
overTemperature
=
false
;
d
ouble
w
attage
=
0.0
;
d
W
attage
=
0.0
;
float
tup
=
upPT100
.
getCurrentTemperature
();
float
tdown
=
downPT100
.
getCurrentTemperature
();
...
...
@@ -472,37 +473,37 @@ bool xRegulateTemperature( boolean bMaximumOfUpDown ) {
// Calculate applied wattage, based on the distance from the target temperature
if
(
overTemperature
)
{
w
attage
=
0.0
;
// turn it off
dW
attage
=
0.0
;
// turn it off
}
else
{
if
(
difference
<=
0.5
)
{
if
(
cookTemperature
>
99.0
)
{
w
attage
=
2000.0
;
// pulse hardly at 2000 watt
dW
attage
=
2000.0
;
// pulse hardly at 2000 watt
}
else
{
if
(
cookTemperature
>
70.0
)
{
w
attage
=
1000.0
;
// pulse moderately at 1000 watt
dW
attage
=
1000.0
;
// pulse moderately at 1000 watt
}
else
{
w
attage
=
500.0
;
// pulse lightly at 500 watt
dW
attage
=
500.0
;
// pulse lightly at 500 watt
}
}
}
else
{
if
(
difference
<=
1.0
)
{
if
(
cookTemperature
>
99.0
)
{
w
attage
=
2000.0
;
// pulse hardly at 2000 watt
dW
attage
=
2000.0
;
// pulse hardly at 2000 watt
}
else
{
w
attage
=
1000.0
;
// pulse moderately at 1000 watt
dW
attage
=
1000.0
;
// pulse moderately at 1000 watt
}
}
else
{
if
(
difference
<=
3.0
)
{
w
attage
=
2000.0
;
// pulse hardly at 2000 watt
dW
attage
=
2000.0
;
// pulse hardly at 2000 watt
}
else
{
w
attage
=
HEATING_ELEMENT_MAX_WATTAGE
;
// pulse constantly at HEATING_ELEMENT_MAX_WATTAGE watt
dW
attage
=
HEATING_ELEMENT_MAX_WATTAGE
;
// pulse constantly at HEATING_ELEMENT_MAX_WATTAGE watt
}
}
}
...
...
@@ -514,7 +515,7 @@ bool xRegulateTemperature( boolean bMaximumOfUpDown ) {
}
// Apply wattage to the element at the right time
if
(
ulWattToWindowTime
(
w
attage
)
>
(
millis
()
-
windowStartTime
)
)
{
if
(
ulWattToWindowTime
(
dW
attage
)
>
(
millis
()
-
windowStartTime
)
)
{
digitalWrite
(
HEATING_ELEMENT_OUTPUT_PIN
,
HIGH
);
bStatusElement
=
true
;
}
else
{
...
...
@@ -526,11 +527,11 @@ bool xRegulateTemperature( boolean bMaximumOfUpDown ) {
//debugPrintFunction("xRegulateTemperature");
debugPrintVar
(
"difference"
,
difference
);
//debugPrintVar("overTemperature", overTemperature);
debugPrintVar
(
"
wattage"
,
w
attage
);
//debugPrintVar("ulWattToWindowTime(
wattage )", ulWattToWindowTime( w
attage ) );
debugPrintVar
(
"
dWattage"
,
dW
attage
);
//debugPrintVar("ulWattToWindowTime(
dWattage )", ulWattToWindowTime( dW
attage ) );
//debugPrintVar("millis()", millis());
//debugPrintVar("windowStartTime", windowStartTime);
//debugPrintVar("test", ulWattToWindowTime(
w
attage ) > (millis() - windowStartTime) );
//debugPrintVar("test", ulWattToWindowTime(
dW
attage ) > (millis() - windowStartTime) );
#endif
}
...
...
@@ -866,6 +867,8 @@ void xManageMachineSystems() {
Serial
.
print
(
"|"
);
Serial
.
print
(
downPT100
.
getCurrentTemperature
());
Serial
.
print
(
"|"
);
Serial
.
print
(
dWattage
);
Serial
.
print
(
"|"
);
if
(
bStatusElement
)
{
Serial
.
print
(
"1"
);
}
...
...
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