Shop OBEX P1 Docs P2 Docs Learn Events
FOR JON Re: [basicstamps] Interesting Problem — Parallax Forums

FOR JON Re: [basicstamps] Interesting Problem

ArchiverArchiver Posts: 46,084
edited 2003-02-18 04:21 in General Discussion
Thanks for the reply. Then why does the stamp continue
to PWM pin 1, even though that command is over.

--- jonwms@a... wrote:
> The BASIC Stamp PWM command does not work well for
> motor control; it is setup
> for digital-to-analog conversion by charging an RC
> network.
>
> The other problem you're having is the the PWM
> command doesn't care what you
> do with the Outs or Dirs register. It will take the
> pin you give it, make it
> an output, then run the PWM function.
>
> -- Jon Williams
> -- Parallax
>
> In a message dated 2/17/2003 6:32:54 PM Central
> Standard Time,
> suri_list@y... writes:
>
> > Hi
> > I am trying to control (Variable Speed) of a motor
> > using an Hbridge .The 2 terminal(Logic inputs) of
> the
> > hbridge are being driven form the stamp IOs out0
> and
> > out1.Please refer to the code shown below.
> >
> > '{$STAMP BS2}
> > output 0
> > output 1
> > output 2
> > output 3
> > temp var word
> > 'RUN MOTOR FORWARD AT A CERTAIN SPEED
> > for temp = 1 to 100
> > out0= %0
> > pwm 1,150, 10
> > NEXT
> >
> > 'RUN THE MOTOR BACKWARD AT A CERTAIN SPEED
> > for temp = 1 to 100
> > out1= %0
> > pwm 0,150, 10
> > NEXT
> >
> > The problem is that in the first part the program
> > works fine and the motor runs forward at a certain
> > speed . But when the part to reverse direction
> comes
> > the motor just stops. I saw teh output pine on the
> > scope and interestingly. Even though the first
> part
> > works fine . In the second loop. IO 1 still keeps
> on
> > giving PWM inspite of the command OUT1 = %0. the
> > magnitude of the PWm is lesser. But its enough to
> keep
> > the fan off. Why isnt IO1 staying at 0.
> >
> > Kindly Advise
> > Thanks
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been
> removed]
>
>
> 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/
>
>


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-02-18 04:21
    You have a PWM command in a loop. Once the loop finally terminates, the PWM
    command will be over.

    -- Jon Williams
    -- Parallax

    In a message dated 2/17/2003 7:01:24 PM Central Standard Time,
    suri_list@y... writes:

    > Thanks for the reply. Then why does the stamp continue
    > to PWM pin 1, even though that command is over.



    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.