H-bridge motor controllers and encoders is all aramaic to me :)

rigidigital

Senior Member
You can call me rigidigital or Whiteoxe, I have no idea why I called myself whiteoxe :)

I am struggling to find out how to use a H-bridge motor controller and an encoder. The idea is to drive two contiuos servo motors on a home made chassis. Ill have the wheels and chassis done in nless than two weeks. Then im gonna be back to motorcontrollers and encoders. I really dont know if the micro controller is going to be sending signals to the H-bridge or encoder or some other majic.

This is the latest on the subject i have found http://itp.nyu.edu/physcomp/Labs/DCMotorControl

Its not serovo motors but im gonna build it anyway. The H-bridge there dosent look anything like the H-bridges ive been looking at all over the place. Id you bother to follow the link, the H-bridge looks like a little IC but its is apparently a H-bridge motor controller. it looks like the encoders Im about to buy from sparkfun ?

and im posting this elsewhere in the hope of some quick replies ;)
 

Marcwolf

Senior Member
Yes.. The L2963 IS 2 x H-Bridge. Rather than having seperate MOSFETs they have encapsulated them into a single chip. You can drive 2 motors or on stepping motor with it.
 

rigidigital

Senior Member
Cheers for that Marcwolf, i needed to know that, it was never spelled out for me on the website, good i can order one. Would you mind having a crack at trying to explain to me how a microcontroller works with the H-bridge and what role does the encoder play in it all. Even PM if you prefer :)

or not :(
 

rossko57

Senior Member
You need to buy H-bridge(s) package to suit the demands of your mystery motors. Adequate voltage and current rating. What powerr supply you have available for motors and electronics may come into that as well.

How H-bridge works
http://en.wikipedia.org/wiki/H_bridge

So a microcontroller needs to have control of those lines to the H-bridge. By outputting a combination of highs and lows, the motor(s) can be run forwards and backwards.
It is possible for the microcontroller to switch those on and off rapidly, to give the illusion of reduced motor power, and so speed control. This is called "PWM"

The encoder(s) don't come into that at all. It's up to you to write a microcontroller program that "listens" to the encoders and uses the info to influence what it is commanding the H-bridge to do. Probably in combination with some manual or automatic control as well.

EDIT - umm, you said SERVO motor - do mean model aircraft style servo? You do not need H-bridge for those, they contain their own motor drrive electronics internally. The command technique is very different too, You need to clarify this.
 

Circuit

Senior Member
The use of the L293D is dealt with very clearly in PICAXE manual 3 on page 18. This includes schematics and sample code.

If you are ordering this chip and have little prior understanding of its use then I would suggest that you order the L293D rather than the L293NE show in the link that your provide. The L293D chip has in-built diode protection on its outputs. The choice of H-Bridge motor controller depends, of course, on the current that your motors will draw; the L293D will allow 1 amp continuous. If you need to go up to a higher current then you will need the L298 which is comfortable with 2 amps.
 

Ravenous

Member
The idea is to drive two contiuos servo motors on a home made chassis.
These don't need a H-bridge. They need a series of pulses to set the speed, as I understand it. And certainly no encoders would be involved unless you fit and handle them separately.
 

Goeytex

Senior Member
Ravenous makes a good point.

A continuous servo motor can easily be driven without any kind of driver.

The servo motor connects as any other servo. The servopos command tells the motor to drive forward or reverse depending upon the servospos value. The speed is a function of how far from "150" the servopos value is in either direction. A value 0f ~150 is stopped. A value of ~70 is full speed one direction and a value of ~230 is full speed the other direction.
 
Last edited:

premelec

Senior Member
@ Marcwolf You said "Yes.. The L2963 IS 2 x H-Bridge. Rather than having seperate MOSFETs they have encapsulated them into a single chip." - I've been looking for a MOSFET H or half H driver with power MOSFETs - is there a variety of L293 that is made with MOSFETs? Seems like there should be... :)
 

rigidigital

Senior Member
You need to buy H-bridge(s) package to suit the demands of your mystery motors. Adequate voltage and current rating. What powerr supply you have available for motors and electronics may come into that as well.

How H-bridge works
http://en.wikipedia.org/wiki/H_bridge

So a microcontroller needs to have control of those lines to the H-bridge. By outputting a combination of highs and lows, the motor(s) can be run forwards and backwards.
It is possible for the microcontroller to switch those on and off rapidly, to give the illusion of reduced motor power, and so speed control. This is called "PWM"

The encoder(s) don't come into that at all. It's up to you to write a microcontroller program that "listens" to the encoders and uses the info to influence what it is commanding the H-bridge to do. Probably in combination with some manual or automatic control as well.

EDIT - umm, you said SERVO motor - do mean model aircraft style servo? You do not need H-bridge for those, they contain their own motor drrive electronics internally. The command technique is very different too, You need to clarify this.
Yep Rossko, its for servos similar to what a remote plane uses except they are continuous rotational. Thats why I thought they might need an encoder because of that little difference in the way they work. And thankyou for the H-Bridge Wiki link, its just 6:35 am, so i need a coffee before i start reading it. :)
 

