
sereandrei
Romania
Asked
— Edited
Hy all,
I am Andrew from Romania , i have a ez-robot platform and a Zumo Robot from Polulu. The Zumo robot came with a H-bridge - DRV8835.
I dont know how to set it up. I know how to connect the motors, but i dont know how to set it up in ez-builder. Excuse my english.
h-bridge from Polulu
So, since I have the time to play now, let's give it a go
Nice and easy, it looks like it will work the same as the TB6612FNG Motor Controller
Assuming D15, D16, D17 and D18 can be used.
Signal from D15 to BIN2
Signal from D16 to BIN1
Signal from D17 to AIN2
Signal from D18 to AIN1
Ground from D15 to GND
VCC from D15 to VCC
Battery +ve to VIN
Battery GND to GND
Motor 1 +ve to AOUT1
Motor 1 -ve to AOUT2
Motor 2 +ve to BOUT1
Motor2 -ve to BOUT2
VMM left disconnected
Mode left disconnected
In ARC add a 4-wire H-Bridge
Set the 4 ports to D15, D16, D17 and D18 - you will have to play around with which is which. I assume D18 first down to D15. You can Merge this file I've already set up, just merge the 4 wire h-bridge control panel.
Please post back any feedback you have so I know if it worked or not.
Mode wants to be low, so grounded or disconnected.
VIN is mentioned, 2-11 V motor power supply connection. Operation at low VIN voltages slightly reduces the maximum current output.
VMM is a power supply to other components with reverse voltage protection. It's not needed in this case.
I have edited my post to suit
Actually I've started to doubt myself on this one... Will have another look over it in a second.
VMM has nothing connected.
The datasheet states;
Which is why I said it is an output.
The motor gets it's power through VIN
The logic gets it's power through VCC
This truth table shows how to supply the board with the GPIO/Digital highs and lows for operation.
So basically, if set up as my earlier post, with D15 & D16 both high it will brake on motor b. If D15 is high it will move motor B forwards and if D16 is high it will move in reverse.
Thanks for all the reply , i was amaze when i saw all the activity on this thread!
First of all thanks Rich, now i can move the zumo robot with my ez-b. I have connected the ez-b to the zumo as following:
D15 -> BIN2
D16 -> BIN1
D17 -> AIN2
D18 -> AIN1
Ground from D15 to GND
VCC from D15 to VCC
Now in the ARC i have chose a 4 wire HBridge Movement Panel and make the following settings :
Left Trigger A -> D17
Left Trigger B -> D16
Right Trigger A -> D18
Right Trigger B -> D15
Now i have forward , left and right , but no reverse , i still need to play with the pin arrangement.
Thanks all for the fast reply !
This is the robot
The motors on the zumo robot are 1:100 , they have speed but don`t have power. It is just fast
I will try to find out how to revers the little guy!
Thanks again all for all the help !
When turning left & right does one wheel reverse and one go forward or does one only go forward? Reverse may need PWM on AIN1 and BIN1 or something...
P.S. That's one quick little dude
I saw the options on the H-bridge for the PWM signal but don`t know how to set it up in the EZ-B?
Thanks all!
The best thing is to start a new project file for this, you can always merge it with your main project once you have sorted out the code needed.
Assuming you kept the set up of
D15 -> BIN2
D16 -> BIN1
D17 -> AIN2
D18 -> AIN1
In a blank project add the Custom Movement Panel (Control - Scripting)
For Forward use the code
Code:
For Reverse
Code:
For Stop
Code:
Try that first, if it works for reverse then I'll do left & right so they spin one side one way and the other side the other. If you are happy with how it is then you can use
Left
Code:
and Right
Code:
Left & right might need adjusting depending on connections.
Let me know what happens.
For forward of one motor you should have
In1 High
In2 Low
For reverse it should be
In1 Low
In2 High
Which is how the H-Bridge Movement Panel works as far as I'm aware...
If the above doesn't work for reverse, try
Code:
Otherwise, you could add 2 Digital (Set Digital) controls, one for AIN1 and one for AIN2, see what happens with both off, one on one off, the other on the other off, and both on.
On the custom Movement Panel i am not able to set multiple parameters like you said.
For example for FW: i can only set one pin D17, on.
How can i set multiple comands on one comand?
Thanks !
Download the latest version (today's version) and it should have the pencil... although I know it is in the previous version too.
If not, then add a script, throw in the commands as mentioned and in the command box for the Movement Panel use ControlCommand("Script", ScriptStart) where "script" is replaced for the script name.
I have the following settings:
On a custom Movement Panel :
For stop :
Set(D18, Off)
Set(D16, Off)
Set(D17, Off)
Set(D15, Off)
PWM(D16,0)
PWM(D18,0)
PWM(D15,0)
PWM(D17,0)
For Fw:
Set(D18, On)
Set(D16, Off)
Set(D17, On)
Set(D15, Off)
For right :
Set(D15, On)
PWM(D16,-50)
Set(D17, On)
PWM(D18,50)
For left:
PWM(D15, -50)
Set(D16, on)
PWM(D17, 50)
Set(D18 , on)
For reverse:
Set(D15, On)
PWM(D16,90)
Set(D17, On)
PWM(D18,90)
Thanks again Rich ! you are the man !
Now is time to add some sensors !
Thanks all!