Current draw across multiple thunderborgs ?

hi,
When 2 or more boards are daisychained, does the current draw of the connected pi 0 get distributed across the boards, or does it affect only the board connected to the pi ??

Assume the pi 0 draws 0.3A
if I have a 2A supply connected the board, I assume each channel gets 0.85A = (2A-0.3A)/2 ??

Now if a 2nd board with a 2A supply is daisy chained, will all the channels get (4A-0.3A)/4 = 0.925A
Or will the 2nd board get 1A per channel, & the 1st 0.85A per channel ??

Please clarify

piborg's picture

This is a bit difficult to answer, hopefully the explanation will make sense.

The first thing to understand is that the current draw from the Pi is at 5V, not the supply voltage. In fact the current draw for the Pi from the supply voltage will be approximately:

draw at 5V × (5V ÷ supply voltage)

For example if the Pi is drawing 0.3 A with a 12 V supply attached to the ThunderBorg it would mean:

0.3A × (5V ÷ 12V) = 0.125 A

an approximate 0.125 A drawn from the supply at 12 V. In practice it will be slightly larger than this, but not by much.

As for which board supplies the Pi, it will depend what is happening. With all of the motors off it will be roughly balanced between the two boards. When both boards are running both motors at full speed the same should be true. The odd circumstance is if one board is working harder than the other, in which case the board doing less work will likely provide more of the power for the Pi.

In short both boards will supply the Pi, but under some circumstances one board will do more supplying than the other.

Whats the fun in asking easy questions - lol
Thanks for the detailed reply :)

1. Is it ok to power 2 daisychained boards by wiring them in parallel to a single power supply ??

2. Does the board support acceleration/deceleration - i.e. if I change the motor power from A to B, does the board apply a voltage curve to reach B, or does the voltage jump directly to B

3. If 2. is no, any suggestions on how to implement a power curve ??

piborg's picture

In answer to your additional questions:

  1. Yes, it is fine to use a single power supply for two in more ThunderBorgs connected in parallel
  2. No, changes to the power level
  3. I would make a function in Python, see below

You can make a function which will slowly increase or decrease power for each motor. This is fairly easy to do if you want a simple linear power curve.

Below is an example for a single motor with a single ThunderBorg. Change the maxAcceleration value to change how quickly the motor will change speed. You can add more functions to control additional motors and use multiple ThunderBorgs instead.

# Load library functions we want
import time
import ThunderBorg

# Power settings
voltageIn = 12.0          # Total battery voltage to the ThunderBorg
voltageOut = 12.0         # Maximum motor voltage
maxAcceleration = 0.05	  # Maximum acceleration per tick
accelerationTick = 0.01	  # Number of seconds between each acceleration tick

# Setup the power limits
if voltageOut > voltageIn:
    maxPower = 1.0
else:
    maxPower = voltageOut / float(voltageIn)

# Setup the ThunderBorg
TB = ThunderBorg.ThunderBorg()
TB.Init()

# Function to limit acceleration for motor 1
def RampToSpeedMotor1(newPower):
	# Get the current power as see if we are increasing or decreasing power
	lastPower = TB.GetMotor1()
	if lastPower < newPower:
		# Increasing power ramp
		nextPower = lastPower + maxAcceleration
		while nextPower < newPower:
			TB.SetMotor1(nextPower)
			time.sleep(accelerationTick)
			nextPower += maxAcceleration
	else:
		# Decreasing power ramp
		nextPower = lastPower - maxAcceleration
		while nextPower > newPower:
			TB.SetMotor1(nextPower)
			time.sleep(accelerationTick)
			nextPower -= maxAcceleration
	# Final change to exact power once one tick or less is needed
	TB.SetMotor1(newPower)

### Example use ###
print 'Dead stop'
TB.MotorsOff()

print 'Ramp to full power'
RampToSpeedMotor1(maxPower)

print 'Wait for 1 second'
time.sleep(1.0)

print 'Ramp to stopped'
RampToSpeedMotor1(0.0)

print 'Wait for 1 second'
time.sleep(1.0)

print 'Ramp to half power'
RampToSpeedMotor1(maxPower * 0.5)

print 'Wait for 1 second'
time.sleep(1.0)

print 'Ramp to half power in reverse'
RampToSpeedMotor1(maxPower * -0.5)

print 'Wait for 1 second'
time.sleep(1.0)

print 'Ramp to stopped'
RampToSpeedMotor1(0.0)

Thank you for being so helpful :)

Subscribe to Comments for &quot;Current draw across multiple thunderborgs ?&quot;