Circuit

Senior Member
@ Marcwolf You said "Yes.. The L2963 IS 2 x H-Bridge. Rather than having seperate MOSFETs they have encapsulated them into a single chip." - I've been looking for a MOSFET H or half H driver with power MOSFETs - is there a variety of L293 that is made with MOSFETs? Seems like there should be... :)
If you go to surface-mount components then quite a few MOSFET toys are in the toy-box. When it comes to through-hole DIP type which, I guess, most of use generally, the choice is more limited. But have a look at the L6204 from ST and the LV8773 from ON Semiconductors. Both use MOSFETs. The latter is a little more sophisticated and presents in a 28 pin package. It is rated at 2 amps/36 volts max with an on-resistance of 0.25ohms.
 

rigidigital

Senior Member
I thinkmmy two projects probly wont require a mosfet, I looked it up in wiki but was still at the least unsure of its function. Do you know of an experiment or even a kit i could buty that would help me learn about these ?
 

premelec

Senior Member
@ Circuit - thanks - I knew there must be some!

@rigidigital - you can think of the H bridge as 4 switches which can be on or off. If you draw two pairs of two series switches from V+ to V- - you can immediately note that if two of the series switches in series on one side are turned on you have a shorted power supply - smoke, fuses blown etc. The motor control comes from turning on one upper and one lower on opposite sides - for forward or reverse depending on which you turn on. Braking of the motor can be accomplished by turning on both upper OR both lower switches [by shorting the motor which is self generating voltage].

MOSFETs and bipolar transistors are both switches in this application - they have some different characteristics as to how you turn them on and off. There may be kits - I recall Bob Blick had a how to build an H bridge with discrete components note on his site which may still exist.

Found it: http://www.bobblick.com/techref/projects/hbridge/hbridge.html
 

rigidigital

Senior Member
premelec;263685 Found it: [url said:
http://www.bobblick.com/techref/projects/hbridge/hbridge.html[/url]
Thanks premelec, what i find a little umm..different it the number of components on that and other H-Bridge controllers. Because you can buy H-Bridge motor controllers from places like but not limited to Sparkfun, that look like little IC parts, little things witha nuber of legs like most chips.

If I'm only powering a little 5 volt (pair) of DC motors the little bitty H-Bridge would likly do the job ,Yes ?
 

rossko57

Senior Member
I think you need to make a design decision:

If you use contnuous-rotation servos, you don't need to use or know anything about H-bridges. It's all done internally. You would need to find out about commanding servos (easy with Picaxe)

If you use regular motors, then H-bridge is the way to go. (As electric motors come in sizes from solar toys to ships, so do H-bridges. Which you want depends on the mystery motors.)
 

rigidigital

Senior Member
I'll give it a go for the sake of experimentation if not nessessity rossko !!! Might have to prend I'm wolverine. I have to find out the amps/volts my motors will use and thensrtart soldering Transistors, resisrtors and maybe a capacitor or two. If the two motors are 4.5 volts then it won't be a very big unit(s). But I'll try hard first to find an IC H-bridge with the right amp and volt ratings and i think lots of those will be able to drive two motors but then it still might be better to have one for each microcontroller and use a cog for each one ?

What percentage of an amp would you say (off the top of your head) would a 5 volt DC motor from a toy car use ? ...I hope thats not 'how long is a piece of string ' question ?

But i am thinking of the servo option unless the DC motor option can be done heaps cheaper and i learn. But ill learn whichever way it goes so price will be the real considerastion. I appologise for my spelling. Id be here forever if i corrected everything.
 

rigidigital

Senior Member
I think you need to make a design decision:

If you use contnuous-rotation servos, you don't need to use or know anything about H-bridges. It's all done internally. You would need to find out about commanding servos (easy with Picaxe)

If you use regular motors, then H-bridge is the way to go. (As electric motors come in sizes from solar toys to ships, so do H-bridges. Which you want depends on the mystery motors.)
Rossko57, its not the little IC I thought would be usable but this unit looks like it can power a couple of pretty good motors. Its rated to 2Amps. ? http://www.ebay.com/bhp/l298-motor-driver
 

rossko57

Senior Member
I hope thats not 'how long is a piece of string ' question ?
I'm rather afraid it is.
Things seem pretty unsettled so far - tracks, wheels? Neither is really suitable for direct drive by motor, you'd normally use gearboxes.
It might be worth studying commercial chassis of the type and scale you have in mind to see the kind of motors they use, and how they use them. There's really no point tearing off and soldering control gear before you have any idea what you want it to control.
 

rigidigital

Senior Member
yes I am all over the 'shops' trying to make a quick decision. I'll consider myself well advised and slow up and study and move in a somewhat more measured/considered direction. Ive been at this for well over 12 hours and also been reading up on transistors, sensors, Motors DC and servo continuous. But its all been good. Thanks for your input again!


Ps.
I realise gears make it possible to move heavy load's but is you main reasoning the high rpm the DC motors produce ?
 
Top