Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Auto shutdown

  1. #1
    Join Date
    May 2016
    Location
    White Plains, NY
    Posts
    122
    Images
    1
    Rep Power
    13

    Auto shutdown

    I'm concerned about killing expensive LiPos. And I know that Raspberry Pi (RPi) systems should not be killed, but should be properly shut down.

    Knowing that the RPi issue will require coordination between the boards, I'm going to leave that issue alone until I solve the communications problem. But knowing I have a processor in the Abortix-M board, and I can program, I've decided to have the Arbotix un-power the entire hexapod if it hasn't been asked to move for maybe a couple of minutes.

    I'm going to add two push-buttons alongside the power switch: Start and Stop. The Stop button will be read by the Arbotix and used, along with a "no changes" timer, to decide whether power-down the system. And maybe beep as it goes...

    In series with the existing power switch I'm going to add a power MOSFET whose gate input will be driven by the Arbotix and can also be made active by the Start button.

    To start, turn the switch on and press the Start button briefly. To stop, let the hexapod time out or press the Stop button.

    Both the electronics and the firmware are fairly simple. Let me know if you want more details.

    -- Brooks
    Last edited by Brooks; 05-31-2016 at 01:16 PM.

  2. #2
    Join Date
    May 2016
    Location
    USA
    Posts
    145
    Images
    12
    Rep Power
    14

    Re: Auto shutdown

    Are you using Dynamixels on the Arbotix? If so, you can get the current voltage from the control table and take the appropriate action(start beeping, execute a shutdown, etc). This assumes you are sharing the battery between the Dynamixels and Pi.

    If using separate batteries (which I may do on one of my bots), you can use something like the Phidgets voltage sensor for the Pi's battery.

    My code is going to regularly poll the voltage, then when it reaches a pre-defined threshold, it will execute a shutdown routine - put the bot in a resting pose, disable torque, shutdown the pi, etc.

  3. #3
    Join Date
    May 2016
    Location
    White Plains, NY
    Posts
    122
    Images
    1
    Rep Power
    13

    Re: Auto shutdown

    I hadn't thought of monitoring the battery voltage! I like the idea. I am using Dynamixels.

    I'm going to go beyond minimal power consumption to zero power consumption.

    I was originally thinking of using a servo to toggle the power switch off!

  4. #4

    Re: Auto shutdown

    I know that Raspberry Pi (RPi) systems should not be killed, but should be properly shut down.
    Actually, I hard-power-off my Pis all the time, and they generally do OK. Sometimes, a git repository will be corrupted, especially when using BTRFS. Not had any problems with NILFS2. Haven't run EXT4 enough on it to know how solid it is. A cron job that calls "/bin/sync" once a minute probably helps.

    I've built voltage detection and soft-power-off into almost every circuit I've made in the last few years, because that's the only way I'm going to not kill my LiPos ... A P-channel MOSFET on the positive input, with a 5 kOhm pull-up from the gate to the positive, and a signal N-channel pulling its gate to ground through a LED, makes for a fine switch.
    A button parallels the N-channel MOSFET to turn on the thing.
    I drive the gate of the N-channel with a GPIO pin of some sort, and a soft pull-down on its gate.
    When the CPU boots, it sets the GPIO high, to keep power on. Thus, I press the "on" button until the system is on (which for most systems with microcontrollers is a few milliseconds.)
    You can also make it "latch" on with a weak pull-up resistor to the N-channel gate from the switched on-power.

    The microcontroller measures the voltage of the battery, through a voltage divider. When it finds < 3.1V/cell, it pulls the GPIO low, which will turn off power.

    I should probably make a schematic. This is a very convenient circuit!

  5. #5
    Join Date
    May 2016
    Location
    USA
    Posts
    145
    Images
    12
    Rep Power
    14

    Re: Auto shutdown

    Related to this topic -

    How are you all providing battery power to your Pis? Are you connecting to the 5V GPIO pin?

  6. #6

    Re: Auto shutdown

    Yes, I connect LiPo to a DC/DC buck converter (4.5A) and that generates 5A that I wire to both the 5V pins.

    Btw, here's the schematic for the Canonical Power Switch Circuit:





    (Of course, "canonical" is a joke -- everybody has different requirements, like perhaps overvoltage/transient protection, or a PTC resettable fuse, or current sensing, or whatever...)

  7. #7
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    852
    Images
    25
    Rep Power
    86

    Re: Auto shutdown

    Quote Originally Posted by _ADAM_ View Post
    Related to this topic -

    How are you all providing battery power to your Pis? Are you connecting to the 5V GPIO pin?

    I used a Castle Creations BEC. It has a programmable output voltage and could handle up to 24v as an input. It was able to produce 5 amps so it easily powered the Pi, Prime Sense sensor and camera without issue. It was twenty bucks but was super small and worked flawlessly.

    http://www.castlecreations.com/products/ccbec.html

  8. #8

    Re: Auto shutdown

    Quote Originally Posted by _ADAM_ View Post
    Related to this topic -

    How are you all providing battery power to your Pis? Are you connecting to the 5V GPIO pin?
    Depends: Normally I do like Kevin and use an external BEC. But the HROS1, was setup to connect the RPI up to +5v from pins on the Arbotix Pro. However the VR on the Arbotix Pro produces up to 1.5amps. So when I am hooking up to Odroid, I again have used BEC connected up to power connector.

    However soon will be trying out my own HAT for RPI/ODroid/UP
    Click image for larger version. 

