Phase-correct vs. Fast-PWM - scope images

I plugged some oddball PWM values into a test firmware, and flashed it to a test mule F6DD driver (FET, momentary switch). Relevant bits of the FW:

// PWM Mode
#define PHASE 0b00000001
#define FAST  0b00000011

/*

  • =========================================================================
  • Settings to modify per driver
    */

#define LOW_TO_HIGH 1 // order in fast-tap mode (long-press will go the opposite direction)
#define VOLTAGE_MON // Comment out to disable - ramp down and eventual shutoff when battery is low
#define MODES 0,1,1,3,3,12,12,40,40,125,125,254,254,255
#define MODE_PWM 0,PHASE,FAST,PHASE,FAST,PHASE,FAST,PHASE,FAST,PHASE,FAST,PHASE,FAST,PHASE

This is the signal at the FET's gate with those modes...

The behavior of phase-correct putting out less light than fast-PWM reverses here, actually somewhere between this mode and the last one. After that point where the on-time is long enough for the FET to reach the fully on state, the fast-PWM is the one that puts out slightly less light (it's noticeable by eye, so I guess it's technically more than 'slightly').

Phase-correct is starting to get noisy...

No visible difference at 254.

Didn't bother with both versions at 255, on is on, it would look and work the same.

These were all done with exactly the same scope settings, just cycling through the modes and taking screencaps. I'll do some later with different settings that show more detail.

Ah nice… So we should switch to phase after 12. Well to keep it simple all you need to do is keep fast and increase the pwm a bit. 254 I haven’t tried that :slight_smile: Good stuff comfy

Good stuff, as usual. Thanks. Would the effect be similar with 7135s?

This is just the output from the MCU on pin 6, different hardware downstream will behave differently. 7135s don't have any problem getting low enough light levels at the minimum, they need at least a PWM of 5 or 6 before they put out enough to even light the LEDs. With a single FET a PWM of 1 will put out more light than the 7135s with a PWM of 5.

Interesting to see it this way, thanks.

Lower 4 levels, slowed down to 4us scale (others were all at 20us).

Nothing to see between them at PWM=1, which is why they're different. It's all rising/falling slope and no on-time, and the fast-PWM has two events for every one with phase-correct.

Ah... now they start to look different, but there's still twice as many with fast-PWM, here at 12 the two versions look very similar in light output. The shorter length is starting to cancel out the difference in frequency.

And here's what's changed when it gets to where phase-correct is noticeably brighter. The longer pulse more than makes up for there being only half as many.