Wednesday, June 20, 2012

Bah on Craft Foam

So back when I was working as a Scenic Carpenter I built a lot of stuff from expanded polystyrene foam (which we, like most of the US and Canada, would refer to inaccurately as "styrofoam.")  You could usually find pretty big chunks of it, although for larger projects you'd glue several together with wood glue, a caulk gun, or Great Stuff (spray foam insulation in a can). 

I'm building up the body of one of the two robots out of foam.  But the expanded stuff just doesn't seem to be around, at least not in other than the odd scraps left over from shipping boxes.  Instead the local art and hardware stores carry extruded polystyrene, or as I've been calling it of late, "crunchy foam."

It is really horrible stuff.  I searched for foam until I found something that looked like it would work, and I committed to this stuff -- thirty bucks of it so far, plus of course sculpting time.  I wish I had kept searching.  A few days later, I discovered you can get pink insulation foam from Home Depot.   I might not have gone that way even then, since I have a rather small space to be handling a full sheet of material in!  It wasn't until I had actually worked with it that I realized how horrible it was.

Anyhow.  The craft foam crunches.  It is way too easy to break, or to dent.  It is very bad about glue; most of the glues I tried never seemed to dry and didn't hold well when they dried, either.  The cells are large and open; gesso goes right into it.  The only thing that seems to be filling the pores is spackle, and I'm using a ton of it.  Which is kinda hurting the whole intent of using styrofoam (aka, the light weight).

The body of the first robot is currently a rather sorry looking mass of styrofoam and foamcore board, patched up with spackle and apoxie sculpt (for the larger holes).  It looks like it is going to take several coats and a lot of sanding before I get that smooth glossy plastic look I want.

At this point I would lose no more than four hours if I were to throw out the existing robot, buy some pink foam, and start carving a new one from scratch.  But it would cost more money, and money and time are both short on this.



The most frustrating part is that everything takes forever to dry.  Again the hazards of not having a big shop to work in.  In a proper shop, I could be laying out the other parts of the project.  But this takes up so much of my available space, and makes so much of a mess, I am loathe to try to do anything else until I can get the body of the first robot completed.  And I'm still looking at probably another two days of sanding, spackling, gesso'ing, and waiting for stuff to dry.

And what else is there to do?  I might not bother putting servos or other electronics in the first robot.  The controller that came with it is a two-channel job and I'd have to create not just a second radio link, but some way for the operator to run both at the same time.  If nothing else, that means another battery or a bunch more connections to deal with.  And this has to be set up, batteries charged, systems checked every performance for five weeks.

