On Wed, Nov 4, 2009 at 2:43 PM, jgeidl <but...@gmail.com> wrote:
>
> Maybe my ignorance has gotten me in another corner. I am hearing that
> I won't be very successful trying to run an H-Bridge with two motors
> with a Basis STAMP. Does anyone have any experience with this?
>
> Here is the statement snippet with which I am experimenting and it
> seems to work but I am not testing very scientifically:
>
> PULSOUT 1, <some value>
> PULSOUT 2, <some value>
This is fine for servos.
But you really need 2 PWM streams going at the same time.
So you can get something like a PWM co-processor:
<http://www.awce.com/pak5.htm>
or you can find an R/C Pulse to PWM converter,
or you can use an Intelligent H-Bridge which uses a serial interface,
or allows an R/C servo style interface.
<http://dimensionengineering.com/Sabertooth2X5.htm>
--
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/
What you're missing here Jim, is the other half of the pulse,
when the output is low, that also counts as part of the PWM.
Let's say you do a 4mS pulse on one motor and an 8mS pulse on
the other. How long does it take you to get around the loop?
Basic Stamps get things done around 100 times a second, so you
don't come back (just guessing here) to the two pulse statements
for another, say 10mS. Okay, so your loop time might be 4+8+10
mS. Or 22mS. Wow. Not much pulse width there. You can only run
your motors about a quarter power with that scheme. So now you
want both motors to run the same speed. So you go 8+8+10, total
time goes to 26mS. So you now spend less time with the power on
to the faster motor, 8 out of 26 where before it was 8 out of
22. So speeding up the slow motor slows down the fast motor. Not
very satisfactory, is it?
Plus many motors are better pulsed 20,000 times a second (so you
don't hear a screaming audio from the motors being pulsed). You
can't even begin to get those speeds from a Basic Stamp.
The problem with PWM is you have to control both the PULSOUT
time, but also the PULSOUT-NOT-ON time. With the BS you can't
control two outputs simultaneously. You can't run your PULSOUTs
concurrently. (There are some sloppy tricks, but the time
resolution is...poor.) Generally, people use another micro to
generate PWM for the Stamp, so the Stamp just tells them
serially, "run the motor this fast" and lets something else do
the heavy real-time lifting.
Now what you can do with a Stamp, is turn a motor full on for a
while, and full off for a while, but PWM on two motors at a
time, without an aux processor of some kind, or an RC circuit
(which like a processor turns a short pulse into well applied
PWM) is very limited.
Now forgive me for mentioning my products, but just for
comparison, Our 'Pod's line of controllers were made for motor
control. They have hardware generated PWM output, so you can
just set the PWM ratio you want, and forget it. Up to the
Megaherts range. Plus it has quadrature encoder inputs, so when
ever you want to know where the motor has turned to, again
hardware has done the work for you, and you just read the
position from a register. The difference between a Stamp
designed a number of years into the last millenium and one
designed in this one, are pretty remarkable. (But then I
admitted my bias.)
Randy
I don't' mind your product plug at all, that's the only way I learn about
new things. My budget won't stand your stuff right now but maybe latter.
Jim, K6JMG
www.spinochio.com
No trees were harmed in the sending of this message; however, a large number
of electrons were terribly inconvenienced.
//
> [mailto:hbrob...@googlegroups.com] On Behalf Of Randy M. Dumse
> Sent: Wednesday, November 04, 2009 3:11 PM
> To: hbrob...@googlegroups.com
> Subject: [HBRobotics] Re: Basic STAMP running an H-Bridge
Is this assuming the same speed for both motors (single PWM)?
If the stamp is 28 pins, then Basic Micro has an AtomBasicPro chip that can
drop in. They have some 24 pin modules as well. I'm told the 'Pros handle
multiple R/C (PWM) quite nicely.
Alan KM6VV
> -----Original Message-----
> On Behalf Of J O H N
>
> The basic stamp only lets you do one thing at a time, so you'll never get
> each motor running at the same time using separate io pins. The trick
> here
> is to add some simple external logic so one basic stamp pin maps two
> channels on the hbridge at the same time. You can use the 74LS32 (four 2
> input or-gates on one chip, ~35 cents each) to do exactly that. I used it
> with a two channel hbridge to control two motors (starboard and port), one
> or-gate for each of the hbridge control inputs. Also, you'll want to use
> the pwm command instead of the pulseout command for motor control.
> <snip>
> John
>
Sorry to be so dense but I don't understand what you are saying.
Jim, K6JMG
www.spinochio.com
No trees were harmed in the sending of this message; however, a large number
of electrons were terribly inconvenienced.
//
> [mailto:hbrob...@googlegroups.com] On Behalf Of Alan Marconett
> Sent: Thursday, November 05, 2009 9:51 AM
> To: hbrob...@googlegroups.com
> Subject: [HBRobotics] Re: Basic STAMP running an H-Bridge
Then I didn't explain it well enough!
I'm saying that there are "bigger and better" modules that are
pin-compatible with the Stamp. And the new modules are faster, and handle
multiple R/C servos (drive signal for some servo modules) or PWM's better.
Check out Basic Micro at:
http://basicmicro.com/Category.aspx?CategoryID=43
> -----Original Message-----
> On Behalf Of James M.(Jim) Geidl
That's the idea! The Parallax, while a fine starting place, is quite slow
(and limited) in today's round of parts.
How many pins on your Basic Stamp? 24? 28??
28 would be better, it opens up more doors. The 'Pro part is the way I'd
go, if your BOE 'bot can accept it.
BA offers free downloads of the IDE's. Studio IDE is just out.
There are other concerns, such as the programming cable (simple 9-pin RS-232
cable for BA), and which pins your Parallax uses for it's programming.
Dig me up a URL for the BOE manual (I might already have it) and we'll check
out what you have. Others on this list have been commenting on these
"chips", and might already have the conversion figured out!
Alan KM6VV
> -----Original Message-----
> On Behalf Of James M.(Jim) Geidl
>
> Alan,
>
Here is a link to a most of the Parallax manuals.
http://www.parallax.com/tabid/440/Default.aspx
It seems to me that "pin-compatible" should mean the programming, serial-in
and serial-out, must be on the same pins on both the STAMP and the ATOM.
I have a couple 24pin BOE boards so am going to try the 24-M ATOM.
Jim, K6JMG
www.spinochio.com
No trees were harmed in the sending of this message; however, a large number
of electrons were terribly inconvenienced.
//
> [mailto:hbrob...@googlegroups.com] On Behalf Of Alan Marconett
> Sent: Thursday, November 05, 2009 12:14 PM
> To: hbrob...@googlegroups.com
> Subject: [HBRobotics] Re: Basic STAMP running an H-Bridge
>
>
Yeah, looks like it'll drop in!
Alan KM6VV
> -----Original Message-----
> On Behalf Of James M.(Jim) Geidl
> Sent: Thursday, November 05, 2009 12:33 PM
> To: hbrob...@googlegroups.com
> Subject: [HBRobotics] Re: Basic STAMP running an H-Bridge
>
>
Jim, K6JMG
www.spinochio.com
No trees were harmed in the sending of this message; however, a large number
of electrons were terribly inconvenienced.
//
> [mailto:hbrob...@googlegroups.com] On Behalf Of Nathaniel Lewis
> Sent: Thursday, November 05, 2009 1:40 PM
This looks interesting too.
BTW, I've noticed that there is no price fixing on this stuff. :-) Funny
how every one of the 24p systems are $49.
I don't have any code to worry about porting so a change in language is too
big a deal as long as it is in the same general form, i.e. Basic. Visual
Basic would actually be a real slick improvement as I like the object
oriented stuff.
Jim, K6JMG
www.spinochio.com
No trees were harmed in the sending of this message; however, a large number
of electrons were terribly inconvenienced.
//
Yes, you are correct, it would be cheaper but more moving parts, so to
speak. I could use a Picaxe, with which I am slightly familiar, as well.
Jim, K6JMG
www.spinochio.com
No trees were harmed in the sending of this message; however, a large number
of electrons were terribly inconvenienced.
//
> [mailto:hbrob...@googlegroups.com] On Behalf Of Nathaniel Lewis
> Sent: Thursday, November 05, 2009 4:43 PM
> To: hbrob...@googlegroups.com
> Subject: [HBRobotics] Re: Basic STAMP running an H-Bridge
>
>
> My original thought however, would be the cheapest. If you
> got a small 8 pin AVR to serve as a pwm co-processor, you
> would not have to go buy another $50-$60 part. The ATTiny45
> is an 8 pin avr, it can even fit in the Board of Education
> breadboard. You could connect a serial line to it and
> communicate with it through the stamp's serout command. I
> could piece together some code to control an AVR in this
> configuration if you would like.
>
> Nathaniel
>
> -----Original Message-----
> From: hbrob...@googlegroups.com
> [mailto:hbrob...@googlegroups.com] On Behalf Of James M.(Jim) Geidl
> Sent: Thursday, November 05, 2009 3:50 PM
> To: hbrob...@googlegroups.com
> Subject: [HBRobotics] Re: Basic STAMP running an H-Bridge
>
>
> Thanks, Nathaniel, I'll take a look at it too.
>
> Jim, K6JMG
> www.spinochio.com
>
> No trees were harmed in the sending of this message; however,
> a large number of electrons were terribly inconvenienced.
>
>
> //
>
<snip