Mean Well‘s 2-in-1 dimming - Page 1
Forum section: electronics / projects

author: kcs
author_rank: Regular Contributor
timestamp: September 20, 2018, 02:14:12 am
content: I would like to controlMW power supplythat has 2-in-1 dimming feature with a microcontroller. The simplest suggestion I have found online was to short DIM+ and DIM- pins with a mosfet/optocoupler and control the duty cycle. However, after measuring DIM+ and DIM- pins with a oscilloscope I do not think it is a good idea anymore (see the measurements#1,#2: first row - optocoupler, second row - mosfet). So, it looks like I should PWM 10V into those DIM pins, but for this I ideally need: (1) to boost ~5V (USB) to 10V, (2) tightly regulate 10V (the upper max limit for the DIM pins is not specified in the datasheet; if voltage goes below 10V, output power of the PSU decreases), (3) isolate that DC-DC converter, just in case and (4) use an optocoupler. But I get a feeling that somehow I overcomplicate it. Maybe I should just leave the PSU always on and use a power mosfet to control the output power? I really do not want to reinvent the wheel and I would prefer simple (yet safe) off-the-shelf solutions. Please advise how you would solve this task.

author: rs20
author_rank: Super Contributor
timestamp: September 20, 2018, 02:25:31 am
content: You completely skipped explaining why you thought your oscilloscope traces looked bad?Would be interesting if you could measure, with a multimeter, the current that flows if you short DIM- to DIM+. That'd help explain whether the internal pullup was suitable.

author: kcs
author_rank: Regular Contributor
timestamp: September 20, 2018, 11:53:59 am
content: Quote from: rs20 on September 20, 2018, 02:25:31 am~0.08mA.Quote from: rs20 on September 20, 2018, 02:25:31 amVpp decreases from 17.4V down to ~8V at 50% duty cycle and keeps decreasing further when duty cycle is increased. I also do not like slow rise times when optocoupler is used. There is alsothis discussion(WARNING: website is not related to electronics) that explains why shorting DIM pins should be avoided, but it could be that they are talking about a bit different dimming implementation (older version).

author: CJay
author_rank: Super Contributor
timestamp: September 20, 2018, 02:37:30 pm
content: What sort of frequency are you hoping to achieve only there are plenty of optos with multi MHz digital capability

author: kcs
author_rank: Regular Contributor
timestamp: September 20, 2018, 04:36:16 pm
content: Datasheet specifies that 300-3kHz PWM should be used for DIM pins, so the curent ~500Hz should be fine. If it turns out to be easier to control output power with an external power mosfet I would like to PWM at least at 10kHz to avoid LED flickering.EDIT: At the moment I think the easiest way of controlling MW PSU would be in two steps:1. To turn it off remotely I could use a optocoupler that shorts out DIM pins.2. To control its output power I could use a second optocoupler + power mosfet.Does it sound reasonable? Will my currently used optocoupler and mofset be fast enough?

author: ajb
author_rank: Super Contributor
timestamp: September 20, 2018, 07:10:30 pm
content: Quote from: kcs on September 20, 2018, 11:53:59 amYou might want to mention that your link goes to a site about, err, non-prescription drug use. Fortunately neither I nor my employer doesn't care, but others will.Regarding that other person's claim that shorting the DIM pins could be bad for the power supply, I don't see how. The datasheet for that other supply mentions that you can't get zero brightness that way, though, but again, that's a different power supply with a different style of dimming input.The PS datasheet isn't super clear about how the dimming system operates, but from the fact that it specifies a PWM input of 300-3000Hz, with a fixed output frequency of 1kHz +/-10%, and the fact that the dim pins are both analog and digital inputs, my bet is that the input is low pass filtered to convert a PWM input into a DC control voltage, and that's what the PSU uses to control its internal PWM. That means that you'dexpectthe voltage to drop as you decrease the PWM duty cycle (remember that the duty cycle the PSU sees is the inverse of the duty cycle you apply to the optocoupler/mosfet), and that the rise time doesn't make any difference, except for maybe in the linearity of your in->out transfer function.Quote from: kcs on September 20, 2018, 04:36:16 pmThat's excessive, unless you plan on using this in front of a high speed camera. 1kHz is more than enough to avoid any flickering visible to the eye. You might have issues with very fast DSLRs, but only if you have enough light to warrant a sub-millisecond shutter time.

author: CJay
author_rank: Super Contributor
timestamp: September 21, 2018, 05:32:53 am
content: Optopcouplers will be plenty fast enough, last year I experimented with some dirt cheap PC817 devices and got speeds in the hundreds of KHz, a cheap 6N138 will do MHz.But, if those pins are exposed and isolated already then you don't need an opto.

author: kcs
author_rank: Regular Contributor
timestamp: September 22, 2018, 10:34:19 pm
content: Quote from: ajb on September 20, 2018, 07:10:30 pmQuote from: CJay on September 21, 2018, 05:32:53 amTo avoid any further guessing I am attaching photos of this PSU. I hope they will allow to tell more about how dimming control is implemented.Quote from: ajb on September 20, 2018, 07:10:30 pmI am not sure I understood this part.Quote from: ajb on September 20, 2018, 07:10:30 pmMy tests showed that opposite is the case. With 1kHz I can see banding in my taken photos.There are many articles online that suggests to use even higher frequencies than 10kHz for LED lighting when digital photography is involved.EDIT:Would it be easy to adjust output voltage by a bit? Would it take more than changing one resistor?BTW, it gets quite hot (+30C above the ambient) even when it operates at 73% of its rated power.

author: ajb
author_rank: Super Contributor
timestamp: September 23, 2018, 01:03:48 am
content: Quote from: kcs on September 22, 2018, 10:34:19 pmThe glue and silk outlines around everything make it hard to trace out via photo, but it does look like C501 and R504 form a low pass filter. R503 and C124 I would guess form a filter across DIM+/DIM- and/or serve to pullup DIM+.QuoteWhat you've essentially got is this:Where M1 represents your optocoupler, and everything else is internal to the power supply. The voltage across C501 is then presumable measured by the power supply and used to determine the PWM duty cycle of its output. So you can apply a DC voltage to DIM+ with respect to DIM- and then the low pass filter formed by R1 (should be R504) and C501 just suppresses noise. Or if you PWM the transistor as shown, DIM+ will be zero when the transistor is on (obviously), but when the transistor is off, DIM+ will be pulled back up to whatever the voltage across C501 is (plus a bit because of R503/Vpullup). So the higher the duty cycle of the PWM, the more time the transistor spends *on*, which means pulling DIM+ to DIM-, so the lower the voltage across C501 is. If you just leave the transistor off, then DIM+ gets pulled up to 10V with a time constant determined by whatever value C501 is times R503+R504. If that's not clear, then you may want to simulate the circuit shown to see how it works.QuoteFair enough, I didn't think about rolling shutters. If you are using this in a photography situation with fast shutter speeds, you would probably be better off with a constant voltage or constant current dimming solution.

author: kcs
author_rank: Regular Contributor
timestamp: September 23, 2018, 05:53:30 am
content: Quote from: ajb on September 23, 2018, 01:03:48 amI have reuploaded that photo, it now has some tracing done.Quote from: ajb on September 23, 2018, 01:03:48 amYes, it explains where the upper 3kMhz frequency comes from, given that R504's value is 75.4k and C501's value is 0.7uF.Quote from: ajb on September 23, 2018, 01:03:48 amIt is now, a picture is worth a thousand words, as they say. So, PSU is measuring voltage across C501, it does not care about the frequency or duty cycle as such. However, the problem with shorting out DIM pins remains. For example, if I feed 5V into DIM pins, I get VoutPWMed at 50% duty cycle, but if I short out DIM pins at 490Hz, 25% duty cycle - Voutis PWMed at 54%, if 980Hz and 25% - Voutis PWMed at 35%. So, there is no linearity (duty cycle at DIM pins ≠ duty cycle at Vout).If R503 is really a pull up resistor, I guess I could replace it with a lower value one to speed up a capacitor charging. Another option could be to look for a optocoupler with a very small output capacitance. When I use a simple push button to short out and then release DIM pins I see that voltage across DIM pins recovers very quickly.

author: CJay
author_rank: Super Contributor
timestamp: September 23, 2018, 08:40:23 am
content: Well good news, the Dim +/- pins are on the secondary side of the PSU so as long as they're not at some high voltage all you need to worry about is level conversion.