(Of course, I found some LED-equipped iPod speakers that would look just so cute as "eyes" -- but I'd need to take them apart and hack them to work, and they are a little small anyhow, and it might be simpler to make something from scratch...)

I am also not sure I like the look of the Ethafoam bumper I planned to add.  It needs the bumper for what little protection it gives, though.



Robot #1 is using a $30 toy car for a chassis (as they say in the business, if it says "remote control" on the box it is a toy.  If it says "radio control" is it a hobby class.)  It has medium-hard knobby "outdoors" tires, a plastic chassis, a very light and springy suspension, and the controller is non-proportional; you get three choices -- fast, off, and reverse.

Fortunately, one of the discoveries made while investigating-by-building is that when weighted down with my new body, it settles down and seems to be decently controllable.  I haven't quite put it to the test by trying to hit the marks at the theater, though...

Robot #2 is planned around a "radio control" chassis.  A Tamiya Frog, in fact -- 1980's tech, but it has nice suspension and shocks, the typical Tamiya 540 motor.  Unfortunately it is a bit of a stripped chassis.  So I have ESC (electronic speed control) on order, I need to put one of my servos in for the steering, and of course I'm still hoping I can get the combination of Vex radio and Arduino to work.

I have no servo saver, and no idea yet what I'm doing about the battery pack.  Nor have I tried yet to fit the frame of a new body around it.  Robot #1, at least, the body appears to sit nicely enough on top that it will not have to be fastened down (meaning it is easy to pull it off to work on.)  But Robot #2 looks like it will be more interesting.

Especially since -- after all, I've got that six-channel Vex to play with! -- it is intended to have the fully pan-and-tilt camera head.



My biggest problem, however, is paying rent while I'm working on this.  I told them I was volunteering the labor.  I also haven't brought the project to the point where I can get reimbursed for parts and supplies -- if worst comes to worst, and I don't have a working robot they want to use for the show, I might end up eating much of the cost.  And that might be all I eat for the month of July!

Thursday, June 14, 2012

Sleazy Easy

I put an Instructable up for my Wireless Easy Button:



















Actually, doing it with the boost converter seems needlessly complex, and also appears to result in a shortened battery life.  Just wire the XBee direct to the battery pack.  It works fine that way.

Monday, June 11, 2012

Robot

I'm trying to build a cam-bot, on a budget, in the next three weeks.

Anyone who plans or documents a construction project learns very quickly that time and money graph against each other.  If you want it faster, it will cost more money.  If you want it cheaper, it will take longer.  And the edges of the graph are increasingly non-linear; shaving the last few days or the last few dollars becomes astronomically costly in money or time.

Add quality and you have three items that can not all be high at the same time.  If you make it as quickly AND as cheaply as you can, it is not going to good-looking or reliable.

I'm making an effect for the stage.  For a musical.  The robot has to come out under remote control and get to a certain spot on stage within the context and choreography of a scene.  And not stall, or go out of control and roll into the orchestra pit.  And it has to do this every single night.  And it has to survive being backstage before its guest appearance, meaning surviving people moving around it and sometimes accidentally hitting it or stepping on it or dropping things on it.  And it has to do this for five weeks plus technical rehearsals.

In any realistic world, you'd say "Let's take the time to build this right" or "Let's spend money on good parts so it will hold up to the stresses of performance."  But we are trying to achieve this without spending either.



See, the difference here is between what is possible and what is practical.  I could get hold of some gear motors, or even surplus electric motors and a pile of gears from Grainger.  Or find a couple of cordless drills at flea markets and hack the internals out and use them to drive wheels, and work out some interface electronics.  Of course I could, and people can.  But it takes time.  The first couple arrangements won't work.  The hardware you find at the surplus store won't quite fit without a lot of Dremel work and epoxy and other hacking.  And the first trial runs the robot will be jerky and uncontrollable (or too slow to be able to perform the necessary choreography within the time the music allots to it).

And by the time you go back multiple times to various flea markets and yard sales and surplus stores, and wait for mail deliveries from Hong Kong or Kowloon, and get through re-building multiple times...well, you will have probably spent significant money and even more importantly, significant time.

Three weeks sound like a lot of time, but not when you have other jobs to do, and you don't have a well-equipped shop to work in, and it is your first foray into robotics.  The point being; there is just way too much chance that after all the time you spend hacking something together on salvaged and home-grown parts, you will find yourself at deadline without a working robot.

The smart solution from the deadline standpoint is to purchase an existing robot or the essential parts (in this case, mostly the part called the Rolling Chassis; the basic set of wheels, axles, transmission, and steering gear).  But here is where money and quality plot inversely.  The R/C cars you find at the toy store are often under thirty bucks, but they also usually have a wheelbase of under 12", plastic wheels, and can barely manage their own weight -- much less the mock camera and other dressing we want on them.

When you go looking for rubber tires, gas shocks, differentials, and all the other goodies of a road-worthy R/C car, you jump up into the $400 range real quick.  As a basic rule, an R/C car that is big enough not to vanish on stage (the stage is sixty feet across and will have upwards of thirty actors on it) is going to be right at the fringe where they turn from toy store racers to serious gasoline powered grown-up-kid hobbies -- with price tags to scale with other adult hobbies.

I think this is probably the smartest route, however.  Going through eBay one can find a used chassis of the non-toy type for under $200.  It is probably solid and reliable enough to perform the necessary movements on stage without breaking down, and they are standardized enough so working out the electronics end may be as simple as buying a used Futaba transmitter and receiver and maybe an extra servo or two.

But I think our director has not done this research and believes that either toy store cars ARE big enough and reliable enough to do the job, or that there must be one in a garage sale somewhere and all one needs to do is spend a few weekends driving around to every garage sale in the county.

And I simply don't believe that this is a good gamble.  People win the Lotto, too.  Even if there IS a car in fully functional shape at a really great price right up the street this Sunday, planning the entire project on that happening is not the smart way to proceed.  The odds are much higher you'll find something that is underpowered, missing parts, gearbox filled with cat hair, and priced only ten bucks cheaper than what you'd spend at the toy store.  That's the problem with eBay and the internet in general; price reference is too easy these days.  People are going to price based on a much better understanding of the price other people are getting away with.  So add to your long odds, the chance of finding the person who bought the thing recently but has no idea how much it is worth.

I did take a long look at a robotics chassis -- as sold at such places as RobotoShop.  They have some decent prices, and they are designed to carry significant loads (which means the dressing and camera is no issue).  They are also designed to be easy to integrate the electronics on -- RobotShop has a chassis which is not only an Arduino compatible with FTDI chip for easy programming, motor drivers already integrated and PWM software already loaded, but it even has XBee headers to make a wireless control option simplicity itself.

The downside, however, is speed.  Whereas I suspect many of the R/C toy cars are going to be so fast there is a good chance it will smash into an actor or fly off the stage entirely, the robotics chassis are spec'd in terms like tens of centimeters per second.  A quick calculation shows me that many of these robots would take up to a minute to get from their entrance to their spike marks for the scene.  And in an American musical, a minute is a VERY long time.



So I did build a camera.  A mock-up of a 1970's broadcast television camera (but much smaller).  Turret lens, boxy body.  Tilt and pan mechanism for the camera, another servo for the turret lens, and a bright multi-color LED.  It is a bit wonky, because I built it really fast while tired and between rehearsals, and I didn't have the time or energy to re-arrange my room so I could get out the drill press and other more accurate tools (I did briefly use the bench grinder with it balanced on top of a kitchen wastebasket, however!)

The camera looks decent even without the paint job and final detailing, and all the servos work.  But I think I'm going to build a new one.  I think it needs to be even smaller, and even lighter, in order to work with the R/C cars we can afford.

And here's the thing again.  I built my own pan-tilt servo bracket out of white pine, aluminium bar stock, nylon bushings and machine screws.  It took three hours and probably cost ten bucks or more of materials.  I can get a servo bracket from RobotShop or SparkFun for fifteen bucks.  And it will have a greater range of motion and have the elements in the right order (my camera tilts then pans, which means the plane of the pan changes -- which makes it impossible to keep the image level).



So I just won a cheaper R/C chassis on eBay.  I'll grab one of the toy store R/C's while I am waiting on delivery and hack into it and see just how bad it is, too.  I need two robots, anyhow.  And I'll design and build a new camera around a proper Dagu pan-tilt bracket.  The one thing my existing camera did -- besides being a learning experience and looking kinda cool -- is to confirm from the Director that I am on the right track.  But I have yet to get explicit permission to spend money, and I can't afford to go into what is going to be a good $200 in parts entirely out of pocket.

I haven't gotten far enough to think about the actual controller.  Too much depends on the chassis (several chassis options come with radio already).  I recognize the utility of the standard controller form-factors to allow a human to control the robot in real time.  But on the other hand, some of the actions -- operating the LED that shines through the "lens," rotating the turret to the next lens -- require a layer of intelligence.  So for those, at least, it makes sense to go through a single serial link (via XBee) and simply communicate from controller to an on-board micro which will then execute the proper commands.  This is possibly fast enough to do the steering and motor control in real time as well, but it still leaves me trying to put knobs and pots on a box solid enough so an actor can learn how to run the bot.

In the end, having anything more than a fixed (and lightweight!) styrofoam camera may be a stretch goal.  But if I can get a pair of R/C cars dressed, then I'll have an acceptable fall-back position.