Designing a PWM to Analog mini board for fans
-
milliseconds, not seconds!
-
And regarding max voltage, I had it wrong, the opamp model I used was too ideal and supplied more than what was supplied to him... Real max Vmax then should be Voutmax from opamp - Vbe from transistor I'm looking for components to minimice this.
-
@Egon-Net said in Designing a PWM to Analog mini board for fans:
Real max Vmax then should be Voutmax from opamp - Vbe from transistor
May be worth adding a few components to achieve a more ideal requirement set. For example,
-
No significant voltage drop at max voltage (as it is with the existing PWM).
-
Decoupling pwm input voltage from output voltage. E.g. 12V in, 24V out or vice versa, or 3.3 or 5V PWM input and 12V outout.
-
Preserving the common (+) of existing PWM driven fans. (your design seems to change it to common (-)).
Other stretch goals are high efficiency (no heat when running at let's say 50%) or galvanic input isolation (opto coupler?).
Just a thought.
Overall, your idea for a PWM -> Voltage fan control is very good and much needed.
-
-
@Egon-Net said in Designing a PWM to Analog mini board for fans:
@achrn you schematic is ok because you are supplying 24V for a 12V fan. Mosfets have quite a high gate voltage that will substract from supply voltage, so voltage applied to the fan will not be able to reach near 24V (final voltage will depend on the mosfet used).
Exactly, which is why I caveated with the observation that I was using what I had to hand. The opamp output swing limits it further too - it doesn't get the gate to 24V either (even if teh PWM was coming in at 24V). Sorry, I should possibly have been more explicit that I wasn't advocating it as a great circuit (which, again, is why I might be interested in a better implementation).
There's a moderate heatsink on teh mosfet.
-
This post is deleted! -
@Egon-Net said in Designing a PWM to Analog mini board for fans:
milliseconds, not seconds!
yeah, thats more logical
-
@zapta said in Designing a PWM to Analog mini board for fans:
@Egon-Net said in Designing a PWM to Analog mini board for fans:
Real max Vmax then should be Voutmax from opamp - Vbe from transistor
May be worth adding a few components to achieve a more ideal requirement set. For example,
-
No significant voltage drop at max voltage (as it is with the existing PWM).
-
Decoupling pwm input voltage from output voltage. E.g. 12V in, 24V out or vice versa, or 3.3 or 5V PWM input and 12V outout.
-
Preserving the common (+) of existing PWM driven fans. (your design seems to change it to common (-)).
Other stretch goals are high efficiency (no heat when running at let's say 50%) or galvanic input isolation (opto coupler?).
Just a thought.
Overall, your idea for a PWM -> Voltage fan control is very good and much needed.
Hi @zapta! I'll try to answer in order:
-
The voltage drop issue is hard to resolve. I can only think in two ways for achieving it: some kind of step-up voltage converter, or going full signal filtering. The step-up will add quite a bit of complexity and would force the output voltage to be fixed (12V? 24V?), and I want to avoid a full signal filter, because it would use quite big inductors, that end up being big, heavy and expensive. I've been looking at opamps/BJT combos that allow me to stay within 0.5V of VCC, and I think I can live with it. I will have a look at existing integrated PWM to Analog too (I think analog devices makes such an IC), because yes, it would be nice to go up to the supply rail.
-
Decoupling is more or less done already. I can further add a voltage divisor and add later gain in the filter so you could use any voltage combo, even things like 3.3v -> 24V
-
I think I haven't understand you correctly. You use the PWM+ wire from Duet. In the base design you use both PWM+ and PWM- (they are called Fan+ and Fan-). Duet's do the PWM on the ground side (PWM-), so you can use any voltage for the fan.
Regarding the other comments, heat is unavoidable once you give up filtering in full signal, because there must be some analog component that does the regulation (we are not switching voltages) but since we are dealing with currents <100mA, it should stay well under 1W. And IMHO adding galvanic isolation is out of the question for the complexity it would add when we are just dealing with fans...
Thanks for your comments, that's really what I need to help me think out of the box! You never know what one's maybe missing!
-
-
@achrn said in Designing a PWM to Analog mini board for fans:
@Egon-Net said in Designing a PWM to Analog mini board for fans:
@achrn you schematic is ok because you are supplying 24V for a 12V fan. Mosfets have quite a high gate voltage that will substract from supply voltage, so voltage applied to the fan will not be able to reach near 24V (final voltage will depend on the mosfet used).
Exactly, which is why I caveated with the observation that I was using what I had to hand. The opamp output swing limits it further too - it doesn't get the gate to 24V either (even if teh PWM was coming in at 24V). Sorry, I should possibly have been more explicit that I wasn't advocating it as a great circuit (which, again, is why I might be interested in a better implementation).
There's a moderate heatsink on teh mosfet.
I've just tested TLV9352 as the opamp and TIP41A as the BJT, and it leaves me at 0.5V from supply voltage. It might be quite difficult to get better than that with this kind of schematic...
-
Ill get a hand full if Brexit is not going to make shipment to Germany crazy expensive. Are you heading for SMD or through hole components?
This is not only super convenient for Fans but i will use this analog voltage to control some LEDs with an Arduino Nano
-
Thanks @taconite! I'm going for smd, but not crazy difficult to solder (just 0805, soic8...) Depending on how many people want some boards and their ability to solder smd, I can offer sending boards already populated with smd components.
Regarding controlling leds, why don't you directly feed PWM to the leds? If your PWM frequency is high enough, you can't see the flicker at all...
-
@taconite also remember the current limits... I don't think this kind of circuit is good for more than ...200mA? The BJT will dissipate quite a bit of power by itself at moderate currents, but it depends too on supply voltage (5V would draw much less power).
-
I thing I'll leave and option to feed the opamp/transistor with an external power, using something like that:
so you can jumper select the power supply.
Thoughts?
-
Ok, I had a spin at the schematic. That would the plan:
INPUTS:
PWM+
PWM-
GND
Optional V_EXTJUMPERS:
V_ANALOG (PMW+ or V_EXT)
HALVE_IN (shorted=yes)
SCALE_OUT (shorted = no)OUTPUT
Analog V_OUTEXPLAINING
Duets use PWM+ as V_FAN, PWM- as pwm'd ground.
With HALVE_IN open, SCALE_OUT closed, VOUT follows PWM input up to V_FAN-0.6V. Rise time is about 140ms.You can use a external step up converted (1€ in Aliexpress for a 28V 2A max) connected to V_EXT and then select jumper V_ANALOG to V_EXT and get max fan voltage. With just one step up you can feed many fans.
You can also connect an external (arduino?) PWM voltage to PWM+ with any voltage and any power supply to V_EXT, and output would follow (3.3V, 5V, 12V...) You cannot use a PWM+ voltage greater than V_EXT. If you set HALVE_IN short, input is automatically halved, so you can use a 24V PWM+ with a 12V V_EXT, for example.
And last, if you short jumper SCALE_OUT, PWM+ voltage will be ignored and V_OUT will be PWM % of V_ANALOG.
This is the schematic for reference:
It would use a dual smd opamp (TLV9352, 0.7-1€ ) some resistors/capacitors (smd 0805, ~cents), a through-hole mid-power BJT (like BD139, ~0.5€) and some jumper pins, plus board (less than 1€) and shipping costs for everything. The transistor must be heatsinked for any significant current.
Does it sound interesting? Would you get some of this boards?
-
@Egon-Net said in Designing a PWM to Analog mini board for fans:
I think I haven't understand you correctly. You use the PWM+ wire from Duet. In the base design you use both PWM+ and PWM- (they are called Fan+ and Fan-). Duet's do the PWM on the ground side (PWM-), so you can use any voltage for the fan.
What I mean is that the duet uses a low side transistor and common (+) connection, with this design, the transistor is on the high side and the fans have common (-) connection.
-
@Egon-Net said in Designing a PWM to Analog mini board for fans:
VOUT follows PWM input up to V_FAN-0.6V
How did you calculate this? Supply voltage - 0.6V VBE for Q505?
Do you assume that the U2B output can go all the way to the V_ANALOG voltage? This is not the case with most op amps. Did you verify that this is indeed the case?
Changing the design to use a non emitter follower configuration may eliminate the need for the OPAMP to go all they way to the rail voltage. Can be a PNP on the high side or NPN on the low side (or P or N channel respectively if you prefer mosfets).
(I am not an EE so please take it with a grain of salt).
-
is this all necessary ?
did you try just adding capacitor in parallel with the fan to reduce whining ?
duet also allows changing pwm freq . i think with a bit of freq tuning , adjusting min/max duty cycle and simple capacitor should solve all those issues without extra circuits . -
@hackinistrator said in Designing a PWM to Analog mini board for fans:
did you try just adding capacitor in parallel with the fan to reduce whining ?
I think it's necessary since nothing prevents the capacitor from always getting charged to max voltage.
Here is a design idea, it's incomplete but demonstrates the principle. It uses low side transistor (a NCHAN mosfet would be a better choice IMO), to keep the common fan control model, is not penalized by VBE dropout, and relaxes the rail to rail requirements of the opamp. It can work with split vin/vout supplies or can be simplified to support a single supply.
This is just an idea, not a complete design and may require some capacitors and other stuff for stabilization, a led or two for diagnostics, a fuse (?), and so on.
(I am not an EE so please take this with a grain of salt).
-
@zapta said in Designing a PWM to Analog mini board for fans:
@hackinistrator said in Designing a PWM to Analog mini board for fans:
did you try just adding capacitor in parallel with the fan to reduce whining ?
I think it's necessary since nothing prevents the capacitor from always getting charged to max voltage.
Here is a design idea, it's incomplete but demonstrates the principle. It uses low side transistor (a NCHAN mosfet would be a better choice IMO), to keep the common fan control model, is not penalized by VBE dropout, and relaxes the rail to rail requirements of the opamp. It can work with split vin/vout supplies or can be simplified to support a single supply.
This is just an idea, not a complete design and may require some capacitors and other stuff for stabilization, a led or two for diagnostics, a fuse (?), and so on.
(I am not an EE so please take this with a grain of salt).
Now I get what you mean about the common(+), you meant the output side! I thought it was about the input side, that's why I didn't get it. Now, entering your circuit:
I can see two stages, first one is a rail to rail comparator, resistive halver, and a single pole low pass filter. It's a valid one, but I'd prefer to use an opamp (from the dual opamp IC) so I don't have another IC. I also prefer a second order lowpass (it has better ripple/settle time), but I see no problem in your approach (other than that you loose PWM magnitude/active high compatibility).
It is the second stage that worries me: you have used a positive-feedback opamp configuration, relying in the BJT inversion, instead of using negative feedback. I'm afraid it could be unestable because of the delay in the feedback though the inverting BJT. And you would need a diode between the opamp and the BJT, since the opamp would not be able to reach GND flat, but that's no problem.
Let me have a look at your circuit and do some simulations. All in all, I like your feedback because this is a topology I didn't think about, and it's interesting (I'm so biased to analog audio circuits!)
I'll return one I have done some test!
-
I just simulated the second stage of your circuit, and it's quite prone to oscillating, even with an ideal opamp... I should test the real thing to be sure, maybe we run out of phase margin with the BJT capacitance in the feedback loop. Besides that, I don't really belive my simulation results, it tells me I get full 24V into the load when at least a Vce-sat (~0.2V) should be lost in the BJT.
Also, it's only valid for a rail to rail signals, since it inverts the input and any less of rail to rail would float from +VCC... So we lose the capability of tracking PWM magnitude... Do we really need it?
I'll post again when I build a protoboard with the circuit.
-
@hackinistrator said in Designing a PWM to Analog mini board for fans:
is this all necessary ?
did you try just adding capacitor in parallel with the fan to reduce whining ?
duet also allows changing pwm freq . i think with a bit of freq tuning , adjusting min/max duty cycle and simple capacitor should solve all those issues without extra circuits .It's not just whining, lots of fan don't even work, or lose all speed in 99% PWM already.
Also you can change frequency in the Duet's, but not in de Duex.
A capacitor does nothing by itself, because the charge/discharge would not be controlled, so it would range from not doing anything at all, to override PWM an making the fan work at 100%. Believe me, I've tinkered a lot before I decided to go this route.