Author Topic: Pulse Stretching  (Read 764 times)

0 Members and 1 Guest are viewing this topic.

Offline djdc13Topic starter

  • Newbie
  • Posts: 2
  • Country: gb
Pulse Stretching
« on: February 21, 2020, 07:06:12 am »
I want to build a PC fan controller for 3 and 4 pin fans (universal). The 4 pin fans are simple as it is just a PWM signal I am generating from Arduino (after changing the PWM frequency on the pins). Running the 3 pin fans with a PWM signal is also working. Sensing the speed of the 3 pin fans with the Arduino is also working but I can not sense the speed of the 3 pin and power them at the same time. The tach signal from the 3 pin fan is powered by the fan power so if you provide a PWM signal as power the tach signal gets chopped and reads incorrectly. I understand I need to utilise pulse stretching so that I can read the RPM on the longer pulses whilst the tach signal is not being chopped but this is what I am stuck with. I do not know how to code the Arduino to do pulse stretching and I do not know if there is an analogue way using just components and no microcontroller.

It would be super awesome if anyone could give me an idea. If this pulse stretching could be sorted then I could make a fan controller with separate channels for each fan, I could have ports for 4 and for 3 pin, I could read all the RPM and I have also rewired all my fan LEDs through a constant current driver so could use another PWM channel to control the LED lighting too all in one package. If I cant figure it out I can either power them with a linear voltage (which I didnt want to do due to efficiency and easier fan stalling) or use only 4 pin fans but that would require changing fans and being defeated lol.
 

Offline ggchab

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Re: Pulse Stretching
« Reply #1 on: February 21, 2020, 08:23:57 am »
Some ideas from my own experiences:
- do you control the GND pin with your PWM signal ? You should try the +12V
- some fans do not work very well with pwm. Adding a capacitor between GND and +12V helps
- for some fans, the "tach" pin is not a "tach" signal but just a logical level that indicates if the fan is running or not
 

Offline djdc13Topic starter

  • Newbie
  • Posts: 2
  • Country: gb
Re: Pulse Stretching
« Reply #2 on: February 21, 2020, 09:40:31 pm »
Thanks for the tip. I am using a low side P-MOSFET switch to control the fan with the PWM signal so yes I am switching the ground. This is to be able to switch without having to have a higher voltage then the switch voltage as I want to use the full 12V of the PSU. Also the 3rd wire in all the fans I have are definitely tach wires as I do get an RPM output on the screen or serial monitor but as the PWM duty is adjusted the readout suddenly goes unstable and reads garbage. I do use a filter capacitor and this helps a little but does not solve the chopping of the tach signal.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf