Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling UC3843 duty cycle with microcontroller

Status
Not open for further replies.

schnell

Electrical
Apr 26, 2010
105
Hello,

I wish to use the UC3843 current mode controller to drive a SEPIC LED Driver.

Do you know how I can use a microcontroller to adjust the duty cycle of the UC3843?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

So far, I have this idea……but it does not work.
-It’s basically using an op-amp to draw current out of the UC3843 ‘COMP pin.
(LT1243 is very similar to UC3843)

Microcontroller applying DC level to OP-Amp input which then varies the duty cycle of UC3843

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I know that the UC3843’s duty cycle can be adjusted by varying the amount of current drawn out of its ‘COMP’ pin.

COMP pin of UC3843 ---with current source

UC3843 DATASHEET:

Block Diagram of UC3843


…….You see, there are various LED loads, of different voltages, and its just impossible to get a feedback compensation network which suits all loads……especially since I have extremes of duty cycle, both very high and very low.

Therefore , I wish to use the UC3843 as a “controllable FET driver”, and control its duty cycle by using a microcontroller to apply a control voltage (in some way) to the “COMP” pin , such that I can control the UC3843’s duty cycle with the microcontroller.

I can easily get a variable DC control voltage from a microcontroller by PWM’ing an RC network with variable duty cycle, depending on the DC level required.

I will measure the LED current using the microcontrollers ADC to read the voltage across a current sense resistor….and then use the microcontroller to increment/decrement the UC3843’s duty cycle to suit

So:
Do you know how I can use a microcontroller to adjust the duty cycle of the UC3843?

(I appreciate that some other circuitry may also be required)
 
Replies continue below

Recommended for you

Why don't you use something a bit more modern?
There are lots of switching regulators on the market laid out for constant-current output and optimised for LED-drive. Most of them have a separate PWM input for dimming, which you can drive directly from you MCU.
Start with Fairchild, Infineon, NXP, ON Semiconductors etc. etc.

Cheers,

Benta.
 
the thing is......

V(in) could be 2.1V, or V(in) at other times could be 30V


Also, the LED load could be 3.5V @ 500mA, or it could be 23V @ 210mA, or 23V @ 21mA.

-When V(in) = 2.1V, the load power is always less than 2.6W.

There are no cheap, off-the-shelf LED drivers which can handle this.
 
sorry i forgot to add that the 2.1V is the lower voltage of a 2 cell NiMH battery, which could sometimes be 4 cell...so battery voltage is anywhere from 2.1V to 6.4V.

(as you can tell, V(in) is sometimes above, and sometimes below V(out), so SEPIC is best here)
 
hello,

The NCP5030 has a max V(in) of around 6V , so we could not use it

Cuk and Buck-boost converters both invert the V(out), so our current sensing would not be so easy.

Flyback would be nice, but too expensive, since it requires a "transformer", a custom wound component......the SEPIC inductors can be coupled but can also be two cheap parts separately.

The thing is , we need a way of varying the duty cycle of UC3843, "manually", so to speak.
 
Could you please explain how the UC3843 is supposed to generate a Vref of 5 V with 2.1 V input voltage?
And how do you get around the 8.5 V UVLO?
And what is the 10 V Zener doing in series with Vcc?
And...?
And...?

I have the feeling you once built something with this IC, and now it's a "fit for all" device (sort 555-like...)

Benta.
 
HI,
-there will be a separate , small 10V(out) SMPS which will supply the UC3843 (this small SMPS is a SEPIC and can produce 10V(out) from 2.1V(in) or 30V(in) etc)

The 10V zener is here as in that schematic the V(in) is 30V, above the maximum V(in) of UC3843.

-Well spotted though, as in our circuit, the Zener will not be there, and UC3843 will be directly supplied by the 10V supply.

We like UC3843 because it is far cheaper than most other PWM controllers.
 
OK, more and more is coming to the surface...

To be honest, I don't like the circuit. You have one major problem that I don't see a way around: passing the current sense voltage through your MCU, closed loop response is completely unpredictable, and basically impossible to analyse.

My suggestion would be to manipulate the current sense feedback voltage, for example through a digital pot or an analog multiplexer/resistor combination network if you only have discrete current settings.
You can then control the pot or multiplexer digitally from the MCU to set the output current.

Benta.
 
-as far as the control loop with the microcontroller is concerned, that does not bother us.......whichever LED load is connected will be a more or less constant load, with no load transients to worry about.

So we will just measure the LED current with the microcontroller ADC, and increment/decrement the duty cycle as necessary.

The "read LED current and adjust duty cycle" operations will be only done once per second, so feedback loop oscillations won't affect us.

The problem is, we don't know how to adjust the duty cycle of the UC3843.

-we perhaps expect to generate a variable DC voltage from the PIC via PWM & RC filter....and somehow use this to vary the UC3843 duty cycle.

Does any reader know how to do this?
 
regarding the digital pot idea....do you mean to do this to avoid using the microcontroller?

-i am afraid we can't do this, since for our range of loads and lines, it is not possible to get a single feedback compensation network that can give stability over all these conditions of line and load.

also, the amount of slope compensation needed at the highest duty cycle is ridiculously high....and the converter ends up virtually in voltage mode.


...so its much easier to just do it with the microcontroller as described.....particularly since although we have lots of different lines and loads..........at any given time, it will only have one fixed line and load......so the microcontroller and slow feedback loop will be fine
 
Why do I feel tired and somewhat sad?

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
Adjusting the DC is done by changing the DC level at the "COMP" point. However, as this is also the output of your error amp, these's no way you can do this with the UC3843. Sorry.

Benta.
 
I can asure you that the method described is a genuine way of doing this..............


the current source at the COMP pin will put a voltage across a resistor for example that is connected from COMP pin to ground.

....the COMP pin is used to hook up to an opto transistor collector for isolated flybacks for example, and the result is that the duty cycle is varied since the trip point for the PWM comparaotr is altered.

...so it is this behaviour that i am effectively looking to exploit.

that is, i am trying to adjust the duty cycle by varying and controlling the amount of current pulled out of the COMP pin

Unfortunatley, i am not sure of a god method to do this.
 
Just set the error amp gain to -1 and apply a voltage. Depending on the voltage you'll vary the duty cycle.
 
I'm wondering at the whole scenario here. If you have a microcontroller which has a duty cycle output, why do you need to go through a PWM IC?
 
its partly because i need a fet gate driver and UC3843 is cheaper than fet gate drivers

-but mainly because microcontollers have a failure mechanism where the PWM pin may stick high and keep the fet on..........obviously the watchdog would catch this but by then the fet would have blown.
-this failure mechanism is not common but to design robustly and avoid "stuck pin", we need the UC3843, which has an output which won't "stick high"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor