Simplest bidirectional motor control

chipwich

Member
I was thinking about smart BEAM bots built around the 08M. But using a L293D for motor control seems like overkill and probably is not very efficient.

Are there any suggestions for simple and efficient methods of controlling very low-power motors (e.g. pager motors)? What about for bi-directional control?

Lastly, any pointers to *simple* Picaxe controlled bots which resemble BEAM robots?

Thanks in advance!
 

jodicalhon

New Member
If running the motors from the same supply as the 08M, a simple 4 transistor h-bridge would do the job for bidirectional control.
<code><pre><font size=2 face='Courier'>
-------------------------------------
| |
| |
| |
1k /e e\ 1k
--/\/\/\----b pnp b----/\/\/\--
| \c c/ |
| | | |
--- .--motor--. ---
| | | |
| 1k /c c\ 1k |
|--/\/\/\----b npn b----/\/\/\--
\e e/
| |
| |
-------------------------------------
</font></pre></code>

Apologies for the dodgy art.

EDIT:
More dodgy art. Simple emitter-follower bridge.

<code><pre><font size=2 face='Courier'>
--------------------------------
| |
| |
/c c\
---b npn b---
| \e e/ |
| | | |
--- .--motor--. ---
| | | |
| /e e\ |
---b pnp b---
\c c/
| |
| |
-----------------------------
</font></pre></code>
Very simple, but you're stuck with a 0.6V drop across the collector/emitter of both active transistors, i.e. you lose 1.2V of drive voltage.

Or you could use a 74AC245 or 74AC240, or something of that ilk, which can be used to drive small motors. It's an abuse of the chip, but I believe that's a BEAM characteristic.

Edited by - acrylic on 23/04/2007 15:56:08

Edited by - acrylic on 23/04/2007 16:00:18

Edited by - acrylic on 23/04/2007 16:03:19
 

Mycroft2152

Senior Member
The 74AC240 or 74AC245 works very well for small (pagerr) motors and is a lot oeasier to wire than the H bridge.

One other advantage of the 74AC245's is the very low current needed to run the chip itself.

Even a pair of 555's can be used as a low vcurrent motor driver.

There are a number of &quot;low voltage / low dropout&quot; motor driver chips that do not have the 1.2 volt penalty. Try google, unfortuantely they are very hard to find and buy. Rhey are ususlly designed as surface mount for use in VCR's and camcorders.

If you have a very efficient motor, suh as an Escap that runs on less than 25 milliamps, you can drive it directly from the PICAXE.

It is even possible, again depending on the motor's current requirements, to gang up a couple of outputs for more drive current.
 
For 3 to 4.5 volts I have tinkered with &quot;Tri State&quot; H bridges made up of NPN/PNP pairs with common collectors. Bias the transistors via LED's and resistors such that the voltage drop of the two LED's will not pass current but a sink or source from an 08M will. The supply can not be greater than the two transistor b-e drops of 0.7 and the forward volt drops of the two LED's added together or the whole lot lights up and you get a solid state short circuit!

The LED's have the added bonus of being highly informative, educational and a lot more fun to look at than the very clever but mysterious &quot;black box&quot; H bridge. Each LED illuminates as each leg of the &quot;H&quot; is powered.

If you can figure all this out and get it working then you can even &quot;cascade&quot; one side of the &quot;H&quot; bridge from the OP of the opposite side and you have single pin tri state, bi-directional control from ONE pin of an 08M = perfect for BEAM's.

Note the common collector gives approx 0.1 to 0.2 e-c volt drop per transistor unlike the standard 1.2 volt barrier problem.

PWM works too and you can have dynamic braking or float run down.

At low voltages and small motors you can forget about back emf diodes too.

A BEAM bot with an 08M would be like a BEAM on herbs.... Note the DisableBOD command gives a 1uA standby current and an 08M what will run right down to 1.3 volts without totally loosing the plot.

When the BEAM lobby discover the 08M it will be look out...

 

jodicalhon

New Member
Here's an old thread that, while ostensibly about stepper motor driving, contains links to a couple of tristatable h-bridge designs by wilf_nv that sound similar to that proposed by Andrew.


<A href='http://www.rev-ed.co.uk/picaxe/forum/Topic.asp?topic_id=4385&amp;forum_id=24&amp;Topic_Title=Budget%2B%2B%2526quot%253Bwet%2B%2Byour%2B%2Bfeet%2526quot%253B%2B%2Bstepp&amp;forum_title=No+new+posts+please%21+17' Target=_Blank>External Web Link</a>

The first link is down towards the bottom of the page. The second link is on page two.

Well worth a look.

Edited by - Jo C on 24/04/2007 14:04:11
 

chipwich

Member
Thanks for the great responses. In the spirit of BEAMs, I'm trying to keep this ultra-simple, limiting components (as best I can) to sensor, Picaxe, motor, and power supply. I've used transistor and IC drivers for motor control, but this design will do more with less... kind of like Hippy's previous posting about using an LED right off the PIC output (with no dropping resistor).

Anyone have any experience running small motors right from the Picaxe output? The first thought is that (of course) it is poor engineering practice and will run the chip out of spec. But at low voltage (e.g. 2v) the chance of damage goes down and back-EMF is probably reduced... And double up the output and now 50ma of drive is available.

It looks like pager motor start-up and stall current is probably on the order of 100ma, but where there is a will, there is a way.

BTW, I'm *not* advocating this as common design practice, just out of interest to see how simple a bot could be made.
 

chipwich

Member
I should note (before anyone misinterprets) that Hippy's design was an LED *flasher* and the peak and average current without the dropping resistor really were in spec for the components... very clever.

Consider that some laser pointers coming from China now forego optical feedback and regulated current supply for just a dropping resistor, and you'll understand the constant push toward design simplification, sometimes at the expense of the longevity of the device.
 

BeanieBots

