• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Retriggerable Monostable for Controlling 3D Printer Fan Motor

timangus

New Member
Quick background: I did a little electronics as a child/teenager, but haven't really done much since. I'm a software engineer by trade so all this analog stuff is a bit of a dark art to me.

I've got a 3D printer, specifically a Wanhao i3+. One thing that's always annoyed me about it is that it has a cooling fan on the hotend that is always on when the machine is powered up, regardless of whether it is actively printing. I want to turn the fan off when the heater is not switched on, but keep the fan on for a minute or two after the heater switches off. The fan output is not hooked to any software controllable output, so I can't do it with code. Instead I've resorted to an old school method of using a 555 as a retriggerable monostable:

wanhao-fan.png
The printer runs off 24V which obviously a 555 won't like, so I've used a zener to get me a 12V rail. The heater I'm using as the input trigger is held at 24V when off, and grounded when on. Q1 is used to pull the 12V input trigger to ground when the heater is grounded. Q2 is to retrigger the 555. R4/VR1/C1 are the RC circuit obviously. Q3/Q4 are to actually switch the fan motor. I should maybe be using a MOSFET here(?), but I currently don't have any to hand that aren't physically massive.

So, I was hoping some of you who actually know what you're doing could take a quick look and point out any dumb things I'm doing, or suggest improvements/simplifications? I've built it on breadboard and it all seems to behave as I expect, for what it's worth.

Thanks in advance!
 

alec_t

Well-Known Member
Most Helpful Member
Welcome to ETO!
Add a catching diode across the motor to protect the output transistors.
Is Heater_Gnd a +ve-going pulse from a source which can pull Q1 base low afterwards?
 

timangus

New Member
Thanks! Diode across the motor is a good point. The heater ground goes from 24V to ground when the heater switches on. It's not a pulse, it's the current path for the heater itself, which is just a bit of a wire in a can I guess (it's 15 Ohms). In other words, when the printer is idle the heater ground sits at 24V and when it switches on (and I want the fan to switch on), the heater ground goes to ground.
 

alec_t

Well-Known Member
Most Helpful Member
In other words, when the printer is idle the heater ground sits at 24V and when it switches on (and I want the fan to switch on), the heater ground goes to ground.
With the present setup, if Heater_gnd is normally at 24V then Q1 is normally switched on, clamping the 555 Tr pin low. Pin 3 of the 555 will thus be kept high, so the motor will be on. The opposite of what you want.
Q2 seems redundant.
 

crutschow

Well-Known Member
Most Helpful Member
Q1 is used to pull the 12V input trigger to ground when the heater is grounded.
You have that opposite.
Q1 will pull the 12V to ground when the heater is at 24V.

Below is a simplification of the circuit (no transistors needed, just a diode) that I think does what you want.
It turns the fan on when the heater voltage goes low, and keeps it on for the 555 time-out period after the heater voltage goes back high.

1593180601654.png
 

timangus

New Member
Pin 3 of the 555 will thus be kept high, so the motor will be on. The opposite of what you want.
You have that opposite.
Q1 will pull the 12V to ground when the heater is at 24V.
You are of course both right. I had my scope on the wrong pin and clearly hadn't thought through what was going on, inadvertently inverting my logic. Q1 should be in an emitter-follower configuration.

Below is a simplification of the circuit (no transistors needed, just a diode) that I think does what you want.
I hadn't even considered using a diode here. However does that not mean that at power on (when the heater is off), pin 2 will be low until the capacitor charges, causing the fan to turn on once until it times out? Is your simulation assuming the capacitor is charged at t=0? Am I missing something?

Q2 seems redundant.
The point of Q2 was to provide a binary input to the trigger, rather than the threshold voltage directly. I tried taking it out of my circuit, instead wiring pin 6 directly to pin 2, but it doesn't seem to work that way. The fan just goes on and off with the heater input. But like I said before, all this analog stuff is a bit alien to me; perhaps I'm not understanding why I should expect that to work?

Thanks so much for your inputs!
 

crutschow

Well-Known Member
Most Helpful Member
Is your simulation assuming the capacitor is charged at t=0?
Yes, the capacitor (THRS voltage, blue trace) is charged from the previous turn-on, turn-off cycle.
When the capacitor voltage is high, the output is low.
The means the circuit will give a two minute fan operation when the 555 power is first applied, the same as your circuit would.

I assume that's not a problem(?).
If it is, then the circuit can be modified for that, but will required some added circuitry.

Edit: After some thought, here's a simple modification so that the 555 doesn't generate a pulse at power on.
Connecting C1 to the +12V instead of ground means the THRS capacitor voltage goes high and the 555 output is low at power up.

1593205367034.png
 
Last edited:

timangus

New Member
Edit: After some thought, here's a simple modification so that the 555 doesn't generate a pulse at power on.
Connecting C1 to the +12V instead of ground means the THRS capacitor voltage goes high and the 555 output is low at power up.
Perfect! That does just what I want. And such a simple modification. Thanks again.
 

crutschow

Well-Known Member
Most Helpful Member
In case you are interested, the operation of the 555 is pretty straight-forward.

It consists of a set-reset flip-flop, with the inputs being level sensitive.

The FF is set when the TRIG input goes below 1/3 Vcc and it is reset when the THRS signal goes above 2/3 Vcc.

When reset, the DIS pin is connected to ground through an open-collector transistor, which can be used to discharge the timing capacitor at the end of the timer period.

The above info is all you need to understand the basic operation of the 555 in most of the common, astable, and one-shot circuits.
 

timangus

New Member
Yep, I understand the basic operation of a 555, thanks. Had a busy few days but had a chance to play with this again. One thing I'm finding is that after one cycle (i.e. one negative pulse of the trigger), after the threshold is reached, the circuit seems to get into a strange oscillating state from which it can't be budged. Subsequent triggers have no effect. The yellow trace is on trigger/threshold, whereas the blue is on vcc/positive lead of timing cap.

1593528080141.png

I've found that putting a relatively large (~2-3uF) cap between the threshold pin and ground stops it happening, though I confess I have no idea why. Replacing the filter cap between the CV pin and ground with a larger one also fixes it. I note that CV is connected to the same comparator as the threshold pin. Any idea what's going on? I'm not too bothered as it seems to work reliably, but I'd quite like to know why, haha.
 

Latest threads

EE World Online Articles

Loading

 
Top