Re: current control algorithm



I have two strings of 5 LEDs and a I need to control them with a pwm
to reach a certain intensity (I can measure the current). Now due to
lack of time , I didn't go with a PI controller (which I think would
be the right way) instead, I just calculate a hysteresis of x counts
(10bit adc) and the measured current has to be within this hysteresis.
Now I unfortunately got a high jitter on my LED current (that's
controlled by the duty cycle) - I assume this is because of a time
delay from the time i set the duty cycle until i measure the current
rise/fall. How do I best go about this?
Is there a quick method to resolve this or do i actually need to take
the time to study and implement a PI controller?

Every time you measure your current with the ADC, do something like this:

PWM += gain * (setpoint - current);

Calculations in floating point, or fixed point with sufficient bits, depending on your parameters, and clip PWM at min/max to avoid wrap around.

Experiment with different gain settings to see which one works best.



.



Relevant Pages

  • Re: current control algorithm
    ... reach a certain intensity. ... and the measured current has to be within this hysteresis. ... actually need to take the time to study and implement a PI controller? ... I wouldn't use an IIR filter in the acquisition: if you just sum up 100 ...
    (comp.arch.embedded)
  • Re: Map controller output to PWM duty-cycle
    ... The controller receives the ... my design could be wrong from beginning. ... physical meaning that when your controller "asks" for more duty cycle ... If you have an integrator in your system this will immediately cause you ...
    (comp.dsp)
  • Re: current control algorithm
    ... delay from the time i set the duty cycle until i measure the current ... How much "time jitter" do you have in your A/DC read routine? ... Can you drive the A/DC from the same PWM signal (so you are ... the time to study and implement a PI controller? ...
    (comp.arch.embedded)
  • current control algorithm
    ... I have two strings of 5 LEDs and a I need to control them with a pwm ... and the measured current has to be within this hysteresis. ... delay from the time i set the duty cycle until i measure the current ... the time to study and implement a PI controller? ...
    (comp.arch.embedded)
  • Re: Thank you Dave, Michael and Jim, some further thoughts...
    ... ouput from my controller to a 12Hz duty cycle. ... If your SSR is zero switching, I think 12Hz is far too high a ...
    (alt.coffee)