Running off of batteries

Hello,

I'm looking to buy the reverse and was wondering if it would work with a 4 X AA battery pack with rechargable batteries (1.2V each)? I am looking to use it with two of the 3V wheels that you sell and then maybe in the future go to 4 of the wheels (depending on how adventurous I feel!)

Thanks,

Rob

piborg's picture

The PicoBorg Reverse needs at least a 6V supply in order to operate correctly.

4 × 1.2 = 4.8V, which is not quite enough.

You could instead use:

  • 5 or 6 rechargeable AAs, this would give:
    5 × 1.2 = 6V for 5, or 6 × 1.2 = 7.2V for 6
  • 4 normal AAs, this would give:
    4 × 1.5v = 6V, but you would have to replace them when done
  • A single 7.2V radio controlled car battery,
    this works very well from experience and gives a good running time

Thanks for the reply.

OK, I will try and find a 6 AA holder. But would 7.2V not be too much voltage for the motors though, as they are rated at 3V? (Sorry, I'm very new to all of this). Am I right in staying that with 6 AA, that would still give me the same mAh rating as 4, just a higher voltage?

Thanks again,

Rob

piborg's picture

Do not worry about being new to things, it just means you have all that fun learning ahead of you ^_^

You are correct about the current, since we are using the batteries in parallel it will only change the voltage.

When you use the library to set the motor power level, it effectively sets the voltage to the motor.
The power it produces out is the power in multiplied by the power level.

For example if we have 7.2V in and we set a 50% level to motor 1 like so:
PBR.SetMotor1(0.5)
then motor 1 will get 0.5 × 7.2 = 3.7V.

The same rule applies to PBR.SetMotor2 and PBR.SetMotors

By changing the voltage out to the motor we control the speed, in order to limit the power out we need to work out what the maximum percentage we can use is.
In our case we have 3V so we can go up to:
3 ÷ 7.2 = 0.417

We can simply have Python calculate this value for us:

voltsIn = 7.2
voltsOut = 3.0
maxPower = voltsOut / voltsIn

we can then use that value when we set the motor power like so:
PBR.SetMotor1(maxPower * 0.5)
will give us 50% of 3V, half the allowed motor output.

You will need to modify any of the scripts you use for this, so for example if we wanted to change the pbrJoystick.py example we would first need to alter the lines highlighted below to include maxPower:

                if joystick.get_button(buttonSlow):
                    driveLeft *= slowFactor
                    driveRight *= slowFactor
                # Set the motors to the new speeds
                PBR.SetMotor1(maxPower * driveLeft)
                PBR.SetMotor2(maxPower * driveRight)
        # Change the LED to reflect the status of the EPO latch
        PBR.SetLed(PBR.GetEpo())

Then you would want to add the new lines early in the script, like so:

#!/usr/bin/env python
# coding: Latin-1

# Load library functions we want
import time
import os
import sys
import pygame
import PicoBorgRev

# Work out the maximum allowed power output
voltsIn = 7.2
voltsOut = 3.0
maxPower = voltsOut / voltsIn

# Re-direct our output to standard error, ...
sys.stdout = sys.stderr

Now the maximum power applied to the motors will be limited to a 3V output.

Hopefully that is not too confusing ^_^

That's perfect! Thank you very much for the explanation. Can't wait to start working on it!!

Do you have any recommendations for a 7.2V battery and charger?

piborg's picture

I would recommend using a NiMH battery pack, they are cheap enough and seem to be more reliable over time then the older NiCd batteries.

We have some of VapexTech battery packs which worked well with our demo robots: http://www.vapextech.co.uk/acatalog/High_Power_Model_Control_Batteries.html
We use the 2500mAh ones, they seem to last a good couple of hours of mucking around or about 30 minutes of full speed, the higher capacities should last longer.

You will probably want a two wire Tamiya style male battery connector to attach the battery to the PicoBorg Reverse with.
Here are some an examples on Ebay:
http://www.ebay.co.uk/itm/TAMIYA-MALE-2-WIRE-BATTERY-CONNECTOR-/13068818...
http://www.ebay.co.uk/itm/NEW-TAMIYA-MALE-2-WIRE-BATTERY-CONNECTOR-RC-TA...
found with the search tamiya connector male

As for chargers we are using an old RC car fast charger, the fast chargers take about an hour to charge a battery pack, the slow chargers take several hours but are typically cheaper.
The battery page I linked above has an appropriate slow charger, looking around it would seem the Ansmann AC/DC Delta 3 would be a good choice for a fast charger:
www.amazon.co.uk/UK-Delta-AC-DC-replaces-998400603/dp/B004W5ZHGG
http://www.ebay.co.uk/itm/Ansmann-AC-DC-Delta-3-Fast-Pack-Battery-Charge...

The chargers I have shown linked to have UK style mains plugs, I am not sure what country you are from but if it is not the UK you will want to find the same sort of thing with an appropriate style mains plug.

I hope this is all helpful information ^_^

Thank you for the links; great information as usual :) I've also had a look on eBay and found this:

