ThunderBorg - Powerful motor controller mounted to your Raspberry Pi
Installation issues
- Permission denied, file not found, 404 or similar:
There are a few possible causes of this:- Out of disk space:
We have occasionally seen this with people who have smaller SD cards, check by using
df
If the Use% column reads 99 or 100% on rootfs you probably need to remove some files to free up space - Unable to find file / 404:
Most likely the internet connection is down or there are problems with the command, check you are connected to the internet okay with
ping -c4 google.co.uk
If you get errors it is probably the connection, if not check the name is correct.
If there is still a problem it might be an issue with the Linux repositories, try
sudo apt-get update
to update where on the internet the Raspberry Pi looks for packages. - Unable to write to the given location:
This should not be the case (instructions use the users own folder), but try running using 'sudo'
- Out of disk space:
- E: Unable to locate package ...
Check your internet connection is okay as above, otherwise try
sudo apt-get update
to update where on the internet the Raspberry Pi looks for packages. - PiBorg logo is missing from the desktop (text is there):
sometimes the desktop refresh is a bit temperamental, try restarting the Raspberry Pi.
Use issues
- My motor spins when I am not running any code
The most likely cause for this is a wiring problem, double check all the connections as shown on the Getting Started tab. - My motor runs backwards
Swap the M+ and M- connections for the given motor at the ThunderBorg terminals. - My motor does not work
Check you are not seeing any errors displayed when callingInit()
and the ThunderBorg runs a colour sequence of red, green, blue when powered.
Now run the following:
import ThunderBorg
TB = ThunderBorg.ThunderBorg()
TB.Init()
TB.SetCommsFailsafe(False)
TB.SetMotors(0.3)
print TB.GetDriveFault1()
If this printsTrue
then the board is reporting a fault, see the GetDriveFault1 returnsTrue
below.
Otherwise the most likely cause for this is a wiring problem, double check all the connections as shown on the Getting Started tab. - GetDriveFault1 or GetDriveFault2 returns
True
Faults may indicate power problems, such as under-voltage (not enough power), and may be cleared by setting a lower drive power
If a fault is persistent, it repeatably occurs when trying to control the board, this may indicate a wiring problem such as:
- The supply is not powerful enough for the motors
The board has a bare minimum requirement of 6V to operate correctly
A recommended minimum supply of 7.2V should be sufficient for smaller motors - The + and - connections for either motor are connected to each other
- Either + or - is connected to ground (
GND
, also known as0V
or earth) - Either + or - is connected to the power supply (
V+
, directly to the battery or power pack) - One of the motors may be damaged
The easiest way to check is to put both motors at a low power setting which is high enough for them to rotate easily, such as 30%
Note that the fault state may be true at power up, this is normal and should clear when both motors have been driven
If there are no faults but you cannot make your motors move checkGetEpo
to see if the safety switch has been tripped
For more details on correct wiring check the Getting Started tab and double check the wiring instructions - The supply is not powerful enough for the motors
- Permission denied
It is likely that the user you are currently logged in with does not have permission to use the I²C driver, try running the same command with sudo, e.g.
sudo python
If that resolves the issue then you can add the user to thei2c
group with:
sudo adduser username i2c
- _tkinter.TclError: no display name and no $DISPLAY environment variable
You are running a graphical program on a text only terminal (such as SSH), you need to run from a graphical environment. - I get the error
IOError: [Errno 2] No such file or directory
There are two possible problems, either the I²C is not correctly setup, or the bus number is wrong.
First try these instructions: manually setting up the I²C on a Raspberry Pi.
If that does not help you probably need to change the bus number inThunderBorg.py
. You will find this file in~/thunderborg
, if you have a DiddyBorg it also needs to be changed in~/diddyborg
. The line you want to change is line 194 inThunderBorg.py
so that it reads:busNumber = 0
If the line already uses0
then try1
instead. - I get the error
ThunderBorg was not found
You should see the boards I²C address if you run the following from Python:
import ThunderBorg
ThunderBorg.ScanForThunderBorg()
If no boards are found check that the ThunderBorg is attached correctly as shown on the Getting Started tab.
If a board is shown then set the I²C address to the shown value before callingInit()
, e.g.
import ThunderBorg
TB = ThunderBorg.ThunderBorg()
TB.i2cAddress = 0x10
TB.Init()
- Python says it cannot find the ThunderBorg module
make sure you have theThunderBorg.py
file in the same folder you are in, e.g.
cd ~/thunderborg
python
If you still have problems you can manually add the correct folder to the Python search path:import sys
sys.path.append('/home/pi/thunderborg')
import ThunderBorg
- I get the error
pygame.error: Unable to open a console terminal
For some reason pygame is unable to access the dummy screen driver.
Try running the script usingsudo
or logging in as root and running the script. - My ThunderBorg is constantly flashing red and yellow
This means the communications failsafe has been enabled and it is preventing the motors running.
The failsafe can be disabled by adding this line into your scripts after theInit()
call:
TB.SetCommsFailsafe(False)
print TB.GetDriveFault2()
If this prints
True
then the board is reporting a fault, see the GetDriveFault2 returns True
below.Otherwise the most likely cause for this is a wiring problem, double check all the connections as shown on the Getting Started tab.