Is there a program or software for tuning a pid controller where you control analog dac to get a specific current you wish to achieve for a led driver
Not too sure what you mean. The two situations, using a PID to control a motor, and driving LEDs with a constant current are so very different I would have to say no.
In this case, I am driving an LED with a constant current. So not necessarily cruise control/control a motor.
Constant current LED driver circuits are fairly simple. I've never heard of anyone doing that in software. Why do you want to do this?
So then use the correct hardware then. Trying to pulse an D/A converter is going to lead to excessive current through the LED, it won't be constant, and the peaks in current over and above the LED's rating will kill or damage the LED in the long term. In short a bad idea.
Similar to this post non PWM driven dimmable LED driver
But I want to create a new post on this. The most popular option is using PWM for constant current but because of design constraints I will have to be forced to use non-pwm. I am curious if anybody done above before?
What "LED Driver" are you using?
A 0-10V control signal is common, I think?
Please explain that - what prevents you using PWM?
The OP in the thread you linked seems to be under a false impression that PWM cannot give a stable light.
Please describe the constraints.
Why are you starting a new thread, considering you already have this one going? The forum rules strongly frown on such behavior.
Using an op-amp, a few resistors and a cap you can convert PWM to analog. They also make DAC (Digital to Analog Converters) you could use. Is the constraint the PCB (Printed Circuit Board) has already been made?
Look for a constant current driver that meets your current & voltage requirements (or a schematic for one).
PWM is "switched" or "pulsed" current and/or voltage. It can be constant current when "on" but that's different from a dimmable-variable constant-current supply.
Most constant-current supplies/drivers are switchmode, which means they use PWM internally, but they put-out smooth-constant-continuous DC current, just like a regular constant-voltage switching power supply puts-out smooth DC voltage.
I have merged your topics due to them having too much overlap on the same subject matter @edwinsun.
In the future, please only create one topic for each distinct subject matter and be careful not to cause them to converge into parallel discussions.
The reason is that generating multiple threads on the same subject matter can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.
Thanks in advance for your cooperation.
Shouldn't be difficult unless you have very unusual requirements. Post your LED drive circuit.
In my opinion what the OP is trying to do is to generate a constant current driver. Using normal PWM does not result in a constant current driver, it is a fixed current that depends on the value of a resistor and the voltage drop across the LED.
So he is looking for a way of achieving this by pulsing an external D/A, in rather the same way as a switch mode voltage converter does. What he is forgetting is the feedback from the actual current draw is needed to make the idea work. He is hoping to use a PID like code to do this, but this is a very bad idea. When I told him this he started another thread.
Thanks for merging the topics. I apologize having to created two separate posts. The reason behind the two posts and see people's opinion regarding if (1) pigeonholed to use a PID (2) if you are not but to accomplish analog dimming.
However, haha I guess people could find them both anyway and hence there is the anchor bias to just use pwm. Given people's very strong opinions about it, I guess the most "proper/popular" way to go about it is using a pwm and using a pid is indeed a "bad idea" that Grumpy Mike mentions. I think this article on TI talks a bit on two ways: https://www.ti.com/lit/an/snva768/snva768.pdf?ts=1697123953538&ref_url=https%253A%252F%252Fwww.google.com%252F.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.