From f9938f60e6210872592da9a851c8339a3cf258e7 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 4 Nov 2023 11:39:05 -0600 Subject: @hank-*-boost: reduced ripple on low modes by raising MCU clock speed to half at levels 2+ instead of the previous value of 1/4th speed I tried full speed too, which makes ripple much smaller and faster... but it also causes a big jump in brightness between levels 1 and 2. My lux meter shows ~350 at 1/150 or ~500 at 2/150, but at half speed it's ~650 at 2/150, and at full speed it's ~1100 at 2/150. So I went for a happy medium to balance ripple, brightness, and runtime. --- hw/hank/noctigon-dm11/boost/anduril.h | 6 ++++-- hw/hank/noctigon-k1/boost/anduril.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/hank/noctigon-dm11/boost/anduril.h b/hw/hank/noctigon-dm11/boost/anduril.h index a12c158..0d7b25f 100644 --- a/hw/hank/noctigon-dm11/boost/anduril.h +++ b/hw/hank/noctigon-dm11/boost/anduril.h @@ -31,10 +31,12 @@ #define MIN_THERM_STEPDOWN 50 #define DEFAULT_LEVEL 70 #define MAX_1x7135 150 -// always run at 1/4th speed, because 4 kHz PWM is enough for this circuit +// moon at 1/4th speed for max runtime +// the rest at half speed, to reduce ripple +// but not full speed because 8 kHz PWM is enough for this circuit // and speed changes make a big visible bump #define HALFSPEED_LEVEL 255 -#define QUARTERSPEED_LEVEL 255 +#define QUARTERSPEED_LEVEL 2 #define RAMP_SMOOTH_FLOOR 1 // low levels may be unreliable #define RAMP_SMOOTH_CEIL 130 diff --git a/hw/hank/noctigon-k1/boost/anduril.h b/hw/hank/noctigon-k1/boost/anduril.h index cfbab16..4ea1127 100644 --- a/hw/hank/noctigon-k1/boost/anduril.h +++ b/hw/hank/noctigon-k1/boost/anduril.h @@ -41,10 +41,12 @@ #define MIN_THERM_STEPDOWN 50 #define DEFAULT_LEVEL 70 #define MAX_1x7135 150 -// always run at 1/4th speed, because 4 kHz PWM is enough for this circuit +// moon at 1/4th speed for max runtime +// the rest at half speed, to reduce ripple +// but not full speed because 8 kHz PWM is enough for this circuit // and speed changes make a big visible bump #define HALFSPEED_LEVEL 255 -#define QUARTERSPEED_LEVEL 255 +#define QUARTERSPEED_LEVEL 2 #define RAMP_SMOOTH_FLOOR 1 #define RAMP_SMOOTH_CEIL 130 -- cgit v1.2.3