Skip to content

Die casting: a machine that runs on its conditions sheet

A die casting machine is set up the way a machining centre is: a sheet of conditions for one die — how fast the plunger goes and where it changes speed, how long the metal cools, how far the die opens. On a real machine that sheet is typed into the control. Here it is the cell's own data: the machine's program is derived from it, and so are the handshake with what stands round the machine, the interlock table and the setting sheet that goes with the die.

examples/casting/diecast_cell_demo.py is the whole of it: an 850 t machine with its furnace and ladle, the arm that takes the shot out, a trim press, a deburring arm — ingots in, castings on a pallet. This guide walks through the parts of it that are particular to casting.

The die casting cell: the machine, the furnace and its charging arm, the trim press and the returns elevator

The machine

bt.parts.die_casting_machine stands a cold-chamber machine as two things at once: the envelopes a cell is verified against — platens, four tie bars, the toggle and injection ends — and a mechanism whose moving platen, ejector and plunger are joints.

dcm = bt.parts.die_casting_machine(
    scene, "dcm", die=(0.290, 0.250), die_size=(0.640, 0.640), tip=0.100,
    catalog="ube_machinery/ub-is2/ub850is2",              # the figures: UBE's catalogue
    shape="ube_machinery/ub-is2/ub850is2-reference",      # the picture: a reference model
)
dcm.axes            # "dcm/axes": joints clamp, eject, shot
dcm.parting         # the frame a die drawn in its part's frame is placed at
dcm.sleeve          # 0.685 m: what the ladle pours into, with this die

die is the thickness of the die's two halves. It sets where the platen stands with the die shut and how long the sleeve is; a die thicker than the platens open to, wider than the tie bars leave, or a plunger tip the machine does not take is refused by name. With shape= the machine is drawn as a model package of it, link by link, while the envelopes go on being what collides — the same split a machine tool has.

The die itself is the cell's: two meshes placed at dcm.parting, the moving half attached to dcm.platen_link.

Sized before anything moves

Whether a machine can cast a die is arithmetic a foundry engineer does on the casting plan. bt.casting.check does it on what the cell actually stands on:

shot = bt.casting.Shot.from_meshes("shot.obj", "as_cast.obj", gate_mm2=565.0)
sizing = bt.casting.check(bt.casting.Machine.of(dcm), shot, conditions)
print(sizing.summary())
# clamp: the die may be cast at up to 91.3 MPa; 3726 kN opens it at the set pressure (44 % of the clamp)
# sleeve: 25.4 % full as the plunger starts
# gate: ratio 13.9, 41.7 m/s through it
# yield: 58.7 % of the pour is casting

The shot's weight and the area it presents to the clamp are measured off the closed mesh the die was made from (bt.casting.measure), so a die that changes takes its figures with it. A die the clamp cannot hold shut, or a shot heavier than the ladle carries, is an error; a sleeve too empty or a gate too fast is a warning a reviewer would ask about.

Nothing here is a flow or a solidification analysis. The metal is not simulated: the casting is in the die when the plunger stops, because the conditions say so.

The conditions run the machine

conditions = bt.casting.Conditions(
    pressure_mpa=40.0,
    slow_mps=0.3, fast_at_m=0.505, fast_mps=3.0, decel_at_m=0.615, decel_mps=1.0,   # the shot, by stroke
    cooling_s=10.0, open_m=0.76, close_s=2.8, open_s=3.3, eject_m=0.10,
    warmup=3,
)
hs = bt.casting.sequence(scene, dcm, conditions, source="caster", castings=["shot"],
                         biscuit=0.033, shot=shot, clearance=0.70)

bt.casting.sequence writes the machine's program: die shut, pour requested, the shot run as its phases on the plunger joint, cooling, die open, the ejector out once an arm is in place, the spray requested once it is out again. It returns a Handshake — the cell's programs wait on hs.signal("die_open") whatever the machine is called.

the machine says the cell answers
ladle_req — a shot is coming (the ladle scoops, and stands over the sleeve)
pour_req — the die is locked poured
die_open extract_ready — the hand is in place
ejected taken — the hand has closed on it
released extract_out
spray_req sprayed, spray_out
scrap — this shot is a cold die's (the cell sends it back to the furnace)

Two more of the cell's answers stand up unless the cell takes them down: part_ok (the last casting came out whole — nothing is left in the die) and melt_ok (there is metal to pour). A cell without a part check or a furnace leaves them alone; this one's sensors and furnace panel drive them. The die closes only with both, with the cell's start, and with both arms out — conditions of the interlock table like the safety door and the E-stop:

print(scene.interlocks([hs.program]).to_markdown())
# | close die | ramp `ramp clamp → 0 (dcm/axes)` | `(dcm/start AND dcm/extract_out AND dcm/spray_out
#   AND dcm/part_ok AND dcm/melt_ok AND dcm/door/closed AND NOT dcm/estop)` | ready | …

Conditions the machine and the hand cannot run are refused as the cell is built: an opening short of what the casting and the hand need between the die faces (clearance), an ejection past the ejector's stroke, a shot profile that does not fit the plunger's.

bt.casting.cycle reads one cycle back out of a bake and bt.casting.sheet writes the setting sheet with it. The demo puts its cycle beside the one UBE Machinery publishes for this class of die: the machine's own times are that chart's, entered as conditions; the pour, the extraction and the spray are what the ladle and the two arms take.

The casting is never free

A shot is one of a few meshes waiting in a feeder at the cavity: a source started once puts the next one in the die, and the die holds it — a grasp bound to the ejector's link, so the shot opens with the moving half and comes off the core as it is ejected. From there it goes from hold to hold:

scene.bind_grasp("extract/chuck", robot="extract", parts=["shot"], reach_m=0.03, touch_links=jaws)
scene.bind_grasp("trim/hold", robot="trim/axes", parts=["shot"], link="bed", reach_m=0.06)

A hold with a reach is a level, not an edge: energised while somebody else still has the part, it takes it the moment that hold lets go — in the same scan, so the part is not free in between for a belt to carry off. The order is always the same and is written as a handshake: the taker says it holds, the giver lets go. What a hand may touch is declared (scene.allow_link_obstacle_contact), and stays declared while another machine carries the part.

The shot seated in the trim press, the chuck round its biscuit

One thing becomes two

The trim press makes a casting and a gating of the shot. Nothing is cut: as the punch goes through, the press's hold lets go, the shot goes back to its feeder, and two other meshes stand where it was — both made from the same drawing as the shot, so the picture does not jump:

scene.add_sink("trim/cut", seat, (0.05, 0.05, 0.05), "caster")              # the shot, back to its feeder
scene.add_source("trimmer", castings, park=…, position=seat, quaternion=turned)
scene.add_source("gating", gatings, park=…, position=under_the_hopper)

press.step("shear", actions=[S.set_signal("trim/hold", False), S.start("trimmer"), S.start("gating"),
                             S.set_signal("trim/keep"), ram(stroke, 0.3)])

The casting is held in the nest until the deburring arm has it; the gating lies on the conveyor under the hopper and rides back to the furnace. A shot that is not kept — a warm-up shot, or one that came out short — is let go in front of the nest and goes the gating's way whole.

The furnace keeps its own books

What the furnace weighs is the furnace's, not a controller's. It is a plant program: rungs that add to words — a ladle out, an ingot in, the tower melting into the bath at the furnace's rated capacity.

plant = scene.sequence("furnace")
plant.rung(S.rising("ladle/scooped")).move("furnace.bath_kg", S.word("furnace.bath_kg") - 3.348)
plant.rung(S.rising("furnace/ingot_in")).move("furnace.charge_kg", S.word("furnace.charge_kg") + 5.0)
plant.rung(S.signal("furnace/melting")) \
     .move("furnace.charge_kg", S.word("furnace.charge_kg") - melted) \
     .move("furnace.bath_kg", S.word("furnace.bath_kg") + melted)
plant.plant()

The furnace's control sees those words through a level probe and a thermocouple (scene.add_analog) and switches its burners, asks the charging arm for an ingot, and gives the machine melt_ok.

Because every ingot, ladle and gating is an edge in the bake, the run balances — and the demo writes the balance: what went into the tower, what was ladled, what the bath and the tower gained, and what is left unexplained (nothing). By the hour, at the cycle the cell runs, it also says what the cell asks of the furnace: here exactly the 300 kg/h the furnace melts, 41 % of it gating that comes back.

Deburring in the hand

The trim press leaves stubs at the gates. The deburring arm takes the casting to a spindle that stands still and runs the flange's edges across the bur. tl.carve_stock cuts the casting's mesh where it is at each instant of the bake — an arm that carries the part past a fixed cutter carves it as a cutter moved over a part at rest does:

carve = tl.carve_stock("part/0", robot="deburr_station/spindle", tcp_link="bur_tcp",
                       cutter_radius=0.00476, cutter_length=0.0159, window=(t0, t1))
carve.removed_volume * 1e9        # 444 mm³ of the 461 the stubs are

robot is whichever of the two holds the cutter (a spindle on a column is a robot without joints), and window carves the stretch of the run this casting is at the bur. The edges are toolpaths with their spin given, so the casting is turned as well as placed.

The casting's flange run across the bur of a spindle that stands still

The casting is hot

A casting off the die is at a few hundred degrees, and nothing in the picture says so: aluminium does not glow at that. bt.casting.cool takes it as one lump of metal at one temperature — a thin-walled casting is: across a 3 mm wall the Biot number is a few hundredths even under water — and works out how hot it is when, from the casting's own mesh (its skin and its mass) and where the baked cell has it:

lump = bt.casting.measure("trimmed.obj")                  # 728 cm³ under 0.39 m² of skin
heat = bt.casting.cool(lump, 350.0, [(opened, "die"), (ejected, "air"), (dipped, "water"), (lifted, "air")])
heat.at(lifted), heat.when(60.0)                          # °C out of the tank; when it can be held
shown = bt.casting.show_temperature(scene, tl, "part/0", heat)
as the die lets it go 350 °C — taken, not derived: the common alloys leave the die between about 300 and 500 °C
after 3.7 s in the arm's hand 347 °C
out of the quench tank, 3.0 s under water 100 °C
cool enough to hold (60 °C) 5 min 15 s after the die
its gating, as the press cuts it off 218 °C — a biscuit's lump holds its heat

The time constants are the alloy's heat over what the skin gives up a degree — 400 s in still air and 1.9 s under water for this casting — on film coefficients that are the order a shop works with (bt.casting.Cooling), not a measurement of one. show_temperature draws the casting on the baked cycle in the colour of the band its temperature is in, with the key beside the viewport, and as it is once it can be held. It is display only — the same Scene.show_shapes that draws a part as an operation leaves it, here with the part's own shape and a colour — so nothing the cell collides, grips or verifies has changed.

The shot in the arm's chuck just off the die, drawn in the colour of its temperature; the key in the corner

What the cell is tested for

Three things a cell like this is accepted on are scenarios of the demo, and rows of its FAT:

scenario what is different what must follow
no_ingots the bundle was not delivered; the bath stands near the ladle's limit melt_ok falls, the machine stands ready with its die open, no shot is made without a ladle of metal
overflow_left a sensor does not see its overflow: it is still in the die the die does not close again, part_ok stays down, the shot goes back to the furnace
cold_start the die is cold the first three shots are marked scrap and never reach the press
python examples/casting/diecast_cell_demo.py --scenario overflow_left
python examples/casting/diecast_cell_demo.py            # the run, the documents and the FAT

On to the machining cell

The casting on that pallet is not the part yet. examples/casting/case_machining_cell_demo.py is the cell that makes the part of it: two Haas VF-2 with their automatic windows facing each other, a FANUC M-20iD/25 between them, a turn-over unit, a parts washer and a belt out.

The arm's double hand half round inside the first machine: the faced part in one gripper, the next casting in the other

The arm carries two grippers back to back on one flange. It goes in under the raised window with the next casting, takes the finished one out with the free gripper, turns the hand half round and sets the next one down — the machine stands for one exchange, and the cell makes a part every 78 s against the 86 s a casting takes.

The first operation's part turning over in the rotor between the two machines, a finished part on the belt

The two part programs are G-code run on the machines' axes and end by running the cell with M-codes; the washer is loaded through its front door on the generic handshake. What the castings are cut to — each operation against its own drawing, and the one casting followed through both machines against the design — is A part made in two operations.

python examples/casting/case_machining_cell_demo.py                    # the run, the documents and the FAT
python examples/casting/case_machining_cell_demo.py --setup g54_high   # a work zero entered 2 mm high

On to the inspection cell

The washed part is not shipped yet. examples/casting/inspection_cell_demo.py is the cell that leak tests it, looks at it, marks it with a number of its own and packs it: a FANUC M-10iD/12 between the belt in, two leak test fixtures with a Cosmo Instruments LS-R902 each, a camera, a laser marking station, four bins on a pallet — and a belt out for what failed.

An arm in a fenced cell between a belt, two leak test fixtures, a marking station and a pallet of blue bins

The leak test is a calculation and a measurement. The air the test fills comes off the drawing — the part's inside less the filler block that stands in it — and the tester's own formulas turn the housing's limit into what the tester reads:

test pressure, limit 50 kPa, 2.0 mL/min
equivalent internal volume 1,856 mL
limit, as the tester reads it 10.9 Pa over 6 s of detection
the tester's stages 5 + 5 + 1 + 6 + 1 = 18 s
seal head against the lift under test 3,927 N against 2,895 N

A test the tester cannot be set to — a pressure outside its regulator's range, a limit below what it reads, a time finer than its timers — is refused by name, and so is a seal head that would not hold the part down. What a casting really leaks is a tag it carries; the air in the fixture is a program of the plant's own that falls behind the master at that rate, and the tester's program reads it, stage by stage.

A seal head running over the part just set on one fixture while the arm takes the tested part off the other

A part's history is written by the cell's control, the way a line's is: the number of the shot that cast it comes with the part, the arm's program carries it along from hand to fixture to hand with what the tester read, the part gets the next serial number as it is marked, and a row is written as it leaves.

| # | left at (s) | shot | fixture | reading (Pa) | leak (mL/min) | leak test | appearance | marked     | container | seat |
| 2 | 104.0       | 4122 | B       | 1.0          | 0.18          | OK        | OK         | CC320-0002 | bin_0     | 2    |
| 3 | 134.2       | 4123 | A       | 30.0         | 5.50          | NG        | —          | —          | belt out  | —    |
| 4 | 182.0       | 4124 | B       | 1.4          | 0.25          | OK        | OK         | CC320-0003 | bin_1     | 3    |

That is --scenario pore: the third casting is porous, the tester fails it, the arm sets it on the belt out and waits to see it there, and no number is spent on it. The example's tests hold the history against what is — every part in the bin its row names, read at what it really leaks.

A marked part going down into a bin beside the one already in it

A part comes every 39 s — two machining cells — and leaves every 39 s; the arm is 18 s on a round at the most, and the cell alone would keep up with a part every 24 s. The acceptance test's derived rows found one thing while the cell was written: with a fixture's "loaded" wire lost, the arm set a second part down on the first. The arm now believes a seat's switch before a fixture's word.

python examples/casting/inspection_cell_demo.py                    # the run, the documents and the FAT
python examples/casting/inspection_cell_demo.py --scenario pore    # a porous casting

On to the line

The three cells are one floor in examples/casting/diecast_factory_demo.py: the casting cell, the machining cell twice, the inspection cell, belts from the machining cells to the packing arm, two MiR1350 that change the cells' pallets, and a Toyota SAE160 truck that brings a bundle of ingots in at one end and takes the packed pallets to the dock at the other.

A die casting cell, two machining cells and a packing cell on one floor, belts and vehicle routes between them

The cells are the cells. Each is built by its own demo, as it is baked and tested alone, and bt.line.assemble stands them on the floor under a name each. What a cell needs to stand in a line is small and is the cell's own to say (build(line=...)): the names the line gives its parts, what stands on its pallet as the run begins, and two things it tells the line — "my pallet is full", "my pallet is empty" — and one it reads back, how many pallets the line has stood there.

The line answers the calls. The run begins in the middle of a shift, every cell with work in it. One casting is followed: shot 4124 is cast first and is the sixth on the casting cell's pallet.

ejected from the die 26 s
the pallet full, called for 81 s
on an AMR; waiting at the lane's end for the machining cell's empty pallet to come out 96 – 212 s
in the first machining cell (two operations, washed) 212 – 579 s
on the belts to the packing cell 8 s
leak tested (1.9 Pa), marked, the eighth part on the second shipping pallet 654 s
on the dock, by truck 687 s — eleven minutes from the die

The two AMRs share one aisle and two dead-end lanes and never meet in them: the one with the full pallet waits at a lane's end while the other goes down it for the empty one and comes back up. The truck goes into the packing cell forks first at its sheet's 0.31 m/s, turns only where its tail clears the fence, and has the next pallet — bins empty — in the first one's place 69 s after the cell called.

An AMR setting an empty pallet on the rack in the casting cell's gate

The line writes itself up: seconds a part, cell by cell, against the 43 s it is asked for (casting 40.2 s, the two machining cells 39.1 s, packing as fast as they come); every machine's share of the run; the work in progress by area; and where each machine waits, and for what. The hero is machined where the line put it — on a pallet that came by AMR, clamped by the arm, cut on tables that moved — and is within ±0.05 mm of its drawing.

It is also still warm there. As heat the hero is at 350 °C off the die, 100 °C out of the tank and 63 °C as the first operation clamps it, five minutes later: 0.29 mm longer over its 320 mm than at the drawing's 20 °C. A line that holds ±0.05 mm cools its castings before it cuts them, or compensates; this one's cut does not model the growth, and the sheet says so. It is packed at 41 °C. --studio opens with the view following the hero from the trim press, where the shot becomes it, to the dock.

An AMR held up. --scenario amr_late holds the second AMR up for 90 s as it sets out with the casting cell's empty pallet. The cell's call for a pallet then stands 129 s instead of 39; the deburring arm stands 94 s with a casting and no seat for it, the trim press and the extraction arm behind it, and the machine 38 s with its die open for the arm: the fifth shot goes 36 s late. Downstream has stock — the machining cells wait 27 s and 53 s for a pallet — and the hero is on the dock 5 s later than planned. The sheet lists which machines wait longer than planned, and what lets each go.

Writing this scenario found something no cell's own test could: kept at the press for longer than a cycle, the extraction arm came back to a die that had opened again and waited for it to close first — while the machine waited, open, for the arm. The cell's relays now latch "the die has closed since the arm came out".

A truck setting a pallet of blue bins down on a marked spot outside the packing cell

python examples/casting/diecast_factory_demo.py                        # the run, the documents and the FAT
python examples/casting/diecast_factory_demo.py --scenario amr_late    # an AMR held up
python examples/casting/diecast_factory_demo.py --no-fat --studio      # the run only, played in the studio

Twelve minutes of the floor bake in about a minute and a half; the USD is written at fifteen frames a second.

What is not simulated

The metal's flow and its freezing, porosity, the die's heat balance, the hydraulics. The shot's pressure is a number on the sheet, not a force. A casting's temperature after the die is one lump's arithmetic on an ejection temperature that is taken, not a field. The arms are timed as joint ramps at a share of their published axis speeds. A cooling time or a defect a casting simulation gives is taken in as a condition — the conditions sheet is where it goes.