4Borg issue

Hi, i've just built my 4Borg and loaded the program into my it. Due to storage of red and black wires, i bought some myself and used it on the 4borg. ( the wires are similar ).
i program it with the 2 automatic installer as well as the camera option.
however when i try to let the 4borg run on its own, it cant boot up on its own. im using a new 9v battery
can you help me with this?
At this time i also tried the web UI but am stuck at this point.

(pi@raspberrypi:~ $ sudo ~/diddyborg-web/4BorgWeb.py
Loading PicoBorg Reverse on bus 1, address 44
Missing PicoBorg Reverse at 44
PicoBorg Reverse was not found
Trying bus 0 instead
Loading PicoBorg Reverse on bus 0, address 44
Traceback (most recent call last):
File "/home/pi/diddyborg-web/4BorgWeb.py", line 38, in
PBR.Init()
File "/home/pi/diddyborg-web/PicoBorgRev.py", line 264, in Init
self.Init(False)
File "/home/pi/diddyborg-web/PicoBorgRev.py", line 234, in Init
self.bus = smbus.SMBus(self.busNumber)
IOError: [Errno 2] No such file or directory)

Sorry this is my first time and im new to robotics. hopefully im able to get some help.
Thanks,
JS

piborg's picture

This error is usually caused because the script cannot talk with the PicoBorg Reverse.

The most likely culprit is the 3-pin cable between the Raspberry Pi and PicoBorg Reverse is not making good contact.
You should have had a spare 3-pin cable in the 4Borg kit.

I would suggest that you try changing the 3-pin cable which carries the I2C signals for a spare and see if the problem goes away.
It is the cable which is connected to the pin marked '1' on the PicoBorg Reverse connector and '#1' in this diagram:

Hi there,
i tried changing with 3 different cable but picoborg reverse is having the same error. It is successfully installed into the raspberry but the picoborg reverse isnt giving any response.. is there any way to help with this?
If i use my cables for 4 of the joints, will it affect the system?
Thanks

Hi i managed to find the picoborg reverse already. however when i plug in the red cable of the battborg, the system will shut down. any help?

piborg's picture

It sounds like something might be connected incorrectly.
The most likely reason the Raspberry Pi is powering off is that the 5V or 3.3V pins are getting connected to the GND pin.

Can you take a couple of photos of how things are currently wired so we can see?

Thanks for the quick response. I'm moving forward well and connected the cables properly already. My Brother built the 4borg in the opposite manner where the battery is on the other side. And the web ui is working. However, I can't manage to get it moving and boot it up on its own with the 9v battery

Images: 

1 more photo

Images: 
piborg's picture

Just to check does the LED on the PicoBorg Reverse come on when:

  • The USB power has been disconnected
  • The 9V battery is plugged in
  • The switch on the 9V board is turned on

If it is then the BattBorg should be supplying 5V to the Raspberry Pi and the 4Borg should be working.

Given that the chassis is inverted it is quite possible that the + and - connections from the 9V board are also back-to-front.

If the LED is not coming on with the above list then the BattBorg is likely no supplying 5V to the Raspberry Pi.
Try removing the BattBorg from the PicoBorg Reverse and see if you are able to make the wheels turn.
You will need the 9V battery plugged in and the switch turned on along with the USB power attached to try this.

Hi there, i got things sorted out and the 4borg runs perfectly fine with the example scripts. however when i wanna control it myself with the web ui, it doesnt move when i press any buttons.. Any help?

piborg's picture

Is the speed slider fully to the right?

What does the Speeds line say when you press the various buttons?

Yes I've moved it all the way to the right. Speeds line say 100% but the robot isn't moving

piborg's picture

It sounds like there may be another script running which is also setting the output speeds.

Are you running any other scripts via rc.local or crontab?

Thanks for the fast reply. I got it sorted out. Now I put in the script followball.py and its responding. However I can't get it to move. Is it because I'm on test mode? How do I exit test mode. I put it into crontab already.

Images: 
piborg's picture

There is no test mode in the 4BorgFollowBall.py script.
When it is displaying the two numbers they are the speeds sent to the left and right drive.

Are you still running the WebUI script at the same time?
If you run two of the example scripts they will prevent each other working.

I am not running the web ui script only the followball.py script and the 4borg doesn't move although it have the numbers on the screen

piborg's picture

As the motors are not running I would recommend checking the drive is working manually.

First kill all any running Python scripts to make sure nothing is running:
sudo killall python

Second load up a python session from the 4Borg directory:
cd ~/4borg
python

Lift the 4Borg off the ground so the wheels can freely rotate

Now run these lines from python:

import PicoBorgRev
PBR = PicoBorgRev.PicoBorgRev()
PBR.Init()
PBR.SetCommsFailsafe(False)
PBR.ResetEpo()
PBR.SetMotor1(0.7)
PBR.SetMotor2(-0.5)
# At this stage both motors should be turning, but at slightly different speeds
print PBR.GetEpo()
print PBR.GetDriveFault()
print PBR.GetMotor1()
print PBR.GetMotor2()
PBR.MotorsOff()

Let us know if the motors moved and what the output from Python is.

If the motors did turn after that try the 4BorgFollowBall.py script again and see if it is now working.

secondly, how do i access the image that the 4borg is processing while detecting the ball? the picture below shows an example

Images: 
piborg's picture

What you need to do is create a window with a name for each image you wish to show like this:

cv2.namedWindow("red threshold", cv2.WINDOW_NORMAL)

This only has to be done once per window you need.

Now you can show an image on that window using the same name and passing the image like this:

cv2.imshow("red threshold", red)
cv2.waitKey(1)

If you want to draw the contours found on the image you will probably want to use the drawContours function:
http://docs.opencv.org/3.0-beta/modules/imgproc/doc/drawing_functions.ht...

im sorry im kinda new at this can u help me step by step, like how to create a window with this. really sorry for my incompetence.

How do I make the drive automatic ? I can't get the motors to move when in followball script

piborg's picture

What are the results from the previous test I asked you to run:
https://www.piborg.org/comment/4804#comment-4804

Loading PicoBorg Reverse on bus 1, address 44
Found PicoBorg Reverse at 44
PicoBorg Reverse loaded on bus 1
False
True
0.698039215686
-0.498039215686
this is what i got but motors not moving

piborg's picture

The important bit of information from this is that PBR.GetDriveFault() returns True.
This means the board is detecting a problem and refusing to power the motors.

The most likely explanation is that the battery is getting flat.
If you are using a rechargeable 9V try recharging the battery fully.
If you are using a non-rechargeable 9V try replacing it with a fresh battery.

If that does not help see the GetDriveFault returns True section on the troubleshooting page:
https://www.piborg.org/picoborgrev/troubleshoot

Subscribe to Comments for "4Borg issue"