Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
United Kingdom
Asked — Edited

Using Two 2.5 Amp L298 Motor Controllers With One Ez-B.

Hi everyone.

I posted a question in regards to reducing the speed of my two 12v motors on the forum last week and I have been pointed in the direction of using motor controllers, and after a response I got from Rich, I found out that it is possible to use two controllers through one EZ-B, so I have ordered two 2.5 amp motor controllers from EZ Robots.

The reason why I need to use two is because the drivetrain for my robot build runs off a 12v battery and has two 12v drive motors that draw about 0.50 amps while running, but can hit about 1.4 amps peak for a split second, so using both channels on the 2.5 amp motor controller with a max peak limit of 3 amps per channel, that takes care of the drive motors.

The drive train also has one 12v steering motor that runs at 0.24 amps with a peak of about 1.3 to 1.4 amps, so apart from needing a third channel I wanted to leave a safety margin, that's why I will require a second motor controller (only using one channel) connected to the EZ-B v4, which I wasn't sure could be done. But as I mentioned above, Rich told me that although it is not done often, it can be done but the second controller would require scripting. So what I would like to ask is...

1.) Has anybody else done this with a similar set up to my example?

2.) Are there any examples of this in action? e.g, controlled via on screen sliders ect.

3.) I'm assuming that I will have to run 2 pairs of power leads from my 12v battery and connect to each L298. Is this correct?

4.) How would to L298's be wired up to a single EZ-B with speed control? I know Rich has a tutorial but I would also like to hear from other members who have done this.

5.) And finally, and this is the main point I am unclear of, one L298 can be controlled through the EZ-B via on screen sliders, smartphone or Wii remote accelerometer movement, voice control ect ect. But I have read that the EZ software will only have these controls for one L298, so how will I be able to control the second L298 for the steering, say for example if I wanted to use it in a "radio controlled" scenario, with both the drive motor control slider and the steering motor slider on one computer/touch screen?

I am waiting for my first batch of EZ goodies to arrive sometime this month, so I am new to all this and only going by what I have read and seen online so far, so any help and/or advice any of you kind people can offer would be gratefully received. There is not that much mentioned about using 2 controllers with one EZ-B on the forum so hopefully any answers or advice given will go towards helping others too. Rich has already offered me help in regards to scripting a second controller which I surly will take him up on, but it this "how will my finished robot physically be controlled Via an iPhone of tablet PC once its scripted" thing I'm scratching my head over.

Thanks everyone.

Steve ;)


Upgrade to ARC Pro

Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.

AI Support Bot
Related Content
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
United Kingdom
Thanks for the reply jdebay. I've looked through Rich's tutorial and DJ's video and I'm almost there. I just need to get the power wiring sorted as I mentioned in post #13, and a little confused to "common ground".

(-- EDIT --)

Forget post #13. I've just realise that my questions had already been answered in this thread. Sorry about that. Crazy week.

One thing. Could someone confirm for me, where do I wire up the common ground between the EZ-B4 and L298. Is it...

from L298 "ground" to the barrel jack "ground" that plugs in to the V4,

or L298 "ground" to any "ground" pin on the digital ports?
United Kingdom
User-inserted image


I need to take you up on your offer for a little help if something didn't make sense. (Or to anyone else who can help. Okay. So I'm in the process of wiring up my two L298's but I've hit a snag. I have been following Your advice and tutorial, but the L298's I have are a little different to what your and other pictures I have seen in other threads. As oppose to 6 pins I have seen, I only have 4.

Which is the correct way to connect the L298 to the EZB4 for left/right motors, and to have combined speed for both motors, not independent?

Thanks. *confused*
United Kingdom
Don't worry about the last post. I worked it out. I do have another question however. I have got the 2 H-bridges working together, but the issue I have is with steering. I have used an expletive script so I have got the steering to turn left and right. How do I get the steering to center? I just can't figure it out.

United Kingdom
You have 8 pins, 4 are covered by jumpers (EnA and EnB to +5v). Remove the jumpers and connect a PWM to EnA and another to EnB if required or leave the jumpers on if you don't need speed control.

As for steering, how is the steering done?
United Kingdom
The steering in using one channel from one of the H-bridges. If I use the Hbridge PWM movement control, the 2 sliders move the steering on one H-bridge, while the arrows control the 2 drive motors on the second H-bridge.

Then I went to try the 2 H-bridge example and forward, back, left, right all work. But when steering goes left it goes fully left, and same for right, but can't find a way to center the steering.

I just had a bit of a scare when writing the last post. When the steering was fully locked right, there was no noise so I assumed that it had stopped turning. Then all of a sudden thee was an electrical scream and smoke. I killed the power and the steering H-bridge was REALLY hot. It cooled down and it is all still working. Phew. *eyeroll*
Is that your bot on the pervious page? Two drive wheels and a single front steering wheel? If so, a servo would have been a better choice for steering due to it's 180 deg positioning ability....

Or you could remove the motor and H-bridge from the front steering mechanism and just use the front wheel as a castor (swivel back and forth freely). Then use tank type differential steering for the drive wheels...
United Kingdom
It sounds like a little bit of being unaware of what a H-Bridge does and what are the best ways to do everything.

I agree with @Richard, a servo would be the better option for the front wheel. A servo will have position feedback where a H-Bridge (without extra parts) doesn't.

The H-Bridge would have been telling that motor to turn in one direction, no mention of how long for and no feedback to tell it to stop therefore it would, or could, have been spinning it clockwise or anti-clockwise (counter clockwise for the Americans) until told otherwise.

Changing it to a servo would mean you can have position 90 as centre and forwards. Position 30, 45, somewhere around there (trial and error to find what works best) for turning one direction, 125, 140, again trial and error, for the other direction.

Or, and this is dependent on the servo used and experimental... Strip the guts out of a servo, use the servo board to power the turning motor. Use the feedback pot to let the servo board know the position of the wheel... basically rebuilding the servo outside of it's casing. I did similar in Melvin's eyes (however have no photos of that unfortunately).

But personally I would change it for a normal servo. One port, comes with position feedback too, no messing around. Just would require a simple script for the movement panel
United Kingdom
Hi Richard. Yes that is the chassis of my bot. The reason it has a motor for the steering is because the bot has a secondary R/C system when I can't use WiFi. I agree with you about the servo idea but when the bot is finished it will weigh a heck of a lot, too much for a servo to steer.

The other point you make about diff steering again is a valid one, but due to the design of my bot (based on Doctor Who's K-9) and available space I have in my humble abode, I wanted more of a "point and shoot" design to limit any head or tail over swing. (hope that made sense).

I know there is a way to limit the turning circle but I havnt figured it out yet.
United Kingdom
Throw in limit switches and feedback pots if that's the case.

Dave had some on his B9, I think the details are in his B9 showcase post but if not just search for limit switches and feedback pots and they should pop up.
United Kingdom
Thanks for the advice Rich and to Richard too.

Ive bit the bullet and spent the last couple of hours doing a bit of redesigning on the chassis making it in to a front wheeled, differential steering drivetrain and now only using one L298 and a coaster wheel Richard mentioned. Not the way I wanted to go, but on the plus side it has given me a little more room to work with losing the steering section and relocating the drive battery.

In regards to the H-bridge, it was more of I was misinformed rather than I misunderstood. I am aware what a H-bridge does and what it's function is, its just that it was hinted to me that I could do what I wanted to with 2 H-bridges with ARC but that's obviously not the case, although I don't see why not. Motors through H-bridge, H-bridge to EZ-B, and say to EZ-B with an editable slider control or peace of script "This is center. I only want you to turn this far," or "40 degrees left and right from center maximum" just like a servo does. The EZ-B seems to have the ability to do so, so perhaps it could be something for a future update.

Anyway, I read what you said Rich, about the jumpers on the L298. I didn't realise they were removable jumpers as I haven't seen it mentioned anyware, and thought it was a board redesign I was unaware of *blush* . So hooking up 2 more wires to the EnA & EnB to 2 more signal pins on the EZ-B will give me vairable speed control? Quick question, what ARC control do I use for this? I don't think I've come across it yet. Only arrow controls with one speed.

There is no way to update ARC or the ezb4 in order to read position of an H-bridge controlled motor... It's the motor's and controller's job to relay this position back to ARC. With an H-bridge and a dc motor this is impossible because there is nothing to measure position with... The motor has no idea where it is rotation wise... A servo measures it's position with it's built in potentiometer... You might be able to do it using a Sabertooth motor controller and a Kangaroo board, however...
United Kingdom
Interesting. The reson I said I thought it might be possible is if you could set it up manually. Eg, you center the wheel or wheels (steering) manually to start, then with a slide controller with ARC for example and, with some trial and error, drag it to the maximum turning lock and set it as full lock, or have the wheels turn for a set amount of time (so many milliseconds) and set this, then save this as a project control (only useful for that specific project due to the motor size/power ect).

But I stand corrected and get exactly what you mean about why it's not possible. Just a thought.

:P Richard, I've got to ask, don't you ever go to sleep? I know we are in different time zones, but you always seem to reply to posts at all hours day and night lol. :D
United Kingdom
Time based would be the only method without the use of encoders, a feedback pot or limit switches however it is incredibly inaccurate.
Ha, ha I do sleep.... More than 8 hours a night actually... Rich is the night owl... If you can find a way to use a strong servo (quarter scale are seriously strong) in the steering mechanism (I am sure they can handle the heavy loads you require).... This would solve your problem....
United Kingdom

Ahh, you do sleep then. I thought you was like "using the force" or something. :P

Anyway, in regards to using a servo yourself and Rich suggested, I slept on the idea and figured if, using the single wheel for steering, I build a steering frame with the wheel, attach a lazy Susan bearing which I have, fix it to the chassis and have a HD servo turn the lower part of the bearing with the wheel. The bearing should take a lot of the overall weight and still be able to turn quite easily. Sound feasible?

After a trial with the differential steering there was just too much over swing and would have ended up causing damage to the bots body.


I thought the timing idea might work. Like I said, it was just an idea that I thought might work with a little coding of script. Something to maybe experiment on one day. ;)
United Kingdom
Ok. So I have gone with the HD servo I got from the shop and initial testing seem okay. 1 thing though, when the servo holds position either left or right, it makes quite an annoying buzzing sound. Is that normal? Although it doesn't make the noise when the servo isn't fixed to anything.
A little buzzing is normal... Just check to see when the servo is left or right it's not binding on anything (pushing against the stops or end of travel)... If it is adjust the servo position until the buzzing goes away or is at least reduced.. Centre position it should not buzz too much...
United Kingdom
No Richard, deffo not being obstructed by anything and I have reduced the end of travel for left and right on a control. It seems the closer it gets to end if travel, the louder it gets. Not excessively loud, but louder than I was expecting. Center position no noise at all.

The new steering set up with the servo and lazy suzan bearing seems to be working great now, even with the weight of the bots chassis and body fitted, So thanks for the advice. Really appreciated. ;)

That's normal... Glad it's all working for you... One tip (since you're going to add more weight to the bot)... make sure you distribute the weight as evenly as possible... You don't want the majority of weight over the servo... 40/60 front to back might be a good ratio....
United Kingdom
Thanks for the tip buddy. I replanned the equipment layout thIs afternoon so It's been taken care of. ;) . I've lost all the R/C gear which was all located at the front, and have no need for it now, and the main drive battery will be located over the rear drive wheels. When the head is attached to the body this should give me roughly the 40/60 weight ratio you mentioned.