EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

PWM Duty Cycle

Started by Ravi May 5, 2008
hey guys thnx for helpin.....i got the compliment using double dge
PWM...i supose for controoling the motor that wud be the better
idea...
--- In l..., rand3289 wrote:
>
> you can compliment by doing XOR with 1.
> a^1 = ~a
> for bits that you need complimented, you build a bit mask, such as
if
> bit 3 needs to be complimented, it would read 00001000 then you do
XOR
> with the data and it will flip that bit.
> Rand3289
>
> --- Ravi wrote:
>
> > Hi Rajeev,
> > for LPC2000 I've not seen any such option for complement output,
> > I feel use of inverter(NOT gate) at the output port is better
> > solution.
> >
> >
> > Ravi
> >
> >
> >
> >
> > On Wed, 07 May 2008 urjust2oocool wrote :
> > >--- In l..., "subscriptions@"
> > > wrote:
> > > >
> > > > Ravi Wrote
> > > > >Thanx for ur quick reply
> > > > >I'm measuring it with multimeter directly on port pin.
> > > >
> > > > By measuring voltage? If so that may explain the problem.
You
> > >really need
> > > > an oscilloscope for this sort of measurement.
> > > >
> > > > Robert
> > > >
> > > >
> > > >
> > -----------------------------
--
> > >-
> > > > mail2web - Check your email from the web at
> > > > http://link.mail2web.com/mail2web
> > > >
> > >hi ravi and robert,
> > >I 'm using PWM to control a serrvo motor....
> > >to control a motor...u nead 6 PWM's (in each pair each PWM has
to
> > >be the compliment of the other within that pair....)
> > >
> > >I would like to know if we will be able to generate a
compliment for
> > >the same....
> > >If so plz type down the particular part of code wer the
compliment
> > >is made..thanx in advance
> > >regards
> > >Rajeev
> > >
> >
> >
> >
> >
> >
_____________________________________________________________________
_______________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>

An Engineer's Guide to the LPC2100 Series

Hi rand3289,

Could u please explain how due to faster NOT gate
it creates a shoot-through current in MOSFETs

Ravi
On Thu, 08 May 2008 rand3289 wrote :
>My bad, I did not realize PWM was generated in hardware.
>In that case, if there is an "interrupt on pin change" you could link
>PWM output to an input pin, each change would trigger an interrupt and
>in software one would output a negative of the input on another pin.
>If the PWM frequency is not too high, this might work.
>
>Otherwise, you are right, a NOT gate is the best solution. I used it on
>my H-bridges to drive 2 pairs of mosfets, however NOT gate is so fast,
>it created a shoot-through current and one of the mosfets will heat up.
>
>rand3289
>
>--- Ravi wrote:
>
> > Hi Rand3289,
> > How can U do 'a^1 = ~a' with PWM output ?
> >
> > Ravi
> >
> > On Wed, 07 May 2008 rand3289 wrote :
> > >you can compliment by doing XOR with 1.
> > >a^1 = ~a
> > >for bits that you need complimented, you build a bit mask, such as
> > if
> > >bit 3 needs to be complimented, it would read 00001000 then you do
> > XOR
> > >with the data and it will flip that bit.
> > >Rand3289
> > >
> > >--- Ravi wrote:
> > >
> > > > Hi Rajeev,
> > > > for LPC2000 I've not seen any such option for complement output,
> > > > I feel use of inverter(NOT gate) at the output port is better
> > > > solution.
> > > >
> > > >
> > > > Ravi
> > > >
> > > >
> > > >
> > > >
> > > > On Wed, 07 May 2008 urjust2oocool wrote :
> > > > >--- In l..., "subscriptions@..."
> > > > > wrote:
> > > > > >
> > > > > > Ravi Wrote
> > > > > > >Thanx for ur quick reply
> > > > > > >I'm measuring it with multimeter directly on port pin.
> > > > > >
> > > > > > By measuring voltage? If so that may explain the problem.
> > You
> > > > >really need
> > > > > > an oscilloscope for this sort of measurement.
> > > > > >
> > > > > > Robert
> > > > > >
> > > > > >
> > > > > >
> > > >
> > -------------------------------
> > > > >-
> > > > > > mail2web - Check your email from the web at
> > > > > > http://link.mail2web.com/mail2web
> > > > > >
> > > > >hi ravi and robert,
> > > > >I 'm using PWM to control a serrvo motor....
> > > > >to control a motor...u nead 6 PWM's (in each pair each PWM has
> > to
> > > > >be the compliment of the other within that pair....)
> > > > >
> > > > >I would like to know if we will be able to generate a compliment
> > for
> > > > >the same....
> > > > >If so plz type down the particular part of code wer the
> > compliment
> > > > >is made..thanx in advance
> > > > >regards
> > > > >Rajeev
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
>____________________________________________________________________________________
> > >Be a better friend, newshound, and
> > >know-it-all with Yahoo! Mobile. Try it now.
> > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
> >
> >
> >
> > ____________________________________________________________________________________
>Be a better friend, newshound, and
>know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Hi Ravi,
I believe I might have given you the wrong information - after thinking
about it some more, I can not explain it. Up to now I assumed that was
the reason with my H-bridges.
I have 3 identical H-birdges where one mosfet always gets hot during
operation. I drive one side with (PWM AND DIRECTION) the other with
(PWM AND NOT DIRECTION) if anything it's the delay introduced by the
NOT gate that causes the mosfets to heatup when direction bit is
toggled rapidly (in my case reading joystick that oscillates around 0).
Just guessing.
Rand3289

--- Ravi wrote:

> Hi rand3289,
>
> Could u please explain how due to faster NOT gate
> it creates a shoot-through current in MOSFETs
>
> Ravi
> On Thu, 08 May 2008 rand3289 wrote :
> >My bad, I did not realize PWM was generated in hardware.
> >In that case, if there is an "interrupt on pin change" you could
> link
> >PWM output to an input pin, each change would trigger an interrupt
> and
> >in software one would output a negative of the input on another pin.
> >If the PWM frequency is not too high, this might work.
> >
> >Otherwise, you are right, a NOT gate is the best solution. I used it
> on
> >my H-bridges to drive 2 pairs of mosfets, however NOT gate is so
> fast,
> >it created a shoot-through current and one of the mosfets will heat
> up.
> >
> >rand3289
> >
> >--- Ravi wrote:
> >
> > > Hi Rand3289,
> > > How can U do 'a^1 = ~a' with PWM output ?
> > >
> > > Ravi
> > >
> > > On Wed, 07 May 2008 rand3289 wrote :
> > > >you can compliment by doing XOR with 1.
> > > >a^1 = ~a
> > > >for bits that you need complimented, you build a bit mask, such
> as
> > > if
> > > >bit 3 needs to be complimented, it would read 00001000 then you
> do
> > > XOR
> > > >with the data and it will flip that bit.
> > > >Rand3289
> > > >
> > > >--- Ravi wrote:
> > > >
> > > > > Hi Rajeev,
> > > > > for LPC2000 I've not seen any such option for complement
> output,
> > > > > I feel use of inverter(NOT gate) at the output port is better
> > > > > solution.
> > > > >
> > > > >
> > > > > Ravi
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Wed, 07 May 2008 urjust2oocool wrote :
> > > > > >--- In l..., "subscriptions@..."
> > > > > > wrote:
> > > > > > >
> > > > > > > Ravi Wrote
> > > > > > > >Thanx for ur quick reply
> > > > > > > >I'm measuring it with multimeter directly on port pin.
> > > > > > >
> > > > > > > By measuring voltage? If so that may explain the
> problem.
> > > You
> > > > > >really need
> > > > > > > an oscilloscope for this sort of measurement.
> > > > > > >
> > > > > > > Robert
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > >
> -------------------------------
> > > > > >-
> > > > > > > mail2web - Check your email from the web at
> > > > > > > http://link.mail2web.com/mail2web
> > > > > > >
> > > > > >hi ravi and robert,
> > > > > >I 'm using PWM to control a serrvo motor....
> > > > > >to control a motor...u nead 6 PWM's (in each pair each PWM
> has
> > > to
> > > > > >be the compliment of the other within that pair....)
> > > > > >
> > > > > >I would like to know if we will be able to generate a
> compliment
> > > for
> > > > > >the same....
> > > > > >If so plz type down the particular part of code wer the
> > > compliment
> > > > > >is made..thanx in advance
> > > > > >regards
> > > > > >Rajeev
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > >____________________________________________________________________________________
> > > >Be a better friend, newshound, and
> > > >know-it-all with Yahoo! Mobile. Try it now.
> > > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>
____________________________________________________________________________________
> >Be a better friend, newshound, and
> >know-it-all with Yahoo! Mobile. Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>

____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

rand3289 Wrote
>I believe I might have given you the wrong information - after thinking
>about it some more, I can not explain it. Up to now I assumed that was
>the reason with my H-bridges.
>I have 3 identical H-birdges where one mosfet always gets hot during
>operation. I drive one side with (PWM AND DIRECTION) the other with
>(PWM AND NOT DIRECTION) if anything it's the delay introduced by the
>NOT gate that causes the mosfets to heatup when direction bit is
>toggled rapidly (in my case reading joystick that oscillates around 0).

The delay in the gate is probably not an issue (easy enough to measure, I'd
expect it to be on the order of 10's of nS).

However, you are assuming that the the turn-on and turn off times of the
MOSFETS are
- Identical
- insignificant

Neither are likely to be true.

Robert
--------------------------------
mail2web LIVE Free email based on Microsoft Exchange technology -
http://link.mail2web.com/LIVE

I will try to answer for him.

Many MOSFETs will turn on much faster than turn off. When you switch
directions on an H-Bridge, there is a chance that upper and lower
transistors will both be conducting for a short time as one comes on
and the other is slow to turning off. If you use a single control
line and there is no delay to allow the transisitor to turn off
before the other turns on, you get current surges straight through
the bridge to ground. It's called shoot through current.

--- In l..., "Ravi" wrote:
>
> Hi rand3289,
>
> Could u please explain how due to faster NOT gate
> it creates a shoot-through current in MOSFETs
>
> Ravi
> On Thu, 08 May 2008 rand3289 wrote :
> >My bad, I did not realize PWM was generated in hardware.
> >In that case, if there is an "interrupt on pin change" you could
link
> >PWM output to an input pin, each change would trigger an interrupt
and
> >in software one would output a negative of the input on another
pin.
> >If the PWM frequency is not too high, this might work.
> >
> >Otherwise, you are right, a NOT gate is the best solution. I used
it on
> >my H-bridges to drive 2 pairs of mosfets, however NOT gate is so
fast,
> >it created a shoot-through current and one of the mosfets will
heat up.
> >


The 2024 Embedded Online Conference