Another PWM to DC thread

MrAl

Joined Jun 17, 2014
13,704
That could be a solution. I'm trying to keep it as simple as possible so far as circuitry goes
There are only 2 switches that are usable.
1. a momentary off momentary spdt which could be changed to a dpdt
2. a blackout switch that controls a solenoid which in turn cuts all navigation lights as well as some other lights.
Hi,

I dont think you can "chop up" a 128Hz signal into a 1kHz or 10kHz signal just by chopping it up. That's because the only part that would get chopped up is the high pulses while the low parts stay low for the entire duration. That means you dont get rid of the 128Hz.
To convert it to a higher frequency the normal way would be to use a phase locked loop. However, if you are willing to use a microcontroller you can do just about anything you want to do. The microcontroller could chop up the high pulses and add more pulses when the 128Hz signal goes low. You can get a wide range of duty cycles like that.
Also with a microcontroller you can push a button twice for one level, three times for another level, etc., or long press for dimming and have it gradually go down until you release the button.

I also think a dual RC low pass filter could work. The formula for one stage is:
w=1/RC
which is also:
f=1/(2*pi*RC)

That's the -3db point, and when you add a second stage you can get more of a cut.
However, driving a 200ma load is going to take some decent sized capacitors. If we assume the load is 50 Ohms and you want to dim to 50 percent, then you could use two 25 Ohm resistors for the low pass filter, and caps 1000uf could work.

Did you mention what level you think you have to dim to, such as 25 percent, 50 percent, 75 percent, etc. ?
 

crutschow

Joined Mar 14, 2008
38,512
The switch is momentary.
Okay, here's my next shot (below):
It uses a DPDT momentary center-off switch with one pole (not shown) controlling the PWM brightness, and the other pole (shown) controlling a 2-coil latching relay (DPDT shown but could be a SPDT), with the high brightness position connecting the LEDs directly to the +24V and the low brightness position (shown) connecting a resistor in series with the LEDs.
1682388823215.png
 
Last edited:

MrAl

Joined Jun 17, 2014
13,704
Hello again,

What i'd like to hear from the thread starter is if they can use a microcontroller. That would wrap this thread up nicely and pretty darn quick :)
 

LowQCab

Joined Nov 6, 2012
5,101
He's holding-out until somebody comes up with a magical spell
that will make everything work without any time, effort, or expense.

This is a simple problem,
but in order to achieve seamless performance,
a small Circuit-Board is required,
which must be potted in a plastic-box.

The existing setup already works, although not perfectly.
Is the flickering problem completely unacceptable ?,
or does it only happen under conditions that will seldom, if ever, be seen ?
.
.
.
 

Thread Starter

SoundguyAL

Joined Nov 4, 2020
27
Hi,

I dont think you can "chop up" a 128Hz signal into a 1kHz or 10kHz signal just by chopping it up. That's because the only part that would get chopped up is the high pulses while the low parts stay low for the entire duration. That means you dont get rid of the 128Hz.
To convert it to a higher frequency the normal way would be to use a phase locked loop. However, if you are willing to use a microcontroller you can do just about anything you want to do. The microcontroller could chop up the high pulses and add more pulses when the 128Hz signal goes low. You can get a wide range of duty cycles like that.
Also with a microcontroller you can push a button twice for one level, three times for another level, etc., or long press for dimming and have it gradually go down until you release the button.

I also think a dual RC low pass filter could work. The formula for one stage is:
w=1/RC
which is also:
f=1/(2*pi*RC)

That's the -3db point, and when you add a second stage you can get more of a cut.
However, driving a 200ma load is going to take some decent sized capacitors. If we assume the load is 50 Ohms and you want to dim to 50 percent, then you could use two 25 Ohm resistors for the low pass filter, and caps 1000uf could work.

Did you mention what level you think you have to dim to, such as 25 percent, 50 percent, 75 percent, etc. ?
If this boat were stateside, I would have no issue with a microcontroller.
It is an "in harms way" vessel that patrols in nasty places.

The 2nd order RC filter is the next solution I'm going to try.
Thank you for your help.. it is much appreciated.

Okay, here's my next shot (below):
It uses a DPDT momentary center-off switch with one pole (not shown) controlling the PWM brightness, and the other pole (shown) controlling a 2-coil latching relay (DPDT shown but could be a SPDT), with the high brightness position connecting the LEDs directly to the +24V and the low brightness position (shown) connecting a resistor in series with the LEDs.
View attachment 292744
That is a very interesting idea and has now become the last resort solution.
Thanks for the suggestion!



As stated above, I am going to build and test the 2nd order LPF.
I will let you all know how it goes.
Again, to all who offered advice and help, Thank you!
 

Alec_t

Joined Sep 17, 2013
15,119
If you want the VDO gauge dimming to track the dimming of the other gauges, here's a suggested circuit to raise the PWM frequency while keeping the duty cycle nearly the same as the original :-
1682449591498.png
The higher frequency should be easier to smoothe with an LPF.
R6C3 set the nominal frequency of the U1a oscillator. R3R4C2 give a control voltage which is half the average of the incoming PWM voltage. That control voltage sets the duty cycle of the oscillator. In doing so it has the side-effect of varying the oscillator frequency, but that should not be an issue in this application.
 
Last edited:

MrAl

Joined Jun 17, 2014
13,704
If you want the VDO gauge dimming to track the dimming of the other gauges, here's a suggested circuit to raise the PWM frequency while keeping the duty cycle nearly the same as the original :-
View attachment 292802
The higher frequency should be easier to smoothe with an LPF.
R6C3 set the nominal frequency of the U1a oscillator. R3R4C2 give a control voltage which is half the average of the incoming PWM voltage. That control voltage sets the duty cycle of the oscillator. In doing so it has the side-effect of varying the oscillator frequency, but that should not be an issue in this application.
Hey that might actually work, but you gave me another idea.

What not just RC filter the signal with a large resistor and capacity (similar to part of your circuit already) and then use a NPN voltage follower as the output amplifier. That will definitely provide filtering and the amplifier will buffer the output so it can drive just about anything.
 

MrAl

Joined Jun 17, 2014
13,704
If this boat were stateside, I would have no issue with a microcontroller.
It is an "in harms way" vessel that patrols in nasty places.

The 2nd order RC filter is the next solution I'm going to try.
Thank you for your help.. it is much appreciated.



That is a very interesting idea and has now become the last resort solution.
Thanks for the suggestion!



As stated above, I am going to build and test the 2nd order LPF.
I will let you all know how it goes.
Again, to all who offered advice and help, Thank you!

Hello again,

Yes a 2nd order passive LPF might work, but what would definitely work is either a 1st or 2nd order RC with large R and large C followed by an NPN transistor as a voltage follower that acts as the output amplifier. The RC filters the input, no doubt there, and the transistor buffers the output so that it can drive just about anything. For higher current output maybe a Darlington. There is no way this can not work unless something is very, very strange with the original setup that we have not yet heard about.
I would think you could get by with a single RC filter that way too, as the criterion for that filter is relaxed significantly with the addition of the output transistor. This will also mean less experimentation with RC values as you try it out. This can be simulated quite easily and the sim will match the application in real life to a very good degree of accuracy. Probably no experimentation unless there is something still missing from the description of what is needed.
Bipolars are very hardy too so can survive shock and other problems like that. Everything should be cast in resin or something too i would think once it has been proved to be successful. If not, as a min then at least a conformal coating which is what the military often requires for circuit boards.
 

MrAl

Joined Jun 17, 2014
13,704
See https://www.homemade-circuits.com/frequency-to-voltage-converter-circuit/
For a compact way to draw a small current from the PWM output and use the voltage output to turn a transistor on and off - shorting out or leaving in place a resistor in series with the bulbs.
Hi,

Well the solution i was talking about now was just a resistor, capacitor, and NPN transistor, period.
The resistor and capacitor form the RC filter, and the transistor base is driven from the output of the filter, and the output of the entire circuit is taken from the emitter, and collector to +Vcc.
For a different polarity input/output, a PNP might be used instead.
I would think one R and one C should do it, but you can always go to two R's and two C's in tandem for the 2nd order filter if you feel you need ultra ultra filtering.
 

Alec_t

Joined Sep 17, 2013
15,119
The VDO gauge user manual indicates that illumination parameters are set via the CAN bus, using a softare configuration tool.
1682527060206.png

I can find no reference to setting by varying a gauge supply voltage. Can you provide a link?
 

Thread Starter

SoundguyAL

Joined Nov 4, 2020
27
Hi,

Well the solution i was talking about now was just a resistor, capacitor, and NPN transistor, period.
The resistor and capacitor form the RC filter, and the transistor base is driven from the output of the filter, and the output of the entire circuit is taken from the emitter, and collector to +Vcc.
For a different polarity input/output, a PNP might be used instead.
I would think one R and one C should do it, but you can always go to two R's and two C's in tandem for the 2nd order filter if you feel you need ultra ultra filtering.
I like this idea a lot. Using the transistor would definitely eliminate any concerns regarding power transfer.
(Not that P consumption is large to begin with)
And it is extremely simple! Very high quality parts can be procured and the cost will be low.
I haven't decided if it will be potted or put in a waterproof box. If Its potted, I'd like to have some type of heat sinking.

Here is the simulation I have been running:

1682541399575.png

I'd like to keep as much ripple out as possible. Too large an R value keeps Vb too far away from Vcc
This circuit gives around 800mV ripple while reacting to changes in duty cycle fairly rapidly. The lamp is estimated at 600mA or 14W. There is no incandescent lamps in the gauge so probably not a good representation.

