Shop OBEX P1 Docs P2 Docs Learn Events
BS2E PWM Driving H-Bridge — Parallax Forums

BS2E PWM Driving H-Bridge

ArchiverArchiver Posts: 46,084
edited 2001-08-08 15:26 in General Discussion
All,

I've done some searching and tinkering and can't really get the PWM
statement on the BS2E to drive an H-bridge properly. All of the resources I
have found so far revolve around what Parallax has in the manual, which is
not what I want to do. PULSOUT works fine, and I've used this before to
control H-bridges with no problems. Any suggestions?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-08-07 20:46
    In a message dated 8/7/01 2:22:32 PM Central Daylight Time,
    daweasel@s... writes:


    > I've done some searching and tinkering and can't really get the PWM
    > statement on the BS2E to drive an H-bridge properly. All of the resources I
    > have found so far revolve around what Parallax has in the manual, which is
    > not what I want to do. PULSOUT works fine, and I've used this before to
    >

    Bill:

    The PWM from the Stamp is not designed to drive H-Bridge circuits. The
    intent is to create a quasi-analog output by charging a cap through a know
    resistance. If you look at the PWM signal on a scope you'll see that it
    looks random. It's the nature of the algorithm. Over a given period, the
    duty cycle is as specified, but it's not regular -- something you need when
    driving motors.

    There's an old BS1 App Note called "Fun With Trains" that does motor control
    directly (through a ULN2803). I don't know if it will work with your app,
    but it's worth a shot.

    -- Jon Williams


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-07 21:55
    At 03:46 PM 8/7/01 -0400, you wrote:
    >In a message dated 8/7/01 2:22:32 PM Central Daylight Time,
    >daweasel@s... writes:
    >
    >
    > > I've done some searching and tinkering and can't really get the PWM
    > > statement on the BS2E to drive an H-bridge properly. All of the resources I
    > > have found so far revolve around what Parallax has in the manual, which is
    > > not what I want to do. PULSOUT works fine, and I've used this before to
    > >
    >
    >Bill:
    >
    >The PWM from the Stamp is not designed to drive H-Bridge circuits. The
    >intent is to create a quasi-analog output by charging a cap through a know
    >resistance. If you look at the PWM signal on a scope you'll see that it
    >looks random. It's the nature of the algorithm. Over a given period, the
    >duty cycle is as specified, but it's not regular -- something you need when
    >driving motors.
    >
    >There's an old BS1 App Note called "Fun With Trains" that does motor control
    >directly (through a ULN2803). I don't know if it will work with your app,
    >but it's worth a shot.
    >
    >-- Jon Williams

    Bill,
    You must first think of the Stamp PWM as a means for setting an
    analog value. "quasi-analog" as Jon Williams puts it. There is
    a quick and dirty way to do what you want, but it involves a few
    external components.

    R C
    Stamp I/O >----/\/\----o----||----> GND
    |
    |
    100K Pot o
    > QA "quasi-analog"
    o--/\/\--o |
    | | | | |\
    | o---o o--|+\
    | | | \----> PWM out to "H-Bridge"
    | 1|\ 2 | o--|-/
    o--| \o--o | |/U2
    | |/ U1 |
    | |
    o
    o
    > QSAW "quasi-saw"
    |
    o---||
    >GND
    .01uF



    U1 - 74HC14
    - tie ALL unused INPUT pins (3,5,9,11, & 13) to GND (pin 7)
    or VCC (pin 14)
    - connect a .01uF cap directly across pins 7 & 14

    U2 - UA741 Op-Amp

    R&C - R and C values should be those suggested in the Stamp Manual.

    Note: Adjust the 100K Pot for a base frequency of aprox 3KHz.
    Most ESC (Electronic Speed Controllers) use a base
    frequency near 3KHz.

    With this setup, you can send a PWM signal to your Stamp pin to
    set your PWM level. Then you can process other code while this
    circuit temporarily maintains the PWM level. You WILL need to
    make periodic updates.







    Beau Schwabe IC Mask Designer
    National Semiconductor Wired Communications Division
    500 Pinnacle Court, Suite 525 Mail Stop GA1 Norcross, GA 30071
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-08 00:40
    Beau, thanks for the info, but I can't make heads or tails out of your ASCII
    schematic. Any way you can email me a GIF or something?

    Original Message

    > > > I've done some searching and tinkering and can't really get the PWM
    > > > statement on the BS2E to drive an H-bridge properly. All of the
    resources I
    > > > have found so far revolve around what Parallax has in the manual,
    which is
    > > > not what I want to do. PULSOUT works fine, and I've used this before
    to

    > You must first think of the Stamp PWM as a means for setting an
    > analog value. "quasi-analog" as Jon Williams puts it. There is
    > a quick and dirty way to do what you want, but it involves a few
    > external components.
    >
    > R C
    > Stamp I/O >----/\/\----o----||----> GND
    > |
    > |
    > 100K Pot o
    > QA "quasi-analog"
    > o--/\/\--o |
    > | | | | |\
    > | o---o o--|+\
    > | | | \----> PWM out to "H-Bridge"
    > | 1|\ 2 | o--|-/
    > o--| \o--o | |/U2
    > | |/ U1 |
    > | |
    > o
    o
    > QSAW "quasi-saw"
    > |
    > o---||
    >GND
    > .01uF
    >
    >
    >
    > U1 - 74HC14
    > - tie ALL unused INPUT pins (3,5,9,11, & 13) to GND (pin 7)
    > or VCC (pin 14)
    > - connect a .01uF cap directly across pins 7 & 14
    >
    > U2 - UA741 Op-Amp
    >
    > R&C - R and C values should be those suggested in the Stamp Manual.
    >
    > Note: Adjust the 100K Pot for a base frequency of aprox 3KHz.
    > Most ESC (Electronic Speed Controllers) use a base
    > frequency near 3KHz.
    >
    > With this setup, you can send a PWM signal to your Stamp pin to
    > set your PWM level. Then you can process other code while this
    > circuit temporarily maintains the PWM level. You WILL need to
    > make periodic updates.
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-08 07:10
    Just a quick tip...

    If you change your font to a "fixed-width" font, such as "Courier New", you
    will be able to read ASCII schematics...

    Jared Hoylman
    VB Overdrive
    http://vboverdrive.extreme-vb.net/main.php3


    Original Message
    From: "Rodent" <daweasel@s...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, August 07, 2001 4:40 PM
    Subject: Re: [noparse][[/noparse]basicstamps] BS2E PWM Driving H-Bridge


    > Beau, thanks for the info, but I can't make heads or tails out of your
    ASCII
    > schematic. Any way you can email me a GIF or something?
    >
    >
    Original Message
    >
    > > > > I've done some searching and tinkering and can't really get the PWM
    > > > > statement on the BS2E to drive an H-bridge properly. All of the
    > resources I
    > > > > have found so far revolve around what Parallax has in the manual,
    > which is
    > > > > not what I want to do. PULSOUT works fine, and I've used this before
    > to
    >
    > > You must first think of the Stamp PWM as a means for setting an
    > > analog value. "quasi-analog" as Jon Williams puts it. There is
    > > a quick and dirty way to do what you want, but it involves a
    few
    > > external components.
    > >
    > > R C
    > > Stamp I/O >----/\/\----o----||----> GND
    > > |
    > > |
    > > 100K Pot o
    > QA "quasi-analog"
    > > o--/\/\--o |
    > > | | | | |\
    > > | o---o o--|+\
    > > | | | \----> PWM out to "H-Bridge"
    > > | 1|\ 2 | o--|-/
    > > o--| \o--o | |/U2
    > > | |/ U1 |
    > > | |
    > > o
    o
    > QSAW "quasi-saw"
    > > |
    > > o---||
    >GND
    > > .01uF
    > >
    > >
    > >
    > > U1 - 74HC14
    > > - tie ALL unused INPUT pins (3,5,9,11, & 13) to GND (pin 7)
    > > or VCC (pin 14)
    > > - connect a .01uF cap directly across pins 7 & 14
    > >
    > > U2 - UA741 Op-Amp
    > >
    > > R&C - R and C values should be those suggested in the Stamp Manual.
    > >
    > > Note: Adjust the 100K Pot for a base frequency of aprox 3KHz.
    > > Most ESC (Electronic Speed Controllers) use a base
    > > frequency near 3KHz.
    > >
    > > With this setup, you can send a PWM signal to your Stamp pin to
    > > set your PWM level. Then you can process other code while this
    > > circuit temporarily maintains the PWM level. You WILL need to
    > > make periodic updates.
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-08 15:26
    At 06:40 PM 8/7/01 -0500, you wrote:
    >Beau, thanks for the info, but I can't make heads or tails out of your ASCII
    >schematic. Any way you can email me a GIF or something?

    Turn off your proportional spacing, or cut-n-paste it into Windows NotePad


    Beau Schwabe IC Mask Designer
    National Semiconductor Wired Communications Division
    500 Pinnacle Court, Suite 525 Mail Stop GA1 Norcross, GA 30071
Sign In or Register to comment.