Shop OBEX P1 Docs P2 Docs Learn Events
Power-checking robot? — Parallax Forums

Power-checking robot?

SciTech02SciTech02 Posts: 154
edited 2006-04-30 23:41 in Robotics
Can you do it?··Laptop computers·do it and shut down if it drops below a safe level.··Can a robot do it?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There is always an answer.

There is always a way.
There is always a reason.··· -SciTech02.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-27 00:09
    Of course they can.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • AdamEAdamE Posts: 11
    edited 2006-04-27 01:31
    Are there any "tried and true" methods of doing this with a Boe-Boat? Or perhaps a link to somewhere that gives some pointers? Having my robot let off a beep when its running low on juice would be extremely helpful.
  • SciTech02SciTech02 Posts: 154
    edited 2006-04-27 02:40
    Great,·really great.·smile.gif· How do you do you make it do that?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is always an answer.

    There is always a way.
    There is always a reason.··· -SciTech02.
  • TaishoTaisho Posts: 34
    edited 2006-04-27 14:38
    I would be interested in the answer to your question too.· That would be EXTREMELY nice to have.· That way the bot can go park itself somewhere safe before it runs out of power.
  • Charlie JohnsonCharlie Johnson Posts: 147
    edited 2006-04-27 15:05
    Do a google search for Brownout Detector or Microprocessor Supervisor. This will get you started.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-04-27 15:19
    Think about it a minute, what are you trying to measure?

    http://www.parallax.com/dl/docs/cols/nv/vol1/code/nv4.zip
    http://www.parallax.com/dl/docs/cols/nv/vol1/code/nv5.zip
    http://www.parallax.com/dl/docs/cols/nv/vol1/code/nv25.zip

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-27 15:21
    Well the BASIC Stamp already has a Brownout Detector/Reset Supervisor (13811) which will assert the RESET line LOW if the voltage drops below ~4.7V.· When this happens the program will usually restart since as the BASIC Stamp resets the servos are usually disabled allowing the voltage back up.· This starts a cycle.· In the BOE-Bot manual the FREQOUT command used at the beginning helps you detect this condition.· You know if you keep hearing the tone over and over again that the BASIC Stamp is resetting.· This is a simple method of detection, however something more elaborate could be done.· To actually shut the power down would require disconnection of the power supply, or you could simply go into sleep mode so you could reactivate when power was brough back up.· You should look at the Octabot (sp?) as an example of a robot which detects low batteries and seeks a charging station then recharges and roams some more.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-04-27 15:34
    Here's a chip you may be interested in: http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1793

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • TaishoTaisho Posts: 34
    edited 2006-04-27 15:43
    Thanks all of you for pointing us in the right direction.· I have tried searching on this forum and the net but was not finding answers because I was not using proper search terms such as 'brownout'.· I'm a newbie at this.

    My intent is to find a way to detect marginal battery levels before it gets to the point of brownouts so the bot can park somewhere besides the middle of a hallway when it runs out of power.· tongue.gif
  • TaishoTaisho Posts: 34
    edited 2006-04-27 16:36
    Beau Schwabe THANK YOU!!! The article "Checking Battery Condition and Multiplexing I/O Lines" looks like my best bet. I am getting worried that I'm getting in over my head knowledge-wise but I'm going to keep trying.
  • SciTech02SciTech02 Posts: 154
    edited 2006-04-27 19:43
    Hold up now, Isn't there a way that you can get it to detect the power level without buying extra stuff?· Like Chris said, the BS2 checks it's power and resets if it drops below 4.7 volts.· If it can do that,·couldn't it display the voltage it detects?·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is always an answer.

    There is always a way.
    There is always a reason.··· -SciTech02.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-27 20:06
    No, the BS2 doesn't know the condition...the 13811 simply holds the BASIC Stamp in a reset state when the voltage drops below its trip point.· But, you can use the fact that the BASIC Stamp did reset as a means of detecting that if you're careful.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Russ MillerRuss Miller Posts: 25
    edited 2006-04-27 22:10
    Guys,

    Take a look at Tracy Allen's note about using RCtime for battery voltage measurement. This is the cheapest way measure the voltage.
    http://www.emesystems.com/BS2rct.htm#B_voltage (The N&V article using the photocell and led is neat too)

    If you just need to know when the voltage drops below a certain level you can use a voltage divider which passes through the BS2 input pin high/low threshold of about 1.4 volts at the proper input voltage. For example in the ascii schematic below where the BS2 pin in tied to point P, if the threshold is 1.4 (V2) volts and you want to detect 5.2 (V1) volts

    battery(V1)----\/\/\(resistor R1)
    P
    \/\/\(resistor R2)----Vss

    V1/V2 = 5.2/1.4 = 3.7 = (R1+R2)/R2

    Let's use 10K for R2, then R1+R2 must be 37K so R1 = 27K

    It would be a good idea to put a resistor between point P and the BS2 pin (1K or so) just to protect the input. Also, make sure the center of the divider (point P) doesn't go above 5V when the battery is fully charged. You'll probably have to tweak the resistor values because the threshold voltage isn't precisly know for a particular BS2 and changes with temperature, etc. A potentiometer to replace R2 would make setting the value more convenient along with a fixed resistor in the R1 position just so the voltage can't go too high at the BS2 input pin.

    Post Edited (Russ Miller) : 4/27/2006 10:21:14 PM GMT
  • SciTech02SciTech02 Posts: 154
    edited 2006-04-28 03:10
    Thank you Russ, this is what I'm looking for.· Now on the battery part of the schematic, is that the positve or negative wire that goes there?· Also is that the same capacitor that comes with the Boe Bot?·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is always an answer.

    There is always a way.
    There is always a reason.··· -SciTech02.
  • Russ MillerRuss Miller Posts: 25
    edited 2006-04-28 05:27
    [noparse][[/noparse]quote] Now on the battery part of the schematic, is that the positve or negative wire that goes there?The positive wire - use the Vin terminal on your BOE. Vin is the voltage from the battery before it goes to the regulator.

    [noparse][[/noparse]quote] Also is that the same capacitor that comes with the Boe Bot?
    Tracy's note uses a 0.01uF capacitor which you should have in the Boe-Bot kit. You will need a large resistor that isn't in the kit - Tracy used 681K Ohms, Radio Shack or any electronic parts shop should have 470k or 1Meg Ohm resistors. The resistor should be value isn't critical but will affect the numbers you get at different voltages so testing will be required to find out exactly how your particular system responds.
  • SciTech02SciTech02 Posts: 154
    edited 2006-04-28 17:26
    Okay.· I'm using a 7.4 volt battery right now, and this was made for a 6 volt one.··Could I still use this schematic or would I have to get stronger resistors?· I really don't want to fry my BS2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is always an answer.

    There is always a way.
    There is always a reason.··· -SciTech02.
  • SciTech02SciTech02 Posts: 154
    edited 2006-04-29 16:28
    Never mind that last post, it should work if I use a 7.4 volt battery and if I use the schematic on the link.· I'll keep you guys updated on how it's working.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is always an answer.

    There is always a way.
    There is always a reason.··· -SciTech02.
  • SciTech02SciTech02 Posts: 154
    edited 2006-04-30 23:41
    I got it to work.· I changed 48576 to 38576, and it works fine.· I'm running it right now to see if it drops right (It looks like it is working).

    So far, if you want your robot to check it's power, follow these steps:

    1: Use the schematic on this link that Russ provided: http://www.emesystems.com/BS2rct.htm#B_voltage· Vx = Vin.

    2: Also, use the program in that link too.· Substitute 38576 for 48576.

    3:·This uses parts from the "Robotics with the Boe-Bot" text. ·The only part that's not included in your kit is the 680 kohm resistor that you can buy.

    And that's it.· So for anyone who wants to check power on there robot, you can use this.· Remember, you have to somtimes play with the values to get it right.·




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is always an answer.

    There is always a way.
    There is always a reason.··· -SciTech02.

    Post Edited (SciTech02) : 4/30/2006 11:44:37 PM GMT
Sign In or Register to comment.