The VDO gauge user manual indicates that illumination parameters are set via the CAN bus, using a softare configuration tool.

I can find no reference to setting by varying a gauge supply voltage. Can you provide a link?
The manual is a bit frustrating regarding dimming specifically.
When the problem was first encountered, I contacted the tech help dept at Continental and corresponded with 2 levels of agents. The 2nd level contacted HQ in Germany where I was informed that PWM dimming could not work directly. That's when they said dimming could only be achieved by cutting voltage to the illumination circuit. I have not tested cutting voltage with a potentiometer. Rather, I'm taking them at their word.
There is a setting not displayed in (6) of the config tool above. A threshold voltage can be set from 0.5 to 7.5V. Below that voltage the backlight will turn off.
 

Attachments

MrAl

Joined Jun 17, 2014
13,704
I like this idea a lot. Using the transistor would definitely eliminate any concerns regarding power transfer.
(Not that P consumption is large to begin with)
And it is extremely simple! Very high quality parts can be procured and the cost will be low.
I haven't decided if it will be potted or put in a waterproof box. If Its potted, I'd like to have some type of heat sinking.

Here is the simulation I have been running:

View attachment 292885

I'd like to keep as much ripple out as possible. Too large an R value keeps Vb too far away from Vcc
This circuit gives around 800mV ripple while reacting to changes in duty cycle fairly rapidly. The lamp is estimated at 600mA or 14W. There is no incandescent lamps in the gauge so probably not a good representation.



The manual is a bit frustrating regarding dimming specifically.
When the problem was first encountered, I contacted the tech help dept at Continental and corresponded with 2 levels of agents. The 2nd level contacted HQ in Germany where I was informed that PWM dimming could not work directly. That's when they said dimming could only be achieved by cutting voltage to the illumination circuit. I have not tested cutting voltage with a potentiometer. Rather, I'm taking them at their word.
There is a setting not displayed in (6) of the config tool above. A threshold voltage can be set from 0.5 to 7.5V. Below that voltage the backlight will turn off.
Hi,

You are dropping 24v all the way down to 2.4 volts, is that typical for this operation? I didnt realize you were going down that low.

If so, you also have to pay attention to the power dissipation in the transistor. 200ma dropping 20v is 4 watts, not exactly trivial. You'll need a heatsink.
If this kind of voltage drop is typical it is screaming for a switching type circuit, unless you can use a heatsink without too much trouble.
Also with that kind of voltage drop, you can use a second transistor with the base fed from the first transistor emitter and that will reduce the required current from what is now the 100 Ohm resistor. You could probably go to 500 or even 1k after that, which provides more filtering or you could reduce the value of the cap too.

The most important part though is the power dissipation in the transistor, you have to work with that and that will require a heatsink. Not too big a deal, but something that has to be dealt with.
 

Thread Starter

SoundguyAL

Joined Nov 4, 2020
27
Hi,

You are dropping 24v all the way down to 2.4 volts, is that typical for this operation? I didnt realize you were going down that low.

If so, you also have to pay attention to the power dissipation in the transistor. 200ma dropping 20v is 4 watts, not exactly trivial. You'll need a heatsink.
If this kind of voltage drop is typical it is screaming for a switching type circuit, unless you can use a heatsink without too much trouble.
Also with that kind of voltage drop, you can use a second transistor with the base fed from the first transistor emitter and that will reduce the required current from what is now the 100 Ohm resistor. You could probably go to 500 or even 1k after that, which provides more filtering or you could reduce the value of the cap too.

The most important part though is the power dissipation in the transistor, you have to work with that and that will require a heatsink. Not too big a deal, but something that has to be dealt with.
The gauges on the instrument panel must dim to zero (off).
Now I have to brush up on my transistor math. Its been a while...
 

Thread Starter

SoundguyAL

Joined Nov 4, 2020
27
What voltage do you need to the LEDs for maximum brightness?
The dimming circuit in the gauges is from 24V to the cutoff voltage. The cutoff voltage can be set by the config tool to a range from 0.5 - 7.5V. There is some hysteresis in there but I'm not concerned with that.
Experimentation will determine where the cutoff voltage lives. This can get tricky because the non SingleViu gauges are incandescent and can dim from exactly 0 to 24V by the PWM dimmer.

ETA:
The max brightness can also be set by the config tool.
When the illumination circuit is at 24V, the max brightness can be set from 0 to 100%
 
Last edited:

Thread Starter

SoundguyAL

Joined Nov 4, 2020
27
Something I should have mentioned earlier is the operators of this vessel use NVG often.
That is why it is so critical to get the illumination levels of these gauges under complete control.
 

crutschow

Joined Mar 14, 2008
38,512
Is it possible for you to do an experiment to plot the LED current versus voltage?
That would tell us the maximum power dissipated by the transistor.
 
Top