Asked — Edited

Ez-B And Hbridge Are Fighting Me

Hey.

Following rich's hbridge tutorial, which is the following wiring:

Quote:

Vcc = Motor Supply Positive Gnd = Motor Supply Ground (ensure this is common if using more than one supply) +5V = Not Connected

In1 = Digital Port Signal (i.e. D8) In2 = Digital Port Signal (i.e. D9) In3 = Digital Port Signal (i.e. D10) In4 = Digital Port Signal (i.e. D11) EnA = Digital Port Signal (i.e. D12)* EnB = Digital Port Signal (i.e. D13)*

I wired up my ez-b(V4) and now have triple checked my wiring so I do in fact have this exact wiring. Proof that my ARC control is correct:

User-inserted image

Now, when I press any button on my control, the hbridge does nothing. No lights(except the one indicating 5V), no motor movement, no nothing. When I mess up the control ports, I can get something to move.

With the current wiring, D10 when PWM'd will move the left track forward. D11 PWM'd causes the left track to go backwards. No other ports cause an action.

Any help is appreciated.


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

PRO
Canada
#17  

@technopro do keep in mind that the polarity in which you have the motors hooked up does matter as well, if things seem to be backward on one motor try swapping the motor wires around (change polarity on that motor).

#18  

Well! Testing my hbridge without pwm using the hbridge (non pwn) control(going forward), my left motor went forward and my right motor went backward.

Left- both went forward

right- both went backward

reverse-left backward, right forward

So something pwm wise is weird.

#19  

To make the motors move properly, I used the following setup.

User-inserted image

Wiring didn't change from photos, other than the jumpers are on the hbridge and pwm wires disconnected.

#20  

@Tech... from your post #19, try reversing the wires on the right motor...

United Kingdom
#21  

Read my tutorial on the L298n, it explains what to do if forward/reverse turn left/right and left/right move forward/reverse.

To make it simple, reverse the polarity of one of the motors (whichever one you said moves in reverse when you hit forward) or swap over the Trigger A and Trigger B of that side in the control.

It has nothing at all to do with PWM.

#22  

Maybe you missed my last post. I can make it work by switching the trigger ports as mentioned in my last post, but I'm not using pwm. Once I charge my battery, I'll try to get pwm working.

United Kingdom
#23  

The "right" way to do it would be to connect the motor that spins the wrong way around the correct way, i.e. reverse the polarity of it. However, either way will work and there is no difference really (unless you're like me and need everything to be 100% exactly correct, call it an OCD/perfectionist trait).

As for the speed control/PWM, now you have the actual control sorted out the speed control should be a piece of cake. 2 ports, 2 PWMs, you can't go far wrong:)