Converting PULSIN reading to RPM, from PC Fan?


+ Reply to Thread
Results 1 to 16 of 16
  1. #1
    Join Date
    Feb 2013
    Posts
    576

    Default Converting PULSIN reading to RPM, from PC Fan?

    Hello.
    I have a simple circuit with PC fan. It's tachometer output is tied to VDD via 10K resistor and goes into PIC16F886. Fan model is AD0812UX-A7BGL-LF
    and rated speed is 3700 RPM. It has PWM input pin, which I control via the same IC. Code is below

    Code:
    CHECK:
    if BUT3=0 then dly=dly-1
    if BUT4=0 then dly=dly+1
    pulsin rpm,0, cnt
    
    
    lcdout $fe, $1, "PWM=", #dly, "     ", #cnt, "    "
    hpwm 2,dly,20000
    pause 100
    GOTO CHECK
    PULSIN inputs some readings, which are consistent with fan speed, but how to convert them into RPM?
    AT PWM=0, PULSIN returns 3700. With increase of fan speed, value drops, at PWM=255, it returns 820.

    Any ideas?

  2. #2
    Join Date
    Feb 2013
    Posts
    576

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    I've connected same fan to motherboard, and used it's bios settings to change speeds from min to max and based on that, updated the code, and now it delivers results consistent with motherboard readings.

    cnt=60000/cnt*50.

  3. #3
    Join Date
    Apr 2011
    Location
    Portland, Oregon
    Posts
    195

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    It makes very little difference now that you've managed a method that works, but there is a pretty good read on measuring frequency with Pulsin here: http://batdetector.freevar.com/ArduBat/PulseIn.html (notice the misspelling).

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,556

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    Hmmm ...

    I do not think at all PULSIN is the command to use ...

    just open your Holy manual on page 129 ...

    May be you should consider closer the waveforms to choose the good measuring method.

    I could also lead you to use the "capture" module of the processor ... but here I think a simple method would be much much followed by usable results ...

    Alain
    Last edited by Acetronics2; - 18th October 2020 at 19:55.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Feb 2013
    Posts
    576

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    Well, at page 129, there is DEBUG statement described, have no idea, how to use it for RPM measurement

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,556

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    Quote Originally Posted by CuriousOne View Post
    Well, at page 129, there is DEBUG statement described, have no idea, how to use it for RPM measurement
    Hmmm ...

    Here I do recognise THE Curious one ...

    Are you really sure you open your manual on page 129 ??? ... I think ( and I am sure !!! ) you open it on page 131 ...

    BTW ... open your eyes too !!! ( at bottom right ... and not top browser page window )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Feb 2013
    Posts
    576

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    I already tried COUNT. Returns very low number of pulses - for 3700rpm it returns something like 120. Absolutely not precise.

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,992

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    There is this Tip n Tricks pdf that has #5 about RPM measurment using CCP in combination with #1 and #2 tips.

    Ioannis

    41214aCCP Tip n Tricks.pdf

  9. #9
    Join Date
    Feb 2013
    Posts
    576

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    All my PWM/CCP channels are busy
    Too bad they don't make chips with 8-16 PWM outputs

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,992

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    In your case you need an input.

    Can you multiplex with another CCP input?

    Ioannis

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,556

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    1) https://noctua.at/pub/media/wysiwyg/...hite_paper.pdf

    2) @ these very low frequencies, the use of a divider per 2 ( so ... to measure the rotation period ! ) and using interrupts to drive a custom counter is to consider ...

    aside that that wouldn't interfere much with the general timing ...

    Now, being too accurate to measure a PC fan speed is somewhat a nonsense ... ( except for some geeks ... )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  12. #12
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,992

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    Maybe you mean x2 instead of divide by 2.

    Ioannis

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,556

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    Quote Originally Posted by Ioannis View Post
    Maybe you mean x2 instead of divide by 2.

    Ioannis
    Hi, Ioannis

    No, no ... it's not an error : if you divide the pulse train per 2 ( D Flip-flop ...) ... the High or low pulse you get @ output has the exact rotation period ... ( remember how you did that with ol' 74 or 4000 logic chips ... )
    rising edge fires the counter ... falling edge stops it.

    easy then to care with an IOC interrupt stubb ...


    Best Regards
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  14. #14
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,992

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    I was thinking in terms of frequency and the low frequency you stated pushed me into that error. Sorry...

    Thanks for the clarification.
    Ioannis

  15. #15
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,556

    Default Re: Converting PULSIN reading to RPM, from PC Fan?

    Quote Originally Posted by Ioannis View Post
    I was thinking in terms of frequency and the low frequency you stated pushed me into that error. Sorry...

    Thanks for the clarification.
    Ioannis
    You're Welcome Ioannis ...

    AND we are old friends !!!

    Name:  Muppet_8.jpg
Views: 73
Size:  8.4 KB

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  16. #16
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,992

    Thumbs up Re: Converting PULSIN reading to RPM, from PC Fan?

    Yeap! That's right! Nice picture with the two grands! Well I hope I don't look that old though...

    Ioannis

Similar Threads

  1. Computer Fan RPM Sensor Reading
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th December 2019, 21:05
  2. [email protected] calculate Pulsin to RPM
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 15th June 2013, 16:42
  3. RPM of CPU fan PIC12f683
    By mrmodest in forum General
    Replies: 3
    Last Post: - 3rd September 2012, 04:12
  4. Pulsin vs. Interrupt RPM measurement
    By Tobias in forum General
    Replies: 1
    Last Post: - 31st December 2009, 02:29
  5. pc cooling fan rpm monitoring
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th December 2005, 00:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts