Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

30W offline LED driver malfunctioning, is it a noise issue?

Status
Not open for further replies.
T

treez

Guest
30W offline LED driver malfunctining, is it a noise issue?

Hello,

We have an offline (240VAC) 30W offline LED driver with a high power factor. It is controlled by a microcontroller which dims it depending on light levels etc. The problem is that we are getting lots of noise issues with the operation. (eg sometimes it doesn’t dim when it should etc etc).
We are not sure if the problem is with the code, or whether it is noise corrupting the circuit, or noise corrupting the microcontroller. Please help us to know this.

The designer was very “economic” with the components, partly because he was given a tiny space on the PCB in which to squeeze the components on to….there are no local decoupling capacitors immediately local to the opamp, the photodiode, the temperature sensor IC etc…….these are all powered from the 2V5 bias rail but the 2v5 rail does have 20uF of ceramic capacitance on it, so I suppose its not completely without de-coupling.

Another point is that the PIC18F26K20 microcontroller that is also supplied from the 2V5 bias rail has no 4k7 pullup from its MCLR pin to the 2V5 rail, and no 10nF capacitor from the MCLR pin to ground. The MCLR pin has no connections to anything, so it may be getting noise corrupted(?), even though the MCLR function has been disabled in the microcontroller.
Also, there is no mains filter, and no capacitance on the DC Bus just downstream of the Mains rectifier bridge. I requested an AC input filter be added, but this was rejected, saying it would be too costly.

Another point is that the 2V5 bias rail is supplied by an LR8N8 high voltage linear regulator. The designer put no input capacitance at this regulator’s input. I can’t see this being a problem, but I recognise that it is often classed as ‘standard procedure’ to put a capacitor at the input to a linear regulator (but the LR8N8 datasheet doesn’t even mention an input capacitor.)

LR8N8 datasheet:
**broken link removed**

Do you think by having no AC filter that we are leaving ourselves wide open to mains bourn noise coming into the product and corrupting it? I have never seen an offline product without an AC filter before, so I don’t have experience with this.

I have a funny feeling that without a Mains AC filter with the product, we are going to get endless issues with noise. Do you agree?

A representative schematic of the Bias section is shown here…also a representative LTspice simulation of it.
 

Attachments

  • 30W offline LED driver bias supply.pdf
    12.4 KB · Views: 142
  • 30W offline LED driver.txt
    4.8 KB · Views: 69
Last edited by a moderator:

Re: 30W offline LED driver malfunctining, is it a noise issue?

Looking at the "Line Transient Response" graph I would say it is foolish to drive the regulator from rectified AC without any reservoir capacitor. All the examples in the data sheet show steady DC or DC with an added AC component but none show the input going to zero every half cycle. In such a cost sensitive application I would have considered a Zener diode or even a forward biased LED as the regulator with some capacitance across it.

The MCLR pin isn't an issue, if configured so the reset is internally connected to VDD it will obey the standard minimum VDD rules and run when there is sufficient supply voltage. The pin is isolated from the internal reset circuitry, however in that mode the pin becomes a digital input so it shouldn't be left floating. It does not have an internal pull-up or pull-down resistor and a voltage above about 4.5V on it may put the device into programming mode and might result in program corruption.

Brian.
 

Re: 30W offline LED driver malfunctining, is it a noise issue?

Thanks, when you say
MCLR pin isn't an issue
...do you mean it isnt an issue in that it wont reset, but is an issue in terms of being a digital input so it needs to be tied to a rail via say a 4k7 resistor or such?
 

Re: 30W offline LED driver malfunctining, is it a noise issue?

The PIC18F26K20 datasheet…..
**broken link removed**
on page 16, states that the MCLR pin is either a digital input or a reset pin. I presume there are no other options for the MCLR pin?
During programming, the MCLR pin is driven alternately with 9V (programming voltage) and zero volts. Now, page 369, Note 2 of the PIC18F26K20 datasheet states that the micro needs a series 50-100 ohm resistor in series with the MCLR pin because otherwise it may latch up when driven to zero volts. We do not have such a resistor. Does this mean that we may experience latch up during programming?....or do the microchip programmers only drive it to 9V, and just lets the MCLR pin decay down to zero volts during programming?

