Author Topic: is 100% duty PWM output on a pic effectively 5V out ?  (Read 8370 times)

0 Members and 1 Guest are viewing this topic.

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
is 100% duty PWM output on a pic effectively 5V out ?
« on: October 13, 2012, 05:44:41 pm »
well as title. If I set the PWM duty at 100% is that effectively continuous output ?
 

Offline Baliszoft

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: hu
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #1 on: October 13, 2012, 06:30:07 pm »
It is, yes. Such as 0%.
 

Offline Yaksaredabomb

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #2 on: October 18, 2012, 08:12:37 pm »
One thing to keep in mind is that some circuits will not behave as expected at 0% or 100% pwm.  For instance, see the second chart on page 3:
http://www.meanwell.com/search/eln-60/default.htm

The LED driver never reaches 100% output even with 100% pwm, and it goes to 0% output as soon as you drop below 11% pwm.

Good luck!

Jacob
My display name changed June 6th from "jneumann" to "Yaksaredabomb"
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #3 on: October 18, 2012, 08:14:19 pm »
except I'm driving a mosfet that will run a fan
 

Offline Yaksaredabomb

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #4 on: October 18, 2012, 10:21:28 pm »
Okay nvm then haha.  Sounds like fun.
My display name changed June 6th from "jneumann" to "Yaksaredabomb"
 

Offline exp1

  • Contributor
  • Posts: 16
  • Country: ar
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #5 on: October 24, 2012, 02:05:24 am »
Effectively, this little animation shows it pretty clear:
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #6 on: October 24, 2012, 06:10:39 am »
Thank you, i feel like I'm in preschool now  ;), my concern was born out of the fact that some PWM drivers cannot achieve 100% duty but something like 99.9
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 7524
  • Country: nz
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #7 on: October 24, 2012, 06:26:21 am »
I think that's because they cannot stop switching or bad things happen.
So the PWM freq is always present.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #8 on: October 24, 2012, 06:53:04 am »
I guess the advanbtage of the pic is that it's pretty flexible hardware and being a programmable device does not have and circuit constraints
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 7524
  • Country: nz
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #9 on: October 24, 2012, 10:22:31 am »
Yeah, mcu's are designed to be as flexible as possible where as dedicated ICs like pwm drivers have their transistor counts cut down to reduce cost as much as possible. It isn't really an issue in most applications if the scale is 0.1% to 99.9%
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #10 on: October 24, 2012, 10:32:22 am »
well for my purpose i need to be able to stop the mosfet switching should the circuit start up and find that it is warm so that I can run the fan full blast to cool things down and then go back to PWM
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1283
  • Country: fi
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #11 on: October 24, 2012, 10:45:59 am »
If you can modulate between 0.1 and 99.9% then that is a good as full range. You certainly canot see any difference in he fan. I promise you it will not turn with 0.1 % modulation and if it should, it won't produce any air movement. Also, 99.9 % is as close to full speed as makes no difference. So why worry.
Why would you switch between PWM and full on when you can get the same result with PWM only?
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #12 on: October 24, 2012, 11:34:13 am »
If you can modulate between 0.1 and 99.9% then that is a good as full range. You certainly canot see any difference in he fan. I promise you it will not turn with 0.1 % modulation and if it should, it won't produce any air movement. Also, 99.9 % is as close to full speed as makes no difference. So why worry.
Why would you switch between PWM and full on when you can get the same result with PWM only?

its an air con unit and in the event the ecu is hot (because it was in the sun maybe before being started) I want the fan full on for as much air as possible and no mosfet switching so it don't get any hotter
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1283
  • Country: fi
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #13 on: October 24, 2012, 11:43:42 am »
For DC motor control you need a switching frequency in the hundreds of Hz or at most some kHz, anything more is useless. At those frequencies any decent MOSFET won't have any appreciable switching losses. If you pick a low Rds_on component, you can get an on-resistance comparable or lower than a regular relay - in the low milliohms range. So again: why bother to complicate the circuit when you can get all you need using the simple alternative? The fan will be full on at 99.9% modulation for all practical purposes. You won't gain anything at all from adding the last 0.1% with a relay.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #14 on: October 24, 2012, 11:46:25 am »
no circuit complication, just a small addition to the software
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1283
  • Country: fi
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #15 on: October 25, 2012, 05:45:24 am »
I wouldn't bother but then it is your boat. Whatever floats it, as they say.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #16 on: October 25, 2012, 06:47:36 am »
I have to keep a person who has no clue about these things happy and as I'm getting limited information about the final use I'm building in any safeguards I can for nothing.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1283
  • Country: fi
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #17 on: October 25, 2012, 07:45:30 am »
I have to keep a person who has no clue about these things happy and as I'm getting limited information about the final use I'm building in any safeguards I can for nothing.
OK, that may be a valid reason. Defensive implementation is often a smart strategy.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #18 on: October 25, 2012, 07:47:26 am »
Put it this way, it took me half an hour to get across to him that this is a feedback system and that he is not controlling a valve with a pot but that the pot is telling the system the desired temp and the system control the valve.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1283
  • Country: fi
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #19 on: October 25, 2012, 07:50:58 am »
So the guy needs a 101 primer on concepts of control theory  ;)
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #20 on: October 25, 2012, 07:54:32 am »
So the guy needs a 101 primer on concepts of control theory  ;)

GOD don't go there, he retires in under a year and as much as I like him I'll almost be relieved, to him everything is an input or an output, or it has a "switching action". The classic was when I tried to explain the feedback mechanism of a position potentiometer in the water valve, I had to explain each pin, the worrying bit was when he asked if the pot ground was an input or an output, I just wanted to run.

He also thinks that if i put spike suppression on the positive line, i need on on the negative (vehicle chassis too)
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 7524
  • Country: nz
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #21 on: October 25, 2012, 08:10:50 am »
I think Bored@Work would explode if he met someone like that :D
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #22 on: October 25, 2012, 09:03:57 am »
I think Bored@Work would explode if he met someone like that :D

To put it mildly yes  :)
 

Offline Thomas

  • Regular Contributor
  • *
  • Posts: 83
  • Country: no
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #23 on: October 27, 2012, 10:20:11 am »
Back on topic:
I don't know about Microchip timers, but I do know that AVR timers can achieve full 0-100% PWM depending on the PWM mode. Some modes can do it, some don't.

You should be able to find this information in the Microchip datasheet for the part you're using. Find a formula for the output duty cycle and work the numbers.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 14491
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: is 100% duty PWM output on a pic effectively 5V out ?
« Reply #24 on: October 27, 2012, 12:58:33 pm »
well using mikroC (which i'm gradually weaning off of) setting the PWM value to 255 which they say in 100% produces a non 100% duty with a 250nS off time @ 20 KHz and 4 MHz clock, maybe something to do with the clock being too low to achieve resolution ?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf