Problem BeagleBoneBlack + MotorBridgeCape

Moderators: lily.li, violet, salmanfarisvp, seth.welday

Post Reply
scapucciati.lea
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Tue Jun 12, 2018 12:43 am

Problem BeagleBoneBlack + MotorBridgeCape

Post by scapucciati.lea » Tue Jun 12, 2018 12:45 am

Hi,
We are 4 students working in biomedical and mechanical engineering.
We are trying to control 6 servos to control a robotic arm. We are using the BeagleBoneBlack and the motor bridge cape. But we have a big problem. When we supply external voltage to the cape, the BeagleBoneBlack stop instantaneously and we can't communicate with the BB anymore.
Do you know what can be the problem ? :?:
Thanks,
Cheers! :D
Léa

hong.jiang
Staff
Staff
Posts: 200
Joined: Tue Apr 17, 2018 11:03 am

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by hong.jiang » Thu Jun 14, 2018 2:02 pm

Dear costumer:

I have got your problem. The MoterBridgeCape v1.0 's working voltage is between 6 and 15V. Please check if your supply is in this voltage range. And when your system is working ,please don't adjust the supply voltage randomly because it will affect the system stability.

silver1row
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Mon Apr 25, 2016 7:39 am
Contact:

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by silver1row » Fri Jun 22, 2018 10:07 am

Hello,

Which image are you and your people using?

...

uname -a <<<< use this command to find out

...

The BBB and other variations run on another battery supply. Do not try to run both the Motor Bridge Cape and BBB off the same power supply.

...

The BBB runs off of 5v or 3.3v only. You can run your Motor Bridge Cape off a 12v 1.3 Ah lead acid battery.

Seth

P.S. If this is not the issue, please contact me. You may have to set up config-pin on specific pins so the Cape can communicate w/ the BBB. Once you have set up the config-pin utility, you may need to also figure out how to make the config-pin set up on boot or you will have to apply it each time in user space.

krish
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Thu Jul 12, 2018 2:29 pm

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by krish » Thu Jul 12, 2018 4:06 pm

Hi,
When I connect the motorbridgecape to BBB, I could measure a Voltage of 19.18V(DC) in the battery pins(between 4 and 5) even without connecting any battery. Is that normal? if so, when I run the test code, I could not run my stepper motor. Any help is much appreciated.

krish
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Thu Jul 12, 2018 2:29 pm

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by krish » Fri Jul 13, 2018 1:56 pm

Hi,
Thanks for your help.
I am having problem in the cape. When I connect the motorbridgecape to BBB, I could measure a Voltage of 19.18V(DC) in the battery pins(between 4 and 5) even without connecting any battery. Is that normal? if so, when I run the test code, I could not run my stepper motor. Any help is much appreciated.

silver1row
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Mon Apr 25, 2016 7:39 am
Contact:

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by silver1row » Sun Jul 15, 2018 2:20 am

Hello,

I am not completely sure about the voltage you have specified here. If you have a battery bank, use that for the BBB w/ USB and then use a normal 12v lead acid battery for your Motor Bridge Cape. Please remember that the two devices each need a separate battery supply.

Oh and in the MotorBridge.py software library, try this: they just changed it two days ago.

Code: Select all

import Adafruit_GPIO.I2C as I2C
import Adafruit_BBIO.GPIO as GPIO
import time
Reset = "P9_23"
MotorBridge = I2C.Device(0x4b, 2)
GPIO.setup(Reset, GPIO.OUT)
...

See the line MotorBridge = I2C.Device(0x4b, 2): this is supposed to be this way now. Oh and what does the cmd uname -r or uname -a provide?

For the newer images, config-pin is used. You can find more on config-pin here: https://github.com/adafruit/adafruit-be ... config-pin.

So, if you know that the Cape is connected at P9_19 and P9_20, use config-pin to set up your Cape for communicating w/ the BBB w/ these ideas:
  • sudo config-pin P9.19 uart
and...
  • sudo config-pin P9.20 uart
This should allow for communication b/t the BBB and the Motor Bridge Cape.

...

Please provide which software example you are using, I can probably help you. Oh and if you need to revert back to a previous version of Adafruit_BBIO to make this work, I can help you w/ this idea too. If you do not want my help w/ reverting back to the older Adafruit_BBIO library, you can find their info. at GitHub at this address: https://github.com/adafruit/adafruit-be ... -io-python.

And...I know this is getting lengthy:

...

Adafruit.com has Forums at this address: https://forums.adafruit.com/viewforum.p ... 9b94b3af2d. If you look at a couple of my posts, you will find some background info. on reverting the Adafruit_BBIO back to previous versions. Oh and my name on that forum is silver2row.

Seth

P.S. If you get bored of this info, please contact me w/ specifics.

krish
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Thu Jul 12, 2018 2:29 pm

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by krish » Tue Jul 17, 2018 1:51 pm

Hi Seth,
Thank you for your reply. I changed the code accordingly and it works.

For some reason, the BBB died after executing the code. With that BBB, it read an output voltage of 19.2V between pins 4 and 5. It sent an output voltage of 19.2V when an external power supply unit is connected. After replacing the BBB with a new one, the voltage between 4 and 5 is 5V . The motor that I use for my work requires voltage more than 5V and when it is connected to an external power supply (>5V) it worked.

Thanks for your help.

silver1row
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Mon Apr 25, 2016 7:39 am
Contact:

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by silver1row » Wed Jul 18, 2018 5:01 am

Hello krish,

Seth here. I am glad things worked out. Did you have to revert back to 1.0.3 for the Adafruit_BBIO library?

Or...

Did you use the new software which is on Github.com, i.e. for both Adafruit_BBIO and the MotorBridge.py file at github.com?

Seth

P.S. If you get bored and if you are likely to share, I would like to know more about your project. Reply if you feel comfortable.

silver1row
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Mon Apr 25, 2016 7:39 am
Contact:

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by silver1row » Wed Jul 18, 2018 5:12 am

Sorry and Hello,

krish...Seth here, again. Here is some starter software that makes the board idle in a straight, u-turn one way, straight, u-turn another way, mode.

Seth

P.S. Here it is. Oh and if you can provide some feedback, I would like that. You can find it here: https://github.com/silver2row/MotorBrid ... /mbcUse.py.

Code: Select all

import MotorBridge
import time

MotorName        = 1
MotorName        = 2
ClockWise        = 1
CounterClockWise = 2
PwmDuty          = 90
Frequency        = 1000

if __name__=="__main__":
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 1, 90)
        #print "I got your biscuit, now!"

#Making a U-Shape in the lawn
#Left motor on chassis goes while the right motor ccw
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 2, 90)
        #print "I love Jim's TURN!"

#All Flanks...Straight Ahead!        
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 1, 90)
        #print "Give in to temptation!"
        
#Make another U-Turn but this time, motors go in the opposite direction!
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 2, 90)
        motor.DCMotorMove(2, 1, 90)
        
#Straight Ahead
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 1, 90)
        #print "Tacos are not all around here!"
  
  #etc...
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 2, 90)
    
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 1, 90)    
    
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 2, 90)
        motor.DCMotorMove(2, 1, 90)
    
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 1, 90)

    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 2, 90)

    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 1, 90)        

    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 2, 90)
        motor.DCMotorMove(2, 1, 90)
        
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(2, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(2, 1, 90)
        time.sleep(1500)

krish
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Thu Jul 12, 2018 2:29 pm

Re: Problem BeagleBoneBlack + MotorBridgeCape

Post by krish » Wed Jul 18, 2018 3:47 pm

Hi Seth,
I did not do any changes to the code "motorbridge.py" except changing i2c as GPIO.I2C and I2C.Device(0x4b,2). However, I reinstalled GPIO.I2C library from github.
Thanks for your help.

Post Reply