LED Driver PWM waveforms not consistent

Hi.

My high-power RGB LEDs finally arrived and I got a chance to play with the PropBoard LED drivers. In general it worked great,. No visible problems while dimming the channels etc.

I also took a look at the output waveforms from the LED drivers on my scope, and noticed that the PWM signal seemed to get a bit distorted if disconnected the external power and re-connected it while the board was still connected to USB power (9V external power from my power supply).

See att attached oscilloscope screenshots (ground clip to negative external power terminal, probe at LED anode)

Waveform just after uploading sketch to board:

Waveform after disconnecting and reconnecting 9V external power:

The code was a very simple setup with constant current through one of the drivers.

HBLED redLed(1);    // a red LED connected to output 1
HBLED greenLed(2);  // a green LED connected to output 2
HBLED blueLed(3);   // a blue LED connected to output 3

#define MAX_CURRENT 200

void setup()
{
    redLed.begin(MAX_CURRENT);
    greenLed.begin(MAX_CURRENT);
    blueLed.begin(MAX_CURRENT);   
    redLed.setValue(0x00);
    greenLed.setValue(0x00);
    blueLed.setValue(0xFF);
}

One of the channels (channel 2) on my board, had the distorted waveform all the time when MAX_POWER was 200 (even just after uploading the sketch).

The issue was no longer present if I increased MAX_CURRENT to 300 mA. If I disconnect USB and ran the board from external power only everything was also OK.

This issue probably does not cause any practical problems but notifying you anyway.

Hi @frodesto, thank you.

Yes, we were aware of this behavior. This is because the LED drivers (LED2001) need a soft-start time before operating correctly (otherwise it generates a waveform as you’ve posted), every time main power is supplied. On the BETA board this is solved by sending a 1ms pulse with 100% PWM the first time the HBLED::setValue or HBLED::setCurrent functions are called (see this). So it’s normal you are seeing this if you reconnect the main power supply but the MCU is still alive and executing the sketch.

The final board version (more news this afternoon/tomorrow) has a circuit that disconnect the LEDs (I think it send them to GND) and then the 1ms pulse is sent. This will avoid seeing the initial flash at full brightness.

In a normal use case, it may be unusual that the board remains powered without external power supply. For those cases, the final board version should allow the user to monitor the external power supply, set a flag when it drops near zero, and then call some HBLED function to re-issue the soft-start pulse when the external power is connected again.

Excellent, you got this covered.

Frode