Discussion in "8051 Discussion Forum" started by    dstarke    Oct 22, 2007.
Mon Oct 22 2007, 12:40 pm
#1
Thanks for the forum!

I have never implemented PWM before, and as such have no idea of what values for on/off times are a good starting point. I am trying to vasy the speed of a 12VDC fan using a MOSFET (IR540N) via a 7406 level shifter driven by an ATM89C55WD port pin. I think I would like to drive a counter externally with a 500 uSec pulse, and use it as the quanta for the interrupt to create on/off pulses. Is this too fine grain? What would be a reasonable nominal cycle time? 20mSec? Like I said, I have no real handle on the basic cycle time or what would be a reasonable minimum on time.

I can't figure out the formula for #levels vs min on-pulse vs cycle time vs Fan V+. Unless I am mistaken the fan speed is directly related to the fan-v+ and the integral of the on-pulses. Is it advantageous to use a larger fan V+ (like 15V for example) to provide more control?

I am writing the code in C (Keil) but can just as well use assembly (a small learning curve there).

Thank you in advance for yout kind input, and RTM is greatfully received if you can direct me to the relevant manuals.

David.

Mon Oct 22 2007, 02:15 pm
#2
well i never took PWM this serious

Lets just discuss the factors one by one.
first Fan V+ - It will increase the speed of motor and if its higher than the maximum rating of fan then it can ultimately burn the coil. So i Whatever voltage you use keep it <= max rating.
the more important is the current being supplied to the coil. That should be enough to generate sufficient torque. here also.. keep the current less than the max rating.

Now talking about the minimum pulse time.. i say.. there is no specific, it depends on the motor how fast it reacts to the change in polarity of the voltage. So all you can do is experimenting..
What i did was.. used timer in Mode 0 and varied the value to be loaded in THx of the timer..
lets say..
if THx is loaded with a value X when Pulse is ON or high, then THx should be loaded with value 255-X when Pulse is OFF or how.

I found that there is no directly proportional change in the speed vs the loaded value, rather there is a parabolic change in the speed.. i mean.. variation in o/p at higher values are pretty close to each other than the lower values.

So you might need to do experimentation according to the components you use and value you load. PWM seems difficult but its not so difficult.. its just need some experimentation thats all... So give it a try..

I cannot see your circuit too clear but as per the parts you mentioned the circuit seems to be ok. you have connected all the things necessary. As you are just sinking the current so just a normal NPN can also be used in place of that MOSFET. but make sure of the current and voltage that can be handled also heat sink if necessary.

regarding the code.. you can try working on it but there is also an assembly code posted by me in the forum "Project Doubt" with topic name temperature controlled fan.. if you want to see it then you can take it as a reference.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am
DonaldKnown
Thu Apr 18 2024, 12:24 am
utaletxcyw
Wed Apr 17 2024, 10:21 am
Anthonyvab
Wed Apr 17 2024, 08:48 am
RobertCix
Wed Apr 17 2024, 06:46 am