226
253
#define DB_REL_DUR 0b00001111 // time before we consider the switch released
227
254
// each bit of 1 from the right equals 16ms, so 0x0f = 64ms
230
258
* The actual program
231
259
* =========================================================================
265
//---------------------------------------------------------------------------------------
266
#define RAMP_SIZE 128
267
#define TURBO_DROP_MIN 98
b'\t// min level in ramping the turbo timeout will engage,'
268
// level 98 = 105 PWM, this is ~43%
269
#define TURBO_DROP_SET 88
b'\t// the level turbo timeout will set,'
270
// level 88 = 71 PWM, this is ~32%
272
// Ramping Modes, 128 total entries (2.048 secs)
273
// level_calc.py 2 128 7135 3 0.3 150 FET 1 1 1500
274
PROGMEM const byte ramp_7135[] = {
275
3,3,3,4,4,5,5,6, 7,7,8,9,11,12,13,15,
276
17,18,20,22,25,27,30,33, 36,39,43,46,50,54,58,63,
277
68,73,78,84,89,96,102,109, 115,123,130,138,146,155,163,173,
278
182,192,202,213,223,235,246,255, 255,255,255,255,255,255,255,255, // 49-64
279
255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, // 65-80
280
255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, // 81-96
281
255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, // 97-112
282
255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,0 // 113-128
285
PROGMEM const byte ramp_FET[] = {
286
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
287
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
288
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
289
0,0,0,0,0,0,0,1, 3,4,5,7,9,10,12,14, // 49-64
290
15,17,19,21,23,25,27,29, 31,33,36,38,41,43,45,48, // 65-80
291
51,53,56,59,62,65,68,71, 74,77,81,84,87,91,94,98, // 81-96
292
102,105,109,113,117,121,125,129, 134,138,143,147,152,156,161,166, // 97-112
293
171,176,181,186,191,197,202,208, 213,219,225,231,237,243,249,255 // 113-128
295
//---------------------------------------------------------------------------------------
300
//---------------------------------------------------------------------------------------
301
#define RAMP_SIZE 150
302
#define TURBO_DROP_MIN 115
b'// min level in ramping the turbo timeout will engage,'
303
// level 115 = 106 PWM, this is ~43%
304
#define TURBO_DROP_SET 102
b'// the level turbo timeout will set,'
305
// level 102 = 71 PWM, this is ~32%
307
// Ramping Modes, 150 total entries (2.4 secs)
308
// level_calc.py 2 128 7135 3 0.3 150 FET 1 1 1500
309
PROGMEM const byte ramp_7135[] = {
310
3,3,3,4,4,4,5,5, 6,6,7,8,9,10,11,12,
311
13,14,15,17,18,20,22,24, 26,28,30,33,35,38,41,44,
312
47,51,54,58,62,66,70,74, 79,83,88,93,99,104,110,116,
313
122,128,135,142,149,156,164,172, 180,188,196,205,214,223,233,243, // 49-64
314
253,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,
315
255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,
316
255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,
317
255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,
318
255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,
319
255,255,255,255,255,0 // 145-150
322
PROGMEM const byte ramp_FET[] = {
323
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
324
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
325
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
326
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 49-64
327
0,2,3,4,5,7,8,9, 11,12,14,15,17,18,20,22,
328
23,25,27,29,30,32,34,36, 38,40,42,44,47,49,51,53,
329
56,58,60,63,66,68,71,73, 76,79,82,85,87,90,93,96, // 96-112
330
100,103,106,109,113,116,119,123, 126,130,134,137,141,145,149,153, // 113-128
331
157,161,165,169,173,178,182,186, 191,196,200,205,210,214,219,224, // 129-144
332
229,234,239,244,250,255 // 145-150
334
//---------------------------------------------------------------------------------------
234
338
//------------------- MODE SETS --------------------------
236
340
// 1 mode (max) max