aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-07-01 14:31:45 -0600
committerSelene ToyKeeper2018-07-01 14:31:45 -0600
commitb90e9ab2814c1623c0b0068e8230c003923e6d51 (patch)
tree15f0623a76fd67392a9843a3aa1cf1635aa0ca35 /spaghetti-monster
parentFixed bug: moon mode flickered a bit in momentary mode (diff)
downloadanduril-b90e9ab2814c1623c0b0068e8230c003923e6d51.tar.gz
anduril-b90e9ab2814c1623c0b0068e8230c003923e6d51.tar.bz2
anduril-b90e9ab2814c1623c0b0068e8230c003923e6d51.zip
Made it easier to define thermal parameters per driver type.
Renamed THERM_DOUBLE_SPEED_LEVEL to THERM_FASTER_LEVEL, since it's not really 2X speed, it's 4X or more. This parameter defines approximately how bright the light can be without being considered risky or "turbo". Or the threshold between optimizing for rapid response vs optimizing for no oscillations.
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/anduril.c40
-rw-r--r--spaghetti-monster/anduril/cfg-blf-gt.h3
-rw-r--r--spaghetti-monster/anduril/cfg-blf-q8.h3
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4.h2
-rw-r--r--spaghetti-monster/anduril/cfg-fw3a.h6
5 files changed, 34 insertions, 20 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index ab6a0af..cff5386 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -27,17 +27,9 @@
#define USE_LVP // FIXME: won't build when this option is turned off
+// parameters for this defined below or per-driver
#define USE_THERMAL_REGULATION
-#define DEFAULT_THERM_CEIL 45
-#define MIN_THERM_STEPDOWN MAX_1x7135 // lowest value it'll step down to
-#ifdef MAX_Nx7135
-#define THERM_DOUBLE_SPEED_LEVEL MAX_Nx7135 // throttle back faster when high
-#else
-#define THERM_DOUBLE_SPEED_LEVEL (RAMP_SIZE*4/5) // throttle back faster when high
-#endif
-#ifdef USE_THERMAL_REGULATION
-#define USE_SET_LEVEL_GRADUALLY // isn't used except for thermal adjustments
-#endif
+#define DEFAULT_THERM_CEIL 45 // try not to get hotter than this
// short blips while ramping
#define BLINK_AT_CHANNEL_BOUNDARIES
@@ -81,6 +73,22 @@
#endif
+// thermal properties, if not defined per-driver
+#ifndef MIN_THERM_STEPDOWN
+#define MIN_THERM_STEPDOWN MAX_1x7135 // lowest value it'll step down to
+#endif
+#ifndef THERM_FASTER_LEVEL
+ #ifdef MAX_Nx7135
+ #define THERM_FASTER_LEVEL MAX_Nx7135 // throttle back faster when high
+ #else
+ #define THERM_FASTER_LEVEL (RAMP_SIZE*4/5) // throttle back faster when high
+ #endif
+#endif
+#ifdef USE_THERMAL_REGULATION
+#define USE_SET_LEVEL_GRADUALLY // isn't used except for thermal adjustments
+#endif
+
+
/********* Configure SpaghettiMonster *********/
#define USE_DELAY_ZERO
#define USE_RAMPING
@@ -587,11 +595,11 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
#endif
#ifdef USE_SET_LEVEL_GRADUALLY
// make thermal adjustment speed scale with magnitude
- if ((arg & 1) && (actual_level < THERM_DOUBLE_SPEED_LEVEL)) {
+ if ((arg & 1) && (actual_level < THERM_FASTER_LEVEL)) {
return MISCHIEF_MANAGED; // adjust slower when not a high mode
}
#ifdef THERM_HARD_TURBO_DROP
- else if ((! (actual_level < THERM_DOUBLE_SPEED_LEVEL))
+ else if ((! (actual_level < THERM_FASTER_LEVEL))
&& (actual_level > gradual_target)) {
gradual_tick();
}
@@ -613,7 +621,7 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
uint8_t magnitude = 0;
#ifndef THERM_HARD_TURBO_DROP
// if we're on a really high mode, drop faster
- if (actual_level >= THERM_DOUBLE_SPEED_LEVEL) { magnitude ++; }
+ if (actual_level >= THERM_FASTER_LEVEL) { magnitude ++; }
#endif
while (diff) {
magnitude ++;
@@ -643,11 +651,11 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
set_level(foo);
#endif
#ifdef THERM_HARD_TURBO_DROP
- if (actual_level > THERM_DOUBLE_SPEED_LEVEL) {
+ if (actual_level > THERM_FASTER_LEVEL) {
#ifdef USE_SET_LEVEL_GRADUALLY
- set_level_gradually(THERM_DOUBLE_SPEED_LEVEL);
+ set_level_gradually(THERM_FASTER_LEVEL);
#else
- set_level(THERM_DOUBLE_SPEED_LEVEL);
+ set_level(THERM_FASTER_LEVEL);
#endif
} else
#endif
diff --git a/spaghetti-monster/anduril/cfg-blf-gt.h b/spaghetti-monster/anduril/cfg-blf-gt.h
index a576d04..369d028 100644
--- a/spaghetti-monster/anduril/cfg-blf-gt.h
+++ b/spaghetti-monster/anduril/cfg-blf-gt.h
@@ -40,3 +40,6 @@
#define RAMP_DISCRETE_CEIL POWER_80PX
#define RAMP_DISCRETE_STEPS 7
+// stop panicking at 80% power, this light has plenty of thermal mass
+#define THERM_FASTER_LEVEL POWER_80PX // throttle back faster when high
+
diff --git a/spaghetti-monster/anduril/cfg-blf-q8.h b/spaghetti-monster/anduril/cfg-blf-q8.h
index 7733721..269aae9 100644
--- a/spaghetti-monster/anduril/cfg-blf-q8.h
+++ b/spaghetti-monster/anduril/cfg-blf-q8.h
@@ -22,3 +22,6 @@
#define HALFSPEED_LEVEL 14
#define QUARTERSPEED_LEVEL 5
+// stop panicking at ~75% power or ~3000 lm, this light has high thermal mass
+#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high
+
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4.h b/spaghetti-monster/anduril/cfg-emisar-d4.h
index a90d318..4ac1f5e 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d4.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d4.h
@@ -16,3 +16,5 @@
// optional, makes initial turbo step-down faster so first peak isn't as hot
//#define THERM_HARD_TURBO_DROP
+// stop panicking at ~25% power or ~1000 lm, this light is a hotrod
+#define THERM_FASTER_LEVEL (RAMP_SIZE*2/3) // throttle back faster when high
diff --git a/spaghetti-monster/anduril/cfg-fw3a.h b/spaghetti-monster/anduril/cfg-fw3a.h
index 2790086..262ef13 100644
--- a/spaghetti-monster/anduril/cfg-fw3a.h
+++ b/spaghetti-monster/anduril/cfg-fw3a.h
@@ -16,9 +16,7 @@
#define HALFSPEED_LEVEL 14
#define QUARTERSPEED_LEVEL 5
-#ifdef THERM_DOUBLE_SPEED_LEVEL
-#undef THERM_DOUBLE_SPEED_LEVEL
-#endif
-#define THERM_DOUBLE_SPEED_LEVEL MAX_Nx7135
+// stop panicking at about 3A or ~1100 lm, this light is a hotrod
+#define THERM_FASTER_LEVEL MAX_Nx7135
// optional, makes initial turbo step-down faster so first peak isn't as hot
//#define THERM_HARD_TURBO_DROP