Name:	Teeny-AP-RPI-Hat-3d.jpg 
Views:	207 
Size:	59.6 KB 
ID:	6604
    Boards shipped from OSHPark today, just ordered parts to populate today, so hopefully in week or so will be able to try out.
    I ordered the 6amp VR, which I feed the +5v pins on the RPI connector. so hopefully enough power for boards plus their USB.

    Also like ArbotixPro have Mosfet on board to cut power to servos. My psuedo Arbotix Pro code has code in place that detects the voltage and if it gets too low shuts power off to servos. Board has voltage divider on it so can query it for current voltage. Will add code to may Hexapod code that when it detects too low, will probably tell RPI to shutdown. Also at some point will have Teensy go into some real low power mode.

    I totally understand the problem of killing Lipos as I have killed a few!, Which was why in the Raspberry Pi code, I added some code that when I turned off the Commander, the code would turn off the torque to the servos. But sometimes I forgot to turn off the switch, so I added code that would alternate through all of the servos turning the LED on and off. This uses power, but does catch my eye, to then hopefully turn off the power before it is too late.

  9. #9
    Join Date
    May 2016
    Location
    USA
    Posts
    145
    Images
    12
    Rep Power
    14

    Re: Auto shutdown

    Quote Originally Posted by KevinO View Post
    I used a Castle Creations BEC. It has a programmable output voltage and could handle up to 24v as an input. It was able to produce 5 amps so it easily powered the Pi, Prime Sense sensor and camera without issue. It was twenty bucks but was super small and worked flawlessly.

    http://www.castlecreations.com/products/ccbec.html
    That's a sweet BEC, thanks for the tip.

  10. #10
    Join Date
    May 2016
    Location
    USA
    Posts
    145
    Images
    12
    Rep Power
    14

    Re: Auto shutdown

    What do you all think of the Pi-EzConnect Terminal Block Breakout HAT? Seems like it would really make the power and port access much better. It adds some size, but it's not really all that bulky. I'm really not a fan of sticking those little jumper connectors on pins. The screw terminals are infinitely better.

    https://www.adafruit.com/product/2711

    Also, there is the MoPi, which has a wide voltage input range and can be programmed to auto shutdown a Pi if the voltage gets low.

    https://pi.gate.ac.uk/pages/mopi.html

    I'm not really that interested in the MoPi, seems a bit complicated, but the EzConnect has me thinking...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) How to ShutDown Overload trigger of Ax12+
    By MJ2712 in forum DYNAMIXEL & Robot Actuators
    Replies: 14
    Last Post: 05-13-2013, 02:46 PM
  2. wifi robot with fully auto paintball turret
    By seesoe in forum Robotics General Discussion
    Replies: 38
    Last Post: 06-02-2011, 01:34 AM
  3. Add shutdown actions to ArbotiX node?
    By Pi Robot in forum ROS - Robot Operating System
    Replies: 2
    Last Post: 12-20-2010, 12:15 PM
  4. Contest Entry Moving Auto Throttle in my B737 Cockpit
    By Hans Krohn in forum Project Showcase
    Replies: 2
    Last Post: 09-12-2010, 03:50 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •