Shop OBEX P1 Docs P2 Docs Learn Events
high speed motor with h-bridge — Parallax Forums

high speed motor with h-bridge

williewillie Posts: 3
edited 2009-11-06 15:00 in Learn with BlocklyProp
·I am writing a program to run high speed moter with h-bridge. In the program I understand the motor runs on a
pulse out comand to hold the motor at say 1000 for five seconds would you, pause for 5000? and to send the motor to low to stop it would, pulsout I/O pin , 0 to stop the motor? Also using var word would I use the var. in place of the I/O pin number.·Any help would be appreciated,·I am tring to have this program ready for class monday.
thanks
Willie
·

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2009-11-06 06:43
    willie,

    Welcome to the Parallax Forums!

    Please post the code that you are currently using and any schematics if you have them available.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • williewillie Posts: 3
    edited 2009-11-06 14:31
    ' {$STAMP BS2}········ Here is a copy of the program I was going to try. In the first lab the motor runs at a
    ' {$PBASIC 2.5}·········low speed for five seconds, I picked 150 then runs the other direction at a higher
    ·r VAR Word··············speed·I set it at 1000 for five five seconds then it must stop for five seconds then loop
    ·x VAR Word·············
    ·OUTPUT 0················ I added schematic with attachment manager.
    ·OUTPUT 1
    ·r= 0························ Thanks Willie
    ·x=0
    ·main:
    ·PULSOUT 0,150
    ·DEBUG CR, "150"
    ·IF r=5000 THEN back
    ·GOTO main
    ·back:
    ·PULSOUT 1,1000
    ·DEBUG CR, "1000"
    ·IF x=5000 THEN halt
    ·GOTO back
    ·halt:
    ·PULSOUT 0,0
    ·PULSOUT 1,0
    ·IF r+x=5000 THEN main
    ·halt
    519 x 792 - 182K
    scan.jpg 181.5K
  • allanlane5allanlane5 Posts: 3,815
    edited 2009-11-06 15:00
    Um, the "PWM" input looks like it wants an "HWPM" signal -- this is a signal that controls speed by changing the duty-cycle of the signal. That is NOT a "pulsout" command. "PULSOUT" commands are used for controlling servo's, which have an on-board comparator. And even THOSE signals have to be repeated every 20 mSec.

    In short, I think you need an "HWPM" signal generator -- these do exist, that convert a PULSOUT speed setting signal into the repetitive HWPM duty cycle signals.
Sign In or Register to comment.