http://www.ebay.co.uk/itm/FLOUREON-Electric-RC-Battery-Pack-Ni-MH-7-2V-3...

What do you think? The charger outputs 1.2A so should charge the battery within 3 hours (which doesn't seem to bad for the price) and the battery has a large capacity

I'm in the UK so the plugs you showed me would work fine

Thanks,

Rob

piborg's picture

Glad you found the information useful.

The pair you are looking at seems good to me, as you say a three hour charge is quite good.
I remember having to wait for an overnight charge on these when I was younger...

Do not forget to get yourself a connector / cables to attach it to the PicoBorg Reverse.

Hello,

I was thinking of buying a piborg reverse but am not clear on how the output voltage is used. For example if i have 9v going in do i get 9v to each motor or 4.5v.

Thanks

piborg's picture

You get a maximum of 9V to each motor.

You can vary the output to the motor via PWM which is a single command on the PicoBorg reverse, for example:
PBR.SetMotor1(0.5) provides 50% of the input voltage to motor #1,
or
PBR.SetMotor2(0.25) provides 25% of the input voltage to motor #2.

This effectively changes the output voltage, so say for example you have a 9V battery and 4.5V motors, you can make sure the PicoBorg Reverse only supplies an equivalent of 4.5V to the motors by never exceeding 50% PWM.

The PicoBorg Reverse can effectively step the voltage down.
It can't however step the voltage up (so if you have a 9V battery, you can't output 18V).

Hope this helps.

Thanks that was very helpful. If i connect two motors to each connection point (4 motors in total) will they all get the full 9v or 4.5v each?

piborg's picture

If you connect them in parallel they will get the full 9v.
By parallel I mean both motors are connected directly to the outputs.

If you connect them in serial they will split the 9v between them, usually getting 4.5v.
The exact voltage given to each motor in this case depends on the actual work each motor is doing at the time.
In some cases this can mean 0v to one of the motors and the full 9v to the other.
By serial I mean the motors are connected to each other in a chain, with the ends of the chain connected to the outputs.

Hopefully the attached images below will clarify what I mean by parallel and serial.

Images: 

Ok thanks, that's cleared up a lot.

piborg's picture

In general we would recommend you connect multiple motors in a parallel connection.

This is because you have greater control over the power to the motors, in particular if you are trying to limit a motor to say 6v you do not run the risk of getting voltage spikes which cause the motor to briefly get too much power.

If you connect motors in serial it is fairly likely that at some point one or both will get the full output voltage applied to them, so only do this if they are capable of taking that voltage.

Hi Guys, Though I have read all of your advice above.
Can I just ask you to clarify the following.
I have just ordered the DiddyBorg and I am planning to power it with an RC battery pack, rather than AA's.
Am I right in thinking that I will need to get a pack that will deliver 12v, as this will be the same as 12 rechargeable AA's.
Thank you

piborg's picture

12v would be ideal, as you say it should match the AAs perfectly.

