United Kingdom
Asked — Edited
Resolved Resolved by Rich!

H-Bridge L298 Question

Morning all,

I've a query about the L298 H-bridge that I hope that someone may be able to point me in the right direction with:)

I've followed the same directions as in the thread here

So in my setup, I've got it wired as follows

H-Bridge:

ENA & ENB - D19 SW1 OFF

IN1 - D15 IN2 - D16 IN3 - D17 IN4 - D18

5V - D19 5V GND - D19 GND VCC - + battery

Omnibot wiring: yellow - out1 orange - out2 brown - out3 red - out4

EZ-B: PWM - D19 LFT TRG A - D15 LFT TRG B - D16 RGHT TRG A - D17 RGHT TRG B - D18

All good apart from the fact that on my keyboard and in ARC, the left and right controls make the Omnibot move forwards and backwards and the up and down make it move left and right.

I can't find a combination of controls or wiring that seems to correct this.

Any pointers as to where I've gone wrong would be gratefully received.

Thanks

Mark


ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

PRO
Canada
#1  

Hi Mark, try swapping D17 and D18 and see if that corrects it.

United Kingdom
#2  

Hi Jeremie,

Thanks for your help - I'll give that a go this evening and see if that works.

Mark

United Kingdom
#3  

Have a read of this tutorial. I covered pretty much everything that can be covered with this controller.

Quote:

Q: Everything is set up but when I move forwards the robot turns and when I turn the robot moves forwards, what have I done wrong? A: Simply put, one of the two motors is running the wrong way, probably due to the mounting position or polarity. To fix this you have two options;

  1. Find out which motor is running in reverse when the robot is asked to move forwards, disconnect the motor and reverse it's polarity (i.e. swap over the wires from the motor output on the H-Bridge).
  2. Find out which motor is running in reverse when the robot is asked to move forwards, swap over the ports in the H-Bridge settings (i.e. if the left motor runs in reverse on a forwards command change the ports D15 and D16 around so Left Trigger A is D16 and Left Trigger B is D15).

So pretty much what Jeremie said:)

United Kingdom
#4  

Brilliant - that's the exactly what I was looking for :)

Thanks for the tips Rich!

United Kingdom
#5  

Did you get this sorted?

If so don't forget to mark the question as answered and give the relevant person the credit they deserve.

If not I'll gladly help guide you through the process of setting up the triggers to move the robot correctly.

United Kingdom
#6  

Hi Rich,

Yes pretty much there now thanks - forwards and backwards are reversed now but left and right work correctly. I'll have another tweak later but I reckon I can sort it with your help from the tutorial.