Asked — Edited

Connecting Laptop Battery To Ez-B And Rover 5 Chasis, And Using Dagu Motor Contr

I started by buying the smaller sized H-Bridge from the website, found out that to run them i needed 2 H-Bridges. As for i didn't have the time to wait for another H-Bridge so i hooked up the Rover-5 by connecting the 2 motors from each side together on one power output on the H-Bridge. But having only 5 volts split between 2 motors wasn't nearly as fast as it could be and the battery drained way to fast. (5 volts on its own is way to slow)

My plans now is to implement the Dagu controller instead, and use a laptop battery to power up the system. I am not sure which battery to use and how to charge it though, without over powering anything, and b/c everything is being boxed in to my robot (since what i am doing is building a robot that can travel though H2S safely, but b/c H2S can blow up from a spark, etc, everything needs to be air tight)

I think i have a basic idea what i need to do with the PWM and Dir (direction) but i am curious about the Currents (not sure about what port to use, AC port? and do i need 1 or 4 current wires). Also if you know of a way to power up the Rover 5 (10-12 volts) and EZ-B/Dagu (5 volts) using a laptop battery, specific instructions will be amazing. I would also like to know if i can get a 9/6 pin cable on each end that can plug into the battery, and be used as an extension cable for wiring to devices, and/or getting a 9 pin plugin (like the one that is on the battery that i can put on the outside of the robot for plugin into and charging, having wiring run to the battery for extended length from each plug)

User-inserted image

and using one of these 2 laptop batteries to power the device. And using an external charger for the battery:

Apple Battery External Charger

Dell Battery External Charger

User-inserted image

I do believe that pins 1,2,4 are negative/ground (-) and 8,9 are positive (+) but still confused how i can do this all. If you can help i will greatly appreciate it. (apple has 6 pin, dell has 9 pin, not sure about apple yet) another forum seeing simular problems with motor controller


ARC Pro

Upgrade to ARC Pro

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.

#9  

Actually I have figured this one out on my own now that i have posted. My plan is to refer to the PWM instead of the arrows, using if statements to numbers of the PWM. This is a left turn with q down (although i want an Else statement here but is there a "pass" in the EZ-B language, b/c if the PWM = 0 i want it to do nothing?

$Wheel1PWM = GetPWM(D1)
$Wheel2PWM = GetPWM(D3)
$Wheel3PWM = GetPWM(D5)
$Wheel4PWM = GetPWM(D7)

If(Wheel1PWM == 100 and Wheel2PWM == 100 and Wheel3PWM == 100 and Wheel4PWM == 100)
PWM(D1,50)
PWM(D3,50)
EndIf

For a left turn just change the last two from D1 and D3 to D5 and D7, then this is what to put on the up command:

$Wheel1PWM = GetPWM(D1)
$Wheel2PWM = GetPWM(D3)
$Wheel3PWM = GetPWM(D5)
$Wheel4PWM = GetPWM(D7)

If(Wheel3PWM == 100 and Wheel4PWM == 100)
PWM(D1,100)
PWM(D3,100)

ElseIf(Wheel3PWM == 0 and Wheel4PWM == 0)
PWM(D1,0)
PWM(D3,0)
EndIf

then for right turn just switch the port numbers for PWM and in the if statements change to Wheel1PWM and Wheel2PWM. Does this look right to you, and how do I specify an If statement to do nothing ("pass" in most syntax) see more on the next page

#10  

although if there is no pass I just came up with a way to fill up the gap, printing "Must be driving to use"

ElseIf(Wheel1PWM ==0 or Wheel2PWM == 0 or Wheel3PWM == 0 or Wheel4PWM == 0)
Print("Must be driving" )
Print("Forward to use" )
EndIf

But does everything look like this will work properly?

#11  

I am getting an error with the if statement, i guess i can't say If(Wheel1PWM == 100) or any number is there any way of fixing this, i am pretty sure PWM is what i need to be using for the if statement but how do i specify this b/c it should be inbetween 0-100, alike the ADC? Please help.

#12  

I managed to get this error fixed, ends up all the variables have to carry the $ throughout the code before the variable Ex:

ElseIf($Wheel1PWM == 100) 

when i you first explained this to me I thought it was just to specify the variable, didn't think it had to be used in all the code

United Kingdom
#13  

You're getting there:)

Yeah all variables everywhere need the $ prefix.

Also, for If statements as a rule of thumb, I use ($Wheel1PWM = 100) rather than ($Wheel1PWM == 100)

I found the best way to learn is to just play, it'll tell you if it's wrong:)

#14  

Yah i have been playing around a lot, adding more features as i go, the = sine i am so used to object oriented programming that == gets naturally used. As for EZ-B scripting is very simple, much similar to excel coding where it has a list of all terms and what to put inside, etc. Then you just use what it tells you and implement it into your design.

The one problem i am noticing with the code is that I haven't specified direction into the code, meaning when you let go of "q" or "e" it wont go back to normal if you were in reverse, etc. Can you get the direction ex:

$Wheel1Dir = GetPWM (D0) #or GetDir
#Wheel1PWM = GetPWM(D1)

If($Wheel1Dir = off and $Wheel1PWM = 100)
#execute all commands, etc
ElseIf($Wheel1Dir = on and $Wheel1PWM = 100)
#execute differrant command
EndIf

Also I am wonder about the quadrature encoders, I know they are very hard to hook up, has to be done with Arduino. My idea that I have came up with that I would like to know if it can be done is:

Can you hook up the EZ-B to the Arduino Board using the I2C, and then use the Arduino to connect to the Dagu Motor Controller's quadrature encoders. This may be a little complex and I really don't need to use the quadrature encoders much but I am curious if this is do-able.