Moderator
You clearly know the 'spec' limitations and understand the consequences, so I would suggest go for it. I have some very nice 24v geared 645:1 motors that came from a &quot;real world&quot; project I was working on. They run nicely straight from a PICAXE output and only pull around 25mA stalled.
Almost as much torque as a hobby servo at 5v but only at a few rpm.
(MAXON sell them but they are about &#163;40ea!)
As mentioned earlier, part of BEAM robotics is about breaking rules. That's fine as long as the consequences are understood and a tissue is to hand in case there are any tears. I'm sure it'll be fine in the context intended.
 

Mycroft2152

Senior Member
BB, &quot;Creative uses&quot; in BEAM may be closer to the truth than &quot;breaking the rules&quot;. It is really amazing what can be done with a couple of inverters, resistors and capacitors. <A href='http://costaricabeam.solarbotics.net/Circuits_Main.htm' Target=_Blank>External Web Link</a>

BEAM was started before cheap micros were availible and is another inexpensive way to get started in digital electronics.

SMARTBEAM, the combinaton of the PICAXE chip, especialy the 08M, and BEAM techniques create exciting possibilites.

In any event, some basic knowledge is needed. It is very easy to let the &quot;magic smoke&quot; out of any circuit by not being aware of the basic rules, as in firxt reading the manusls.

I always hold my breath, when I see the 'simple' H bridge circuit (as above) or LED circuits posted without the current limiting resistors. I can just see a newcomer breadboarding the circuit and getting a real world surprize.

Myc
(longtime BEAMer and PICAXE user)




Edited by - mycroft2152 on 24/04/2007 19:30:19

Edited by - mycroft2152 on 24/04/2007 21:24:07
 

BeanieBots

Moderator
I agree Mycroft2152, especially about some of the H-bridge designs that have been posted!
I've also followed BEAM for a long time and often use the concepts and principles in larger robots.
 

manuka

Senior Member
I normally run all Picaxe circuits off 3 x AAs (4&#189; V), so am NOT advocating a move to lower supply voltages. Although not a standard trial by fire (&amp; rarely mentioned to impressionable students),it's almost impossible to destroy a 08M from just 3V. Additionally red/green/amber LEDS can be run without dropper Rs too.

On 3V dead I/O shorts, power supply backwards or even ESD woes etc seem to be tolerated.In fact I've had 08Ms too hot to touch that still perform &quot;OK&quot; when cooler, &amp; have NOT lost a Picaxe since late 2002- in that time working with ~1000s.

Higher supplies (especially 9-12V)naturally MAY be capable of mischief however, &amp; those 9V battery snaps fitted to many Rev.Ed kits make me nervous!

The disadvantage of a 3V supply is of course that some devices just will not function- blue &amp; white LEDs especially, but also IR sensors &amp; 433MHz Rx. Additionally you've less reserve energy on tap with just 2 x AAs, meaning that when they become weary (say 1.2V each) they'll be prematurely discarded. 3 x AAs could fall to below 1V per cell &amp; still keep a light drain Picaxe circuit working. With cheap rechargeables abounding it's appealing to use 3 x NiCd/NIMHs (3.6V) as well, but 2 x 1.2V (2.4 V) is too low a supply.

These points are especially important educationally, as on going battery costs may THE most major expense, meaning a tight budget may be nickel &amp; dimed to an early death. In fact make that &quot;dollar&quot; &amp; dimed, as some AA brands/types (most notably Eveready &amp; 9V)can be excessively costly. Here in NZ I normally use &quot;The Warehouse&quot; alkaline AAs instead, as these cost ~US 20c each (~1/10 the cost of equivalent big name brands), &amp; their life seems to be &quot;ages&quot;. Hence I've just switched on a 2003 era Mk.1 PICNIK box,with batteries ~4 yo.,&amp; it's attached &quot;solar motor&quot; <A href='http://www.picaxe.orcon.net.nz/motorpwm.jpg ' Target=_Blank>External Web Link</a> burst into life nicely. Stan
 

Rickharris

Senior Member
You could use a pair of miniature low voltage relays some are little bigger than an IC. I guess current draw could be an issue if your following Beam principles.
 

Rickharris

Senior Member
Speaking of low energy micro sized motors there must be an application for piezo driven motors. these have been around a long time and at their simplest could be a piezo sounder with a wire glued to the centre, the end of this wire rests on a small wheel. As the piezo vibrates the wire moves back and forwards pushing the wheel round, A little mechanical adjustment allows for the wire to push on one stroke and ride free on the back stroke making the wheel rotate.

This seems to me an ideal low mass/cost actuator that could easily be driven by a picaxe and perhaps you could relate the freq/time to the distance the wheel rotates to give positional data.

As yet untried thought - but when I have the time!

<A href='http://www.newscaletech.com/squiggle_overview.html' Target=_Blank>External Web Link</a> I don't know how much these cost but at 1.5 x 1.5 x 6 mm they are really small and by definition must be low power and yet can produce 5 N at nanometer resolution.
 

manuka

Senior Member
In my (admittedly limited) experiences, piezo motors &amp; their variants - although fiendishly clever- are more power hungry that normal motors. Stan
 

Rickharris

Senior Member
Hi Stan,

I have to confess I haven't used or seen one but I was thinking of self made and driven an 08 at audio freq as a sound output, (not worried about the noise!), so no more power hungry than th picaxe would normally be and potentially a much lighter motor/actuator set up.

Have to experiment.
 

jodicalhon

New Member
The first h-bridge design I posted is a standard design and quite safe if, as I stated, the voltage driving the inputs is the same as the h-bridge voltage. If the bridge is powered at 5v, then the inputs would be driven at 0V and 5V. The inputs should not be allowed to float, however.

The second design, the simple emitter follower h-bridge, is again quite safe if used properly and needs no base resistors.

Edited by - acrylic on 25/04/2007 14:15:39
 

slurp

Senior Member
Where the motor has a low current I've seen MOSFET driver chips used such as the 4427A (upto 100mA-ish) and 4424 (upto 150mA-ish).

You've effectively got an H-Bridge on a chip here... the amp rating on the data sheet relates to a peek supply when running them as drivers as intended - try it with a motor pulling that much and you'll have burnt fingers and a blown circuit!

It worth adding some diodes for a little protection against those inductive motor loads.

regards,
colin

www.minisumo.org.uk
 

jodicalhon

New Member
Another simple idea, this time for unidirectional motor control. This application is a small BEAMish robot exhibiting phototaxis.

The driver is, again, an emitter follower, this time in a darlington configuration.

A high from the picaxe runs the motor. A low disables the motor.

The reverse-biased photodiode provides a small base current to the transistor pair that is proportional to the light level.
<code><pre><font size=2 face='Courier'>

---------------------------.-- +ve
|
photodiode |
/c-----.---.
from----|&lt;|---b /c
picaxe \e----b both transistors
\e npn
|
motor
|
------------------------.--- -ve
</font></pre></code>

Two outputs of the 08M are used. Three pins remain for other sensor inputs, tune playing, light flashing or whatever.
 

jodicalhon

New Member
Mycroft2152 wrote:<i>I always hold my breath, when I see the 'simple' H bridge circuit (as above) or LED circuits posted without the current limiting resistors. I can just see a newcomer breadboarding the circuit and getting a real world surprize. </i>

Beanibots wrote:<i>I agree Mycroft2152, especially about some of the H-bridge designs that have been posted! </i>

acrylic wrote:<i>The second design, the simple emitter follower h-bridge, is again quite safe if used properly and needs no base resistors. </i>

Acrylic is quite right. This current-booster has been used often in small BEAM applications.

I have used it with an approx 27ohm gear motor, with Vcc = 5.4V. The unloaded motor draws around 60mA, and at this collector current the base current for the active transistors is less than 1mA. The voltage across the motor is around 3.8V.

If I stall the motor, the motor current rises to around 127mA and the motor voltage drops to about 3.3V as the voltage across the base/emitters of the active transistors increases. The base current of the active transistors rises to around 6.6mA.

Letting the inputs float seems to effectively tristate the bridge. Pulling both inputs low or high tristates the bridge. Even just letting one input float tristates the bridge.

Of course, the downside is the collector/emitter voltage drops, as acrylic stated.

But, all in all, a simple and effective motor driver for small 'bots.

It seems the only 'real world surprise' is for Myc and BB!
 

BeanieBots

Moderator
My comments relate to those who will take such designs and scale them up to run motors at 10A or more. In particular, some of the H-Bridge designs which have been posted as solutions to such motor requirements that utilise seperate drives for each quarter of the bridge.
Have you tried the first diagram?
What happens if you power up with the PICAXE removed?
I'm not saying don't. I'm saying understand.
 

Mycroft2152

Senior Member
Aw, Jo C, you really have to stop cribbing from the old BEAM articles :)

Yes the circuit will work, but only under very specific conditions. If these conditions are not met, then POOF &quot;magic smoke&quot;.

The key is the &quot;proper use&quot;, which means some knowledge of what is actually going on and of the parameters of the devices. There is a big difference betwenn what &quot;can be used&quot; and proper design.

Unfortunately, a new comer, will not have that knowledge and will &quot;try&quot; different things. Let's say he decides to manually test the Hbridge without the Picaxe in place.

My &quot;cringe&quot; comment was based on the fact it was a very generic represnetation and &quot;assumed&quot; too many things.

It all depends on your level of experience and the audience that you are speaking to.
 

jodicalhon

New Member
Yeah, sorry guys. Just couldn't resist a little dig! It's true that a little knowledge can be a dangerous thing.

Agreed, the first h-bridge can't have its inputs floating. Acrylic acknowledges this in his second post.

But the emitter follower seems quite robust. I wouldn't be using it in an industrial control situation, though!

As for cribbing from old BEAM articles: as you know Myc, there is an amazing array of tips, tricks, cool circuits and just general electronic knowledge contained within the Y!Groups BEAM files, and in the BEAM pages over at solarbotics.net - (some courtesy of your good self!) - and it's been my mission over the last few years to try to cram as much as I can into my little brain!

And, (he said defensively), I wasn't cribbing! I really did breadboard and test that circuit!

Cheers.
 

Bob Elton

New Member
I've only just read this thread so apologies if I'm duplicating. And I mean this in the nicest and constructive way.

I honestly think I have a case of Chronic Deja Vue. This H-Bridge type question crops up over and over. And people provide helpful and thoughtful replies. Then others (equally correctly) point out caveats and/or errors.

So, why not get together and post one or two working circuits somewhere? One for experts and one for novices with protection indcluded. I appreciate there are ICs for many things but the discrete approach can be educational as well as sometimes a neccessity.

A simple link could then save 20 odd postings over several days and the threader could simply be pointed to a few clear circuit drawings and a clear explanation including some accurate transistor theory.
 

BeanieBots

Moderator
You're quite right BobElton and your comments themselves have come up quite often.
Technical have promised something along those lines will be comming along in the not too distant future.

When posting to a BEAM forum, the audience will be expecting 'fit for purpose' and criticism is likely to be along the lines of &quot;you don't need that catch diode&quot; or &quot;loose the decoupling caps to save space&quot; and that's fine for BEAM.

The bulk of this forum is educational. IMHO there is no problem with posting such designs as long as they do include a full description and caveats. (which was the case in this thread). I think it would be better to explain why certain components are normally fitted and then explain that &quot;FOR THIS APPLICATION ONLY&quot; they can be ommited.
There have however been some posts in the past (no names), which have, quite frankly been down right dangerous and irresponsible. Fortunatley, this forum is very well self regulated so nothing is ever left &quot;unattended&quot; for long.


Edited by - beaniebots on 27/04/2007 13:53:29
 

jodicalhon

New Member
Very well said, BeanieBots. And, yes, I should have included the caveats in my first post.

These threads engender a conversational tone, and you can tend to think you are just speaking to one person, and forget the large number of others, with widely differing skill levels, who are reading your posts.

Thanks, Jo C, first for your earlier link to wilf_nv's h-bridges, and secondly for leaping so valiantly to my defence, however unnecessarily! I understand the emitter follower much better now!

BTW, forget my simple 'phototaxis robot' idea. It's nowhere near directional enough - amongst other shortcomings.
 

Mycroft2152

Senior Member
Jo C, my &quot;cribbing&quot; remark was made in a good spirited way of referencing to the amazing group of circuits, tricks, and techniques avalible in the BEAM robots world.

BEAM meshes well with the PICAXE in a synergistc manner. Both are ideal for the introduction to electronics to the young and old alike - simple and inexpensive. Even teachers can understand and use them ;)

