Pages: [1]   Go Down
Author Topic: [Q] Robot with dual batteries and motor power control  (Read 1857 times)
0 Members and 1 Guest are viewing this topic.
Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Working on a robot and ended up with having to have 2 batteries. I need a way for the mega which is connected to the master switch to control the power state of the 2nd battery.


Also if needed the step-up's are adjustable.

Reference other post about TIP120 for K on the diagram
 http://arduino.cc/forum/index.php/topic,55311.0.html

Reference other post about using 2 batteries.
 http://arduino.cc/forum/index.php/topic,50493.0.html

Motor Controller
 http://www.sparkfun.com/products/9571

The only reason to turn off/on the motor controller is

1) When the robot is off to keep it in the off state, like for storage/transport, but batteries are still connected.
2) If the batteries are low, turn it off to charge faster or to be able to charge from solar (future option) (idea is if batteries are really low, turn off as much as possible. I pretty much can turn every thing off via software. I have a regulator for the sensors (instead of the onboard one) that can be shut off)
3) If I need to reset the motor controller / battery if it is tripped from overload.

What is the best way to have the mega turn the motor controller of and on? Maybe I am going about this the wrong way? Maybe someone has some better ideas?

Also the TX from the Mega to the RX of the motor controller is giving me problems as well. I mentioned it below. Do I need a diode?
« Last Edit: March 16, 2011, 01:57:34 am by MobileWill » Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What does "turn the motor controller of and on" mean? When you aren't commanding the motor controller to provide power to the motor, it is "off".

Why do you need two master switches?  We're going to do a lot of dancing around in the dark here without some kind of a circuit diagram to look at.

Sorry, I mean so I can reset the motor controller and remove load from the battery in the case there is a overload and also since it has its own battery keep it off when the mega is off.

I am working on a diagram. Trying to decide between Fritzing and eagle. seems Fritzing will be easier.
Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Use a fuse or a circuit-breaker to protect from overload. That should NOT be a function of the microcontroller or motor control.

I cringe every time I hear about people selectively powering systems. That is NOT a safe thing to do. But maybe it will take toasting a few Arduinos to understand why.

Fritzing is almost useless for accurately documenting electronic circuits. PLEASE use a real traditional diagram. Many people just ignore Fritzing pictures because they are too ambiguous and lacking important details to be of any practical use.

I am not using it to protect, just to cut power. It has its own protection, but requires a reset if I push the battery to far.

Since I am using 2 batteries I need a way to turn the 2nd battery on and off.

Hmm, so eagle? Seems confusing. Would eagle light be good enough?

« Last Edit: March 16, 2011, 12:09:21 am by MobileWill » Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am not using it to protect, just to cut power. It has its own protection, but requires a reset if I push the battery to far.

How about an ordinary mechanical switch?  Or even an emergency disconnect of some kind.

Quote
Hmm, so eagle? Seems confusing.

Fritzing seems easy because it leaves out important details. If Eagle is too confusing use paper and pencil and scan it into a JPEG or something.

It needs to be done remotely.  The battery shuts down if the motors draw too much. Right now I only have room for 1 swtich, which I would like to be the master switch.

Also in the future I want to have full control where if the batteries are low I can shutdown all systems/sensor until the batteries have charged, like solar. Most cases the robot will be on a charging dock, so I don't have to shut systems down, but it would speed up charging.
Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino can monitor the voltage of the battery supply. You can determine where the cutoff voltage is and just program Arduino to stop everything until the voltage comes back up. Be sure and use some hysteresis to prevent thrashing the system right around the threshold.

You can also use a current sensor to monitor the current to the motors. Again, if the current goes too high, you can program Arduino to respond appropriately to that kind of fault.

Thanks most of that I have, the problem is turn the 2nd battery on/off, I kind of have it working with the Mega > TIP120 > TIP42

Problem is the TX>RX to motor controller is causing power across it. It might not be a issue. When the robot is off I am fine, but when I turn off the motor controller while the mega is on the power LED on the motor controller only dims a little, doesn't turn off unless I remove the TX wire.

Also yesterday the TIP120 was getting super hot.

I was trying to switch the ground with the TIP120 but with ground being common I have issues getting the Motor Controller to acutally turn off/on.

I am working on the diagram will take some time, but in the mean time I can do a basic one.
Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I updated the original post with more info and a high level diagram.
Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 548
Posts: 27392
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@Mobilewill,
If the NPN to PNP or P-mosfet isn't controlling the high side like you wanted, try putting  relay there instead, see the middle of the diagram below.
Use the mega to turn an NPN transistor on/off to turn a relay on/off.

What is the motor controller you are using?

