Designing a PWM to Analog mini board for fans
-
@fcwilt said in Designing a PWM to Analog mini board for fans:
@Egon-Net said in Designing a PWM to Analog mini board for fans:
Yes, I've done quite a lot of test. Some of my fans don't work at all as soon as you drop from 99% PWM. Most of them work, but PWM is not linear at all: 99% is already less than 25% airflow
That doesn't make sense.
According to my oscilloscope 100% is pure DC and 99% is 99% "pure DC".
It seems strange that those 1% intervals where the power to the fan drops to 0 would reduce the airflow to 25%.
Weird.
Frederick
As @zapta said, brushless motors are driven by embedded electronics, they are not just inductors and magnets. And some electronics are very susceptible to supply anomalies. If you do something like this to an opamp, it will easily begin to oscilate. The 99% "pure DC" has 250 narrow gnd peaks per second, which generates infinite harmonics that can and indeed disturb most electronics. If you have an original e3d V6, try to PWM its 24V 3010 fan. It will stop as soon as PWM is activated, no matter the %. And if you have a 24V 4010 radial fan from TriangleLabs (if they have not changed the source) try to PWM it, and witness the speed fall once you go to a non-100% PWM.
-
@Egon-Net said in Designing a PWM to Analog mini board for fans:
If you have an original e3d V6, try to PWM its 24V 3010 fan. It will stop as soon as PWM is activated
I dug one out of my inventory and sure enough that fan doesn't work worth a hoot on PWM.
Now I have to go through my entire inventory of fans and see if all of each model work on PWM or I just got stupid lucky and picked out ones that did.
You could have left me in blissful ignorance but no, you had to go and educate me.
While I test my inventory I will think of you fondly
Frederick
-
@dc42 said in Designing a PWM to Analog mini board for fans:
For the inductor, part # 13R105C is widely available and rated up to 330mA
I added it to my digikey to-purchase list. Will try next time I order, out of curiosity.
-
First draft for the PCB, still lacks proper connectors and labeling. It measures 20x38mm.
I could add a smd resistor + led in the back side just for those who want to populate it in parallel with the output. And maybe I'd move the transistor to the border to let vertical space for the heatsink outside the pcb...
Thoughts? Suggestions?
-
Looks good.
You can raise the cuteness level by rounding the corners.
I think that by soldering right angle connector and bending the transistor, they can also be stacked up using spacers, which is nice.
-
@zapta said in Designing a PWM to Analog mini board for fans:
Looks good.
You can raise the cuteness level by rounding the corners.
I think that by soldering right angle connector and bending the transistor, they can also be stacked up using spacers, which is nice.
Do you mean rounding the trace corners or the pcb itself?
-
@Egon-Net, the PCB itself. Some makers do it, I think for the more friendly look.
-
So to just get it straight the PCB is converting a PWM Voltage (5V, 12V, 24V which ever you like) with duty cycle from 0% to 100% to a "real" analog voltage (which ever you like because it is decoupled) from 0 V to around Vin, right?
Do you supply the files with Assembly? If you order and ship to Germany I would take a hand full
What timeline are you looking for?
-
Preliminar design for the PCB:
- Connectors with 100mil pin spacing, so each one can use whatever fits (angled or straight)
- Moved some components to the back so the PCB is even smaller, now measures 20x32mm
- Moved transistor to the very side of the board with a bit more of clearance
- Rounded corners, for the cuteness factor
- Added optional led and resistor on the back
Renders:
Comments?
-
@taconite said in Designing a PWM to Analog mini board for fans:
So to just get it straight the PCB is converting a PWM Voltage (5V, 12V, 24V which ever you like) with duty cycle from 0% to 100% to a "real" analog voltage (which ever you like because it is decoupled) from 0 V to around Vin, right?
Do you supply the files with Assembly? If you order and ship to Germany I would take a hand full
What timeline are you looking for?
You got it right! The only limitation is that PWM voltage (in case is not a open drain like Duets) must be equal or lower than VCC (so you can use a 5V PWM to output an analog range from 0 to 24V, but you can't use a 24V PWM to output an analog range from 0 to 5V)
And keep in mind current consumption. At 50% PWM, the transistor will be wasting (half voltage)x(half current) watts, so you'd need quite a hefty heatsink for moderate currents, or even a bigger transistor. The planned BD139 should be good up to 3W well heatsinked.
Keep also in mind that fan voltage is not referenced to GND, but to VCC.
Regarding supply, I can send you the DIY kit (board+components), or assembled and tested board. Also can send the gerbers and BOM so you can do it all by yourself.
I'm ordering the PCB's this very weekend, so it should be about 20 days or so to be testing the first batch.
-
@Egon-Net
mhh thats a bummer . I wanted to do 12V PWM to 5 V analog.But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12 -
@Egon-Net said in Designing a PWM to Analog mini board for fans:
Comments?
Looks great and cute
A few random thoughts, please take with a grain of salt.
-
Are the components at the back of the board optional?
-
It seems that the new layout considerably restricted the ground path from the GND input to the transistor. I don't know if it matters or not.
-
Is there sufficient clearance for a spacer wall at the bottom, at the screw hole near the diode? Hard to see from the pictures here.
-
You may want to add voltage input specification on the top of bottom silk screen. e.g. 12V - 24V or whatever the range is.
-
I think that VCC typically means +5V. Maybe change to Vin+
-
The PWM input is active low. That is, if ones measure 10% high, it means 90% PWM value. I wonder if it can be conveyed somehow on the board to avoid confusion.
Looking at the responses here, it seems to be a great ideas that will benefit many.
-
-
@taconite said in Designing a PWM to Analog mini board for fans:
@Egon-Net
mhh thats a bummer . I wanted to do 12V PWM to 5 V analog.But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12Do you realize you could just use the PWM- from duet and 5V instead of Duet's Fan Vcc? You are not forced to use 24V/12V from Duet.
Here you have a example just with passive components:
Since your load is Arduino's analog input, and assuming it has quite a high input impendance (IIRC, 1MOhm) you could just pull-up with your 5V supply with a 1K resistor (5mA current draw) and use VFan- from Duet (which is a PWM open drain). You'll have a little offset from de resistive divisor around A1, but it would be small. According my simulations, 2.3V for 50% PWM, 0V for 0% PWM and 4.54V por 100% PWM. You can play with R2 and C1 values a bit more to achieve even better results (for example 10k-10u).
Of course you could also use my board, but I think your problem doesn't need it.
-
@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:
Comments?
Looks great and cute
A few random thoughts, please take with a grain of salt.
- Are the components at the back of the board optional?
No, just the led and its resistor are optional
- It seems that the new layout considerably restricted the ground path from the GND input to the transistor. I don't know if it matters or not.
There's a dual GND plane, top and bottom are GND. Plenty of copper for GND
- Is there sufficient clearance for a spacer wall at the bottom, at the screw hole near the diode? Hard to see from the pictures here.
A real diode is not as huge as in the render, so there should be no problem. Just in case, I was going to print the PCB in paper and check the clearances for every hole. We could also use a SMD diode, but I have a lot of 1N4001 at home, that's why I picked it.
- You may want to add voltage input specification on the top of bottom silk screen. e.g. 12V - 24V or whatever the range is.
Good idea. It should be good for 4.5V-40V (But the hight the voltage, the lower the usable current due to power dissipation)
- I think that VCC typically means +5V. Maybe change to Vin+
Mmm VCC for me means "any positive voltage", but I can rename it to Vin+ if it seems clearer.
- The PWM input is active low. That is, if ones measure 10% high, it means 90% PWM value. I wonder if it can be conveyed somehow on the board to avoid confusion.
PWM is active low, but I configured the comparator opamp to do inversion, so it follows the PWM percentage. It will be active low when using PWM voltage.
Looking at the responses here, it seems to be a great ideas that will benefit many.
I'm very glad!
-
@taconite said in Designing a PWM to Analog mini board for fans:
But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12What exactly do you want to achieve? An Arduino reading the FAN PWM output from a duet?
The optocoupler provides electrical isolation which you may or may not need. Then you can convert it to analog signal as feed it to the Arduino as such (see @Egon-Net's explanation) or feed it to the Arduino as a digital signal and let the Arduino determine the PWM value (e.g. using this standard function https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/ ).
-
@zapta said in Designing a PWM to Analog mini board for fans:
@taconite said in Designing a PWM to Analog mini board for fans:
But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12What exactly do you want to achieve? An Arduino reading the FAN PWM output from a duet?
The optocoupler provides electrical isolation which you may or may not need. Then you can convert it to analog signal as feed it to the Arduino as such (see @Egon-Net's explanation) or feed it to the Arduino as a digital signal and let the Arduino determine the PWM value (e.g. using this standard function https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/ ).
Didn't know about pulsein function, but for me it seems the way to go...
-
haven't heard about the pulsein function aswell. I wanted to get the 24V (or 12V) PWM into an equivalent 5V analog voltage hence the optocoupler. But principle should work, shouldn't it?
EDIT:
@Egon-Net said in Designing a PWM to Analog mini board for fans:@taconite said in Designing a PWM to Analog mini board for fans:
@Egon-Net
mhh thats a bummer . I wanted to do 12V PWM to 5 V analog.But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12Do you realize you could just use the PWM- from duet and 5V instead of Duet's Fan Vcc? You are not forced to use 24V/12V from Duet.
Here you have a example just with passive components:
Since your load is Arduino's analog input, and assuming it has quite a high input impendance (IIRC, 1MOhm) you could just pull-up with your 5V supply with a 1K resistor (5mA current draw) and use VFan- from Duet (which is a PWM open drain). You'll have a little offset from de resistive divisor around A1, but it would be small. According my simulations, 2.3V for 50% PWM, 0V for 0% PWM and 4.54V por 100% PWM. You can play with R2 and C1 values a bit more to achieve even better results (for example 10k-10u).
Of course you could also use my board, but I think your problem doesn't need it.
Oh no I didn't know that this would be possible - thanks!
-
Well, I think I have the final design:
Besides minor cosmetic changes, I've added a jumper column to select PWM active high or active low with two jumpers. You can put the pins and jumpers or just solder it fixed. The silkscreen guides you about which ones to short por PWM active HIGH or PWM active LOW. PCB now is a bit bigger, but I think is worth it.
Any comments before I launch the order?
-
Nice work! Could you perhaps add a surface mount pad to the diode so the same board can accommodate both the through hole and surface mount part?
-
@gaweyo said in Designing a PWM to Analog mini board for fans:
Nice work! Could you perhaps add a surface mount pad to the diode so the same board can accommodate both the through hole and surface mount part?
Good idea!