Connecting Multiple Motors

Multiple Motors were not found using "ThunderBorg.ScanForThunderBorg"
Hello ThunderBorg,

I recently purchased two "ThunderBorg - Dual 5A Motor Controller with DC/DC & RGB LED".
I ran the example with the GUI screen and sliders, the motors and LEDs worked for both boards, no problems.

Then I followed the instructions exactly as stated in (Under "Multiple Boards"):
https://www.piborg.org/blog/thunderborg-getting-started

I ran exactly for the first board:
ThunderBorg.SetNewAddress(10)
And then used for the second board:
ThunderBorg.SetNewAddress(11)

I then connected them in parallel and ran:
print ThunderBorg.ScanForThunderBorg()

It printed out that it found 1 ThungerBorg:
[10]

The raspberry pi was directly connected to [10] and the [11] board was not found at all. So I decided to move the raspberry pi connections over to the other board, it found [11], but not [10].

I also tried the example GUI with sliders again, there was no response to ether board, however the LED was on and nothing seemed hot or drawing more power than before (I was monitoring power). Voltage was 12 V in, amperage was limited to 4.5 Amps peak (often under an amp for testing, never peaked). I supplied power to both boards independently. Other than that, a raspberry pi was hooked up and running off the power that the ThunderBorg provided.

Please help me figure out what is wrong with the boards. I followed the setup instructions exactly, so I do not know why it did not work.
Thanks,
Chris

piborg's picture

It sounds like the connections between the two ThunderBorgs are to blame since both boards work fine directly connected.

What cables have you used to connect the two ThunderBorgs? Some photos of the connections would be helpful.

The examples will need to be changed slightly to get them to control the boards as they talk to the default I2C address. For example to update the GUI open the tbGui.py script in a text editor and look for this line:

#TB.i2cAddress = 0x15           # Uncomment ...

if you change it to

TB.i2cAddress = 10           # Uncomment ...

then the GUI will now control the motors attached to that ThunderBorg.

So I have taken some images (attached here) and have also checked and rechecked the wiring. I also did as advised above, the motors worked on individual boards, but again, not daisy chained. I did not want to pull off the boards and inspect them but will if advised.

I have also tried 2 sets of wires on this, still no daisy chained functionality.

Images: 
piborg's picture

I am not entirely sure what the problem actually is in this case. The wiring looks correct and based on your experiments both boards seem to be functioning correctly on their own.

Given that the problem only occurs with the daisy-chained board it is very likely a wiring or power related problem. In both cases the I2C signals can become "noisy" and the second board fails to understand them correctly.

Based on past experience these are my suggestions on what to try next:

  1. If possible try to use some shorter cables from both the Pi to the first board and between the boards. While I2C can work with longer cables it works best with shorter ones
  2. Another possible cabling problem is picking up noise from other sources. Try wrapping some tin foil around the six cables and see if that helps
  3. Some cables are better at carrying higher frequency signals like I2C than others. If possible try some different cables between the two ThunderBorgs. Smaller are likely to work better.
  4. This could be a problem with having two 5V DC/DCs (one on each ThunderBorg). Try disconnecting the V+ and GND terminals on one of the ThunderBorgs and see if you can talk to both of them.
  5. It is possible that the PSU you are using to power the boards is causing some switching noise that the 5V DC/DCs are not filtering out well enough. It might be worth trying to put a capacitor across the V+ and GND terminals on both ThunderBorgs to smooth out any problems. Make sure the capacitors are rated for a higher voltage than you are using.

It would also help to know what result you get from running this command with both ThunderBorgs connected:
sudo i2cdetect -y 1

So I started going through your suggestions, I shortened the wires by about an inch, no change, I then wrapped it in a tinfoil shield, then it started working!

I do find that a little odd that there would be that much influenced by the Pi but I must assume there was. Thank you for your help and suggestions.

piborg's picture

Glad to hear you have solved the problem :)

It is fairly unlikely that the Pi was the problem, I suspect that the connections were picking up noise from the PSU or another nearby source.

Basically long wires tend to act like radio antennas, causing them to pickup any noisy electrical signals to some extent. Generally longer wires pick up more of this noise, which is why only the second ThunderBorg was affected.

We have seen this kind of problem on robots where the motors actually cause this kind of noise, especially with high speed motors.

I executed the program but can not turn.Is there a way to incluse the output?

piborg's picture

Most of our examples have power settings in the script itself:

# Power settings
voltageIn = 1.2 * 10            # Total battery voltage to the ThunderBorg
voltageOut = 12.0               # Maximum motor voltage

The first thing to check is that the two settings match the voltages for the motors and the battery pack you are using.

You can increase the output by making voltageOut larger. If voltageOut is larger than voltageIn then the actual power output will be the full power of the batteries.

The other thing to check is that your batteries are fully charged. Flat batteries will also have reduced power.

Subscribe to Comments for "Connecting Multiple Motors "