
Xuven
USA
Asked
— Edited

This is bugging the hell out of me...I have a L298N H bridge setup and for the life of me cant seem to figure out why Megabyte turns to the right . Instead of reversing straight back! Ive tried swapping all the combos for movement in EZ builder. Forward, left and right work. But reverse he seems to pull to one side. Im sure its something obvious,...but im stumped!
Hey , i have had the same problem before. You can either reverse polarity on the motors connections or swap the enable pin connections. One of them is backwards. I tried 4 times before i had it all moving in the correct direction lol ,
You can swap around the connections in the Movement Panel all you want but if one side is wired backwards it will turn instead of reversing straight back.
Sorry, nothing to add... just misread your post... As Josh said, trying swapping wires....
Check out my H-Bridge tutorial, it should explain why it is doing what it's doing and tell you how to fix the problem.
Flipped the wires and still nothing baffled. I pinned it out using Richs guide and it worked before o started cleaning up wires
Do you have the enable (EnA and EnB) supplied with +5V or a PWM? One signal to each of the Ins (In1, In2, In3, In4)? +5V to the +5V? Or the switch pressed for on board regulation (if your board has that option)? Voltage for the motors also plus a common ground?
If so it should work provided the Enables are high and the In1 to In4 have the correct High/Low to make the motor move.
Pay careful attention to the labels on the L298N board, there are a number of variations, yours looks different to mine.
EnA and EbB are wired togther with a y cable . They run to D0 for PWM. IN1,IN2,IN3,IN4 run to D16,D17,D18,D19.
Make sure you have PWM or a digital On set for D0 (otherwise it wont work).
Then, provided D16-D19 are on In1-In4 in the same order it should just be a case of setting the H-Bridge control to D16 down to D19 in order. One motor (or both) may run the wrong way due to polarity of the motors, if that's the case swap D16 with D17 in the control and/or D18 with D19.
Provided you have D0 giving EnA and EnB +5V or a PWM the control should at least do something.
If it doesn't work test all wires from EZ-B to H-Bridge for continuity, make sure there isn't a break in one of them.
If it still doesn't work take some jumper wires and carefully connect up from the Vcc (i.e. +5V - I assume this is a V3 you are using, don't do this with a V4) like so;
Vcc to EnA Vcc to In1 Ground to In2 Does motor 1 spin?
Then Vcc to EnB Vcc to In3 Ground to In4 Does motor 2 spin?
That should check if the H-Bridge and motors are working. If nothing happens then there is an issue with the H-Bridge or the motor. If that is the case, eliminate the motor from being the problem and just provide it with a Vcc and Ground to check it spins. If it does then the H-Bridge has an issue. If it doesn't then the motor is toast.
@ Rich this is the board im using. Will it make any difference when trying to trouble shoot? The motors turn and i can see the lights on the bridge come up. But i still cant get it to reverse. If i do get it to reverse it wont move forward. Tried swapping jumpers and there good