WOW this is the first time ive seen this. the bot is awesome it is for lack of a better word right now "beautiful". im definately going to read through this later when im awake.
if you dont mind me asking exactly what wheels are those can you buy them? what kind of tools did it take to machime this thing. i can only dream of having a set up to do this
WOW this is the first time ive seen this. the bot is awesome it is for lack of a better word right now "beautiful". im definately going to read through this later when im awake.
if you dont mind me asking exactly what wheels are those can you buy them? what kind of tools did it take to machime this thing. i can only dream of having a set up to do this
Thanks for the kind words.
The wheels came from EBay. Some kind of Lego wheels. The tires are hollow though so weight support is limited. I'm creating my own hubs to hold the tires that are not plastic.
I have a CNC milling machine, drill press, chop saw, belt sander and manual lathe. That lets me get a bit creative but really there is a lot you could still do with wood tools and decent drill press. With a carbide toothed skill saw you can actually saw sheet AL. Just be sure as hell it is clamped like a mother. I have also used metal blades for a jig saw on <= 1/4" AL with good success. Cleaner edge than the chop saw.
I wish for a horz. band-saw but that is never going to fit my space. Plan and save and you'll be surprised what you can wrangle up. Lots of guys sell these tools once they get bored of it and the china tools usually go cheap.
Already identified some issues that will need to correct in rev 2. The ears can go. Wanted to have a couple more mount points but they interfere with access slots I need to add. Will also shift the mount holes down slightly for the same reason. I want the HDMI plug to be usable and a screw hole sits right in front of that. I guess the Pi's come with mounting holes these days but I have several 2nd gen boards and I don't plan to upgrade.
So major construction is finished on the shop. I've got all the benches built and the mill and mill tooling is moved in. I have also come up with what I think is my final revision of the RaspberryPi bracket for fitting it onto my chassis. I am frankly tired of fiddling with this and I really think the lack of any decent mounting options for these was a 'curious' design choice. So now once I have a workable program for the Raspberry to handle the L6470 driver and the Mini IMU I can begin to focus on getting the Pi and the Propeller to talk to each other.
Last step for the shop is to wrestle the 400lb lathe out of the basement and up onto the bench I have built for it. Then I can get back to the real work on the robot. I'm really happy with the building conversion though. Nice to have a nice quiet place to design and prototype. Get's less quiet when that #$%# compressor kicks on though.
Alright, the hernia-inducing task of dragging that Grizzly lathe out of the basement is complete and my shop is now fully stocked. It's really a treat to have my metal tools together in one spot. So now I'm able to get back to making parts again. Went back to creating new wheel hubs for those Lego tires. The wheel hubs are made from 3" solid round stock. An initial stub is created on each side to allow it to be held in the 3 Jaw without keeping the jaws flipped. The recess has proved to be more difficult than I thought it would be. I have to change cutting tools several times to get angles that can reach in to produce it. If I made a second set I would use the mill to rough out the recess and then finish on the lathe.
The mill is used to cut the spoke pattern and bolt-hole arrangement around the central bore. I use an arbor to fixture the part in the mill. It turned out a littler chatter-prone. I should have made the arbor a bit wider to support the part better. More vibration than I would like to see. This hub could very likely support my body weight so it's complete overkill but I do love the way it looks!
If you ever start to fancy yourself a mechanical engineer then go ahead and undertake a moderately complicated project making and fitting many custom parts and you'll probably get knocked down a peg or two. These are a great example. In my mind they were simple and easy to make. They would attach simply by screws from the bottom into tapped holes in the parts. That's before I changed the design of the deck though. The hole pattern will not work for a non 45 degree angle and I will have to be creative in attaching the angled sensors on the sides. Now I have to create legs to prop them up from behind. Then there is the matter of needing to machine them from 4 sides.... didn't think about that early on. I still need to locate a 2-56 tap for the tiny mounting holes on the sensor PCB and the standoffs needed to secure them to the back of the stand are tiny.... 0.125" stock with a 0.075" hole drilled through them. 0.275" tall. More sewing needle work on the lathe.
I will also look for plug-in type connectors for the stepper motor wires rather than the screw blocks. It'll be nice though to get the sonar sensors mounted up so I have room to do other sensor testing.
For a short time I will be going to a dual Propeller chip design. I want to develop the old propeller into a more low level controller operated via serial commands. In that role it will be taking back over the stepper drives, the sonar sensors , IR and other device driving tasks. I will use the second propeller to run the robot logic and coordinate behavior. Once that has been fleshed out over a decent serial protocol the RaspberryPi can substitute in and get going easily over the serial link. I develop things faster on the Prop though and it's easier to get going from bare bones with the Prop than the Raspberry. That will remove the Chipkit Uno 32 and Big Easy stepper drivers from the design. It's completely functionally replaced with the L6470 SPI stepper driver chip. Tell it how far to go and what speed to go at and it will do the rest. Can even detect motors stalling based on BEMF.
I love it when people machine their own parts. Not enough people do. So my grandfather passed away last year and my father took in all his tools. He has two lathes, one pretty big, bout 6 feet long, and then there is a small one. He custom made tons of parts for it and I haven't even begun to figure out what they all do. So far I have just used it as a lathe, but apparently it has a milling attachment. Sorry I don't know all the terminology. I taught myself how to use the lathe, but haven't used all the accessories Has anyone used one of these milling attachments before? How well do they work? Will i be able to make most of what I would need for small bots? For the mechanics, I mean, not for the outer casing. I do have a ton of hand tools, vices, drill press, routers and stuff like that if i need to go there.
I love it when people machine their own parts. Not enough people do. So my grandfather passed away last year and my father took in all his tools. He has two lathes, one pretty big, bout 6 feet long, and then there is a small one. He custom made tons of parts for it and I haven't even begun to figure out what they all do. So far I have just used it as a lathe, but apparently it has a milling attachment. Sorry I don't know all the terminology. I taught myself how to use the lathe, but haven't used all the accessories Has anyone used one of these milling attachments before? How well do they work? Will i be able to make most of what I would need for small bots? For the mechanics, I mean, not for the outer casing. I do have a ton of hand tools, vices, drill press, routers and stuff like that if i need to go there.
Most of the old milling attachments I've seen are pretty heavy duty so the only real limitation you will have is the size of the raw stock you can clamp on it. Most of them can only handle fairly small pieces and the range of motion can be limited. Otherwise you are only limited by your skill and imagination! I would love to have one of those older lathes, they were heavy duty and could take a lot of abuse and still do some great work.
Go to the bookstore and purchase one of the machist magazines, they have advertisers that sell reprints of old machining books that can be helpful. Good luck and be prepared to have more fun than you expected! Being able to imagine something and then actually create it is a great feeling!
I know where you are coming from with the mechanical engineer remarks! It almost always takes me at least a couple of tries to get a great idea turned into reality. There's always the little gotcha that you forgot about or doesn't show up until you assemble everything. That's why I have a rather large scap heap of failed attempt! At least I have some scrap for experimenting on!
Keep up the good work! I'm rooting for you! At least you've gotten your robot operating on its own before the upgrade! I'm still a ways off from that step on my baby...
I'd echo what Bob said there. Lathe milling will be cramped in the X/Y direction and extreamly generous in the Z direction but otherwise is largely the same overall as milling with a milling machine. it is not usually terribly convieniant to switch from lathe to mill on those. While you will think that is not a big deal sooner or later you will notice that you avoid doing the things that are not terribly conviniant to do. Still you can do plenty of milling with such an attachment on the lathe if the work will fit into the constraints of the machine. Lots of people start with a lathe and go on from there. If you do get more involved in milling I highly suggest at least one of the smaller benchtop mills. It will be better suited to the task.
If you get more involved in the hobby I'll bet some of those custom attachments may become more self-evident over time.
Keep up the good work! I'm rooting for you! At least you've gotten your robot operating on its own before the upgrade! I'm still a ways off from that step on my baby...
Thanks Bob! Back at ya! I'm really enjoying your thread as well and looking forward to seeing that beast taking it first steps towards hunting down and killing Sarah Conner!
Exquisite work. I just read the whole thread. Has your purpose for the robot changed since you started the project? I just got around to reading this thread because "Scratch Built..." suggested to me that the robot was 'cobbled' together. Wow.
Thanx guys. Great info. I'm absolutely psyched to get going and start ruining some metal
Yes, they are really nice Laithes. Later in my grandfathers life he had a lot of time to custumize parts and really baby both the big and smaller one. I'm not too worried about big parts. I am more interested in smaller linking parts. So I imagine I will do ok for awhile with what I have.
I will most def pick up a couple of mags and I will for sure get a book on milling with the laithe.
Thanx again, much appreciated. Exactly what I wanted to hear. No more excuses to not get started.
I guess I didn't think of 'scratch' coming across as bailing wire and duct tape but I see where you guys are coming from there. Meant it more along the lines of 'from scratch' cooking because I wanted to make my own custom mechanics rather than buy a kit. The idea was to do something that would force me to practice my metalworking for a bigger, badder, outdoor capable bot later on. The last area I want to learn in is welding.
The purpose of the bot will remain a patrolling sentry system. It is really built around that concept with it's limited drive power, unsealed design elements, and smallish battery, but so far all have proven very capable of handling that task. The bigger bot I plan to be a 4 or 6 wheel drive system maybe 8" wheels, SLA batteries, substantial weight, and heavy duty motors. Want to give a go to an autonomous mower or remote control mower/snow plow/etc.
Productive weekend all-in-all. I was able to drill the stands for the angle brackets to hold them up and mill the brackets to allow them to clear the existing mount points for the IR sensor brackets. It was not without some foul-ups. Somehow I miss-typed a dimension as I was adding the new drilled holes to the CAM file for the sensor stands. I had to then propagate that to the angle bracket leg to make it match up. I also mistook the size of the mounting holes on the sensors. They are not #2-56 like I first thought. They are #1-64. That means the tap drill I used is too large. My best option is to drill the holes on the sensors larger and make them into #2. I'm not even certain I want to try and tap a #1 sized hole.
Revision 2 of these will have integrated mounting feet. Will make a more solid mount.
First photo is the drilled stands.
Second photo is the tiny standoffs made to position the sensors.
Third photo is the stands mounted to the chasis.
Forth photo shows the issue with the mounting angle. The non 45 degree angle leaves no good option to attach to the drilled grid. The mount points will have to be drilled custom for their position.
The other activity was getting started on the conversion of the code to C++. I started with the SONAR sensors. One of my goals is to create code that will degrade gracefully. Before a missing sensor would cause a failure as the whole group waits for an echo that is never coming. Now the loss of any sensor degrades the timing of the sweep but the group will move on after a timeout and go to the next sensor now.
I'm working on making up a small library of objects. For instance SONAR is a type of "Sensor" object and all Sensors have a get() method. This lets you use a generic Sensor object in most instances to get a result. I don't want to generate some massive robotics library but I am going to try to abstract some of the interfaces where it seems most helpful.
Interesting I ran into. The sensors do not like being fitted into the stands. I made the holes pretty snug so they could be tested out in the stands with a friction fit. It seems they are trying to ground the whole chasis through the contact with the stand and several sensors just refuse to operate like that. Two sensors work great for whatever reason but three of them will not operate while in contact with a stand. If I pull the stand off the chasis then they also work. Guess I will expand the openings and wait till the tiny taps arrive so I can mount them with the standoffs. I tried creating a better ground by connecting the chasis to it directly but that did not alter the situation.
So last weekend I got the sonar sensors all mounted and hooked up. I had to greatly over-size the holes to keep the sensors from contacting the walls of the holes with the variations i each sensor's actual part placement, hole alignment, ect. In the end I was able to get them all functioning in the stands and the robot behaves properly in the home again. Delrin would be a better standoff material to make sure that isolation is maintained. In looking at the issues I began to also wonder if it might not just be related to the metal contacting the sensor cans and physically messing with it picking up the echo. Debugging software and hardware is all part of the fun I guess
I now have working C++ code for the sonar sensors on the Propeller. I also have code to group them into groups of up to 4 sensors that can be swept through, converted to useful units, and filtered with a rolling 3 sample median filter to discard spurious readings. CMM (Compact Memory Model) code in PropGCC really squeezes a lot more function into the 24K of memory for the Propeller. So the propeller will need to be setup to also manage the power-off control, the IR prox sensors, the IR cliff sensors, motion detection, and temperature monitoring, and likely any other sensing I can cram into it. The Raspberry will handle motor control through SPI stepper drivers, time/date, IMU calculations, behavior processes, video management, networking. and battery level monitoring.
My first steps are now taken in writing the real programming for Linux. I have the Raspberry able monitor the battery voltage and soon will daemon-ize that code. The idea will be to send a message to the Prop on low battery then do an orderly shut-down on the Raspberry. After 45 seconds the Prop will send the pull-the plug signal to the power supply and the robot shuts down. I have a power management IC that should work well for this application because it now becomes important to not have the basic power switch just pull the plug on the robot. I will keep a kill-switch in the mix though for when it gets a mind of it's own.
I have switched to Arch Linux for the operating system on the Raspberry. The boot and shutdown time are fantastic ~15 seconds and the memory use is very minimal. Perfect for this application. It's certainly a lot more work to get a working install with Arch but the quick boot is worth it to me in my application.
The sensors do not like being fitted into the stands. I made the holes pretty snug so they could be tested out in the stands with a friction fit. It seems they are trying to ground the whole chasis through the contact with the stand and several sensors just refuse to operate like that.
It sure does seem to. Be it electrical or physical, a metal stand in contact with the transducers produced a myriad of problems. I need to go back though and ground the chassis anyway. On version 2 of the power distribution board I'll add tie points to the battery ground so I can ground the chassis at the supply.
@erco, Is the pivoting ir sensor glued to the brass standoff?
Yes, my Sharp sensor is quickie superglued to a plate which is glued to the standoff, which is "pivotably mounted", as patent lawyers might say. And the 4-pin socket for the ultrasonic sensor is similarly superglued to the red acrylic upper deck. Thick gap filling superglue plus accelerator is marvelous for quick construction. BUT a word of warning. The fumes released from CA can optically fog many clear plastics over a period of time, so use care around optical devices with plastic lenses like this IR sensor.
Well, this project has not fallen off the map. I've just been involved in a lot of Yak shaving trying to get the RaspberryPi into a condition that will make it useful for an autonomous robot. The principle issue I had was the power situation. The decision by the R-Pi makers to include no power-down capability on the Pi meant that I had to cobble something up. I was initially going to use the propeller and an IC to do this but the IC had a few limitations that I couldn't meet with the Raspberry and waiting till I had the Propeller integrated was going to take forever. The sticking point was that for the IC to work something had to be awake enough to pull the KILL line off it's default condition in under a few hundred milliseconds. No way the Linux boot even on Arch could take care of that and having to get to a serial protocol to the Prop just for this seemed a bit awkward.
I ended up going to a SOIC PicAXE controller. The 08M2+ has just enough I/O to do the job and when run at it's 32KHz clock it takes only 30-40uA to run it. So I created a prototype PCB. It includes the single channel I2C ADC, a 3.3V power supply that idles at about 16uA, the SOIC PICAXE, and a power P-Channel MOSFET to switch the battery voltage. The circuit when operating in the OFF state consumes 50uA. When operating in the ON state it consumes about 25mA and a lot of that is the power LED. This combined with a daemon that is launched on startup for the Raspberry allows me to write a config file that determines at what voltage the Raspberry will send the signal to cut it's power. Thus making unattended operation from LiPo batteries possible. Below is the PCB and schematic:
Note: Revision was made to connect the ADC voltage divider to the output side of the MOSFET.
The divider obviously uses several milliamps of current and putting it on the battery side was just
a goof on my part.
So finally I was able to profile a run from a 2.2AH LiPo. Like I had read around the web, I set the cutoff voltage to around 9.8V for the 3 cell pack or just about 3.3V per cell. I knew from just playing around that once they got under 10.7V the drop was extreme but last night I was able to collect much better data. With the daemon logging voltage to syslog every 5 minutes I got a very clear picture of that final knee and thought it might be useful to others that plan to use a LiPo on a bot. The knee causes you grossly over-shoot when you calculate for 3.3V per cell (9.9V total) cut-off so it makes the percent seem to hang around 60% and then fall through the floor just after 50%. Instead I decided that the better floor would be about 3.5V per cell or (10.7V total). Then keep the critical cutoff to about 3% above that floor and should leave plenty of battery charge to handle months of time before someone finally recharges them and provide much more meaningful percentages when looking at voltage. The loss in operation time is only about 10 to 15 minutes at that point. The graph from the data I collected in Excel is below:
X Axis is time in minutes, Y Axis is measured voltage.
Next steps are to generate a PCB with some basic support circuits on it to stack on the Pi. Currently I have it adding:
- RTC
- I2C GPIO expansion of 8 or 16 (but I have not decided that yet.)
- 3 Single ended 12 - 16bit ADCs.
- 1 Differential ADC.
- Some type of socketed add-on to plug in a Propeller Board as a coprocessor. (Jazzed's SpinSocket is the main contender)
- Breakout each built in channel of SPI
- Breakout I2C
- Power controller interface to my soft-switch power board (Changed to a single 6-pin ribbon) (SCL,SDA,KILL,INT,CHRGLED,GND)
- Breakout unused R-Pi GPIO in an order that doesn't make my brain hurt.
- Jumpered LED bank to allow some easy configurable status indication on the board.
That's probably fairly ambitious as it is. Once that is done I have a good place to start to retro-fit the Raspberry into my bot and start working towards getting it rolling. The realistic side of me says that's many months out.
Comments
if you dont mind me asking exactly what wheels are those can you buy them? what kind of tools did it take to machime this thing. i can only dream of having a set up to do this
This is probably the last time it will ever be that clean!
Thanks for the kind words.
The wheels came from EBay. Some kind of Lego wheels. The tires are hollow though so weight support is limited. I'm creating my own hubs to hold the tires that are not plastic.
I have a CNC milling machine, drill press, chop saw, belt sander and manual lathe. That lets me get a bit creative but really there is a lot you could still do with wood tools and decent drill press. With a carbide toothed skill saw you can actually saw sheet AL. Just be sure as hell it is clamped like a mother. I have also used metal blades for a jig saw on <= 1/4" AL with good success. Cleaner edge than the chop saw.
I wish for a horz. band-saw but that is never going to fit my space. Plan and save and you'll be surprised what you can wrangle up. Lots of guys sell these tools once they get bored of it and the china tools usually go cheap.
Already identified some issues that will need to correct in rev 2. The ears can go. Wanted to have a couple more mount points but they interfere with access slots I need to add. Will also shift the mount holes down slightly for the same reason. I want the HDMI plug to be usable and a screw hole sits right in front of that. I guess the Pi's come with mounting holes these days but I have several 2nd gen boards and I don't plan to upgrade.
Ok that's funny.
Last step for the shop is to wrestle the 400lb lathe out of the basement and up onto the bench I have built for it. Then I can get back to the real work on the robot. I'm really happy with the building conversion though. Nice to have a nice quiet place to design and prototype. Get's less quiet when that #$%# compressor kicks on though.
Keep some clear floor space for robot testing.
The mill is used to cut the spoke pattern and bolt-hole arrangement around the central bore. I use an arbor to fixture the part in the mill. It turned out a littler chatter-prone. I should have made the arbor a bit wider to support the part better. More vibration than I would like to see. This hub could very likely support my body weight so it's complete overkill but I do love the way it looks!
Just need to get wheel number 2 done now.
I will also look for plug-in type connectors for the stepper motor wires rather than the screw blocks. It'll be nice though to get the sonar sensors mounted up so I have room to do other sensor testing.
For a short time I will be going to a dual Propeller chip design. I want to develop the old propeller into a more low level controller operated via serial commands. In that role it will be taking back over the stepper drives, the sonar sensors , IR and other device driving tasks. I will use the second propeller to run the robot logic and coordinate behavior. Once that has been fleshed out over a decent serial protocol the RaspberryPi can substitute in and get going easily over the serial link. I develop things faster on the Prop though and it's easier to get going from bare bones with the Prop than the Raspberry. That will remove the Chipkit Uno 32 and Big Easy stepper drivers from the design. It's completely functionally replaced with the L6470 SPI stepper driver chip. Tell it how far to go and what speed to go at and it will do the rest. Can even detect motors stalling based on BEMF.
Most of the old milling attachments I've seen are pretty heavy duty so the only real limitation you will have is the size of the raw stock you can clamp on it. Most of them can only handle fairly small pieces and the range of motion can be limited. Otherwise you are only limited by your skill and imagination! I would love to have one of those older lathes, they were heavy duty and could take a lot of abuse and still do some great work.
Go to the bookstore and purchase one of the machist magazines, they have advertisers that sell reprints of old machining books that can be helpful. Good luck and be prepared to have more fun than you expected! Being able to imagine something and then actually create it is a great feeling!
Bob
Keep up the good work! I'm rooting for you! At least you've gotten your robot operating on its own before the upgrade! I'm still a ways off from that step on my baby...
If you get more involved in the hobby I'll bet some of those custom attachments may become more self-evident over time.
Thanks Bob! Back at ya! I'm really enjoying your thread as well and looking forward to seeing that beast taking it first steps towards hunting down and killing Sarah Conner!
Looks like a labor of love, Can't wait to see more of it.
-Tommy
Yes, they are really nice Laithes. Later in my grandfathers life he had a lot of time to custumize parts and really baby both the big and smaller one. I'm not too worried about big parts. I am more interested in smaller linking parts. So I imagine I will do ok for awhile with what I have.
I will most def pick up a couple of mags and I will for sure get a book on milling with the laithe.
Thanx again, much appreciated. Exactly what I wanted to hear. No more excuses to not get started.
The purpose of the bot will remain a patrolling sentry system. It is really built around that concept with it's limited drive power, unsealed design elements, and smallish battery, but so far all have proven very capable of handling that task. The bigger bot I plan to be a 4 or 6 wheel drive system maybe 8" wheels, SLA batteries, substantial weight, and heavy duty motors. Want to give a go to an autonomous mower or remote control mower/snow plow/etc.
Revision 2 of these will have integrated mounting feet. Will make a more solid mount.
First photo is the drilled stands.
Second photo is the tiny standoffs made to position the sensors.
Third photo is the stands mounted to the chasis.
Forth photo shows the issue with the mounting angle. The non 45 degree angle leaves no good option to attach to the drilled grid. The mount points will have to be drilled custom for their position.
The other activity was getting started on the conversion of the code to C++. I started with the SONAR sensors. One of my goals is to create code that will degrade gracefully. Before a missing sensor would cause a failure as the whole group waits for an echo that is never coming. Now the loss of any sensor degrades the timing of the sweep but the group will move on after a timeout and go to the next sensor now.
I'm working on making up a small library of objects. For instance SONAR is a type of "Sensor" object and all Sensors have a get() method. This lets you use a generic Sensor object in most instances to get a result. I don't want to generate some massive robotics library but I am going to try to abstract some of the interfaces where it seems most helpful.
I now have working C++ code for the sonar sensors on the Propeller. I also have code to group them into groups of up to 4 sensors that can be swept through, converted to useful units, and filtered with a rolling 3 sample median filter to discard spurious readings. CMM (Compact Memory Model) code in PropGCC really squeezes a lot more function into the 24K of memory for the Propeller. So the propeller will need to be setup to also manage the power-off control, the IR prox sensors, the IR cliff sensors, motion detection, and temperature monitoring, and likely any other sensing I can cram into it. The Raspberry will handle motor control through SPI stepper drivers, time/date, IMU calculations, behavior processes, video management, networking. and battery level monitoring.
My first steps are now taken in writing the real programming for Linux. I have the Raspberry able monitor the battery voltage and soon will daemon-ize that code. The idea will be to send a message to the Prop on low battery then do an orderly shut-down on the Raspberry. After 45 seconds the Prop will send the pull-the plug signal to the power supply and the robot shuts down. I have a power management IC that should work well for this application because it now becomes important to not have the basic power switch just pull the plug on the robot. I will keep a kill-switch in the mix though for when it gets a mind of it's own.
I have switched to Arch Linux for the operating system on the Raspberry. The boot and shutdown time are fantastic ~15 seconds and the memory use is very minimal. Perfect for this application. It's certainly a lot more work to get a working install with Arch but the quick boot is worth it to me in my application.
Hmmm. Maybe my quickie minimalist "hanging out in the breeze" sensor mounting method has its merits.
http://www.youtube.com/watch?v=wen79d7V2jY&feature=player_detailpage#t=25s
It sure does seem to. Be it electrical or physical, a metal stand in contact with the transducers produced a myriad of problems. I need to go back though and ground the chassis anyway. On version 2 of the power distribution board I'll add tie points to the battery ground so I can ground the chassis at the supply.
Yes, my Sharp sensor is quickie superglued to a plate which is glued to the standoff, which is "pivotably mounted", as patent lawyers might say. And the 4-pin socket for the ultrasonic sensor is similarly superglued to the red acrylic upper deck. Thick gap filling superglue plus accelerator is marvelous for quick construction. BUT a word of warning. The fumes released from CA can optically fog many clear plastics over a period of time, so use care around optical devices with plastic lenses like this IR sensor.
I ended up going to a SOIC PicAXE controller. The 08M2+ has just enough I/O to do the job and when run at it's 32KHz clock it takes only 30-40uA to run it. So I created a prototype PCB. It includes the single channel I2C ADC, a 3.3V power supply that idles at about 16uA, the SOIC PICAXE, and a power P-Channel MOSFET to switch the battery voltage. The circuit when operating in the OFF state consumes 50uA. When operating in the ON state it consumes about 25mA and a lot of that is the power LED. This combined with a daemon that is launched on startup for the Raspberry allows me to write a config file that determines at what voltage the Raspberry will send the signal to cut it's power. Thus making unattended operation from LiPo batteries possible. Below is the PCB and schematic:
Note: Revision was made to connect the ADC voltage divider to the output side of the MOSFET.
The divider obviously uses several milliamps of current and putting it on the battery side was just
a goof on my part.
So finally I was able to profile a run from a 2.2AH LiPo. Like I had read around the web, I set the cutoff voltage to around 9.8V for the 3 cell pack or just about 3.3V per cell. I knew from just playing around that once they got under 10.7V the drop was extreme but last night I was able to collect much better data. With the daemon logging voltage to syslog every 5 minutes I got a very clear picture of that final knee and thought it might be useful to others that plan to use a LiPo on a bot. The knee causes you grossly over-shoot when you calculate for 3.3V per cell (9.9V total) cut-off so it makes the percent seem to hang around 60% and then fall through the floor just after 50%. Instead I decided that the better floor would be about 3.5V per cell or (10.7V total). Then keep the critical cutoff to about 3% above that floor and should leave plenty of battery charge to handle months of time before someone finally recharges them and provide much more meaningful percentages when looking at voltage. The loss in operation time is only about 10 to 15 minutes at that point. The graph from the data I collected in Excel is below:
X Axis is time in minutes, Y Axis is measured voltage.
Next steps are to generate a PCB with some basic support circuits on it to stack on the Pi. Currently I have it adding:
- RTC
- I2C GPIO expansion of 8 or 16 (but I have not decided that yet.)
- 3 Single ended 12 - 16bit ADCs.
- 1 Differential ADC.
- Some type of socketed add-on to plug in a Propeller Board as a coprocessor. (Jazzed's SpinSocket is the main contender)
- Breakout each built in channel of SPI
- Breakout I2C
- Power controller interface to my soft-switch power board (Changed to a single 6-pin ribbon) (SCL,SDA,KILL,INT,CHRGLED,GND)
- Breakout unused R-Pi GPIO in an order that doesn't make my brain hurt.
- Jumpered LED bank to allow some easy configurable status indication on the board.
That's probably fairly ambitious as it is. Once that is done I have a good place to start to retro-fit the Raspberry into my bot and start working towards getting it rolling. The realistic side of me says that's many months out.