For anyone interested, checkout WWW.Solarbotics.net, the main refereence (non-commercial) site of everything BEAM.


 

jodicalhon

New Member
No worries, Myc!

You're right about the Picaxe/Beam combination being a winner. Beam introduced me to analog electronics, and the Picaxe (and this great forum) is helping me into the microprocessor world, with its myriad possibilities.

Cheers, mate!
 

chipwich

Member
Some follow-up related to my initial question:

I was unable to directly run any of my small pager motors directly from picaxe, even with doubling up the outputs. Using a 2.6v supply (rechargeable 2xAA), Even by subjecting the 08M to a tremendous amount of intentional and unintentional abuse, it doesn't look like I damaged anything permanently. I suspect that this would be different using a higher supply voltage.

I ended up using a TIP122 NPN driver transistor. Not as simple and &quot;beam-like&quot; as I'd hoped for, but not bad, I suppose. An IRF530 didn't work properly, but I didn't have time to investigate whether this was due to the low-voltages, or just an error on my part of some sort.

Thanks much for all the ideas in this thread.
 

BeanieBots

Moderator
Worst case, the IRF530 will not turn on until the gate voltage exceeds 4v, so you probably won't have much luck using one at those voltages.
 
I have managed &quot;slow revs&quot; from pagermotor 7mm Namiki units when driven from +ve and sink into an 08M pin. The 08M will sink more current than source by almost a factor of two.

To beef up the revs I just parallel'd up a few outputs. and this gave enough power to use a motor with eccentric to make a novelty vibrating pen.

This still won't make much of an 'H' bridge but the new 14M with the extra OP pins should make a simple &quot;BEAM-ish&quot; bot possible.

A tip with the smallest pager motors... they might be small but not always the most efficient current wise. The bigger one 7mm Namiki from pagermotors draws less current.
 
Top