You can have a different voltage if you wanted, but it must be between 7-25v to be within the limits of both the PicoBorg Reverse and the BattBorg.
We would recommend somewhere between 7.2-15v as suitable for both the motors and the boards.

If you do change the battery voltage you should change the line which sets voltageIn in the various DiddyBorg scripts.
For example if you attach a 7.2v battery pack:

# Power settings
voltageIn = 7.2            # Total battery voltage to the PicoBorg Reverse
voltageOut = 6.0           # Maximum motor voltage

Thanks for your fast response.
I plan to get a set of normal AA's to begin with, when thy die maybe AA rechargeable's and stick with those.
I have just found a HLNA0028 1100mah pack (I knew I had one somewhere), although that is on the limit, I might give it a try at some point, though I have reservations.
Perhaps something like this?
http://www.ebay.co.uk/itm/9-6v-3000mAh-NI-MH-RC-Rechargable-AA-Power-Pac...

piborg's picture

The HLNA0028 1100mah should be fine, the main problem will be the lower voltage and capacity will mean the DiddyBorg will run for a fairly reduced time compared to the AAs.

If you use normal AAs we recommend you change the voltage input value to 15v in the script (10 x 1.5), otherwise the motors will receive 7.5v instead of the rated 6v.
You are not likely to damage them at 7.5v, but you will probably reduce how long they last for as they will run faster than intended.

The battery pack you linked to should work well, it may even last a little longer then AAs given the larger capacity.
Again you probably want to change the number in the scripts, otherwise he will run slower than normal (about 80% speed), but it will not damage anything if you do not :)

Thank you for the insight, I have played safe and brought rechargeables. Better safe than sorry.
Once I have become less of a newbie (this is my first Rpi RC project) I will experiment a lot deeper.

My ultimate goal is to build something like your fantastic DoodleBorg ... now that would make me a very happy nerd.
On that note, I've already been looking for some motor cycle starter motors, no luck yet though.
I'm thinking I could use other types of motor, maybe electric wheelchair ones or something.

Thanks again for your help.

I have a TURNIGY ACCUCELL-6 that I plan to charge with

On my Diddyborg there is one power source for everything by using the PicoBorg Reverse in combination with the BattBorg. The BattBorg supplying the 5V to Pi. I now would need to power the 2 Servos, maybe 3 HC-SR04's and the UltraBorg and perhaps some other things in the future. My first choice is to use the existing 12V battery supply to power everything but of course at the proper voltages. One thought would be a second BattBorg to power the UltraBorg which would then power the 2 servos, and 3 HC-SRO4's. This would separate the Pi 5V power form the Servos and other devices.

piborg's picture

Using a second BattBorg to power the UltraBorg will work well.

You should be able to connect the battery pack to both BattBorgs using another couple of wires to go between the BattBorg screw connectors.
Alternatively a second battery pack would keep DiddyBorg running for the same length of time.

Using the one BattBorg to power everything would be too much current drain when the servos start moving, likely causing the Raspberry Pi to reset.
With the two separate BattBorgs the servos and HC-SR04s will get their own 1.5A supply.

You could also use a UBEC for the UltraBorg instead of a second BattBorg, since the servos and HC-SR04s are less picky about the 5V being precise compared to the Raspberry Pi.
If you do just make sure the BattBorg is powering the Raspberry Pi to ensure it gets a nice clean 5V.

In both cases make sure you remove the 5V link jumper to keep the Raspberry Pi 5v and the servo / HC-SR04 5v separated from each other.

Hi,
I know that it must have been posted somewhere in the comments above, but I was wondering if I could use a standard 9v battery, instead of having to use AAs or battery packs, to power the diddyborg? We don't have many rechargeable AAs but we do have one rechargeable 9v that nobody is using along with a bunch of other 9vs. The rechargeable battery is a nickel-metal hydride battery with a capacity of 150 mAh.

Would a standard 9v or my rechargeable 9v be enough, not enough, or too much for a diddyborg to handle?
Thanks for any help!

piborg's picture

The simple answer is yes, both the rechargeable and non-rechargeable 9V batteries will work.
The only problem is they will not run for as long, the rechargeable in particular may not last long enough to be useful.

In order to make the scripts work correctly you should change the line which sets voltageIn in the various DiddyBorg scripts.
For example if you attach a non-rechargeable 9V battery:

# Power settings
voltageIn = 9.0            # Total battery voltage to the PicoBorg Reverse
voltageOut = 6.0           # Maximum motor voltage

For rechargeable 9V batteries check what the real voltage is.
The ones we have are actually 150mAh @ 8.4V, it should say on the battery itself.

As for running time we can work out a rough comparison by calculating the total power for the battery packs in mWh.

For 10x typical rechargeable-AAs we have something similar to:
10 x 1.2V x 1800mAh = 21600mWh
For the single rechargeable 9V we have something similar to:
1 x 8.4V x 150mAh = 1260mWh

To calculate a rough guess to how long the rechargeable 9V will last compared to the AAs:
1260mWh / 21600mWh = 0.0583... ~ 5.8%
To put it another way I would guess 10x typical rechargeable AAs will last something like 17 times as long as a single rechargeable 9V.

Thanks for the quick reply!
That pretty much answers all my questions. I checked and my rechargeable battery is 8.4v as well.
Thank you so much for answering my questions.

SeamusMcGinley's picture

Hi there, I have a 12v Hi Torque Stepper motor with 12volts running into the PiBorg Reverse.
It works..Hooorah.

But...barely 5mins in the device is so hot it is like a hot cup of tea that you can barely get from the kitchen to the living room without going Ouch, ouch, OUCH!

Is this normal or should I be going into the code and tweaking something?

Regards

Seamus

piborg's picture

Hi Seamus,

They can get hot, but the script can be altered to reduce how hot they are getting.
I will go through the changes on the pbrStepper.py example, but they should apply to any script controlling steppers using PicoBorg Reverse.

The first thing that can be changed is what happens when the motor is stationary.
The standard script leaves the motor powered when it is not moving.
Doing this provides the most torque for holding a stationary position, but causes the motor to heat up while it is not moving.

In a lot of cases applying power when the stepper is not moving is unnecessary.
The script can be changed to turn the power off between moves by adding an additional line.
This new line turns the motor off until a new command is given.
We do this after the movement has happened:

try:
    # Start by turning all drives off
    PBR.MotorsOff()
    # Loop forever
    while True:
        # Ask the user how many steps to move
        steps = input("Steps to move (-ve for reverse, 0 to quit): ")
        if steps == 0:
            # Turn off the drives and release the GPIO pins
            PBR.MotorsOff()
            print 'Goodbye'
            break
        else:
            # Move the specified amount of steps
            MoveStep(steps)
			# Turn the motor off after moving
			PBR.MotorsOff()
except KeyboardInterrupt:
    # CTRL+C exit, turn off the drives and release the GPIO pins
    PBR.MotorsOff()
    print 'Terminated'

The second thing that can be done is to reduce the amount of power to the motor.
This will cause it to move slower and run cooler, but it will also lower the torque.
First I would change the sequence code so that it uses a single value to make changing it simpler:

# Tell the system how to drive the stepper
maxPower = 1.00                         # Output to drive the stepper
sequence = [                            # Order for stepping 
        [+maxPower, +maxPower],
        [+maxPower, -maxPower],
        [-maxPower, -maxPower],
        [-maxPower, +maxPower]] 
stepDelay = 0.002                       # Delay between steps

Note the order of the + and - symbols needed to rotate the motor.

Now the sequence has a single power setting you can lower the value of maxPower to reduce how hot it gets when running.
Since this will slow the motor down you may have to increase stepDelay to get the motor to rotate properly.
If the value gets too low the motor will stop being able to turn, however I believe that stepper accepts a fairly wide range of voltages below 12V.

Subscribe to Comments for "Running off of batteries"