Shop OBEX P1 Docs P2 Docs Learn Events
PAK 8 operation — Parallax Forums

PAK 8 operation

ArchiverArchiver Posts: 46,084
edited 2002-03-03 21:31 in General Discussion
Hey Al Williams, it's me again!
I'm back on my motor-speed-control-using-a-PAK8 project. The multiple
PWM outputs and serial addressing were just what I needed to control
several motors (and optionally the braking and directions) with one
Stamp.
Got my mechanical issues sorted out, got the timing figured (needed a
tiny pause after the time base command to let it "take"), and even
the command structure (must send values MSBit first, even though 16
bit values are sent LSByte first). Whew.

Now I've got an app killer (wanted a killer app). I'm using this in
an RC controlled vehicle, so the pulse counts (=PWM duty cycle) are
resent a few times a second for smooth response. Every time I update
the values, the output pin seems to go high for a moment, then the
new PWM cycle starts... hard to tell with my old analog scope. This
causes a severe judder in the motors at the update frequency... if I
can't get around this, I go back to my (obsolete and hard to find)
Intersil CDP68HC68's, which made smooth transitions...
Help! and thanks, Pat Matthews

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-03-03 21:31
    Hard to say without seeing your code. The PAK-V is usually what folks
    use to do PWM and it makes the change from a single command so you
    shouldn't get any jitter there.

    The PAK-VIII is a pulse generator, so you are probably computing your
    own off and on times to get your PWM duty cycle. The problem is you
    can't set them both at the exact same time, so I'd guess that for a
    split second you have an "odd" PWM value in the registers. The changes
    take place at the end of the cycle, so you could have this scenario:

    Start on for 5 units, off for 5 units. (50%)

    You decide to go to 30% (3 on, 7 off)

    You set 3 on, you are now getting 3 on, 5 off (37.5%)

    Then you set 7 off. Now you are at 30%

    If you went the other way, you get 5/12 = 41% before going to 30%.

    Does that sound like it would explain what you are seeing? There should
    be no pause in the cycle generation other than what you program, but
    there will be a time when you are using an old half cycle time and a new
    half cycle time. That is, unless you are purposely disabling the pin
    while making changes.

    If your outputs can float, that might be the answer. Set the pin to Hi-Z
    before making your change. Then reenable the pin after setting the right
    duty cycle. However, if you have pull ups on the outputs this will cause
    the "momentarily on" issue you are seeing.

    Does any of this sound like what's happening?

    Al Williams
    AWC
    * Easy RS-232 Prototyping
    http://www.al-williams.com/awce/rs1.htm


    >
    Original Message
    > From: y2patmat [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=2rNiPa0d2uw3qNYx3Blc2PPw9uX_EMOtxk_cY_DaxhrR1UVh04V8p9NH2EsACwXi9iQMFamdcF4Z]patmat2350@a...[/url
    > Sent: Sunday, March 03, 2002 3:14 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] PAK 8 operation
    >
    >
    > Hey Al Williams, it's me again!
    > I'm back on my motor-speed-control-using-a-PAK8 project. The multiple
    > PWM outputs and serial addressing were just what I needed to control
    > several motors (and optionally the braking and directions) with one
    > Stamp.
    > Got my mechanical issues sorted out, got the timing figured (needed a
    > tiny pause after the time base command to let it "take"), and even
    > the command structure (must send values MSBit first, even though 16
    > bit values are sent LSByte first). Whew.
    >
    > Now I've got an app killer (wanted a killer app). I'm using this in
    > an RC controlled vehicle, so the pulse counts (=PWM duty cycle) are
    > resent a few times a second for smooth response. Every time I update
    > the values, the output pin seems to go high for a moment, then the
    > new PWM cycle starts... hard to tell with my old analog scope. This
    > causes a severe judder in the motors at the update frequency... if I
    > can't get around this, I go back to my (obsolete and hard to find)
    > Intersil CDP68HC68's, which made smooth transitions...
    > Help! and thanks, Pat Matthews
    >
    >
    > 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/
    >
Sign In or Register to comment.