We currently have no components connected to our MCLR pin. (and we appear to be suffering from noise issues) We are trying to work out the minimum number of components that we will have to add there as we are severely space constrained, and assembly staff may slip up when fixing componnts to the already finished PCB. I wonder if the lowest component count solution for the MCLR pin would be to declare MCLR in software as a reset pin, and then just add a 4k7 pullup resistor between the MCLR pin and the 2V5 rail?
In the circuit, our PIC18F26K20 has a 2V5 rail.
 

Re: 30W offline LED driver malfunctining, is it a noise issue?

The pin has three functions, two decided during programming, one used only during the programming sequence:

1. Digital input - which should not be left floating.
2. -MCLR which can suffer from negative overshoot if DRIVEN low.

3. Programming voltage. There is a high voltage detector on the pin which places the device in programming mode, regardless of the other two options. The actual data transfer to the memory is done through the PGC and PGD pins using a special protocol.

The resistor is there to protect against negative transients as the pin is driven low, because of the programming function, that pin does not have the same degree of voltage protection the other pins have. If internal reset is used, the pin is a digital input and can safely be grounded directly or tied to VDD directly as there is no possibility of undershoot.

There is a possibility, although unlikely, that the pin is picking up enough noise that it gets tripped into programming mode. That will certainly stop normal operation but the danger of actual data corruption is quite small as a kind of 'unlocking' sequence has to be fed serially to the programming pins to tell it what and where the data is to be stored.

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Re: 30W offline LED driver malfunctining, is it a noise issue?

Thanks, i assume of we declare the MCLR pin as a digital input and we ground it, then we must buy the microcontrollers pre-programmed?, as we will not be able to program it with the MCLR pin grounded.
Also, do you know if the MCLR pin is driven low during programming?....if so, then we will need the 100 ohm resistor in series with the MCLR pin when programming i believe?

(Page 369, Note 2, of the PIC18F26K20 datasheet states that the micro needs a series 50-100 ohm resistor in series with the MCLR pin because otherwise it may latch up when driven to zero volts).

The PIC18F26K20 datasheet…..
**broken link removed**
 

Re: 30W offline LED driver malfunctining, is it a noise issue?

You didn't mention ICSP before!

So the MCLR isn't left disconnected, it is wired to a pin on the programming socket, the extra wiring may make the noise problem worse. There are notes in the data sheet about how to use the pin as a digital input and as programming voltage input but basically, the simplest solution is to add a 10K resistor to VDD. That value is high enough that the VPP won't feed into the surrounding circuit or be overloaded by it. The pin will be at VDD and taken up to VPP during the programming cycle but not down to VSS so there is no need for a series pull-down resistor. Even if the VPP was taken to zero, the resistor would be in the programming unit, not your board anyway. So all you need is one ~10K resistor. Do not add a capacitor to ground as it may upset the programming unit.

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Re: 30W offline LED driver malfunctining, is it a noise issue?

Woops..sorry for not mentioning the programming in cct connxion.
Do not add a capacitor to ground as it may upset the programming unit.
Thanks, i also told our boss that we didnt need the capacitor to ground from MCLR pin.....but the boss replied that " the external software consultant, who has 25 years of software experience, says we need a 10k pullup ( like you said), and also a 10n capacitor to ground from MCLR".

Its going to be a nightmare to white wire these components into our tiny PCB, but the boss insists the cap is needed.

The boss insists that the 10n capacitor from MCLR to gnd is essential to mitigate noise
 

Re: 30W offline LED driver malfunctining, is it a noise issue?

I disagree!

In days of old it was commonplace to use a capacitor like that to delay the rise of the reset signal but in that PIC, the reset is generated internally and even if you ground the MCLR pin it will have no effect on operation. Adding the capacitor therefore makes no difference to noise immunity but what it will do is delay the rise and fall of VPP instead which could make programming less reliable, depending on the drive capability of the programming device. If you read about problems people have with Pickit programmers it usually turns out to be the wiring length or components on the target board causing trouble rather than the PIC or Pickit itself.

It sounds to me like the software consultant hasn't read the PIC specification and is assuming it works like older microprocesors.

Brian. (with more than 35 years experience of PIC programming!)
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top