-
Notifications
You must be signed in to change notification settings - Fork 84
/
ReflowMasterProfile.h
170 lines (141 loc) · 6.42 KB
/
ReflowMasterProfile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/*
---------------------------------------------------------------------------
Reflow Master Control - v1.0.0 - 01/07/2018
AUTHOR/LICENSE:
Created by Seon Rozenblum - [email protected]
Copyright 2016 License: GNU GPL v3 http://www.gnu.org/licenses/gpl-3.0.html
LINKS:
Project home: github.com/unexpectedmaker/reflowmaster
Blog: unexpectedmaker.com
DISCLAIMER:
This software is furnished "as is", without technical support, and with no
warranty, express or implied, as to its usefulness for any purpose.
PURPOSE:
This is the profile structure used by the Reflow Master toaster oven controller made by Unexpected Maker
HISTORY:
01/08/2018 v1.0 - Initial release.
20/05/2019 v1.04 - Increased max curve to support profiles up to 8mins
19/12/2020 v2.00 - Simplified constructor and initialisation
---------------------------------------------------------------------------
Each profile is initialised with the follow data:
Paste name ( String )
Paste type ( String )
Paste Reflow Temperature ( int )
Profile graph X values - time
Profile graph Y values - temperature
Size of the time array
*/
#define ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
class ReflowGraph
{
public:
String n;
String t;
int tempDeg;
float reflowTime[10];
float reflowTemp[10];
float reflowTangents[10] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
float wantedCurve[480];
int len = -1;
int fanTime = -1;
int offTime = -1;
int completeTime = -1;
float maxWantedDelta = 0;
ReflowGraph()
{
}
ReflowGraph(String nm, String tp, int temp, float flowX[], float flowY[], int arraySize )
{
n = nm;
t = tp;
tempDeg = temp;
len = min( 10, arraySize );
Serial.print( nm );
Serial.print(" len? ");
Serial.println(len);
fanTime = flowX[ len - 3 ];
offTime = flowX[ len - 2 ];
completeTime = flowX[ len - 1 ];
for ( int i = 0; i < len; i++ )
{
reflowTime[i] = flowX[i];
reflowTemp[i] = flowY[i];
if ( i == 0 )
reflowTangents[i] = 1;
else if ( i >= fanTime )
reflowTangents[i] = 1;
else
reflowTangents[i] = 0;
}
for ( size_t i = 0; i < ELEMENTS(wantedCurve); i++ )
wantedCurve[i] = -1;
}
~ReflowGraph()
{
}
float MaxTempValue()
{
float maxV = -1;
for ( int i = 0; i < len; i++ )
maxV = max( maxV, reflowTemp[i] );
return maxV;
}
float MinTempValue()
{
float minV = 1000;
for ( int i = 0; i < len; i++ )
{
if ( reflowTemp[i] > 0 )
minV = min( minV, reflowTemp[i] );
}
return minV;
}
float MaxTime()
{
float maxV = -1;
for ( int i = 0; i < len; i++ )
maxV = max( maxV, reflowTime[i] );
return maxV;
}
};
/*
End ReflowGraphs
*/
const uint8_t PROGMEM UM_Logo[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf8, 0x00, 0x3f, 0xc0, 0x7f, 0xfc, 0x03, 0xc1, 0xff, 0xfe, 0x1f, 0xff, 0xf8, 0x00,
0x3f, 0x80, 0x7f, 0xfc, 0x00, 0x00, 0x3f, 0xe0, 0x01, 0xff, 0xfc, 0x00, 0x3f, 0x80, 0x7f, 0xfc,
0x00, 0x00, 0x0f, 0x80, 0x00, 0x7f, 0xfe, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x00, 0x00, 0x03, 0x00,
0x00, 0x1f, 0xfe, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfe, 0x00,
0x3f, 0x80, 0x7f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x00, 0x3c, 0x00, 0x01,
0xe0, 0x03, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x00, 0xff, 0x00, 0x07, 0xf8, 0x03, 0xff, 0x00,
0x3f, 0x80, 0x7f, 0xfc, 0x01, 0xff, 0x80, 0x0f, 0xfc, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc,
0x01, 0xff, 0xc0, 0x0f, 0xfe, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xc0, 0x1f,
0xfe, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xe0, 0x1f, 0xfe, 0x01, 0xff, 0x00,
0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xe0, 0x1f, 0xfe, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc,
0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xe0, 0x1f,
0xff, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00,
0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc,
0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xe0, 0x1f,
0xff, 0x01, 0xff, 0x00, 0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00,
0x3f, 0x80, 0x7f, 0xfc, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x3f, 0xc0, 0x7f, 0xfc,
0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x3f, 0xc0, 0x3f, 0xfc, 0x03, 0xff, 0xe0, 0x1f,
0xff, 0x01, 0xff, 0x00, 0x3f, 0xc0, 0x3f, 0xf8, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00,
0x3f, 0xc0, 0x1f, 0xf8, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x3f, 0xc0, 0x0f, 0xf0,
0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x3f, 0xe0, 0x03, 0x80, 0x03, 0xff, 0xe0, 0x1f,
0xff, 0x01, 0xff, 0x00, 0x3f, 0xe0, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00,
0x3f, 0xf0, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x1f, 0xf8, 0x00, 0x00,
0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x1f,
0xff, 0x01, 0xff, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00,
0x0f, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x07, 0xff, 0xfe, 0xfc,
0x03, 0xff, 0xe0, 0x1f, 0xff, 0x01, 0xff, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };