1
0
mirror of git://projects.qi-hardware.com/ben-counterweight.git synced 2024-11-28 05:13:44 +02:00

Change wood size for 4th mold. Improved documentation.

- cw.py: switch from 1/2"x2" wood to 1"x3"
- README: explain what we need to protect against
- README: added more process details
- README: merged g2gp pass into "doit"
- doit: script for final machine-specific alignment and translation
This commit is contained in:
Werner Almesberger 2010-08-08 21:28:36 -03:00
parent d497d6740f
commit 709838ab46
3 changed files with 108 additions and 15 deletions

60
README
View File

@ -46,16 +46,25 @@ From the bottom to the top, we have the following elements:
- the Ben's main PCB
Protection
----------
Dangers and protection
----------------------
The counterweight contains lead, which is toxic and also conducts
electricity. While the health risk caused by handling the counterweight
is very low compared to other lead sources, it's still a good idea to
prevent accidental exposure. While there is normally an air gap between
the PCB and the counterweight, they may touch if the countereight is
improperly installed, if the PCB gets bent, or if the counterweight
comes loose for some reason. Electrical contact can cause the Ben to
malfunction and may even result in permanent damage.
The counterweight is covered by one or more layers of paint, to prevent
direct skin contact with the lead during handling. The paint may also
offer some amount of protection against electrical contact.
The counterweight is covered by a layer of hard plastic that isolates
from electrical contact and that also resists being punctured by pointy
components or solder joints of the main PCB.
A layer of hard plastic is placed on top of the counterweight, to
isolate it from electrical contact. The plastic also resists being
punctured by pointy components or solder joints of the main PCB.
Finally, all elements on the main PCB that are unusually tall are taped
over, to further reduce the risk of them working their way into the
@ -71,18 +80,45 @@ gravity casting with a Roland Modela MDX-15 CNC mill.
- analyze geometry, e.g., by viewing ben-bottom-inside-500um
- define CAD model in cw.py
- generate in HeeksCAD with "import cw" (requires HeeksCNC)
- define Zig-Zag operation
- generate Python script and run it (takes a while)
- save NC file
- convert G-code to gnuplot, with cncmap/g2gp
- generate in HeeksCAD with "import cw" (requires HeeksCNC and
HeeksPython)
- define Zig-Zag operation (*)
- generate Python script and run it (takes a while, about 10-20
minutes for the Python script on my Q6600, plus 20-100 minutes for
HeeksCAD to read the data back)
- save NC file, using the name specified in "doit" (see below)
- mount piece and determine geometry with millp
(from http://svn.openmoko.org/developers/werner/cncmap)
- define conversion in "doit" script (to do: put in repository)
- coordinate transform and conversion to Roland's RML-1
- define conversion in "doit" script
- coordinate transform and conversion to Roland's RML-1 (**)
./doit >job
- send job with cncmap/spool
(*) In this case, the following parameters were used:
- 32 mil Carbide End Mill
- step over 0.2 mm (default)
- step down 2 mm
- start depth 0.5 mm
- final depth 6.5 mm
- rapid down to height 0.5 mm
These parameters depend on the mill, the tool, and the material.
Note that, in my setup, tool speed and the clearance height are
set by the "doit" script, and HeeksCAD's settings have no effect.
The CAD model uses only an approximation of machine coordinates.
The final transformation and alignment is also made by "doit".
Total machine time is about 7 hours for 2" pine, about 11 hours
for 3". Zig-Zag is quite inefficient and repeats some paths many
times. A better tool path could reduce machine time to about a
third.
(**) HeeksCAD currently doesn't generate RML-1 output. I'm using a set
of utilities that process toolpaths in the gnuplot format and
generate RML-1 from that. Hence the detour.
Gravity casting
---------------

17
cw.py
View File

@ -41,14 +41,25 @@ channel_radius = 1 # mm
# metal, and to create a buffer for thermal energy.
#
inlet_radius = 6.5
inlet_straight = 3
inlet_straight = 3 # for 2" wood
inlet_straight = 33 # for 3" wood
shaft = 3
#
# This maximum y dimension of the piece from which the mold is machined
#
ymax_piece = 45
ymax_piece = 45 # 2" wood
ymax_piece = 75 # 3" wood, piece is really 70 mm, but we need slack
#
# Mold compression. If using a wooden mold, the two parts compress, making the
# counterweight a bit thinner.
#
mold_compression = 0.1
#
# Cumulative mass and torque.
#
total_mass = 0
total_torque = 0
@ -260,7 +271,7 @@ make_base()
if __name__ != "__main__":
cad.translate(group, -15, -46, -5)
cad.translate(group, 18, 5, 0)
cad.translate(group, 18, 5, -mold_compression)
sk = do_rect_cad(0, 0, 0, 120, ymax_piece, 0)
cad.extrude(sk, -10)
sk = cad.getlastobj()

46
doit Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh -e
#
# doit - Generate RML-1 job from gnuplot toolpath
#
DIR=/home/moko/svn.openmoko.org/developers/werner/cncmap
G2GP=$DIR/g2gp/g2gp
RECT=$DIR/rect/rect
ALIGN=$DIR/align/align
ZMAP=$DIR/zmap/zmap
GP2RML=$DIR/gp2rml/gp2rml
# 1st mold. 1/2"x2" pine. Did't have space for the battery cover's tongue.
rdata="10.50 8.40 -33.40 138.30 8.00 -34.00 10.50 50.10 -33.40"
rdata="14.50 5.90 -33.40 138.30 5.50 -34.00 14.50 50.10 -33.40"
Z=-34
# 2nd mold. 1/2"x2" pine. Six air outlets.
# correction: x+2.5, y-3, z-0.2
rdata="11.8 10 -33.9 137 10 -33.6 11.8 51.5 -33.6"
rdata="14.3 7 -33.9 137 7 -33.6 14.3 51.5 -33.6"
Z=-33.8
# 3nd mold. 1/2"x2" pine. Seven air outlets.
# correction x+2.5, y-2, z-0.2; z is very uneven
rdata="12.1 8.1 -33.2 139.4 8.1 -33.3 12.1 50.2 -33.9"
rdata="15.6 6.1 -33.2 139.4 6.1 -33.3 15.6 50.2 -33.9"
Z=-33.5
# 4th mold. 1"x3" pine. (Shop changed wood sizes. 1/2"x2" is now too small.)
# correction: x+3.5, y-1.5, z-0.0
# rotation: compensate for piece misalignment, y0 is 1 mm larger than y1
rdata="11.8 8.5 -23.4 11.8 73.3 -23.5 137.3 8.5 -23.2"
rdata="15.3 7.0 -23.4 15.8 73.3 -23.5 137.3 6.0 -23.2"
Z=-23.5
# cast*.g is HeeksCAD's NC output.
rect=`$RECT $rdata | awk '{$3 = ""; print}'`
$G2GP cast4.g |
awk '{ if ($3 != "") $3 += '$Z'; print $0; }' |
$ALIGN 0 1 $rect |
# angle, reference (lower left), rect
$GP2RML 20 5 5
# clearance, xy speed, z speed