Guerrilla guide to CNC machining and resin casting
Benchtop manufacturing tips, thoughts, and recipes for robot builders, model makers, and other hobbyists
VOLUME II: Real-world projects
(click here for vol I)
Copyright (C) 2007, 2008, 2009, 2010 by Michal Zalewski <lcamtuf@coredump.cx>
1. Introduction
This is a direct continuation of the first part of my hobbyist CNC manufacturing guide. The second part
focuses on building an appropriate part library for CNC engineering tasks, taking baby steps with simple CAD and CAM projects, working with
casting resins, and troubleshooting common issues encountered along the way. It also throws around a couple of loosely tied
mechanical and electronic design ideas that may be of some use in starter projects.
The reader is expected to be familiar with the basic topics covered earlier in the series, including having a good understanding of key parameters
of CNC mills, or the key characteristics of all the chemicals used. It is also necessary to have a basic grasp of electronics, particularly as related to
digital circuit design, as I will not be explaining the fundamentals; as noted earlier,
"The Art of Electronics" is a good place to start if you
need learn more.
2. Prefabricated element library
Reinventing the wheel is sometimes fun, but most of the time, just pointless; even the most creative makers benefit from knowing various generic,
prefabricated components that may and should serve as connectors, bearings, fasteners, spacers, and other low-level buildng blocks in even the most
unusual designs. The same rule also applies to various electromechanical devices and sensors needed to bring your creations to life. So, let's begin
by going through what to stock on, and where it makes sense to use it.
Now, to be sure, this section barely glances over some of the fundamentals; if you are interested in a more thorough collection of mechanical
engineering ideas and tricks of trade, you should also check out the two books mentioned earlier in the series:
"Machine Devices and Components Illustrated
Sourcebook" and "Mechanisms and
Mechanical Devices Sourcebook".
2.1. Let's talk bookkeeping
You will probably hate this, but should start keeping an old-school inventory of all the stuff you buy. Trust me on this: creative chaos and CNC machining
do not mix. You need to know up front what exact screw or dowel pin lengths you have at your disposal, what is the diameter of motor shafts you need to fit a
gear onto, or how deep your 1 mm end mill can go when peck-drilling a hole. If you get any of these factors wrong, you will likely have to start the entire
component from scratch, setting you back hours or days.
Go with the format that works best for you - an old-fashioned paper notebook is easier to draw in, while a text file on your disk is more convenient to
revise and update as you go. Whichever option you choose, try to keep track of the following:
- Stock materials: keep a basic inventory of resins, prototyping boards, pigments, and other specialty consumables. Write down manufacturers'
product numbers to make it easier to restock (particularly important for pigments - all 15 shades of pink look very much alike). You will also likely
find it useful to write down key characteristics of the resins: pot life, Shore hardness, flexural strength and modulus, mixing ratios, and any additional
application notes - it beats scanning through individual product datasheets over and over again. Here is an excerpt from my list (invent your own cryptic
abbreviations as needed):
Name | Dsty | Visc | Mix | Pot | Hrd | Flx | FMd | EaB | Amt | Notes
-------------------+------+------+--------+-----+-----+-----+-----+-----+------+-------
IE 3075 | 1.11 | 300 | 100:89 | 8 | 80D | 120 | 2.9 | 8 | 4 kg | MDI
OC 7086 | 1.10 | 650 | 100:57 | 17 | 80D | 110 | 2.4 | 8 | 4 kg | HMDI
- Cutting tools: create a list of all the cutters in your collection. This really matters. Include geometry data: tip shape, mill diameter,
corner radius, cutting length, reach, total length, and so forth. Also write down manufacturers' product codes and quantities, so that you know when to
reorder, and never end up having to postpone a project for two weeks because you managed to break the last cutter capable of machining some particular
detail - or worse yet, end up with a geometry that simply can't be made at all with the tools available on the market. Be pedantic and try to keep the list
current, as you will be referencing it very often to make some very important project decisions later on. Doing an inventory check every six months or so is
not a bad idea, too. An excerpt from my list:
Dia | CutL | Rea | Geo | CRad | Fl | Len | Shnk | Coat | Series | Qty
-----+------+-----+-----+------+----+-----+------+------+---------------------+-----
0.4 | 0.6 | 4 | sqr | - | 2 | 38 | 3 | Y | Hanita 7N22 | 4
3 | 25 | ext | sqr | - | 4 | 75 | 3 | Y | Cobra Carbide 24452 | 2
Machining mistakes will often cost you your lunch money. Since it's easy to forget a "lesson learned" for a less commonly used tool, consider writing
down application notes. What cutting parameters worked well in what material? Which settings resulted in a broken tool or poor finish?
- Mechanical components: keep a list of all the essential mechanical components discussed later in this chapter. All the screws, pins, washers,
springs, bearings, connectors, spacers, rods, tubes, and so forth, are worth enumerating. Plain wire and cable, tape, cable ties, and other commodity
materials you can restock locally do not matter that much, though.
Since most of the geometries for said components are very simple, you might also want to measure them up front. For example, for a non-countersunk machine
screw, you would need inner and outer thread diameter, shaft length, head diameter and height. For springs, rods, and tubes, you need outer and inner
diameters and nominal length... you get the picture. Don't make any "obvious" assumptions: for example, M2 screws are actually nowhere near this diameter:
the thread is usually 1.8 / 1.9 mm.
- Actuators: motors and solenoids from surplus outlets are usually poorly labeled, yet their parameters vary very significantly even for roughly
the same form factor. Because of this, you need to do a thorough job of investigating their characteristics. Try to gather as much information as possible
before you buy: manufacturer name, model, nominal voltage, and recommended operating voltage range at the very least. If the retailer does not have all
the information, scout around: try to decipher and search on the web for any markings seen on photos, inquire with manufacturers if nothing comes up;
look for similarly described items in other surplus stores; etc.
If you can't find the maximum operating voltage, be prepared to sacrifice one motor for destructive testing. To perform the test on a typical brushed,
low-power DC motor (this is absolutely not suitable for motors over 10 W or so!), clamp or glue the output shaft to something to prevent any movement,
provide a rudimentary heat sink for the motor (might be just a metal vise you are holding it in), place the whole setup on a metal tray away from flammable
materials, and start supplying progressively higher voltages to the unit. Start at perhaps 1V, then go to 24V in one volt increments, pausing for about 15
seconds between each step. Check the temperature of the motor periodically; stop if it gets too hot to touch, or if there is any smoke, the smell of burning
isolation, or simply a sudden drop in current; then subtract about 25% from the currently dialed in voltage, and use this figure as the maximum value for the
motor. If you stopped the test on time and the motor still runs smoothly, you might be able to reuse it for future work.
The remaining parameters you should know about are no-load and stall currents, no-load RPM, and stall torque for the motor (preferably, at its maximum
voltage - although the dependency is roughly linear). If not specified, these can be measured non-destructively: currents with a multimeter; RPM with a
makeshift right involving a phototransistor and an oscilloscope, a frequency counter, or - if you feell generous - an electronic tachometer; lastly,
stall torque can be measured with a kitchen scale and a 10 cm stick glued or clamped to the output shaft.
For stepper / brushless motors, wiring diagrams are useful, too. They can be figured out with an ohmmeter to identify coil pairs and tap locations
(hints here; some trial-and-error may be then required to figure out coil ordering)
- but it would save you some time to have this information up front. For each motor, also try to sketch their general shape, and take measurement of all
important dimensions, including any flanges, mounting holes, etc.
- Switches and sensors: look up or measure their dimensions, trigger pressures and displacements, and other applicable operating parameters.
For dimensional data, I recommend taking own measurements, rather than relying on datasheets: while some manufacturers are fairly accurate, this isn't
always the rule. Trigger pressure is particularly useful, and again easy to find out using a kitchen scale: just gently press it against the scale
until you hear a click.
- Other electronics: although this is less important, it makes sense to catalog other passive and active electronic components in your drawers; you
will usually not depend on their exact dimensions in a critical manner - but having their names, key properties, package types, and quantities written down
helps identify nondescript components, or plan ahead with larger-scale projects. Nothing is more annoying than running out of
H-bridge ICs or even just resistors in the middle of a holiday weekend you for once wanted to dedicate to your hobby and your hobby alone.
In addition to this documentation, you should try to grab technical manuals and safety guidelines for all the specialty chemicals, plus application datasheets
and non-trivial for all the less obvious electronic components in your workshop (ICs and exotic sensors in particular). Companies go out of business, trash
their webservers, or phase out products when you least expect it. Sure, you will able to look up the pinout of any 7400 series chip on the web for the
foreseeable future, but if you have a rare Dinsmore compass sensor - better not bank on it. Plus, running a search and downloading 5 MB PDFs every
time you want to check the pinout on your favorite microcontroller just gets old.
All right? With bookkeeping out of the way, let's get into the shopping mode for all the components you may find useful.
2.2. Mechanical components
2.2.1. Screws and threaded rods
Perhaps the most essential items on your grocery list should be machine screws, also known as bolts (the question of naming is roughly equivalent to the
"vi vs emacs" debate - call them whatever you want). Machine screws will let you create exceptionally strong and serviceable joints in a manner that can't be
approximated with, say, glue. Where to get them? Your local hardware store likely carries a large selection of screws, but you probably shouldn't be buying
them there: the pricing is almost certainly atrocious, and you won't find the most useful sizes in stock, unless the store specializes in miniature
applications. Instead, look for bulk manufacturers or distributors of miniature fasteners, such as Micro Fasteners
or Small Parts Inc. They will charge only around $2 to $4 for a bag of 100 screws of a particular variety, and
all have an excellent selection of miniature sizes to pick from.
SIDE NOTE: Small Parts Inc will be a recurring name through this section. For almost all small, mechanical components, they are the best, most
user-friendly place to shop - although be warned that in some cases, they may be more expensive than more specialized retailers. Most importantly,
however, Small Parts inventory is also available through Amazon, and eligible for
free 2-day shipping under Amazon Prime, with no minimum purchase required. This is almost impossible to beat, and offsets any pricing differences
most of the time.
Anyway - whichever store you choose, you should be looking for 100-packs of non-countersunk, fully-threaded machine screws made of steel or brass; the
exact type of an alloy is mostly irrelevant (for fastening plastics in designs not exposed to elements, anyway): pick the cheapest one. Be sure to stay away
from more expnsive and less durable Nylon, aluminum, and similar exotic materials, though. Drive type (slotted, Phillips, hex socket) is mostly a
matter of personal preference: if you have a matching screwdriver, you should be fine - and if you don't have it,
get one already!
When it comes to screw diameter, it is
good to stock on something around 1.5 mm (fragile - for small, precision applications where space is at a premium), 2 mm (good for all around uses), and 3 mm
(good for high loads or extra long reach lengths); in the States, the corresponding ANSI Unified Thread Standard designations are 0-80, 2-56, and 4-48,
respectively. Most useful screw lengths are around 6, 8, 10, 15, and 20 mm. You can also substitute 20 mm for 4 mm, and ditch 3 mm (4-48) diameter
altogether, if you plan to focus on smaller projects only - that is, nothing over 2-3 kg or so. A handful of projects might also have an use for
subminiature screws (say, M0.8 - 000-120 ANSI, or even less), but expect them to be significantly more expensive.
Good all-purpose A so-so
screw geometry screw geometry
_
/ |________________ |\________________
| ////////////////) | ___/////////////> <-- sharp tip for wood applications
\_| |/
^
^ `-- not fully threaded
|
`----- countersink
The sizes of hex nuts and washers for a particular screw diameter are mostly standardized, and should be selected accordingly. Keep in mind that your uptake
of the screws will likely be higher than that of nuts and washers, so do not aim for a 1:1 ratio. In most rigid plastics with high flexural strength, you
can just make a slightly undersized hole - and then drive a screw through it, so that it impresses its own thread in the plastic, and form an excellent
interference fit that will not give up easily. No nut is needed in this approach at all! Alas, the trick does not work well when joining very thin
sections, or when working in brittle plastics susceptible to stress cracking (acrylic, polycarbonate, polyester) - so still, some nuts would not hurt.
What else? Oh, while we are at fasteners - another potentially interesting addition to your library could be threaded metal rods, but it's your call. These
rods can serve two purposes: the boring one is that when cut to a desired length, and capped with two nuts, they form an arbitrarily long fastening screw.
The more exciting use: pair a rod with an appropriate nut, and then use it to cleverly convert torque to linear thrust. A naive example would be:
___ actuated element
sliding guide | |
============================================================| |===================
|___|
|
| rigid linkage
--------. | _
| _________________________________________________________.-.______________ |
motor |===[/////////////////////////////////////////////////////////| |//////////////]===| bearing
| `-' |_
--------' threaded rod <-- nut -->
The nut is not allowed to freely rotate with the rod, as it is attached to another element - but can move forward or back when the rod is rotated: it is
going to advance by the distance equal to the pitch of the thread (say, 0.5 mm) with each turn. Voila - we have a really simple and compact way to
convert rapid rotation of a DC motor driving the rod into a slower, more powerful linear motion of whatever we wish to attach to the moving nut.
Now, there is no reason to get too smug - regular screws are not really meant to be used this way, and the assembly would have pretty awful efficiency
under load - somewhere around 10-20% is a safe bet - because friction is the primary mode of power transfer, as opposed to rolling action in well-designed
spur gears and
ball bearings. Still, screw drive
is much simpler than any other alternative, and is also locking - that is, applying linear force to the actuated element would ordinarily not move the nut
or rotate the motor (because of the very low angle of the thread). Not a great solution, but hey - it comes handy.
Anyway, a couple of 30 or 90 cm rods would likely last for a longer while if you foresee yourself using this approach. Perhaps the most useful diameter
for small applications is around 2 mm (2-56).
2.2.2. Plain pins, rods, and tubes
At first sight, dowel pins
sure look completely unnecessary: they are just pieces of featureless cylindrical steel, machined to tight tolerances. But
as much as they may seem plain, they have important applications. Their perhaps most important use is as axles for spur gears and other rotating
mechanisms (example); but you will also use them
to precisely align workpieces during the milling process; to align multi-piece molds for casting; and to join finished parts with an accuracy far better
than would be possible with a screw alone. They also do a good job as easily servicable torque couplers; slide guides and movement limiters; contact sensors;
and much more.
Non-tapered, solid metal dowel pins are available from a number of places, including Small Parts Inc, for about $4-$8
per 100; 2 mm diameter pins with lengths around 4, 6, 8, 10, 15, 20, and possibly 30 mm are probably all you need. You can also look around for 1 or 1.5 mm
diameter pins for precision work, especially if you want to build really compact gearboxes for small motors.
Dowel pins aside, you might want to have a peek at vanilla (non-threaded) metal rods and tubes: they are very cheap ($1-$2 per meter, Small Parts offers
a good selection), and when cut to a desired length with a hand saw, they are an indispensible engineering material for building lightweight frames
(example project), creating long torque-bearing axles, and putting together similar
assemblies that are ridiculously resource-consuming to machine individually. Steel or brass tubes around 3 and 6 mm, aluminum ones between 4 and 8 mm,
as well as solid metal cylinders, are worth checking out. Rectangular, hexagonal, or L- and I-shaped rods are particularly useful for torque transfer
applications.
2.2.3. Spacers
Nylon spacers are a yet another potential low-cost lifesaver you should be aware of; it's much less essential than dowel pins, but may simplify mold design
and reduce cutting times by providing a way to ensure a specific distance between fastened elements without actually machining tall protrusions on the
part itself:
Without a spacer With a spacer
part 1 part 2 part 1 part 2
| | | | | | | |
| | | | | | spacer | |
| \_____ _____/ | | | _____________ | |
|_ _ _ _ _ _||_ _ _ _ _ _| |_ _ ||_ _ _ _ _ _ _|| _ _|
:_ _ _ _ _ _::_ _ _ _ _ _: <- :_ _ ::_ _ _ _ _ _ _:: _ _: <- screw through hole
| _____||_____ | | ||_____________|| |
| / \ | | | | |
| | | | | | | |
| | | | | | | |
<-----------> <---->
part height part height
The lower the height of the part is, the quicker the initial master can be machined, and the less silicone is needed to make a mold - so this simple tool
may come handy. Now, it's not all roses - you lose some rigidity of the joint when it comes to shearing forces: the screw will be allowed
more play when an interference fit exists only in relatively thin sections far apart from each other. Still, there are cases where it works well.
Spacers with inner diameters of 2 and 3 mm, and outer diameter of 4 mm, are probably most useful with the choice of screws and dowel pins discussed
earlier; lengths of approximately 7, 10, 15, and 20 mm are a recommended starting point if you want to stock them.
Small Parts Inc is - again - a good place to shop for these on the web.
2.2.4. Springs and spring wire
Springs are traditionally seen a simple shock-absorbing tool, and in that capacity, they are of fairly limited use - maybe as a suspension for certain
all-terrain wheeled robots. That said, there is a number of less obvious applications where springs come handy: for example, attached to a motor so
that the axis of the spring is aligned with the axis of rotation, they can work as a lightweight, flexible, buffered torque transmission device. A
canonical example of this use are... sex toys: this highly NSFW X-ray image
illustrates the idea fairly well. The same principle can be used in small robots for torque coupling, with none of the X-ray drama. Another uses of
springs include contact sensors (whiskers) and return mechanisms for actuators, to name few.
Springs come in three principal flavors: compression (wound in a manner that permits them to shorten under load, at the expense of the ability to be stretched
elastically), extension (wound tightly to permit maximum elongation when pulled apart - no meaningful compressive action), and torsion (tightly wound,
thicker, designed specifically for twisting action - e.g., transferring torque). Compression springs can double as (poor) extension springs to some extent;
but extension springs will not work as compression ones. Extension and compression springs can be used for torque transmission, too; they might handle high
torques less gracefully than a dedicated torsion spring, but the difference is not particularly pronounced in small-scale applications.
For each variety, spring geometry is described primarily in terms of their inner and outer diameter, and length under no-load conditions. For a given type of
steel, the force needed to move a spring is proportional to the thickness of the wire ((OD-ID)/2), and inversely proportional to spring diameteter, pitch,
and length.
It's difficult to advise on the right size of springs to stock up on, as it is highly application-dependent; it might be good to start with a cheap
assortment of small springs, such as this one. For individual 10-packs
of springs, you can also go with Small Parts, although it will cost you more, and you will have to make some
rather arbitrary choices up front.
Spring wire, also known as music wire, is a close relative of springs, and can be used to make tactile sensors, or to wind your own non-standard springs and
tensioners. Because of its elastic properties that make it bounce back even after a significant bending force is applied, it is a far better choice
than common wire varieties for bump sensors and structural components. Assortments are available
cheaply from a number of sources; if all else fails, look for dental
wire used to make braces - same thing.
2.2.5. Ball bearings
The most rudimentary way to constrain a rotating component to a fixed axis is called a sleeve bearing. In this simple arrangement, a cylindrical
rotating part is driven through a circular opening of a slightly larger diameter. With a proper choice of lubricants, this permits rotation in the axis
of this opening only, while introducing only a modest amount of friction. This is often good enough for low-speed, low-load applications - but
sleeve bearings may result in significant power losses or unacceptable wear in more demanding conditions, especially if significant off-axis forces are
present (due to unbalanced loads, gravity, etc). While dowel pins and sleeve bearings work very well for almost all gearboxes, the last stage - with
the load attached to it - may be trickier to design efficiently.
Ball bearings address this problem by introducing an intermediate layer of smooth, rolling balls between the inner rotating element, and the outer frame
in which the bearing is mounted. This allows rotational motion to be transmitted through rolling action with negligible friction even under heavy loads
(example). Ball bearings are not exactly dirt cheap, and so, should be used wisely - but
they are affordable enough to keep a several dozen in continuous stock. Some of my favorite bearing sizes are 3x6x2 mm (ID x OD x H,
link, about $1.00 a piece - only for miniature projects); 6x10x3 mm
(link, $1.50);
8x12x3.5 mm (link, $1.50); and 8x16x5 mm
(link, $1.00). If you want the cheapest option, consider 8x22x7 mm, too - they are
bulky, but because of their wide use in rollerskates and other consumer products, they trade for about 50 cents a piece or less
(link).
All the links above will take you to one of the best sources of ball bearings - VXB. Along with individual bearings,
they routinely carry 10-, 20-, 30-, or even 100-packs at very competitive prices, unmatched by Small Parts. I have a very positive experience ordering
from them, and you should try them out, too.
2.3. Robot-related electronic components
2.3.1. Motors
The selection of motors at your disposal is the single most important factor affecting your ability to bring your ideas to life - and rest assured,
balancing torque, motor size, power consumption, and price is not always trivial. You will probably be interested in low voltage, low power DC motors
- around 3 to 12V, and no more than 30W or so - as going past that point can be costly, dangerous, and is largely unnecessary in small to medium-size
projects. If that's correct, you still have quite a few choices to make.
Brushed motors:
- Vanilla: this is the traditional variety of DC motors - with rotating electromagnets and simple, mechanical commutation to switch said
electromagnets in a sequence corresponding to motor's current angular position. Such motors have three major advantages: they require no particular
external circuitry to run, are widely available in a great variety of shapes and operating parameters (starting with motors measuring less than 4 mm in
diameter - see example), and tend to be dirt cheap - with brand name motors
starting under $1 or so. Their availability, simplicity, and low price mean you can experiment with lots of unique designs without a significant up
front investment.
Their most significant disadvantage is that they run at very high speeds (commonly between 3,000 and 15,000 RPM when idling, self-limited by back
electromotive forces) and deliver relatively low maximum (stall) torques - mandating the use of reduction gears in almost all applications to balance
these two parameters in a more useful way. Other problems include the absence of position feedback mechanisms (external sensors are often necessary),
electrically noisy operation, and the fact that their power-to-size ratio is limited by the difficulty of efficintly dissipating heat from the rotating
armature. Their long-term life is also limited by the wear of carbon brushes - but to be fair, this is seldom an issue for hobbyist work, and more of a
problem for continuous duty applications.
- Geared: these motors include an additional integrated gearbox that reduces RPM, and increases torque proportionately (as per the law of
conervation of energy). These gearboxes typically operate with a respectable efficiency (85-95%), and offer reductions between 20:1 and 400:1. At the
resulting rotational speeds, geared motors can be directly used to actuate a variety of mechanical assemblies in robotic applications.
The primary disadvantage of these motors is their price, particularly for high-quality planetary
gearboxes. Planetary gears are preferred to more traditional arrangements of offset spur gears, because they add very little to the dimensions of the
motor, and can be more efficient under load - but unfortunately, you can expect to see prices anywhere between $20 and $150; Maxon motors, favored by researchers,
commonly fall in the $100-$150 range. Spur gear motors are much cheaper, commonly between $5-$10, but only some of them are worth buying. Many types of
metal gear units (photo) are usually a good investment,
because they are very durable, usually reasonably efficient, and, thanks to the use of hardened steel, pretty compact. Plastic (Nylon) gearmotors
(example) are usually not worth your time: they are large and flimsy, and it's pretty
easy to do better by cutting your own gears to fit a particular application.
- R/C servos: the term refers to brushed DC motors with offset axis reduction gears, additionally coupled with a potentiometer (acting as a position
sensor) and a controller circuit (this picture is a good illustration of
the internals of a high-end R/C servo). The internal circuit is tasked with receiving positional directives from the outside world - encoded as pulse width or
serial binary data on the control wire - and then comparing the requested position with the one sensed by the potentiometer. If the two do not match, the
controller attempts to rotate the motor in the right direction to eliminate the difference.
Servos are extremely popular in hobbyist robotics, simply because they offer a great combination of precision, torque, and hassle-free operation. On the flip
side, most of the low-cost ($4-$15) models are bulky (commonly over 5 times the volume of the actual DC motor used!), and their pots and plastic gears tend
to be pretty flimsy (replacement gears are usually available, but hey). Lastly and perhaps most annoyingly, many of these servos can't rotate continuously to
make a full 360° turn, being limited by the potentiometers used to sense the position - 60° or 180° of freedom is common. A handful of models can
be disassembled and tweaked to permit free rotation (usually introducing a gap where the motor loses positional feedback for a while), but this is not a rule.
More expensive servos (typically priced over $20) may use proper, 360° two-phase encoders or optical sensors, but it's unheard of in more affordable
models - as these feedback mechanisms alone are about 10-20 times more expensive than a simple pot.
Brushless motors:
- Vanilla: brushless motors deal away with mechanical commutation and rotating electromagnets; in this design, the rotor consists simply of a
number of permanent magnets, with no wiring whatsoever. To put it in motion, a set of stationary electromagnets arranged around the rotor is powered in a
specific sequence by an external controller. Current or magnetic field sensing is typically used to synchronize this process with the actual position of
the rotor and avoid vibration or power losses. The advantage of this design is that it's mechanically simple, robust (no brushes to wear out), much less
electrically noisy (no sparking), and most importantly - it does not suffer from the heat dissipation and wiring management issues inherent to brushed
designs, allowing much larger currents to be run through the electromagnets without overheating the motor.
Now, brushless motors have three serious drawbacks: firstly, of all motor types discussed here, they require the most complicated and expensive
external control circuitry / software to run efficiently (only a handful of devices, such as computer fans, come with controllers built in). Secondly, almost
all the reasonably priced models you would be able to find are meant for high-performance R/C applications - so they run several times faster, and sink
several times more current, than their brushed counterparts (10-20 A is common); you can salvage smaller and less power-hungry motors from computer fans or
hard disk spindles, but this is obviously not a convenient and sustainable way of doing business. Lastly, brushless motors that are commonly available still
tend to be pricey, starting at $7
a piece or so. For these reasons, unless you need a unique power-to-weight factor of these motors, I would say you are better off with other options instead,
at least until the landscape changes a bit.
- Stepper: stepper motors are an interesting variation of the brushless motor design: the number of permanent poles on the rotor is significantly
increased, and there are more electromagnet coils, designed to have a fairly high "idle" resistance to prevent sinking excess current when the rotor is not
spinning. No position, speed, or load sensing is provided as such. Steppers are specifically meant to be operated at low RPM in a sequential, indexed mode:
switching the coils in a specific order advances the motor only by a fairly small angle (7.5° or 15° is common in small motors, 1.8° in larger
ones), and the motor holds still in between steps. A simple half-stepping algorithm can double the number of steps possible (at the expense of some torque
loss), while a more complex control circuit can achieve around 10 microsteps per each step by varying per-coil currents.
The primary advantage of steppers is that they run efficiently at useful speeds (0 - 300 RPM), deliver a reasonable torque through the entire speed
range - typically higher than brushed DC motors of similar size and power requirements - and can be used to execute precise and repeatable movements with
no need for extra sensors. Like other brushless motors, they are also very durable. Steppers are commonly used in consumer electronics, such as printers or
CD drives, so they are reasonably easy to get through surplus retailers, with quite a few interesting options in the $1-$3 range.
Their chief disadvantage is that by operating at a low speed, they can't benefit from the back electromotive force equilibrum that limits the current
for fast-spinning motors when no load is applied; a regular DC motor might sink 1A when stalled, but only 100 mA when the load is light; steppers, on the
other hand, can be considered constant current devices. This property might be undesirable in applications where the average load is expected to be low, but
some extra peak torque is required every now and then. A related problem is that because of their high frequency alternating polarity pattern on the rotor,
and high inductance coils, stepper motor torque drops off rather aburptly at speeds over about 300 RPM; going past 1500 RPM is difficult and
largely pointless in most applications; if you want to use reduction gears to increase torque, there is just not that much RPM head room to use.
A bit on the types of steppers you might see: most stepper motors have two independently operated electromagnets (or groups of electromagnets).
To complete a single step, these electromagnets need to have their polarities changed in a specific four-step order; anything else would just cause the rotor
to wobble back and forth. Reversing the polarity of each coil can be achieved with a circuit known as the H-bridge - which comes at a certain additional cost
(e.g., $1.00 per motor if you use 2 * FAN8082 ICs). To
eliminate this extra complexity, some steppers are designed so that each electromagnet has two complementary, opposite coils that can be operated
independently: turn one on to polarize the electromagnet one way, turn the other one on to get reverse the field without the need to physically reverse
polarity of the wires (illustration). In such a design, the motor can be driven with a
much simpler and cheaper transistor circuit (e.g., for $0.20 per motor if you use 4/7 of ULN2003A); but on the flip side, more room is needed to accommodate
these extra coils - so you get less output from a larger, heavier motor.
The first arrangement, requiring H-bridges, is called a bipolar stepper; the second option, with complimentary coils, is called unipolar. Telling them
apart requires some skill: typically, motors with 6 or 8 leads can be driven in either mode, to best suit your needs; motors with 4 leads
must be operated as bipolar, as they have no center taps that allow each coil to be split into two; and motors with 5 leads can be tricky: some might turn
out to be unipolar-only (split coils with center taps connected together), some might be an oddball hybrid with one coil with a center tap, and one without
(this works best with bipolar control).
Well, that's it. The choice is up to you, and it's not an easy one! Servos and geared motors have their advantages, but can easily put a hefty
price tag on any even moderately complex robots - consider, for example, that a typical quadruped walking robot with independent limbs
requires about 12 motors (8 if you are willing to make some major sacrifices); a decent hexapod needs between 12 and 18 actuators. DC motors are abundant
and cheap, so they make more sense from that perspective - but if you take this route, you will often need to design and machine somewhere between 3 and 6
gears per motor, and accommodate a lot of simple sensors to properly instrument the motion of each joint. This process is time-consuming, and gives you many
opportunities to learn from your own mistakes.
All right, made up your mind? To further complicate your life, when comparing the motors of a particular variety, there are several additional
parameters to look at:
- Running speed: the faster the motor runs, the more more complex the gearbox would need to be to bring its output to a usable range -
commonly somewhere between 15 and 300 RPM. From that perspective, a DC motor running at 3,000 RPM is generally better than a motor running at 15,000 RPM:
to bring it's output down to around 50 RPM, the former would typically need 3 reasonably-sized reduction gears, while the latter would need 5.
On the other hand, keep in mind that very low speeds in some geared motors or servos might be just as unsuitable for certain applications. A 5 RPM geared
motor directly driving a wheel would need 6 seconds to complete a single revolution. If the wheel has a diameter of 50 mm, this gives around 0.5 km/h! The
same problem applies to steppers with reduction gears.
- Torque: torque is a pretty simple concept: a motor delivering 1,000 g/cm of torque can lift 1 kg attached to a 1 cm lever - or, proportionately,
50 g on a 20 cm lever. In real life, you almost always want to compare motor torque as a function of RPM: for example, if you need the wheels to spin at
a particular speed, an appropriate gearbox can be employed to satisfy this goal; but a sufficiently powerful motor needs to be selected for the job first.
Hmmm... so we know the no load RPM for for a motor, but in this mode, the usable torque
is exactly zero; and we know stall torque, but when stalled, the motor is rotating at exactly 0 RPM - also not doing any useful work. How to reconcile these
parameters and arrive at something practically meaningful, then?
The thing is, each motor has a unique efficiency curve; when buying surplus units, you seldom can get this data, but for low-power brushed motors, it usually
looks like this. The motor's optimum efficiency is somewhere around 85%
of the no load RPM, at which point, the torque is about 25% of the stall value, and current consumption is somewhere around 20%. You can aim for any other
point on the curve depending on your needs, but power efficiency will suffer; past 60% of stall torque, it will suffer rather dramatically. High momentary
loads are obviously OK (when lifting something, or going uphill), but continuous operation in this region will drain the batteries rather quickly, which
is often undesirable.
In any case, the optimum efficiency is a good reference point: let's try to normalize the torque for a 100 RPM application at optimum efficiency, and use
this for any comparisons. The calculation is relatively simple: consider a motor with a stall torque of 80 g/cm, and a no load speed of 12,000 RPM. Good
efficiency will be achieved at 10,000 RPM, translating to about 20 g/cm of torque; to bring this down to 100 RPM, a 100:1 gearbox would be used (and not,
as no load RPM would imply, a 120:1 one). Factor in transmission losses in the gearbox (10% or so is a good ballpark figure) - and you can expect about
1,800 g/cm of torque at that speed. If this particular gearbox is stalled, you will get 7,200 g/cm peak. What does this means in practice? With 8 cm
diameter wheels, this is enough to slowly but surely haul a massive 4 kg robot up a 30° slope.
Anyway, you can use the resulting formula -
torque_100RPM = nominal_torque * 90% * nominal_RPM * 85% / 100 - to compare motor performance across the
board.
- Dimensions: size matters - long motors will inevitably prove to be difficult to fit inside an actuated joint - and may
end up sticking out and limiting movements in an undesirable way; while wide motors will be difficult to interface to wheels without reducing ground
clearance rather significantly. Changing the axis of a rotary motion is not impossible, but not trivial either - bevel gears are a more complicated 3D
creature that requires some extra skill to design right, whereas regular spur gears are a quickie in 2D; transferring movement using belts, chains, or
racks, is also tricky. So, plan accordingly: short and wide motors for joints, long and slim motors for drivetrains, and above all... the smaller the
better.
- Nominal voltage: it's very easy to work with motors rated for 3-9V, and power them from a single supply with all the digital electronics;
and it's equally easy to find affordable, rechargeable batteries around this voltage to match your desired application perfectly. With higher voltages, the
picture gets more complicated: you will need a separate supply (or pricey DC-DC voltage converters), and may end up having to pay extra for
H bridges or transistor arrays capable of driving the motor without leaking out the magic smoke. Higher voltages also greatly
increase the risk of catastrophic circuit failures - including the possibility of frying the port or motherboard of your PC - when something goes wrong.
So, I recommend sticking to the 3-9V range where possible, and advise against using motors over 12V; keep in mind that 12V motors may need a 16V supply
or so if you take voltage drops across driver ICs (usually about 1.3V), and battery discharge characteristics, into account. Also, if you plan to
venture beyond 24V anywhere in your circuit, you are strictly on your own - you will need to observe safety precautions not covered in this
guide. As little as 30-50V can give a pretty mean shock, and may cause fairly spectacular breakdown of some conductive materials and electronic components,
even at relatively low currents.
To be fair, almost any DC motor will run at a voltage as low as 10-20% of its rated maximum. You can definitely run a 24V motor pretty smoothly off of 9V
or so; but you will see a roughly proportional drop in torque - meaning you could probably be just as well using a smaller, cheaper motor to begin with.
To find good prices on a wide assortment of brushed and stepper motors, look for local electronic surplus and discount retailers. Some very interesting
choices are available from Kysan Electronics, including competetively priced metal gear motors, but
modest minimal order quantities apply (check with them for details). Otherwise,
All Electronics, Electronic Goldmine,
Surplus Shed, BG Micro,
and HSC Supply are excellent surplus outlets. Jameco and
Mouser have first-hand, cheap components in bulk; DigiKey is the third
well-known outlet, but their pricing is usually less competitive; and
Newark is another, with good pricing on some ICs.
Of all these places, Mouser and All Electronics are my favorite destinations - but
all of them are worth checking out.
You won't find many servos and brushless motors in any of these places, though; for these, Hobby King is definitely
the best place to shop. They ship worldwide from Hong Kong at very reasonable rates, but keep in mind that large orders may get some attention from
customs, depending on where you live. Even with import duties added, they would still be much cheaper to shop there than in many of the local outlets,
though.
Oh, a friendly tip: I would generally recommend staying away from robotics-oriented stores, such as Solarbotics,
Robotics Connection, Pololu,
Acroname, and many, many more; it's not that they are bad people, but they often sell the same surplus components
with "robotic" slapped in front of the name, and at a significant premium. They also carry many off-the-shelf components and sensors at a markup higher than
Jameco, Mouser, etc;
for example, you can get
this motor for $23 from Robot Marketplace, $16 from Solarbotics, or just $8 from Kysan
Electronics (the actual factory price is under $3 on orders over 1,000 - so it's safe to assume that all these parties paid this much). One of the
tell-tale signs of a fishy deal is when a store conceals model names or part numbers on supposedly first-hand components, coming up with a designation
such as "Robot Motor 1" instead - and cleverly photographs the items to make the data impossible to decipher from the picture itself.
Anyway - some of my favorite motors currently available on the market are listed below.
Vanilla brushed motors:
- Mabuchi FF-N20PN "8117" ($1.20): one of the
tiniest but still reasonably powerful DC motors I stumbled upon (pager motors are smaller, but deliver negligible torque). Diameter of 10 / 12 mm, length of
16 mm. Around 15,000 RPM, stall torque is around 15 g/cm (equivalent to ~1,800 g/cm with a 100 RPM gearbox), stall current 1.5A when running on 6V. Good for
miniature projects, though power hungry under load. The motor I link to does not match the standard specs available from Mabuchi, so is probably a custom
or discontinued model.
- Mabuchi RF-300FA-12350 ($1.50):
spindle motor commonly used for CD and DVD drives. A fairly powerful, small motor with an attractive form factor. Diameter of 25 mm, 12.5 mm long.
About 7,500 RPM, 30 g/cm (would yield ~1,600 g/cm with a 100 RPM gearbox), 600 mA stall current when running at 6V. A slightly larger but super-cheap
Mabuchi FF-500T-10750 ($0.75!) might be an insteresting alternative for some
larger projects, too: it is 32 mm wide, 16 mm long, idles at 5,000 RPM, and delivers 100 g/cm (~4,000 g/cm with a gearbox) at 9V, 0.4A stall current.
Both these motors are good for walking or wheeled robots.
- Canon EN22 ($1.15) is a nifty, high quality, precision brushed
motor running off of 12V. Diameter of 18 / 22 mm, length of 34 mm. Free speed of 9,000 RPM, about 150 g/cm (~8,500 g/cm with a gearbox) at 1.2A.
A tempting alternative is a slightly chaper
Canon
DN26, measuring 25 mm in diameter and 25.5 mm long. That motor idles at 6,000 RPM, and delivers about 80 g/cm (~4,000 g/cm with gearbox) at an
impressively low 250 mA stall current (12V). Both are very quiet and excellent for medium size projects.
- Nichibo
MD5-2554AS-BB ($1.95) is a very powerful and fast motor for demanding applications. Running at 21,000 RPM with 12V, it delivers around 400 g/cm
(theoretically ~65,000 g/cm with a gearbox, though you would need bulky steel gears to handle this) at over 6A stall current. Measures 28 mm in diameter,
about 35 mm long. A similar motor with comparable dimensions is Molon
CM0-1237 - running at 14V, 13,500 RPM, and delivering around 500 g/cm (~50,000 g/cm with reduction) at 4.5A stall current. Both are good primarily for
powering high-speed mecanisms (e.g. propellers, turbines), or for very large projects where high-capacity batteries or mains supply is available. Where weight
and motor size is an issue, brushless motors could be an equally
power-hungry but much lighter option, too.
Spur geared motors:
- Sanyo 12GN-0348-NA3S and
12GN-0348-NA4S ($7.50): two cheap, extremely small,
robust, metal gear motors delivering about 2,200 g/cm (NA3S) and 3,500 g/cm (NA4S) stall torque, and idling around 100 and 70 RPM respectively, when
supplied with 6V. Dimensions are pretty amazing: around 12 x 10 x 25 mm. You may want to browse the
entire range, too.
Stepper motors:
- Symbol Technologies 21-02485 ($1.00), about 20 mm wide and 12
mm thick. It is a 5-wire hybrid that is best operated in bipolar mode; it seems to handle 9V well, but gets a bit warm during continuous 12V operation.
It rotates 15° per step, consuming about 100 mA per coil. The torque seems to be around 40 g/cm. Not much larger than Mabuchi FF-N20PN, this is quite
a unique bargain for driving small loads - but it might require a 10:1 reduction or so to haul anything heavier around the place.
- Epson STP35NI48SV50 ($3.00). About 35 mm
wide and 12 mm thick. It's a 5-wire, common bus unipolar stepper, 7.5° per step. Runs off of 12V nominally, consumes about 250 mA per coil, and
delivers around 220 g/cm in torque. Can be used to drive appreciable loads with a very modest reduction, and is shorter than most brushed motors you
would be able to find.
Panasonic 42SPM24DGYE
($2.50) is a larger stepper motor, 42 mm in diameter and 23 mm tall. In my testing, could handle 12V. Moves 7.5° per step, needs around 300 mA per
coil. Produces around 600 g/cm of torque!
Servos:
- Mystery servo EM_43g ($3.50) - a really cheap, miniature 6V
servo of acceptable quality, delivering around 500 g/cm of stall torque. Its speed is about 10 RPM with no load.
- Hextronik HXT900 ($3.65) - another affordable, more powerful,
slightly larger servo - 1,600 g/cm at stall, 40 RPM under no load, runs off of 6V. Very popular with hobbyists.
- Hxtronik HXT5010 ($6) - a larger, ball bearing servo capable
of delivering about 6,500 g/cm st stall. It's slow - 8 RPM with no load at 6V. Reportedly can be modified to rotate 360°.
Well, that's it. Again, keep in mind that you need 2-4 motors for most wheeled or treaded robots, around 6-8 for a biped robot, and normally 12+ motors for
fully-featured quadruped or hexapod bots! It is usually better to buy a dozen el cheapo motors you actually expect to have an immediate
use for, than to get one of every type imaginable, or go broke on 20 really nice $40 servos "just in case". To be fair, many robot builders
actually do take that last route, and end up with cool designs that unfortunately cost $2,000 or more. Naturally, if you have enough expendable income,
by all means, get the nicest motors you can find.
2.3.2. Linear actuators (or lack thereof)
For certain mechanisms, life could be easier without motors. A compact electrical device that directly outputs linear motion (thrust) could quite conceivably
be more convenient to use, for example, to operate joints. Alas, linear motion systems are complex, and seldom mass-produced for consumer applications; even
in industrial applications, pneumatic actuators controlled by electronic valves tend to be more common than any purely electromechanical solutions.
There are two minor exceptions, though: firstly, we have solenoids - simple electromagnet and plunger assemblies capable of moving a load attached to the
plunger a short distance back and forth. Solenoids are typically used to operate valves and car door locks. Some models are reasonably sized and fairly
affordable - for example, this push-type or
this pull-type actuator, sell for $2.50 a piece. Devices of this size can
usually lift between 500 and 1,500 g, but seldom by more than 5-10 mm. Other than their small displacement, the main disadvantage is that they are
essentially binary: although the action may be controlled to some extent for a well-known constant load, it's rather difficult to do so reliably.
Another exception is something called a "muscle wire" - an unusual alloy of nickel and titanium that contracts slightly when heated up. This heating can be
induced by simply running a sufficient current through the wire. An appreciable lifting force is generated - up to around 1 kg for 1A wires -
but because the wire gets only about 5% shorter, this travel needs to be amplified (and lifting capability proportionately reduced) in most applications.
The other significant drawback of muscle wire is that it is fragile - it can be easily destroyed by overheating, overloading, or just just getting
caught into something; it also runs hot enough to soften some plastics. It's definitely cool - just not nearly as cool as it might appear at first sight.
If you are interested, Small Parts sells an assortment of Flexinol brand wires, for around $5 per meter.
To some limited extent, synchronized, vibrating piezoelectric elements can also be used to build linear motion systems, as shown in
this animation. Although used in some consumer products - most notably,
in high-end SLR lenses - broad availability of cheap actuators of this type seems unlikely any time soon.
2.3.3. Sensors
A variety of sensors can be used for measuring the outside world, and providing internal feedback on the state of the robot - current position
or movement of limbs, wheels, steering mechanisms, etc. Several types of rudimentary sensors can be built from scratch (e.g., spring wire whiskers) -
but there are limits to what you can do at home. This section covers some of the most useful, commercially available choices to consider in your designs:
- Tactile switches: one of the simplest, smallest, and chapest sensors available. There are three primary applications you should
be aware of: firstly, when placed behind a spring-, elastic pad-, or dowel pin-mounted bumper, they form a great contact sensor, particularly useful for
wheeled robots. Secondly, in conjunction with an rubberized foot (in legged robots) or a floating axle (in wheeled robots), they are triggered under robot's
own weight, and useful for detecting ground contact. Lastly, they are an important internal feedback device for moving mechanisms, if placed so that the
switch is triggered when the assembly is retracted to a particular spot (home position).
A wide selection of microswitches in all shapes and sizes is available from Mouser, as well as all the other outlets
mentioned earlier. Pricing starts at $0.10 or so a piece when bought in reasonable quantities (at least 50 is a good idea). Photos can be deceptive, so be
sure to verify dimensions, trigger force, and button travel, then consider how they would fit your potential projects. In most cases, it makes sense to stock
up on the smallest, low-profile non-SMD switches with low trigger force you can find (e.g., Mountain Switch MS-100589, 6 x 3.5 x 5 mm, triggers on 160 gf),
then some larger but reasonably flat switches with a wide button where a greater pressure-sensitive area is desired (e.g., ALPS SKHCBJA010).
- Optointerrupters, aka optointerruptors, aka photointerruptors: a more expensive class of sensors used primarily for internal sensing, and capable of
detecting the movement of a mechanical element traveling through a slot or directly in front of the device. This works by shining an IR LED on the element,
then measuring the reflected or transmitted light with a phototransistor. Since measurements are made without disrupting or limiting the movement,
optointerrupters in various arrangements can measure speed, relative or absolute angular position, even movement direction, in a very convenient way.
All the mentioned stores carry a nice selection of these devices; for example, have a look at tiny, wide-slot
Toshiba TLP841 ($0.45), ideal for sensing gear position.
Reflective optointerrupters of note include
Optek OP609RA ($0.70).
- Mechanical rotary encoders: like optointerrupters, these devices are meant to measure rotation or angular position without limiting the movement -
but unlike the previous category, they require mechanical coupling, and hence cause some friction. There are two basic types of such sensors: linear
ones, such as ALPS RDC803001A ($1.50), which rely on a heavy-duty rotary potentiometer with several phase-shifted taps to measure absolute angular position
of an attached rotating element whilst allowing 360° motion; and pulsed devices such as Mountain Switch MS-101208 ($0.40), which alternate between closed
and open circuit when the shaft is rotated, commonly producing 12 or 24 pulses per turn.
The benefit of potentiometer-based sensors is that they provide absolute positioning with a high resolution - so in many cases, a single device can replace
an optointerrupter and a home position switch, reducing complexity and improving accuracy at the same time. Wear and power loss considerations aside,
their primary downside is the relatively high price for models that allow 360° measurements,
and the need to interface them to an A/D converter to get the reading. Pulse encoders are much easier to use and cheaper, but provide just speed feedback -
so a home position sensor is often still required.
- Magnetic field sensors: solid-state Hall effect sensors (such as
Honeywell S41, $0.50 a piece), or mechanical Reed switches
(no-name example, also $0.50), can work very much like an optointerrupter,
and sense the position of a small permanent magnet embedded in the rotating element. Their primary benefit is lower power consumption (no need to drive
LEDs), longer lifetime, and the fact they can "see" through plastic covers and work in other scenarios where no direct access to the moving element is
possible. Their downside is that they are easy to disrupt when in direct proximity of motors, speakers, high-current or coiled wires, or other sources of
magnetic fields. It is also usually more expensive and tricky to embed a tiny magnet somewhere, than it is to drill a small hole or mark a reflective dot.
- Distance sensors: distance sensing is a very important task: it not only allows the robot to avoid constantly bumping
into its surroundings, but in more sophisticated designs, can be used to sweep the surroundings to build map out the world in X-Z plane - something far
easier to analyze than X-Y images from a camera (even in camera-enabled robots, such depth maps simplify image processing significantly).
As usual, there are several types of distance sensors: the two most interesting groups are infrared and ultrasound. Infrared is generally cheaper, but has a
limited sensing range, and may be considerably less effective in very bright light. One of the most interesting devices in this class is Sharp GP2Y0A02YK,
capable of sensing objects in the 20 to 150 cm range and pretty cheap ($10 via Mouser). Comparable alternatives for other sensing ranges (e.g., 10-80 cm)
are available to suit your needs; just be wary of "threshold" sensors that simply output one value when the object is farther than X cm, and another
when closer than X - not very useful in robotics.
Ultrasound sensors are far superior - with typical sensing ranges up to 6 meters, and flawless performance even in challenging conditions - but they also
cost more. MaxBotix manufactures a range of neat devices such as LV MaxSonar EZ4 ($25 or so).
EZ4 detects objects from 15 to 650 cm, outputs serial, analog, and pulse width data, and has a very narrow beam with excellent side rejection, ideal for
environmental scanning.
Other, more exotic types of distance sensors are also available - including laser rangefinders - but tend to cost arm and leg (hundreds or thousands of
dollars, that is). In robots equipped with a camera and some spare computing power, the location of a laser dot can be observed directly through the camera,
and used to calculate distances, thanks to parallax (example) - but this can be complicated, particularly
outdoors, where other bright lights may interfere with the process.
- Digital compasses: in most designs, robots can measure traveled distance very accurately, for example by sensing wheel rotation or measuring
distance to a nearby wall. It is far more complicated to keep an accurate idea of the direction the robot is facing, however - as even a very small
angular inaccuracies, say 0.5° after every turn, tend to accumulate and create significant deviations in the long run. Digital compasses come very
handy for correcting these errors, and also helping the robot understand its location after being lifted off the ground, power cycled, etc.
I must sound repetitive, but there are (again!) two types of digital compasses to be aware of: ultrasensitive, solid-state Hall effect sensor ICs, such
as Honeywell HMC1051 ($20); and regular Hall effect sensors sensing the position of a traditional, miniature compass needle in a liquid - e.g.,
Dinsmore 1490 (digital output, 8 directions, $15) or 1655 (analog output, $40). Personally, I like Dinsmore
units because of their daring design - but it's your call.
- Other fancy sensors: some robot designs may have an use for accelerometers (needed to balance dynamically stable robots, and in designs that
are likely to lose contact with the ground often; MMA7361LT is a nice low-cost unit), flex sensors (for measuring deflection, and hence angular position
- an interesting alternative to other types of encoders, but two orders of magnitude more expensive), heat sensors (can be used to detect humans and animals
pretty reliably; surprisingly cheap, too), inclinometers or tilt switches (for detecting terrain features or dangerous operating conditions), GPS modules
(a pricey gadget good for long-distance positioning, but largely unsuitable for accurate positioning indoors), microphones (a pair of microphones can be
used to pinpoint source of sounds in a room), or - of course - digital cameras. But unless you have a specific ambitious design in mind, you probably do
not need to buy any of this just in case.
2.3.5. Integrated circuit glue and MCUs
You probably have your favorite picks in the land of microcontrollers, and if so, there is no need to change old habits. If you don't
have your mind made up, you might want to have a look at
ATmega644P ($7) or the new
ATmega1284P ($8), though. These two very inexpensive chips
operate at anywhere from 0 to 20 MHz (internal oscillator provided), carry 64 kB (644P) / 128 kB (1284P) Flash program memory that can be written without
any expensive programmers (an SPI USB dongle goes for about $20-$30), plus 4 kB / 16 kB data memory (SRAM), and 2 kB / 4 kB EEPROM. This amount
of memory is certainly enough to write pretty sophisticated programs, as long as you do not need to capture and process images, or engage in other extremely
data-intensive tasks - in which case, a more expensive and power-hungry 32-bit chip may be necessary.
Both of the aforementioned Atmel chips come with 32 bidirectional I/O lines, 8-channel 10-bit ADC, and hardware PWM channels, and are available in
PDIP-40
packages in case you do not feel like doing too much SMD work. Both accept a wide range of voltages, and are very power efficient, consuming between 0.5
and 5 mA when busy (depending on clock speed). Perhaps more importantly, unlike several other types of microcontrollers (PIC, ATtiny), they have an
extensive support for open source C development: a fully-functional port of GCC, GDB, libc, libm, binutils, a nice emulator, and even a decent,
dedicated evelopment and debugging IDE. This sure beats manually approximating 32-bit floating point arithmetics in 8-bit RISC assembler.
If chip size is critical, ATmega328P is a narrow PDIP-28 version with comparable specs, but 32 kB Flash, 2 kB SRAM, 1 kB EEPROM, 23 I/O lines, and 6 ADC channels
($4). All these chips are available through Mouser.
For debugging and prototyping more complex algorithms, you might actually prefer to use a regular computer instead. This has some disadvantages - most notably,
an external ADC will be necessary to sample analog signals - but also lets you play with arbitrarily crazy algorithms without having to micromanage interrupts
and memory layout, or prematurely optimize your code to fit on the chip and run fast enough. The easiest way to interface to a PC is through the IEEE 1284
parallel printer port - programs can set and read back TTL-compatible signals on individual pins directly, at megabit speeds, with no need to negotiate,
encode, or time communications in any particular way, unless you want to. This is not the case for any other common I/O port - RS-232 serial ports are slower,
use a specific protocol, and require 15V signalling; USB and Firewire connections require a dedicated controller to negotiate with the host and implement
packet transmission; and audio inputs and outputs can be easily used for digital communications, but only at fairly low speeds. Industrial and prototyping
I/O controllers are another alternative, and more flexible than the parallel port, but also very expensive.
So, if you want to take the IEEE 1284 route, and if your computer does not have the 25-pin printer port by default, you can grab a cheap
PCI
or PCMCIA expansion card instead; just beware of USB dongles that claim
to work as a parallel port - they only emulate a printer driver, but do not provide low-level port access through standardized means at all.
When using MCUs, you will probably benefit from some intelligent way to output status messages and other runtime data; luckily, there is a lot of
pretty, neatly backlit text-mode LCDs based on the well-known HD44780 chip - for example,
NHD-0216K1Z-NSB-FBW-L ($12). The
chip is very easy to interface with using 6 data lines (parallel nibble mode, write-only).
In addition to getting a platform to actually execute the code, you will need some IC glue to make your life easier. Firstly, try to get a good assortment
of generic logic chips - preferably 74HC (CMOS) series, though 74LS (TTL) is also OK. Both these families are easily available from just about any
reputable electronics place, very cheap ($0.15 - $0.35 per chip), and both offer comparable performance and output current capabilities; 74HC has a
significantly lower idle power consumption, better fanout, and is a bit less picky about supply voltages - but for most part, it does not really matter
that much. The only thing to keep in mind is that CMOS and TTL logic voltages are slightly different, so you might need a pull-up resistor for TTL -> CMOS
interfacing, and a pull-down one for CMOS -> TTL when mixing the two systems.
Some of the most useful chips in the 7400 series are basic logic gates (74xx00, 02, 04, 08, 32, 86 - NAND, NOR, NOT, AND, OR, and XOR respectively),
line drivers for controlling small loads (74xx240, 241, or 244), and multiplexers, demultiplexers (74xx164, 74xx165), line selectors (74xx137, 74xx42, maybe
74xx151), and flip-flops / latches (74xx175, 74xx75, 74x259) for controlling more devices than the number of output pins on the MCU.
Some projects may also have an use for counters, 555 timers, quartz oscillators, or assorted op-amps, etc - but this should be fairly obvious.
If your MCU does not have an ADC, or if it's not fast enough or not accurate enough for your needs, you may need to shop around for this part, too.
TLV571 ($5, around 1M samples per second) and ADC0804 ($3, 10k samples) are both decent, affordable 8-bit converters that work in a standalone mode, use
parallel output, have internal clocks, are easy to hook up to pretty much anything. A bilateral switch such as CD4066 ($0.20) can be used to cleanly switch
between multiple analog input lines for a single ADC to keep costs down. Oh, and if you also want to output analog signals, for example to drive a
speaker or control the current supplied to some other device, consider TLC7524 ($3) - a cheap and robust general-purpose parallel input 8-bit DAC; or
MCP41010 ($1.50) - a nice dual 8-bit digital potentiometer with serial input. Couple them with a power transistor and you should be good to go.
Driving motors is another topic that calls for some IC shopping: most MCUs and 7400 chips can output something around 20 mA, which is far too little for
most motors (and some other output devices); using discrete transistors is possible, but not always space- or cost-efficient. FAN8082 is probably the
cheapest ($0.40) full H bridge driver capable of bidirectional control of brushed motors and bipolar steppers up to peak 1.5A at 18V - and even comes with
rudimentary speed control; the only disadvantages of this chip are a relatively high voltage drop (approaching 2V!), and the fact it does not support a
"freewheeling" (high impedance) mode: only forward, reverse, and brake.
Somewhat more expensive TA7291P ($0.90, 2A peak at 20V) supports all four output states; while TLE52052
($3.50, 6A peak at 40V) can drive larger motors. Several dozen similar chips also exist - shop around.
You almost certainly want to grab 10-20 of one of these devices. And for driving unipolar steppers, solenoids, and other power equipment where
polarity reversals are not necessary, ULN2003 ($0.30) and ULN2065 ($2) offer high current capability in a small package (6 x 500 mA at 50V and
4 x 1.5A at 35V, respectively, complete with protection diodes).
In cases where it is desirable to ensure a higher degree of separation between the logic circuitry and the driven load (especially useful with dual
supplies), you might want to look into optocouplers such as H11A1 ($0.40), or a broad selection of miniature mechanical and solid state relays
($0.50 - $2).
An important challenge hinted in one of the earlier sections is the problem of living with a motor that requires a voltage different from all the logic
chips. It is almost always desirable to pick the supply voltage to match the most power-hungry component - the motor - and then adjust the voltage for
low-power chips, rather than the other way round. This is because resistor-based voltage dividers and linear DC-DC regulators, such as LM317T ($0.25) or
L7805 ($0.50), are very inefficient, and therefore, work well only for relatively low currents; wasting few miliamps when driving a chip or a sensor
is not a problem, but 1A for a motor is an issue. Non-linear converters are much better, but simply get expensive rather quickly: 20 mA ICL7660 costs $2,
a hybrid 3A Murata OKR-T3-W12-C is $7, and its 6A variant is $14.
2.3.6. Power sources
The last item on your shopping list should be power sources. For prototyping, I would recommend getting a regulated, adjustable benchtop power supply,
delivering something around 0-15V at 0-5A or 0-30V at 0-3A, depending on your needs. Mastech GPS-3030D
($90) looks like a good choice; just stay away from supplies that do not let you limit current with a separate dial (e.g., Lascar PSU 130), as being able
to do so is a great safety feature - you are much less likely to fry expensive chips due to wiring problems if the supply is temporarily capped at 20 mA,
rather than 3 A.
Once you have your design finalized, you probably want to take it off the tether and let it roam freely. Many designs do well with regular
off-the-shelf alkaline batteries or NiMH rechargeable cells. Voltage aside, be sure to consider two factors: battery capacity (the amount
of time it would be able to supply a particular current), and internal resistance / impedance of the device (limiting the maximum current it can supply).
For commodity batteries of a particular type, the capacity is roughly proportional to battery size, and inversely proportional to nominal voltage; internal
resistance is chiefly proportional to voltage. A typical alkaline AA battery will deliver up to 3,000 mAh (or, expect it to last about 15 hours at 200 mA)
and will have an internal resistance around 0.1Ω, in practice supplying as much as 10A when necessary; D-size cell has a comparable current capability,
but delivers as much as 20,000 mAh. On the other hand, your typical 9V battery is closer to 500 mAh, and has a resistance of 10Ω - that's less than
1A maximum current when you need it.
For datasheets of many common Duracell batteries, see this page; while Wikipedia
provides a good general overview of battery capacities. Oh, and in case
you were wondering: NiMH rechargeable batteries generally have lower capacities than their non-rechargeable counterparts.
In some projects, commodity batteries simply won't do. If you need high capacity at higher voltages cheaply, but don't care much about weight, you can turn to
rechargeable, sealed lead-acid cells; about $20 will get you a 12V in the 7-8 Ah range, or a 6V one around 12-15 Ah - but it will easily weigh about 2 kg.
This may be not a concern for wheeled vehicles moving over flat terrain, but often becomes an issue in pretty much any other use case. You can also shop for
lithium-polymer (Li-poly) rechargeable cells, which tend to be much smaller and about 5-6 times lighter, but usually also several times more expensive. A
good selection of reasonably priced Li-poly cells
can be found via Hobby King -
they have 7.4V 5 Ah cells for about $25 (~300 g), 1.6 Ah ones for $10 (~90 g), and 0.8 Ah cells for $5 (~50 g). A simple charger costs around $5. Li-poly
cells have a tendency to start fires when charged incorrectly, short-circuited, or damaged, so some caution will be necessary. A voltage cut-off IC,
such as MAX8211 + n-channel power MOSFET, or MAX8212 with a p-channel one, is also necessary to prevent draining Li-poly batteries past a certain minimum voltage.
Ultracapacitor "batteries" are another interesting concept - aerogel-based, high power density capacitors in the 300-1,000 Farad range are capable of storing
enough juice to replace NiMH batteries, and have the advantage of low weight, near-instantaneous charge times and extremely low internal resistance (well,
this quickly becomes a disadvantage if you accidentally short them - but resettable PPTC fuses can help with this). Sadly, the price of such a capacitor
easily reaches $50-$150 today; this will probably change.
Lastly, solar cells are an interesting power source, too - used for a number of simple, lightweight robots
(solarbotics) - but don't be led into thinking they are fun to work with: small, cheap (polycrystalline) cells
seldom deliver more than few miliamps at usable voltages unless put directly under a desk lamp, and so you need to make significant design trade-offs,
including storing energy in a capacitor and pulsing motors only every few seconds or minutes, to get anywhere.
Many other ideas for power delivery were floated around and tried in experimental designs, including wireless induction, optical tethers using laser beams
automatically following photovoltaic cells, etc; they will not be universally useful, but let your mind wander every now and then :-)
2.3.7. Standard electronic components (duh)
It goes without saying that you will also need an assortment of resistors and capacitors, a handful of PCB mount potentiometers and trimmers, a bunch
of medium-power BJT and MOSFET transistors, 2.54 mm raster PCB terminal blocks and ribbon connectors, a solderless breadboard or two for
prototyping, and a bunch of perforated or blank PCBs for finished projects (good news - you can "etch" and drill them on a CNC mill with high precision!).
LEDs and regular pushbutton or rocker switches can come handy, too (you want to be able to power down that killer robot when it turns against you, right?),
so do chip sockets (makes salvaging MCUs and other relatively expensive parts from failed designs much easier).
Thin wrapping wire (30 AWG) and insulated magnet wire (32 AWG and beyond) also comes handy for hooking up tiny sensors in tight spots - especially
tricky in legged designs.
3. Working with the software
All right - with the assortment of basic components sorted out, it is now time to start exploring the CAD / CAM software of your choice. This section gives
you a quick overview of the essentials you need to know to work efficiently - but is not application-specific, and by no means exhaustive; you can't
get proficient with these tools overnight... and until you are proficient, you will be given ample opportunities learn from own mistakes. Don't get
discouraged too quickly, and make these lessons count.
3.1. Baby steps with CAD
CAD programs tend to have a steep learning curve: they often use non-standard UI paradigms, coupled with unfamiliar lingo to describe object primitives and
transformations. On top of this, it is somewhat difficult to learn to manipulate complex 3D objects using 2D input devices and 2D projections on the screen.
Let's start with some general tips:
- RTFM: set aside 2-3 days to actually complete all the tutorials, review manuals, and go through the help pages. You need to understand what the
program has to offer, and what terminology it uses. You are not too smart for that, no matter how good you are with computers otherwise. Even if
you have some experience with general-purpose 3D modelling software, you will learn a lot. Believe me on this one.
- Check configuration: go through the settings for your program, and make sure your default settings are sensible. Set units to milimeters,
editing tolerance / accuracy to 0.001 mm or so (meshing accuracy for display purposes can be much lower), minor grid spacing to 1 mm, major grid spacing to
5 or 10 mm, and grid distance to a value comparable with the work area of your machine. Setting linear snaps to 0.5 mm (or 0.25 mm for smaller projects) is a
good idea, so is configuring angular snaps at 15°. For CNC work, I find translucent shading with edge thickness set to 1 pixel to be most useful; but
play around. If the program allows you to set a different color for naked (open) edges that are not joined with any other adjacent edges - and therefore,
probably result in a non-watertight geometry - then be sure to turn it on.
- Learn keyboard and mouse shortcuts: most CAD programs allow you to type in command names instead of selecting them through a menu, using sort
of a mini-shell; learn the names of the commands as you go through the initial exercises, as it's infinitely faster than navigating through multi-level menus
or dozens of toolbars. There are also keyboard shortcuts for disabling and enabling grid and object snaps on the go, changing drag modes, zooming or rotating
viewports, constraining movements, "nudging" objects by a small distance, etc.
- Never, ever approximate: need to reorient or scale an object? You may be tempted to just zoom real close, and drag-and-drop until the effect is
visually acceptable - but in CAD applications, this will come back to haunt you.
Approximations like this will introduce hard-to-diagnose geometry problems: curves that imperceptably self-intersect and therefore can't be
turned into 3D surfaces correctly; open shapes that almost, but not quite form a solid; or other kinks and seams that look OK until something, later on,
goes horribly wrong. Small variations in surface heights also make waterline machining hard to set up. Both CAD and CAM applications do a poor job of
explaining why, exactly, you are not getting the expected result; if things go wrong, you might need to deconstruct the shape and spend a lot of time
checking every single knot / control point - or start from scratch.
So, don't cut corners: all CAD programs have extensive numeric data entry capabilities, linear, radial, and object snaps, "orient on curve" and "orient on
surface" operators, and so forth; all these allow you to maintain accuracy - and you really have to learn them to survive.
- Avoid 3D operations that claim to do all the thinking for you: most CAD programs provide product-selling features to effortlessly tweak
complex shapes: for example, you have tools to calculate intersections or unions of closed geometries, place or move holes, etc; but all this leads to
cummulative dimensional inaccuracies, and sometimes, unexplained geometry glitches. A much safer approach is to break down complex problems into simple
steps, and operate on intuitive primitives (planar curves and surfaces) for as long as possible in the editing process. Bundled tutorials will likely
show you the right way to do it.
All right, ready to get started?
3.1.1. Drawing and manipulating basic curves
Your first goal should be discovering how to draw the following simple shapes:
- A single line segment,
- A multi-segment line (with simple, sharp corners; also see how to close it to form a continuous shape),
- A circle - center point + diameter, between two points, between three points, arc, etc,
- A rectangle - by specifying corners, or a center point,
- A polygon - circumscribed and inscribed, with a specified number of sides.
In most cases, you will be using these splines, and not fancy, ready-made surface or
solid tools, to bring your designs to life. Spline curves are extruded, revolved, lofted, or used as trimming paths to create complex 3D objects
- so fight the urge to experiment with all the spiffy solid drawing commands for now.
Once you have the above mapped out, try entering numerical parameters manually, play with standard snaps and basic keyboard shortcuts, and so forth.
Try to draw a smiley face without the use of your mouse (remember LOGO?). When you are done, explore the following operators:
- Move (proper command, not drag-and-drop in the UI),
- Rotate,
- Flip / mirror around a specified axis,
- Scale proportionately (in all 3 dimensions),
- Scale non-proportionately (in a single dimension),
- Clone / make copy,
- Make linear array,
- Make radial (polar) array.
In particular, understand how all these operations behave for various origin or reference points. Then, check out the following analytic tools:
- Measure distance,
- Measure angle,
- Measure diameter / radius,
- Find center,
- Measure surface area / volume.
Again, practice numerical entry for all the new drawing functions, and see what other options they have. Try to use them to draw a simple shape - for example,
a mock spur gear using a circle, and a radial array of rectangles. Use measurement tools and a calculator to make sure the elements of a radial array are
spaced evenly, and the distance between the first and last tooth is consistent with the remaining teeth.
3.1.2. The inner workings of splines
Internally, curve segments are represented as a collection of coefficients of a polynomial function. The degree of the function defines how complex the
segment may be: first degree segments are just straight lines, and only their starting and ending points may be manipulated; second degree segments can
additionally have a single bend (think parabola), and the shape and direction of this bend can be manipulated by moving an additional control point; third
degree segments can have two bends with two control points; and so forth. In most programs, a single logical curve may consist of several discrete
polynomial segments; the point where one segment ends, and another begins, is called a knot. The important consequence of this is that the direction of a
curve can't change instantaneously within a particular segment; knots that join them are usually smooth as well, but do not have to be: a particular type of
a knot, often called a kink, allows segments to meet at an arbitrary angle with no regard for curvature continuity. A square, for example, typically has four
kinks in the corners, and four first degree curve segments in between. A circle may be implemented the same way, but with second degree segments instead.
Editing curve coefficients manually is not something you'd want to do, so most programs offer two UI-based abstraction layers: one is dragging
control points, generally located outside the curve, to which the shape is "pulled" toward with a force proportional to how far the control point is
(illustration), and possibly also proportional to a "weight" assigned to
that point; some programs use Bezier handles extending from
knots instead (example), but the idea is the same: the curve is pulled toward handle locations.
The other mode is moving around edit points through which the curve must pass, and will be fitted to do so
(illustration). In both edit modes, you will also be shown all the sharp endpoints
(kinks) that terminate segments of the curve, and should be able to drag them around.
All right, this probably sounds overwhelming, but is really important in practice. To understand how curves can be edited, find the following
controls and play with them on some of the simple shapes discussed in previous section:
- Displaying control ("attraction") points, moving, inserting and deleting them,
- Displaying and changing control point weight, if supported,
- Displaying edit ("via") points, moving, inserting, and deleting likewise,
- Adding a kink,
- Changing the degree of a curve segment,
- Displaying curvature and continuity information for a curve.
Also familiarize yourself with these tools:
- "Explode" operator to split a curve at kinks (but not regular knots) - see what it does to a rectangle, to a circle, etc,
- Join operator that merges adjacent curve endpoints to form a single logical curve with kinks,
- Commands that let you draw curves with degrees higher than 1 by specifying control or edit points.
When you are reasonably comfortable with the concepts outlined in this section, see if you can turn a circle into a nice, symmetrical heart by adding
two kinks (if necessary, depending on the implementation) and scaling or dragging around control points. Then, if permited by your CAD application,
try the same with edit points to a new circle. See which editing mode you like more.
3.1.3. Curve reassembly
The two next very important tools for curve and for surface editing are the split and trim operators. Both take two operands: a set of cutting objects, and a
set of objects to slice. The latter selection is neatly cut into separate chunks in the places they intersect the former group. The split operator ends here,
while the trim operator also removes one of the halves (as picked by the user). Remember the gear-drawing exercise earlier on? The trim operator could be
used to remove the overlapping segments and create a proper gear outline. This is how complex shapes are built, so play with this a bit.
In most programs, the trim, split, join, and explode operators are very accurate, often using trimming masks instead of recalculating the entire geometry - and
for most part, preserving the planar nature of edited shapes. Many other Boolean operators and complex 3D editing tools do not necessarily share this
property, so stick to simple tools where possible.
Be aware that the trim operator does involve some computational guesswork, and you will inevitably see it fail every now and then; if so, do not panic:
use the split operator, and manually delete the bits you no longer need. As usual, practice is the key: see how these operator behave with two curves that
share a particular straight segment, slightly overlap or do not fully touch each other, etc. Knowing this behavior will be very, very helpful as you go.
3.1.4. Other useful curve tools
The last three editing tools are immensely useful for CNC work are filleting, chamfering, and offseting a curve. Filleting is applied to a corner (kink) on a
curve - and replaces it with a specified corner radius. The change is barely noticable for obtuse, and significant for acute angles; the significance of this
operation is that it closely emulates the behavior of an end mill in the XY plane, and thus helps create models that conform to the actual CNC output for
snap fits.
Chamfering does roughly the same, but replaces a kink with a straight segment that starts a specified distance from the kink in one direction on the
curve, and ends at a specified distance in another. Chamfering can be used to approximate fillets in many applications while producing a computationally
simpler geometry (so that CAM processing takes less time). Both techniques are also used for aesthetic purposes (to achieve nice rounded or tapered
edges), and to relieve material stresses in engineering applications: chamfered or filleted ribs and protrusions are able to withstand higher shearing
forces without breaking off.
The last operator - offseting - simply allows a curve to be resized in a very useful way: by creating a complementary curve consisting of points at a
constant, specified distance from the original. This is subtly different from scaling, and extemely useful in creating all sorts of thin-walled elements,
such as external enclosures.
| | | : |
| | | : |
| ` \ : |
| \ \ : `-----
|_______ `-._____ \____ `.......
input fillet chamfer offset
Well, that's it - we're done with curves! Well, OK - this is purely optional, but you may want to poke around and explore the other curve tools: stars,
spirals, helixes, etc; non-uniform refitting, blending (like filleting, but giving you a greater control over curvature continuity), extending,
and closing curves; curvature display; and so forth. These features are not needed nearly as often, but knowing them should not hurt.
3.1.5. Creating simple surfaces
This is where it gets good. To get started, draw a closed curve, then find an operator to create a planar surface bounded by that curve. Looks promising?
Next, see what happens if you select two separate curves; and what happens if one is inside another, or partly overlaps it: you should be able to make
surfaces with holes. Examine the failure modes, too: what if one of the curves is on a slightly different Z level? Or slightly tilted? Or not planar at
all? What if a curve is open or self-intersects?
The other key surface-building operator is extrusion. Draw an open or closed curve, and try using this tool to extrude it in the axis perpendicular to that
curve. See if you can toggle the setting for generating "cap" surfaces on the top and bottom: in some cases you need them, in some you don't. Let several
surfaces intersect, and revisit the split, trim, join, and explode operators you previously used on curves. Draw 6 rectangular planar surfaces, arrange
them to form a crude box, and then trim and join them to create a neat, watertight object with no unnecessary internal detail or protrusions of any sort.
Your program probably offers solid measurement and diagnostic tools: ask it to calculate the volume of your solid, and see if everything checks out.
Another three important surface creation tools - less so for designing gears, but for developing organic shapes - are curve revolution, lofting, and sweeping.
The revolution operator allows you to draw a surface by rotating a curve around a specified axis (imagine the curve leaving a trail in space): this is a
common method of creating many cylindrical shapes such as bottles, glasses, cans, and so forth. The lofting operator lets you "drape" a surface over a series
of curve outlines arranged in 3D (think of slicing an object and preserving contours of each slice -
example).
While revolution is relatively simple, lofting definitely deserves 30 minutes of experimentation or so: radial and planar arrangement of the outlines,
various alignment, fitting tolerances and modes, are worth exploring. Lastly, sweeping is an operator somewhat similar to revolution - but causes the
shape to follow an arbitrary path, rather than rotating around a straight axis; common uses include creating spiral threads, cylindrical cams, etc
(illustration). Some programs support advanced sweeping operations between multiple
rails and using multiple profile curves, supplementing lofting - so be sure to investigate.
Again, experiment with these tools, and observe how they behave depending on the type and arrangement of curves used. Also, examine the operators for
extracting edges from surfaces and solids: boundaries, silhouettes, and intersections will be useful.
At this point, you can also play with variable edge chamfering and filleting, edge blending (a more reliable and accurate way to create complex
fillets), hole placement and removal, Boolean operations on solids, cage editing,
orienting objects on a surface, and so forth - but again, do not make a habit of using these functions unless really necessary, and certainly not if
you need to maintain micron-level accuracy.
3.1.6. Managing the mess
The last set of CAD-level tools you need to explore are ones related to grouping, ungrouping, temporarily hiding or locking objects, and working with layers.
The purpose of grouping is to manipulate separate, perhaps non-contiguous objects as a single entity in the UI to reduce clutter - but still have the ability
to open the group and tweak something easily if you change your mind later on: a good example is a stack of gears, where you may still want to be able
to tweak gear spacing without having to resort to booleans, but for most part, just want to move them around as a single thing. A different take on grouping
is a layer - objects on a particular layer (say, "bottom cover") may be assigned a specific color, and may be locked, hidden, or selected by that
association, but can be edited separately in the UI at all times.
Hiding is useful for keeping your workspace tidy without losing data: for example, you might want to hide helper curves used to create a gear,
rather than deleting them, so that you can always pull them back should there be a need to correct an error. Locking, on the other hand, keeps finished
objects visible, but prevents any interaction: accidentally selecting, dragging, or trimming them when you are operating on something nearby.
Many programs also support instantiating objects - that is, creating virtual copies of an object; each instance may have separate coordinates,
scaling, and rotation, but references the same underlying geometry (and all instances will be updated when one of these copies is edited). Instances usually
offer memory and CPU time benefits over creating independent copies of every screw or a gear, so make a habit of using them in more complex projects.
3.1.7. Practice time (and some rules to go by)
Well, that's it! Although your typical CAD application has dozens more 2D and 3D primitives and manipulation tools, the aforementioned set will be likely
all you need on a daily basis. Try to experiment with said features to create simple shapes: bar stool, door hinge, a rubber duck, or a wine glass
are all good starter projects. Once you are done messing around, let's come up with something to feed to a CAM program: draw a simple heart shape,
about 30 x 30 mm. Then, draw a square on the outside, at least 5 mm away from the edges of the heart - and another one, by offseting that first
rectangle by 1 mm to the inside:
_________________________
|.-----------------------.|
|| ||
|| ,-~-, ,-~-, ||
|| / , \ ||
|| | | ||
|| | | ||
|| `. .' ||
|| `. .' ||
|| `. .' ||
|| `.' ||
|| ||
||_______________________||
`-------------------------'
Move this entire set of curves so that the bottom left corner of the outermost square is at (0,0,0). Select the outermost square, and extrude it down to
-9 mm in the Z axis (turn "cap" surfaces off). Then, make a planar surface out of the same curve, and drag the result down to -9 mm again. Next, select
both rectangular curves and create a planar surface in the 1 mm space between them. Lastly, select the inner square, extrude it down to -8 mm, make a planar
surface out of the same selection, and drag it to -8 mm likewise. Select all the created surfaces and join them. Voila - you should have a closed solid for
the mold: a hollowed out box, 8 mm deep, open on top, and with 1 mm walls on all the other sides
Now, select the heart, drag it down to Z = -2 mm, then make a planar surface out of it. Extrude the curve down to -6 mm. Join the two newly created surfaces.
That's it - you have a complete mold: notice that if you machine this shape, pour silicone rubber into it, and then cover it with a flat sheet of
polypropylene, put something on top, and let the resin cure, you will end up with a rectangular negative mold with a heart-shaped cavity, accessible from
the bottom end, and closed off with a 2 mm wall on the top. If we then flip it, pour in polyurethane resin, and again cover the mold with non-stick plastic,
a simple 6 mm thick heart pendant will be produced - identical to the heart resting at the bottom of the original machined mold. Simple as can be.
If you are observant enough, you might have noticed that the CAD heart we created does not have a bottom cap. This does not matter for machining, as this
area is safely hidden from the cutter; but it is better to avoid this where possible, as it hinders the ability for your CAD application to, for example,
calculate the volume of a solid.
That aside, you are probably scratching your head about a couple of other seemingly arbitrary decisions made when creating this shape: for example,
we used a certain distance between the part and the edges of the mold for no obvious reason. Well, when working on your own, you will need to start thinking
about how the part is going to be machined very early on - and then, these details will come naturally. In essence, you simply have to make sure the part can
be realistically made with the tools you have, that it is not going to take too long, and that the result will be structurally sound. Some of the rules
should be apparent after reading the earlier part of the guide: for example, in three axis cutting, you should avoid undercuts (cliff-like geometries that
hang over a void); here's a couple more:
As for structural considerations - in one-part mold designs, you should avoid five fairly simple things:
- Overly thin bottom surface of the mold: at least 3 mm is advisable for 40 Shore A silicones to ensure sufficient strength and dimensional
accuracy; closer to 5 mm for large volume parts.
- Long, tall outer walls with unreinforced sides: if the outer wall holding the resin in is thin, tall, and long, and holds back more than few
mililiters of resin, it will likely deform under load. Mold depths greater than 10-15 mm warrant making the walls slightly thicker in critical sections
(they can also be reinforced later on by gluing a strip of PMMA or other rigid plastic on the outside, but it's messy).
- Very narrow and long molds: if you make a mold 5 cm wide and 20 cm long out of flexible silicone, you will have a significant difficulty laying it
perfectly straight, because the force needed to elastically deform this shape is negligible, and easily overcome by surface friction; adding wider
sections in the center helps (and so does using a ruler if you mess this up).
- Long, thin protrusions reaching back to the surface of the mold: deep, small diameter holes in the rigid positive mold should be machined to end 0.1 to
0.2 mm before the intended bottom of the master (top of the negative mold); otherwise, the resulting silicone protrusion will end up touching the plastic
cover - and if the cover is moved even very slightly, it will deflect to follow. Leaving some clearance fixes this problem. While this 0.1-0.2 mm extra will
leave a thin film at the top of every hole, this film is very easy to remove without leaving a trace.
- Very deep positive masters: pulling out a silicone casting from your CNC master may be difficult if mold depth is higher than 10-15 mm, and all outer
walls have 90° and go straight to the bottom; making the outer walls gently
sloped (1-4° or so), staircased, or simply adding a 6-8 mm thick pull tab somewhere, makes things much easier. Adding a draft angle and
pull tabs is an absolute necessity for mold resins around and over 80 Shore A.
When using silicones in the 60-80 Shore A range, most of these constraints are less pronounced; except for the last one, where the need for careful
mold design increases in proportion to the hardness of the rubber.
3.2. Creating toolpaths in CAM software
All right, this is where the pain begins: if you thought CAD can be counterintuitive, CAM programs will probably make you cry. They are some of the most
unforgiving, sluggish, and buggy applications I have ever worked with; I hope somebody decides to sit down and writes a decent open-source implementation
to shake this market up. Until then, to even understand how to import a project, create a toolpath, and write the resulting NC file, you might need to
read the manual several times over; and if you do not end up having several projects ruined by random glitches, consider yourself amazingly lucky.
Before loading your project, start by configuring the application for your particular machine - which amounts to picking the right postprocessor (or creating
a new one based on something closely related with the NC language reference in hand), and confirming that all the global options are set sanely: arc / helix
interpolation enabled (except when it randomly introduces weird glitches, of course), metric units checked, tolerances similar to that of your CAD
application, etc. If your machine is to be operated using G-code, and the program asks about a "coordinate system" at any point, be sure to set it to G54;
this is the first and default user-controlled coordinate systems - and the only one you will really need to use for hobby work with individual workpieces.
3.2.1. Importing and orienting the geometry
When you're done with the configuration - and only then, mind you - try to import your CAD geometry. Depending on the software, you might need to first
export the data to some other, common interchange format (IGES, DXF, STL); if so, prefer formats that support spline surfaces to these that require conversion
to polygons (if not possible, at least configure meshing to achieve sufficiently close tolerences in this conversion - 0.001 mm is a good idea).
Once you have the model loaded, you need to make sure it is oriented correctly. In 3 axis mold work, it is customary - and usually most convenient - to set
your X and Y origin point (zero coordinates) in the bottom left corner of the workpiece, and Z origin at the top of the block (so that you do not have to
adjust the model depending on stock height - just machine from the top surface down); a different Z0 location may need to be used if you expect to completely
remove the top surface of the stock in between processes, since this takes away the ability to put the Z0 sensor there during tool changes
- but that's a different story.
The actual X, Y, and Z origins will be set later on, using the machine's control panel - but before that, the loaded geometry needs to be oriented
accordingly. Be sure to check where (0,0,0) in the program actually is, and if it is not aligned with the model as expected, move the origin or the
model around. The way to do this is highly application-specific, but is really of critical importance - if you get this wrong, cutting will begin at
an unexpected location: in mid-air if you are lucky, in something expensive if not.
Several simple mills, such as Roland MDX-15 or MDX-20 always use a fixed machine coordinate system with (0,0) in the bottom left corner of the working table;
only the Z origin can be set before sending out the toolpath. For these mills, you need to make sure that your part is loaded into the CAM application at
an X and Y position corresponding to how far from the hardware origin the actual workpiece will be mounted. For this mold, you can just go for X = 10 mm,
Y = 10 mm - we can mount the actual stock roughly at that location later on.
Confusing side note #1872: the rules for rotary machining are different: your mill will have a specific procedure for setting the Y and Z origins to be precisely aligned with
the center of rotation, and the model must be aligned with the Y=0 Z=0 axis to match your stock material and the desired machining strategies. There are
quite a few good articles about this in the jewelry world; but do not even bother with four axis milling until you have a decent success rate with
three axis workflows, as it is harder to follow.
3.2.2. Roughing toolpath
As mentioned earlier, most cutting processes are split into two phases: roughing, which aims to remove bulk of the material as fast as possible, leaving only
a relatively small "margin" in place; and finishing, meant to remove the remaining bits slower and more accurately to achieve a good surface finish. If the
top of the workpiece is uneven (perhaps after earlier cutting experiments), an additional surfacing process is sometimes employed before any other steps,
but this should not apply here.
Most roughing strategies employ a modified waterline approach: the toolpath fills all hollow regions in the X-Y plane for progressively lower Z values;
the fill pattern for each step may be linear, spiral, shape outline offset, or anything else, and may cut only on that Z level, or also move up a bit to
better interpolate slopes; but the idea really remains the same
(image). The most important parameters
for this toolpath are: Z step, the distance between fill toolpaths in the X-Y plane, margin width (the minimal thickness of material to be left in place for
finishing), and machining feeds and speeds.
The first parameter, Z step, will put more stress on the cutter when set to a high value, may cause some chipping, and will increase the amount of material
left behind at the bottom or in staircase patterns on sloped surfaces; very low Z step, on the other hand, will just make the cutting process unbearably
slow. For RenShape 460 and a 3 mm cutter, 0.5 - 2 mm makes sense; in our case, 1 mm is probably optimal.
Toolpath distance has a similar effect, but in another plane. The value simply needs to be lower than the diameter of the tool, otherwise the toolpath
may not make any sense (and your CAM program may opt not to warn you about this subtle detail); 1-2 mm should work well in our case.
Next, margin size should be set so that the cutter can still machine most of the narrow spots on the mold - not necessarily all of them, but as discussed
earlier, bulk of the work should be done in the roughing pass. Be careful: if a slot on the mold is 4 mm wide, the cutter is 3 mm, and margin is 0.6 mm, the
region will be left uncut (3 + 0.6 * 2 > 4). It is tempting to set margin to 0, but heavy cutting tends to leave tool marks - so in most cases,
leaving around 0.3 - 0.5 mm makes more sense; 0.3 mm is my recommendation for our sample mold. Here's a nice trick, too: if the program does not have a
specific setting to define a margin, simply edit the tool to add 2 * margin to its declared diameter; and offset the toolpath by
margin up in the Z axis (or even move Z origin up manually on the machine). The effect will be exactly the same; just be careful not to
accidentally propagate these values to other processes that are not meant to have a margin.
The next part of the puzzle are machining speeds. For roughing RenShape with small diameter cutters, RPM can be usually set to the maximum value; for
our 3 mm bit, feed speed should be set to about 3,000-4,000 mm/min at 12,000 RPM, or proportionately less if the maximum RPM is lower. If your
application supports specifying lower feed rates for material approach movements, you should set this speed to 70-80% of the primary value (hard or
abrasive materials may require 30-50%, but PU boards don't).
Conventional (up cut) machining strategy is advisable for roughing and finishing in PU boards, for the reasons explained in the previous section (better
dimensional accuracy); but meander mode is also acceptable for roughing with a safety margin, and will speed things up for linear toolpath fill
patterns.
Next, there are various application-specific settings you might need to tweak, including selecting the area to machine, so that only the inside of the mold
is worked on, and the program does not concern itself with the external shape of the box we imported from CAD. Just pick a rectangle somewhere on the 1 mm
"flange" of the mold, and you should be fine; but watch out for traps. Try to understand how the program interprets cutting boundaries - there are three
possibilities:
- The center of the tool needs to stay within the selected region (so, a region extending one radius length outside the boundary will also be profiled),
- The entire tool stays within the boundary (keeping the center of the tool at least one radius away from the boundary curve),
- The tool may go outside as long as it touches the boundary - up to a full diameter of the tool.
In some programs, this is configurable; in others, the meaning of a boundary changes from one cutting method to another (ugh!).
Also look out for settings that let you specify part sampling accuracy (0.05 mm should be enough for the roughing step), or define toolpath entry and exit
strategies (for plastics, often best turned off, as they only add machining time). If you stumble upon anything puzzling in your application, just drop
me a mail and we can try to figure it out.
3.2.3. Finishing toolpath
The roughing phase leaves some material uncut, and there are three components to this:
- The expected margin left on purpose on all surfaces for finishing,
- Some extra material up to Z step height on the horizontal and sloped surfaces whenever the waterline step is not aligned with the geometry
of the part,
- Completely uncut holes / slots where the current tool should fit, but
tool + stock did not.
Fixing all this requires some creativity, depending on the shape of the part. In most molds, the first step is to repeat Z level cutting (this time,
without filling the X-Y plane) with a zero margin; Z step should be reduced to capture all vertical features of the component and trace around them fully, as
explained in section 3.1. This operation generally fixes the first and third issue on the list above.
The next step is to machine all horizontal surfaces to correct the second problem. This is done with parallel X, Y, or spiral projection profiling of the
inside of the mold, usually with a toolpath stepover of 20% of tool diameter or so. When doing this, keep in mind that the region within one diameter of the
tool from any vertical protrusion is already machined as a result of the earlier finishing step. Since touching these walls again with a cutter moving
sideways can only negatively affect surface finish, adding a matching X-Y margin (but no Z margin!) to this operation is a pretty good idea; if controlling
X-Y margin separately is not supported by your CAM program, you can use the trick suggested in the previous section: lying to the program by increasing
the specified tool diameter (and in this case, not touching the Z origin at all).
In deep molds with vertical walls, lowering RPM for both these steps may be desirable to avoid chatter; if you notice fine, spiral scratch-like patterns on
some walls, you should probably have done that. Another potential cause of such a pattern may be too much material left at the bottom of the mold,
causing the final Z level to involve heavy cutting; a way to prevent this is to swap the two steps outlined above - but keep in mind that if this is done,
a correct X-Y margin must be set correctly to avoid trouble.
The remaining steps depend on the specifics of your mold. Angled slopes might need to be re-machined using a suitable strategy (3D pattern draping often
works well, but so do linear movements parallel to the slope); ball cutter may be useful for this purpose, too. If your mold features any holes with a
diameter exactly matching the diameter of the tool, you will probably also have to add manual drilling steps, or at least double-check that the program
has bothered machining them. Finally, progressively smaller tools may need to be employed to finish specific regions, such as tight corners, small diameter
holes, or fine surface patterns. In this particular case, you might want to re-machine the fillet on top of the heart: if so, a 1 mm tool with 10 mm reach,
operated at about 900 mm/min, 12,000 RPM, with waterline Z step of 0.25 mm, should do the trick.
If a particularly fine finish is required, especially with larger tools, lowering feed speeds to 30%, using unidirectional, linear toolpaths, and perhaps
reducing RPM a bit (to 80% or so), is often a good idea.
Another random tip: when making deep cuts with limited chip removal opportunities using small, long-reach cutters (say, 1 mm diameter tool cutting an 8 mm
hole 1.5 mm in diameter), finely powdered chips may end up getting compressed by the neck of the cutter, and effectively reduce hole diameter by deflecting
the tool. A good way to minimize this problem is to machine the hole twice.
3.3.4. Final sanity checks and exporting toolpaths
Measure twice, cut once: since there are quite a few parameters you need to keep track of, always double-check your work before sending it to the machine;
5 minutes will save you a lot of grief:
- Do the toolpaths look OK? Are all the regions machined as expected, on all Z levels? Is the sequence of operations correct?
Are there any toolpaths in regions where you would not expect them to be - e.g., outside the mold? Do the toolpaths enter all the
tight spaces as expected, or do you need to adjust sampling accuracy? Run a simulation if supported by your program, or examine the paths manually,
layer after layer, if not.
Even if your design is perfect, CAM programs have annoying and inexplicable bugs: for example, I had one of the programs tested
ignore a large and well-defined part of the geometry for a specific part sampling tolerance setting, and just plow the cutter through it during finishing;
tweaking this value 0.001 mm in any direction would make the glitch go away.
- Is the tool moving above the workpiece? In applications that require you to specify rapid movement height manually, confirm that
it is actually set to be above the entire machined geometry; Mayka and DeskProto seemed particularly tricky in this regard, while VisualMILL is nice enough
to support auto-detection of a safe movement distance.
- Are the toolpaths reasonably efficient? Is there a lot of back-and-forth movement between regions, unnecessary tool retractions, etc? If yes, try
to split the cutting process into smaller steps, adjust sampling accuracy, turn off special entry and exit strategies, turn on optimizations and sorting,
etc. Erratic operations here may easily double the machining time - no joke.
- Is all the numerical data entered correctly? Re-check the maximum depth of generated toolpaths versus tool reach. Are all the feed speeds and tool
diameters as expected? It's quite easy to enter 600 RPM instead of 6,000, or use a margin-adjusted tool for finishing.
- Do you have everything covered? Are all the regions that need special machining accounted for by the right combination of extra finishing steps?
It's easy to overlook a single hole to drill, and it's really annoying to discover this two days later, when you are ready to assemble your prototype.
If everything checks out, you need to get the toolpaths ready for cutting. In some programs (e.g., Modela Player), the output is done directly from the
application - in which case, nothing needs to be done right now. In many others, the data is written to a text file, and that file then needs to be sent to
the machine using a separate utility (e.g., VPanel); if so, export ("post") the toolpaths now.
4. Making parts
Well, yeah - let's make some stuff already!
4.1. Milling
First, we need some stock material. For this mold, the workpiece should be about 6 x 6 cm, and at least 15 mm thick - though the beauty of this process is
that you can use a larger or thicker stock, and the amount of cutting does not change. Just grab a square piece roughly 6 x 6, sawed off from the
prototyping board at hand. Then, dust off the table and the workpiece, and use 3-4 thin strips of double-sided tape
(as discussed in the previous part of this guide) or any other mounting system to attach it to the table - securely. When mounting the stock, you need to
make sure that both the bottom left corner and the top right one are within the area the cutter can move to (which is smaller than the actual size of the
table - check manuals); that when fully retracted, the tool can clear the workpiece comfortably; and that it has enough movement in the Z axis to reach to
the lowest point you intend to machine. You can use a "booster" block of prototyping board if the stock is too low or otherwise hard to mount, and then
use several drops of instant glue (for PU) or another strip of tape (for machinable waxes)
to attach the actual workpiece to this block. If your machine has a rotary axis, a
tool changer, or any other features that the cutter or spindle assembly could collide with, make sure this will not be a problem, too.
Finally, hook up the mill to the computer, mount the right mill in the collet, and turn the power on. Set the coordinate system to G54 if applicable, then
use the bundled software or a hardware control
panel to set the X and Y origins about 2 mm from the bottom leftmost corner of the stock (i.e., slightly over the workpiece); and Z origin at
the top of the part. You
can use a Z0 sensor, or - if the machine does not have one - simply grab a thin strip of paper and hold it under the cutter to spot the right moment while
carefully lowering the spindle using the control panel (no refunds on your fingers, so affixing it with some tape may be a good idea instead).
Every time you want to output any data to the machine, there's one more important thing you always need to check: that the tool is above the workpiece
in the Z axis. If it is not, perhaps because you aborted a previous cutting attempt or tried to check something outside the milling envelope, sending a new
toolpath will likely cause the cutter to plow through the part on its shortest way to the next destination. Some CAM programs know to avoid this, or can be
instructed to do so by manually entering some G-code to retract the tool first - but it's not a rule, so don't bet any money on this.
Anyway - let's start cutting! Some mills allow you to adjust cutting speed dynamically, using a hardware jog dial or some sort of a
software slider; if so, make a habit of dialing it down to the minimum setting before starting a process, and ramping up the speed to 100% once you
see the cutting takes place in the expected spot and in a sane manner. In any case, hold your hand on the "abort" button, grab some eye protection, stand
clear of the table, and... hit "send"!
With any luck, several minutes later, you should have the mold ready; if a tool change is necessary halfway through the process, be sure to vacuum off
the chips and redo Z0 sensing for the new tool. Forgetting that last step can be an expensive mistake.
There are several things that can go wrong, but should be pretty self-explanatory: if the machine starts cutting at an unexpected location, or too high / too
low in relation to the workpiece, you probably messed up CAM model alignment or setting X, Y, and Z origins on the machine. If your tool breaks while
cutting at the expected location, you probably used incorrect RPM, feed speed, or cutting depth parameters. If the workpiece comes loose (which, by the way,
you do not want to happen - really, with industrial machines milling metals, people have died this way), you need to do a better job attaching it.
If the machine stops suddenly, you probably overloaded it, or it couldn't
communicate with your PC - perhaps because of incorrect port settings, or the power save mode kicking in. Incorrect dimensions of the machined part are usually
due to installing the wrong cutter. If you run into any problem you can't figure out, feel free to drop me a mail, and I'll do my best to help.
You are probably anxious, but before turning off the mill and removing the part, vacuum off some of the chips again and carefully examine the result,
with a flashlight if necessary: were all the areas machined exactly as expected? Anything that needs to be retouched? When you turn off the machine and
remove tha part, there's no going back - the alignment of the workpiece is lost, and will be very difficult to accurately restore.
4.2. Casting negative molds
Let's assume the mold looks roughly the way we wanted it to. Clean it thoroughly, and when necessary,
use a soft brush, an airbrush, or canned air to remove any dust from hard-to-reach spots. Measure and inspect the
mold surface carefully:
is the finish silk smooth? Are there any visible toolmarks on horizontal surfaces? What about vertical ones? If you notice any
unexpected dings or other issues,
stop now and do some extra testing, perhaps using an even simpler model (something that takes under a minute to cut is a good idea). Check
if the results gets better if you attach the workpiece more robustly? If RPM or feed speed is lowered? If CAM margins are tweaked? The importance of these
factors is often machine-, material-, and tool-specific - and this is your best chance to figure it out. If you ignore any potential problems and move on
to more complex molds, you will end up with simply too many variables to sort this out later on.
If everything looks as expected, apply a release agent to the mold next, as discussed in the previous part of the guide.
For preparing silicone molds, one light round with Stoner A324 or wax seems to be enough, and even if you do not use any demolding agents, you should
be fine in most cases; for polyurethane molds, I strongly recommend applying one or two coats of wax, followed by A324 - otherwise, the mold and the
molded part may fuse together and form a nice, decorative paperweight.
Applying the agent is pretty simple: distribute it with a brush or spray it on, taking care to cover all the surfaces from all angles. Let it dry
(this can be accelerated with compressed air, heat, or vacuum), then proceed with subsequent applications if necessary. Also note that waxes and
several other solid releases can be buffed out to a shine with a soft brush or a piece of cloth, so be sure to try it out.
Next, you need to prepare and mix an appropriate amount of resin, taking care to avoid cross-contamination of the components.
Your CAD application should have a tool to estimate the volume of your model; subtract this
figure from the volume of a solid box with the same outer dimensions as the (virtual) workpiece to get the volume of resin needed, multiply it by specific
gravity of the rubber (usually around 1.1 g/cm), and add about 30% as a safety margin. This last part is important: some material will stay in the mixing cup,
some will probably spill outside the mold - especially during degassing - and some extra is required simply so that the the mold can be
gradually covered without trapping any air underneath. With the volume calculated beforehand, prepare your workplace, measure the appropriate amount
of the first component into a cup able to hold at least 3 times that volume, start a kitchen timer, add the second component, and mix thoroughly for about 2
minutes with a tongue depressor, a chopstick, or other durable tool, scraping sides and bottom of the container regularly, and changing directions and
angles every now and then.
It is best to place the mixing container on a scale and weigh the components directly as you pour them; pre-weighing the desired amount in a syringe is also
OK, but doing so in a separate cup is too error-prone: several mililiters will always cling to the walls, depending on the shape of the container and
the viscosity of the resin, and it's very difficult to account for this.
After mixing, degass the contents of the cup for about 3-4 minutes, watching the process to make sure the material is not overflowing (release vacuum
several times in a row if it is; depending on the geometry of your vacuum chamber, shaking or spinning it carefully may help, too). For some resins,
particularly polyurethanes, you might find that results are better if you also degass the components individually before mixing; but in many cases, a single
round should be enough.
If you do not have a degassing rig, obviously skip some of the above; in this case, you will need to be extra careful not to mix the resin too virogoursly,
as to avoid introducing bubbles. If this proves to be difficult, here's a cool trick: put the silicone in the fridge before and after mixing for
20 minutes or so; as the temperature decreases, viscosity increases sort-of linearly, but cure speed drops exponentially - allowing more time for bubbles to
rise to the surface of the cup. Never cool down polyurethane resins, though: components may crystallize and alter the chemistry - and even if this does not
happen, condensing water will turn the resin into a polyurethane foam later on.
In any case - let's assume you have the resin mixed and free of bubbles at this point. You can put the mold itself inside the vacuum chamber, pour about
1/2 of the required volume evenly over the entire geometry, put the mold on a sheet of aluminum foil, and wrap the foil to form a makeshift flange around
the cavity - so that when the liquid rises under vacuum, most of it stays where it's supposed to be. Next, put all this under vacuum for about 2 minutes,
and slowly release the valve at that point (you do not want the remaining bubbles to punctured and then filled with the air rushing in - you
want them to peacefully collapse, instead - and this means giving it a minute or two).
When done, put the mold on a flat surface on your workbench, and pour in the remaining resin.
When working with transparent silicones, you can now give it about 1-2 minutes for any residual air bubbles to rise or collapse back into the solution,
while you suck out any larger pockets of trapped air (should there be any) using a syringe and a stub length needle (paying special
attention to any tight spots in the mold - use a flashlight to inspect them if visibility is poor).
If you do not have a degassing chamber, or if the mold is too big to put there, the procedure is again
slightly different: gently and slowly pour the resin in a single, deep spot in the mold, trying not to trap too many bubbles in the process; inevitably,
you will end up with some, so force them out with a syringe filled with some extra resin. Non-transparent silicones are more difficult here, because you
will need to learn where the bubbles are likely to be stuck and pinpoint them blindly - it's not impossible, but you need to learn this by trial and
error.
Well, that's it! Cover the mold with a piece of plastic (preferably also treated with mold release), put something flat and heavy on top of it, then
stop the whole thing from sliding off by resting something by the edges of the cover. Covering the mold to avoid air entrapment is a bit of an art
form by itself, but after several hits and misses, you will get it right: the trick to be gentle, slow, and to start at one of the edges instead of just
dropping it centrally. You also need to make sure that the cover is not electrostatically charged after wiping it and applying the mold release earlier
on - touch it to the tin foil flange around the mold, or somesuch.
When done, wait several hours until the leftover resin in the mixing cup gets safe to touch, then move the mold to the oven set to
35° C for 1-2 hours. Silicone molds can be removed from the master at this point, and laid flat first at 50°, then at 80-100° C for the
final cure (1 hour for each step); for polyurethane rubber molds, see the curing tips in the next section instead.
Pressure pot may be used while the resin is curing, too, but unless you are dealing with a particularly tricky mold or a particularly high-viscosity resin,
it's usually not necessary.
With silicones, about the only problem you can run into is just poor cure, with the surface of the mold being tacky, or - worst case - the entire mold being
soft and gummy. These problems can be caused by insufficient mixing (especially if it occurs in strips or patches), incorrect mixing ratios (polyaddition
silicones are very sensitive to this - measure carefully), or cure inhibition due to contact with incompatible chemicals (especially liquid dyes, certain
types of rubber, and foodstuffs). If this happens, to rescue the master, first put it at 50-60° C for a while, to see if the remaining resin is
inclined to cure. If not, wipe as much of it as possible, then use naphtha to dissolve the rest.
Another less likely problem is that some liquid additives may also cause premature cure of the material, rendering it thixotropic and impossible to pour
into a mold; but this will be obvious early on. All in all, the number of problems you are likely to run into is limited... and if things go south, again,
don't hesitate to ping me.
4.3. Making polyurethane castings
In principle, the process of making polyurethane parts is roughly the same as working with silicone: you start with a negative rubber mold, treat it with an
appropriate mold release, mix and pour in a resin, and then cover it with non-stick plastic to cure.
Polyurethane resins come with a couple of extra gotchas, however.
First of all, most ABS-like resins, and transparent ones in particular, are highly moisture sensitive - so you need to make sure that the mold is
perfectly dry, and avoid touching it with bare hands. The best way to avoid trouble is to place silicone molds for 20 minutes at 120-150° C, then
remove them while wearing PVC or latex gloves; silicone has a fairly poor thermal conductivity, so this should be reasonably safe - but use thicker gloves
or a tool if in doubt, as there are no refunds in case of horrible, disfiguring burns. Next, apply mold release to a still hot mold; and then cool it
down quickly to room temperature using a fan (do not put them in the fridge and do not use freeze sprays, as this promotes condensation). Five extra
minutes under vacuum to be safe - and at this point, you should be able to get a high-quality polyurethane part from that mold.
Now, molds made out of polyurethane rubber can't be baked the same way - but placing them at 60° C for 50 minutes, then allowing them to cool down
for another 20 minutes before removing them from the oven and putting under vacuum for a while, should work pretty well.
Mixing the resin also requires clean, dry cups and mixing tools; treating them with a small amount of mold release makes it easier to clean up and
reuse the equipment, so this is a good practice. Be sure to reuse the mixing sticks, too: once they get a coat of cured resin, they become more durable
and less likely to absorb moisture or other contaminants. Oh, and before measuring the resin, be sure to thoroughly stir each component in its original
container (most easily, by simply shaking and inverting it - but make sure it's closed tightly, and exercise caution anyway): the additives present in some
compositions tend to settle out of the solution in storage. After pouring the resin, sealing the container with inert gas is a good idea;
leaving it open, waiting to be knocked over, is a pretty bad one.
If you want to add color, dry pigments usually need to be dispersed in a small amount of isocyanate or some plasticizer first (0.5 to 1 g is a good
starting point), and only then added to the remainder of the resin; caking can be a problem otherwise. Pigments and fillers also tend to absorb moisture,
so baking them alongside with the mold is not a bad plan - in fact, certain types of fillers, such as pecan flour or Kevlar flock, simply must be subjected
to this treatment.
A drop of acetone or ethyl acetate may be added to the resin while mixing to aid degassing, especially in higher viscosity compositions with short pot
life, but is not always necessary. For non-transparent resins, several grams of zeolite, pre-baked at 150-200° C shortly before the casting process,
may help with humidity-related issues, too.
The pot life of your resin is probably between 5 and 20 minutes, and you need to be done in about 60% of that time or so (the exact figure depends on
the cure profile of the resin). This isn't much - but on the upside, the viscosity of a typical polyurethane resin should be much lower than that
of the silicone, so it can be mixed, degassed, and poured more quickly. You will need to test the limits, and sort out the workflow, with some trial and
error, though: even something as trivial as making sure you have a place to put away dirty syringes, or can grab a paper towel with one hand, will have a
tremendous impact when every minute counts.
The idea is to mix the components for about 1 minute or so (very thoroughly, changing directions and scraping sides of the container several times over),
degass the resin in the mixing cup for 30 seconds or so (until it collapses), pour part of the resin into the mold (use a syringe to apply the resin to a
more complex shape if you don't have a vacuum rig), degass the mold again for a brief moment, take the mold out and lay it on flat surface, then pour the
remaining resin, making sure there is some excess to form a convex meniscus and push away any residual bubbles in high-viscosity resins. If too many bubbles
are still present, using a syringe to push them out is a good idea, too. When you are done, simply cover the result with sheet plastic
(necessarily treated with mold release) and apply some weight on top (100 - 200 g is optimal - you do not want to squish the mold).
You should be aware that some polyurethanes are a bit tricky to mix, as they undergo a phase change: the components may initially form a
milky dispersion, and only as the reaction progresses (30-60 seconds maybe), form a homogenous solution. If mixing is stopped earlier, this may have adverse
effects on the final part. Experiment a bit; if your resin exhibits this property and has a pot life that makes 2 minutes of mixing impossible, consider
getting a magnetic stirrer and continuing the mixing process under vacuum, as discussed in the previous part of the guide. You can then put the whole
thing in a pressure pot, where it needs to stay until the resin is reasonably hard.
The optimal curing schedule for polyurethane resins is usually roughly similar to that for silicones, but always check the datasheet: for example,
polyurethane rubbers often require lower post-cure temperatures than rigid plastics; also, some rigid plastics become significantly tougher if post-cured at
a high temperature (100° C or so), while some simply get more brittle as additional cross-links are formed between the polymer chains.
The usual accelerated cure protocol may be to wait 2-3 hours for the resin to harden (this will take much longer in cold weather), place the mold at
30-40° C for the next two hours, allow it to cool down after that; demold components, place them in the oven, set the temperature to 50-60° C for
30-60 minutes, and 80-100° C for 2-4 hours.
Before handling polyurethane parts after heat-accelerated cure, always allow them to cool down slowly: like almost all plastics, but unlike silicones,
they are fairly soft at high temperatures. This not only means they need to be handled with care to prevent simple mechanical damage, but also that creating a
significant temperature gradient may cause warping due to uneven thermal expansion in this vulnerable state.
The likelihood of trouble when casting polyurethanes is quite a bit higher than when dealing with silicones, and chances are, your first casting will not be
perfectly right; don't get discouraged - because of the shorter working time and greater sensitivity to contaminants, the process takes some skill to carry
out flawlessly; and even as you get familiar with all this, you should probably expect a 5% rejection rate for molded parts. Air bubbles are one of the
most significant issues. While an occassional small bubble of air does not necessarily ruin a large part, an unfortunately positioned one may critically
weaken a tiny gearwheel, or be an aesthetic blemish in a transparent component.
In industrial settings, bubbles are commonly avoided simply by applying a significant pressure to the curing system, thus forcing any voids to collapse,
and gases to dissolve back into the resin - but as discussed earlier, getting a pressure pot is a complex decision. If you prefer not to,
your best bet is to learn about common failure modes and try to avoid them, instead. In general, bubbles can be divided into several classes:
- Voids at the bottom of holes and in slot corners: similar to what can be seen in silicones, this is caused by air entrapment
when pouring the resin. Can be avoided with a more careful pour, by using a syringe or a stick to apply the resin to problem areas, or by in-mold degassing
under vacuum.
- Medium-size bubbles near the top of the mold: single bubbles around 1-3 mm in diameter are usually attributable to air entrapment. In covered,
single-part molds, such bubbles may also get trapped when the cover is put on without due care, or over too little resin. In closed multi-part molds,
another reason for large bubbles is that there were no appropriate vent channels to allow the air to escape and be displaced with the resin.
- Large tear-shaped bubbles: in covered single-part molds, these usually appear near edges of the
mold when excess pressure is initially applied to the cover
(forcing too much resin out), and then removed, allowing air to be sucked back in. In multi-part molds, when appearing around mold parting lines, they
usually indicate resin leaks. If seen in large numbers and rising from the bottom of the mold, they may also indicate a very significant chemical
incompatibility with a pigment or other additive, or excessive curing temperature. Several extremely sensitive transparent resins may respond
with giant, oddly-shaped bubbles to residual moisture or very low curing temperatures
that permitted trace moisture to be absorbed from the surrounding materials before cure - but most compositions don't.
- Small bubbles all through the resin (foam-like): in low viscosity polyurethanes, such sub-milimeter bubbles are typically a sign of pigment
contamination (moisture), poor mixing, or incorrect mixing proportions. In very high viscosity resins (thixotropic, etc), this may be indicative of
insufficient degassing, but this is uncommon.
- Clusters of tiny bubbles (frothing) on the top surface: poor degassing, resin exposed to air (and your breath in particular) for too
long before the mold was covered. Disturbing the resin while it's still curing and tacky may also nucleate bubble formation in places where it would
normally not occur; foam clusters appearing near mold edges, for example, are typically caused by accidentally bumping and moving the cover a bit during
the first minutes of cure. Sometimes, low room temperature during the cure may also contribute to this problem, allowing the resin to stay liquid for too
long; 20-25° C is preferred, so a space heater is often an unexpected solution to this problem.
Other issues you may run into include cure inhibition when exposed to certain mold materials (uncommon, but affecting some resins such as Innovative
Polymers OC-50xx, which happens to be sensitive to platinum-cured silicones), parts too soft or too brittle after full cure (bad mixing proportions -
forgetting to tare the scale is a common culprit; bad cure schedule may also be to blame), patches of uncured material or varied color (insufficient mixing),
small clumps of pigments visible (pigment not dispersed properly), pigment settling out of the solution (mostly a problem with powdered
metals, glass, glitter, and other large and heavy additives - using more finely powdered dyes or higher viscosity resins usually helps), or pigment
changing its color after mixing (chemical incompatibility - tough luck). I might have missed several corner cases; as usual, if you stumble upon something
that seems hard to explain, feel free to drop me a mail, I will be thrilled to help.
Still, assuming things worked out as expected, you now have a cheesy heart-shaped pendant in your hand; keep it to as a reminder of how it all started :-)
Then, make a couple more and test their properties: see what happens if you hit one with a hammer, drill a hole through another, sand or polish their surface?
Test any other resins you might have, and examine their properties. You may also want to play with controlled errors - try
to use a ratio 30% off the recommended figures in one test; add a drop of water with a detergent in another; how much tolerance does this resin have?
What are the usual symptoms of trouble? The more you know about this before embarking more serious projects, the better.
5. Assorted mechanical engineering notes
5.1. More complex mold types
Several fundamental problems in mold design were discussed in section 3.1.7: say, the need to ensure minimal bottom thickness, reinforce thin walls, reduce
length of thin protrusions, or add pull tabs for deep geometries. This is essentially all you need to know for flat, one-side molds - but there
are some cases where more innovative approaches are necessary:
- Two-part molds: simple shapes that are concave on their back side are relatively easy - consider this geometry:
.----.
.' `.
| .--. |
___' .' `. `___
| | | |
|_____| |_____|
The process of making a two-part mold would simply involve first placing the part on a pedestal several milimeters thick, and slightly wider than the
part, and milling it the usual way; then, reversing the whole thing, removing the bottom of the pedestal, and cutting the bottom:
_ _ _ _
X| |X X|__ __|X
X| .----. |X XXXX|_______ _______|XXXX
X| .' `. |X XXXXXX | | XXXXXX
X| | .... | |X XXXXXX | | XXXXXX
X| ___' .XXXXXX. `___ |X XXXXXXXXXX `. .' XXXXXXXXXX
X| | :XXXXXX: | |X XXXXXXXXXX. `--' .XXXXXXXXXX
X| _|_____:XXXXXX:_____|_ |X XXXXXXXXXXX. .XXXXXXXXXXXX
X|__|XXXXXXXXXXXXXXXXXXXXXX|__|X XXXXXXXXXXXXX` 'XXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Master for side 1 Master for side 2
Observe that pouring silicone into the first master will yield a concave, negative mold with a flange; while the second one will result in a top cover with a
protruding convex shape, and a flange that mates with its counterpart. Since the halves need to mate precisely, it is important to account for compatible
corner filleting in the model - but otherwise, the process is very straightforward. For large parts, the pedestal must be reasonably thick or reinforced with
rigid plastic, to prevent it from deflecting under its own weight, and that's it. For integrity reasons, many types of multi-part molds benefit from 60-70
Shore A rubbers.
In some of the more complex molds, thin pathways (1 mm thick or so) must be added to allow the air to escape from certain spots, or resin to be injected
with a needle; this will leave a mark, but it should be very easy to cut it off and file it down (in fact, you can see similar marks on the inside or
bottom of almost all injection molded plastic parts in existence). A reservoir for some extra resin may be introduced on top of one or more of these
channels, especially in pressure casting - so that air is not immediately sucked in as the resin gradually fills the voids.
In some cases - for example, spherical shapes - it may make more sense to have the partition line in the middle of the geometry, and not at the very bottom;
the approach is the same, and the only complication is that the partition line needs to be sealed (for example with silicone grease), and the resin must
be injected with a needle through a channel on top of the mold.
- Large molds: the primary concern with large parts is the cost of the silicone, and the fact that the mold may be pretty heavy - sometimes requiring
additional sections and hacky reinforcements
to prevent it from deflecting under own weight. To solve these problems, an initial thin coat of silicone can be poured or brushed over an
oversized geometry in several steps to form a skin layer, perhaps 1 mm thick, instead of submerging the master fully; further build-up usually involves
another batch of silicone with a thixotropic additive to make the mold thicker, usually up to about 5 mm
or so (and sometimes reinforced with gauze or other light fabric). Finally, a rigid polyurethane shell is then brushed on top of these layers, to form a
hard backing with a flexible, removable rubber insert inside
(example). A specialized, thixotropic polyurethane resin for building
such inserts is Innovative Polymers IE-3065.
- Rigid molds: when casting soft materials, or when dimensional accuracy is of utmost importance in two-part molds, it makes sense to resort to
rigid or semi-rigid molds that can be clamped together or placed on uneven surface without affecting the part. Simple molds for tires and other silicone goods
are best to machine directly in the prototyping board; polyurethane rubbers around 70-90 Shore A (e.g., IPI IE-9080) can also be used. As noted, a
truly religious application of mold releases is necessary, and incorporation of draft angles to facilitate part removal is important, too.
- Molds for non-CNC items: there are quite a few
good
mold-making tutorials available from resin manufacturers, so I will not
repeat this information here. In general, the task involves building a suitable box, attaching the master model inside - typically at the bottom - and then,
if necessary, cutting the rubber carefully to recover the original item and allow the plastic to be poured in. These techniques may come handy with parts
that are easier to machine directly (e.g., on a rotary axis), or for replacing damaged third-party
objects without the need to create CAD models and machine them yourself. Exactly the same resins, mold releases, etc, can be used.
5.2. Part geometry tips
Figuring out how to design physically possible, durable parts, is a subject where it's nearly impossible to come up with an exhaustive set of simple
rules; you will have to observe the world around you and experiment a lot. That said, here's a collection of random notes:
- Baseline part thickness: 1.5 mm for is a good starting point for enclosures, bases, and so forth; between 1 mm is good for gearwheels up to
about 1,500 g*cm of torque, with progressively thicker gears or higher pressure angles being necessary past that point. When dealing with large, load-bearing
parts, keep in mind that a sheet of even the hardest plastic can be fairly flexible if thin and long enough. Do not work around this property
by simply increasing part thickness until it's stiff enough - it's costly, and makes shrinkage and exotherm issues more pronounced. Use strategically
placed walls, ribs, flanges,
or even flat surface features to
reinforce the geometry, instead
(click here for an example of a reinforced gearbox cover).
The science of bending is pretty complex, but you
can probably already appreciate the difference between a flat sheet of metal and an I-beam or an angle; the same applies to polymers. This is how
lightweight and seemingly flimsy plastic furniture is made to support your weight, and cheap toys are made to survive being stepped on.
- Fitting tolerances: for most interference fits in plastics, you simply want to make the two mating parts of exactly the same size, sampled with
a resolution of at least 0.001 mm (be sure to account for filleting!). Where friction needs to be reduced, a clearance between 0.002 mm to 0.01 on
every side usually works fine. In both cases, when such tight fits are necessary, special care must be taken to minimize mold and part shrinkage:
allow a full day for the resin to reach handling strength, and then attempt a gradual post-cure only after demolding.
Also keep in mind that thin, wide parts mounted on an axis are particularly prone to play: if you have a gear wheel that happens to be 2 mm thick and is 40
mm wide, and mounted on an axis with 0.02 mm clearance on each side, the outer edge will be able to wobble by almost 0.5 mm up and down
- and that's before taking elastic deformation into account. There are four ways to prevent it: adding a neck to increase the contact area with the axis;
making the fit tighter; reducing part width; or preventing movement in undesirable directions with sliding guides.
- Screw holes: measure the inner diameter of screw thread with a caliper, then subtract about 0.03 mm, to get a value to use as a
self-tapping hole diameter that would not require a nut. This only works in rigid elastomers that are not prone to stress cracking, though: acrylic and
polyester may not take this kindly. In softer plastics, you may need to offset the diameter further, too.
- Minimum wall thickness: depends on the material you are working in and the cutter used, but it is safe to say that tall protrusions
0.75 mm and under, as well as any walls 0.25 mm thick or smaller, require special attention and very careful mold handling in RenShape 460.
If created unintentionally and machined at normal speeds, they will
likely break off and leave an ugly mark - so avoid them where possible: always chamfer any non-essential acute angles
and inspect the mold for similar problems.
Many other useful part design rules are listed on
this page; while some of them only apply to injection molding, it's
still an interesting read.
5.3. Desiging spur gears
Straight spur gears are the most rudimentary and the most common type of a gear - transferring rotation between parallel axes using symmetrical,
uniformly sized and spaced teeth oriented on a circle. The most important features of a properly designed gear is that it transfers torque
uniformly using rolling motion
(see animation) to minimize friction - and getting this
right is a bit tricky, so follow this section closely.
Begin by deciding how many teeth your gear needs to have, and how thick each tooth needs to be. For the gear construction method outlined here,
you can go for almost any tooth count - at least 10 is recommended for optimal strength, but lower values are definitely possible. Tooth thickness is
mostly limited by the cutting tool available (as the tool will needs to cut matching slots for meshing gears). For example, for a 0.4 mm cutter,
you probably want to keep tooth size in the 0.5 - 0.7 mm range; it must be somewhat higher than the diameter of the tool.
Every normal spur gear is described in terms of a pitch circle - a nominal circle at which two meshing gears should be touching, and at which the thickness
of every tooth and the corresponding slot is exactly the same (illustration).
For any given tooth count and tooth size, you can arrive at the diameter of this circle by
calculating tooth_count * tooth_size * 2 / π. The metric system is further based on the concept of a "module" - defined as
pitch_diameter / tooth_count (and therefore equal to tooth_size * 2 / π) - as a different, less intuitive, but much easier to measure
way to describe any given gear.
As hinted, meshing gears should be generally designed so that their pitch circles touch with each other. Once you have calculated and drawn the pitch circle
itself, the next step is to pick a yet another defining property for your gear, called the "pressure angle"; this is the angle at which the torque is to be
transferred between mating gears, shown as a solid red line in the animation above. Gears designed for higher pressure angles will have thicker, more robust
teeth - but will also also generate stronger axial forces, will be more noisy, and if given the opportunity, more prone to slippage. High pressure angles
increase the curvature of tooth profile, making it more pointy for low tooth counts, and requiring a smaller cutter under the pitch circle in high tooth
count gears. My recommendation would be to stick to 12-18° at torques up to 2,000 g*cm or so; and use 20-25° past that point. The standardized values
used in most of the commercially available gears are 14.5°, 20°, and 25° - but there is nothing special about these numbers as such.
Now, moving on! Let's draw a line tangent to the pitch circle, and then rotate it by the value of the selected pressure angle, in relation to the point where
it touches the wheel; then, draw a second circle with the same center as the pitch circle, but tangent to the rotated line (this is
marked with a dashed red line in the animation). This new circle is known as the "base circle"; if you do not want to bother with
constructive geometry, the diameter of the base circle is simply pitch_diameter * cos (pressure_angle). The significance of it is that no power
transfer is supposed to occur below this circle; and that tooth profile above the base circle is an
involute curve originating from its surface. Involute is an interesting curve best visualized by imagining
having wrapped a piece of string around the circle, attaching a pencil at the end, and then moving the pencil away from the circle. As it moves, and is
pulled by the string,
it draws a curve like this.
The parametrization of this curve is x = r * cos(t) + r * t * sin(t), y = r * sin(t) - r * t * cos(t), but in most CAD programs, it is actually
easier to approximate it using a simple iterative algorithm. Assuming that the pitch circle is at (0,0), it goes thus:
- Let
offset = 0,
- Draw a point at
x = offset, y = r,
- Rotate point around (0,0) by
360 / (base_diameter * π) * offset degrees to the left,
- Increase
offset by base_diameter * 0.01 (the constant defines curve approximation accuracy, and can be changed),
- Go to 3 until the desired length of a curve is created.
- Select all created points, fit a curve through them with the desired accuracy.
This picture illustrates the result.
With the involute constructed, it is now time to decide what the tooth height should be. To ensure good meshing and tooth strength, most sources recommend
making it equal to roughly the module (or, 2 * tooth_size / π); making the tooth shorter - down to 50% of the module or so - is
sometimes beneficial, however, as it may help you avoid pointed tooth profile in very small gears, or insufficient cutter clearances in large ones; there is
no significant harm in generating stub gears with only 70-80% the nominal height if necessary.
Once you settle for a particular height, draw an addendum circle with a diameter of pitch_diameter + tooth_height * 1.98, and a dedendum circle
with a diameter of pitch_diameter - tooth_height * 2.02 or so. The addendum circle marks the height limit for every gear; the dedendum
one tells you how far every slot between teeth needs to extend to accommodate a meshing tooth; the clearance created by the dedendum needs to be slightly
larger than the addendum in standard gears, but the adjustment values mentioned here are arbitrary.
When you have all these circles and an involute curve drawn, calculate the angle corresponding to a distance of 1/2 tooth width along the pitch circle:
360 / (pitch_diameter * π) * tooth_size / 2. Next, draw a vertical line extending from the center of the circle to the outside, and rotate
it by this angle. Rotate the involute curve so that it passes through the intersection of this line and the pitch circle - and mirror it in the Y axis. You
should have much of the tooth profile on the screen. The remaining part down to the dedendum line can be drawn by extending a straight line to the center of
the circle. You can then use the trim operator to trim the parts extending under the dedendum, over the addendum, and trim the addendum circle itself, to
form a complete tooth profile; and join all the resulting segments if necessary. Voila?
Well, almost - this is where most of the guides you can find on the Internet end, but it's not exactly that simple! This approach only works if the total
number of teeth is higher than 2 * tooth_height_factor / sin(pressure_angle)²; for full length gears (factor 1.0), this is 30 teeth
at 15°, 17 at 20°, and 12 at 25°; for stub length gears with a factor of 0.7, the limits are 21, 12, and 8, accordingly. If you have fewer
teeth, the tips of each tooth begin to interfere with the profile of the slot as they move in or out - especially when a significant difference in tooth
count, and therefore the curvature of each gear, exists;
this drawing illustrates the problem pretty well.
An extreme case of differences in tooth count is meshing with a rack - which can be considered a gear with an infinite diameter with a base circle under the
dedendum circle, and a perfectly straight involute with an angle matching the pressure angle
(see example). This image
shows various stage of a rack tooth entering and exiting a gear, as would appear to a camera mounted on the gear itself, and fixed on a particular tooth;
the concave area at the bottom is the undercut not accounted for by the involute curve, but necessary to properly mesh in this situation.
So, what do we do? Generating the undercut curve is actually fairly simple - the algorithm amounts to drawing a single, centered rack tooth engaged with the
gear, then making copies of this tooth at linear offsets and rotating them by an angle corresponding to a matching distance on the pitch circle: a method
very similar to how the involute itself is approximated.
All right, all this probably sounds ridiculously confusing - and rightly so. While completing this exercise manually a couple of times is a very valuable
lesson, I have a simple shell script that implements almost all of the calculations and construction steps for you in Rhino, so that you do not have to
spend an hour on every single gear: click here to download it (to run the script, you need to have
Cygwin installed). The script takes tooth count, pressure angle, module, and addendum as parameters in the command
line, and generates a sequence of commands that should be pasted or loaded into the application. The following steps still need to be carried out manually
later on:
- Rotating the involute curve - the one pointing right - around (0,0,0) from where it intersects the pitch circle (marked in red) to the intersection
of the right tooth width guide (black line). Be sure to use "int" object snaps for this.
- Mirroring the involute curve and the undercut curve (pointing left) around in the Z axis, drawing a circle with a diameter of
tool_diameter + 0.05 mm, and dragging that circle
around to sure that the tool will be able to enter the slot; minor adjustments to the undercut curve are OK,
but if there is a significant clearance problem, a different geometry should be attempted (stub length, smaller pressure angle, larger module).
- Removing the mirrored copy, trimming and joining the involute and undercut curves as necessary, and then rotating them around (0,0,0) from their
current location on the pitch circle to the left tooth guide.
- Mirroring the curve again, and trimming it against the addendum circle, perhaps also dedendum circle, to create a complete tooth profile,
- Creating a 360° polar array of
tooth_count tooth profiles, centered around (0,0,0), trimming and joining them as necessary,
and then offseting the entire gearwheel by 0.001 mm to the inside to minimize interference.
- Cleaning up all the guides and helper circles except for the pitch circle.
Phew, that's it for real!
Oh, here's one more thing: lowering tooth height, increasing module, or changing pressure angle are not the only tools to generate a machinable geometry
when the standard output is not satisfactory: another trick is dubbed "profile shift". This last approach involves using a larger addendum circle, and a
larger dedendum circle, on the pinion gear (the smaller of the two meshing gears); and doing the opposite on the larger one. My script lets you do this by
varying the own_add and mating_add parameters in the command line: for example, specify own_add = 0.5, mating_add = 0.3
on the pinion gear, and own_add = 0.3, mating_add 0.5 on the other one, and compare the result to the default output from the script.
Spur gear with a given tooth height, width (module), pressure angle, and profile shift, will mesh properly with any other gear matching these parameters,
regardless of the number of teeth. So, since the process of constructing gears tends to be time-consuming, consider creating libraries of common gear
curves for easy reuse in other projects.
5.4. Other types of gears
There are three other types of gears that you should know about. Firstly, we have helical gears, which are essentially spur gears - but (literally) with a
twist. In these gears, the top profile is not simply extruded straight down, but twisted slightly - similar to what you can see
here. Gears constructed this engage more gradually when rotating,
resulting in smoother and quieter operation - but also produce some extra axial force pushing the two gears away from each other (similar to the action
of a screw). To solve this issue,
we also have herringbone gears,
which essentially consist of two mirrored helical gears joined together; in this arrangement, the net force along the axis of rotation is zero.
Since both these gear types are largely impossible to machine without employing a rotary axis, and can be easily derived from spur gears, I will not be
giving them too much attention; plastic spur gears are very quiet themselves when designed and lubricated properly, so there is seldom a need for these
alternatives in normal applications.
Worm gears are another interesting type of a gear, this time relying on a rack tooth profile revolved around a spiral path
(photo). Their primary benefit is a very high reduction ratio (one rotation of the
shaft translates to advancing one teeth on the mating gear). Their primary disadvantage is that there is a fair amount of friction involved, resulting in poor
efficiency (generally under 50%). Again, both of the mating gears need to be machined on a rotary axis (the mating gear is essentially just a low angle
helical one); if need to make one of these, and have a difficulty figuring the geometry out, drop me a mail.
Lastly, we have bevel gears: a very useful device for changing the rotation axis
(picture).
These gears are constructed by first drawing two pitch circles in different planes, touching each other at the desired meshing angle (usually 90°), then
finding the point where the axes of these circles, extruded perpendicular to their construction planes, intersect. For each of the wheels, a single tooth
profile is drawn the usual way, and then rotated so that the plane of the tooth is perpendicular to a line extending from the aforementioned axis
intersection point. The profile is then copied and scaled alongside this line fromt he intersection point, and the resulting two curves are lofted -
producing a geometry
like this. Unlike most other gears, any given bevel gear mates
correctly only with its original counterpart.
5.5. Gearboxes and transmissions
The most useful type of a gearbox for robot designs would be the one constructed to reduce or increase RPM of a motor; this arrangement usually looks
like this: a small gear turns a larger one, in turn permanently attached to a smaller
gear, which then powers the next stage; more powerful gearboxes usually combine gears with progressively higher pressure angles, so that the initial,
fast-rotating stages are quiet and very efficient, while the slowly turning output gears do not break too easily.
In settings where horizontal space is at a premium, several independently rotating pairs of gears may be stacked on two nearby axles instead, transferring
rotation back and forth (as seen here or
here). A flat arrangement with one
axle per gear in alternating orientations is also possible
(image) - but requires at least three different gear sizes
to be used to avoid interference, whereas the stacked design only requires two.
Planetary gears are another interesting, space-efficient approach; the most significant benefit of
this spiffy design is that it's very compact, self-contained, and capable of transferring more torque due to multiple meshing points in every stage.
Downsides include the need for extra complexity to actually constrain and interface every stage
(example), requiring you to spend long hours on every individual
case.
The only new thing that appears in the planetary gearbox are the internal teeth on the ring gear: this is constructed by subtracting the addendum, and
adding the dedendum, rather than the other way round; and then generating the involute curve under, not above, the pitch circle - and creating the
undercut curve using an appropriately rotated rack.
Certain specialized types of transmission rely on racks,
belts,
or chains instead of round gears. Racks should be self-explanatory, with straight teeth at an angle equal to the pressure angle; making your own belts
is relatively challenging, because the belt needs to be very flexible, but not stretchy. This is usually accomplished with the use of a polyurethane rubber
backed with aramid cloth, and takes some serious trial and error to get right. Since there is no rolling action, belt tooth profile can be pretty
much arbitrary (examples).
5.6. Drive systems
Probably the last area where a quick summary of the options may be useful is the subject of picking the right drive mechanism for the first robot. The
choices essentially amount to:
- Wheeled designs: this is definitely the best mode of locomotion to use while getting familiar with the dynamic properties of plastics, experimenting
with sensors and microcontrollers, environment mapping algorithms, and so forth. Two basic wheeled movement systems are commonly employed:
- Differential steering: one pair of wheels (rear or front) is hooked up to two separate motors, and the other pair of wheels is spinning freely.
Driving in straight line is achieved by rotating the wheels at the same rate, while turns are implemented by making one of the wheels turn faster
(example photo).
In this design, two separate optointerrupters or rotary encoders should be used to monitor the free wheels, to detect loss of traction, and to compensate
for the unintended differences in motor speed.
This is a very simple system, and it has some disadvantages; most notably, unless difficult to instrument pivot wheels (or more user-friendly, but exotic
omni wheels) are used, all turns result in the non-powered set of wheels being dragged sideways across
the floor, causing significant friction (proportional to turn ratio, axle distance, and wheel contact area). This, in many
cases, puts constraints on robot length, or the permissible turn radius.
Three wheels can also be used instead of four, but this limits the amount of motion feedback the robot will be able to receive to just a single sensor;
with treads or in two wheeled
systems, dead reckoning gets a lot more difficult. Another interesting variant
of a differential drive is the use of Mecanum wheels, where the problem of
friction is largely eliminated; making these gizmos yourself is difficult, though, and the price tag on ready-made ones is rather steep ($100-$300 for a
set of four).
- "Proper" steering: in this arrangement, rear wheels are connected to a rigid axle (usually, a metal rod; non-round bars are often more
convenient than smooth, round ones), and
the entire assembly is powered by a single motor; front wheels are mounted so that they spin freely, and can also be turned in the X-Y plane (usually +/-
10-30°).
Some linkage - for example, a rigid bar or symmetrical gearwheels
- is then added to synchronize their turn angles
(ideally using Ackermann geometry), and a position sensor plus a second
motor is used to implement steering (example). A simple turn sensor is usually
fitted with the front wheels to detect traction, too. This design - analogous to
car steering - is fairly complex in comparison, and requires some familiarity
with two-part molds and material properties to design a good way to attach the wheels and deal with the resulting shear stress - but offers superior
performance and simply looks cooler.
Turn angles possible with this mechanism are much higher than with differential steering, but when very high, some slippage may occur unless the speed
of the outer rear wheel (traveling a larger circle) is higher than that of the inner one - especially in front-light robots. This can be corrected by
using two rear motors - essentially combining
the two steering systems - or with
differential transmission on the rear axle.
- Legged robots: legged robots pose a lot of problems related to space management (fitting all the mechanisms within the envelope of a leg),
torque requirements to actuate joints near their pivot point (you need 15 kg*cm of torque to lift a 1 kg load on a 15 cm leg), and - last but not least -
designing practical movement algorithms. For these reasons, I do not recommend starting here, unless you intend to simply
bolt a bunch of expensive servos onto a simple frame.
That said, the usual arrangements are:
- Biped robots: achieving a natural, stable walking gait probably requires at least 4-5 degrees of freedom per leg, packed in a very narrow envelope -
as well as gyroscopes, accelerometers, and a bunch of contact or current sensors to detect problems early enough. Because of this, and because of the
algorithmic complexity of biped motion, most of the designs you can see cut at least some corners - for example, using oversized feet to achieve static
stability (example), or executing
turns in awkward and inefficient ways (e.g., using series of small steps).
- Quadruped and beyond: with four legs or more, it is quite easy to create a design capable of moving in any direction without the need for
dynamic balancing. At least three degrees of freedom per leg are probably required to achieve efficient and useful walking gaits (making turns,
climbing obstacles, etc -
example layout),
but some success on flat surfaces can be achieved with only two
degrees (example). Hexapods seem to be particularly popular,
perhaps because of their sinister look.
A number of designs for scuttling robots with one or less than one degree for freedom per leg can be found on the Internet, but
they are necessarily very limited
(example), and essentially work like a wind-up toy.
- Other exotic designs: the list is pretty long - we have
"pogo stick" hopping robots,
ball-balancing devices,
levitating (air cushion, magnetic fields, vibration) designs, flying, sailing, or
crawling ones. I do not claim to have any experience with these, but it's clear that
there can be no better way to impress the ladies - so tinker around.
6. Final words
Well, that's it. Hopefully, this can get you started - and excited about CNC milling, and robotics in general; if you are looking to toy with
specific designs now, I recommend heading over to Society of Robots; you can also check out
this project of mine.
If you have any questions, concerns, corrections, praise, or chocolate, please ping me at lcamtuf@coredump.cx.
It would be cool to know that this guide helped at least one person, in any way :-)
Your lucky number: 8456251