Go to expresspcb.com and download their software, it is great for making diagrams like this, easy to use and to manipulate symbols into something if needed.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using this motor controller
http://www.sparkfun.com/products/9571

It did work today, last night the NPN was getting too got to touch. Except tonight I didn't try running the motors.

I would think the PNP would get hot, I guess not.

What relay would I use? Can you link to one?
« Last Edit: March 16, 2011, 01:59:55 am by MobileWill » Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 548
Posts: 27392
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"What NPN was getting too hot?  What PNP? "

http://arduino.cc/forum/index.php/topic,55311.0.html
See reply #10.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What voltage are your motors?
Using step-up converters is a significant waste of power, especially in a portable, battery operated device. NOT RECOMMENDED.
I don't see any reason all the grounds should not be tied together, permanently.
Why one battery for the motor and the other for the Arduino? The Arduino will draw a tiny fraction of what the motors use. One battery will be exercised regularly while the other (identical?) battery will barely idle along without breaking a sweat. Not a very good use of expensive batteries.

The grounds are all tied together right now.

The Arduino + sensors + camera + servos + xbee or wifi draw a lot and take away from the motors, in otherwards I am at a point that with 1 battery it can't move. If you read the thread about the batteries you will see we decided to go with 2 batteries.

3.7v isn't enough for the Arduino. I need more then 5v. The step-ups worked well on my first tank robot. I need high capacity batteries.
I am using 2 Lithium-Ion 6Ah from Sparkfun.com

The motors are hobby 3v+. I could connect them in series, right now they are parallel. But from what I read it can cause some problems if 1 motor becomes under heavy load.

It would be nice if the motor controller had a separate connection for motor power. The other one I have from adafruit is that way. Its on the other tank robot, that unfortunately have had to borrow parts from. I could use the motor shield, but there isn't enough room and some of the pins overlap with the voice shield.


Quote
the TX>RX to motor controller is causing power across it.
the motor controller only dims a little, doesn't turn off unless I remove the TX wire.
Quote
That sounds pretty bizarre. Perhaps you need to explain what you mean by "causing power across it"?  Something seems significantly wrong with your circuit to cause this kind of behavior.

Yeah I am not sure what is going on here. If I turn off the motor controller the Power LED on the motor controller is still lit dimly and the step-up has some power out.



Quote
I was trying to switch the ground with the TIP120
Quote
If you already have a motor controller handling the heavy current switching, it is still not clear why you think you need ANOTHER power switch??

Because the motor controller has its own power and I need to turn that off when the robot is off, otherwise it is always on.

Quote
I am using this motor controller: http://www.sparkfun.com/products/9571
It did work today, last night the NPN was getting too got to touch. Except tonight I didn't try running the motors.
I would think the PNP would get hot, I guess not.

Quote
What NPN was getting too hot?  What PNP?  I don't see those in your diagram anywhere?  Transistors getting too hot, especially if you aren't feeding any significant loads (like motors), is a symptom of something very wrong with your power scheme.

The transistors I am using as a switch, see other post.

Quote
I would use the batteries in SERIES to create the 7V without using those power-wasting step-up converters. It would also equalize the load on the batteries and give them a more normal life expectancy.  If you must charge them individually (vs a 7V charger), then use a switch or relay to convert between series connection (for operation ) to isolated access (for charging).  Coincidentally, that same switch or relay would provide your safety cutoff functionality.  

The chargers can't charge 2 cells only one. I haven't found one otherwise, and they wouldn't be a match set. See link to post about needing 2 batteries above. I need to be able to charge while the robot is powered. It will dock to charge and needs to still receive commands and such.

Quote
If you are using only one control output to the motor controller, it is not clear why a Mega2560 is used?  Note that there are Arduino boards that are designed to run on 3.3V, so again, no step-up converter is needed and you will save much of the power stored in the battery.

Edit: A comprehensive power plan will also include planning on how things will work as the battery terminal voltage (and power) droop from exhaustion.

Because I left off all the stuff I haven't connected as it isn't part of this problem. I have lots of sensors and stuff. If you look at the diagram they are labeled there on the mega box.  Figure 'H'.

Right now I am using a Xbee but the final design uses WiFi which draws a lot. As well as the camera/servos.


I hope this clears things up. This is my first large electronics project and hope to learn all this and get it running so I can play with code.

Thanks for all the input and help. I feel I am close to having a running robot. I do wish I could conserve power more as the idea is be able to run for days, hence the charging dock and possible supplemental power from solar.
Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Any ideas?  Hope to wrap this up soon.
Logged

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Pages: [1]   Go Up
Jump to: