EECS Section

Machine Week

Brainstorming

We explored a range of ideas in our brainstorming list.

We started off by researching different implementations of the coreXY system, some useful references include:

CoreXY

Friday, November 13

  • Held the initial meeting and split up the tasks.

Saturday, November 14

  • Created CAD models of the motor mount, pulley mount, and carriages, although we eventually decided to adopt Quentin’s Urumbot design.
  • 3D printed the models and explored the initial design on a mock frame.

Sunday, November 15

  • Coordinated with the extrusion team and designed carriage components to fit the extrusion head.
  • Measured the heat plate, decided on the frame dimensions, and cut the aluminum extrusions to size with a bandsaw.
  • Assembled the frame and mounted the motors and other components.

Monday, November 16

  • Routed the strings around the pulleys and successfully controlled the extrusion carriage’s movement along the X and Y axes!
  • Mounted the extrusion head to the CoreXY mechanism and discovered that the laser-cut gantry carriage pieces were not strong enough. We re-fabricated all the mounting components and reassembled them.
  • 3D printed spacers to go between the plate layers.
  • Found that the motors needed additional power to drive the mechanism.

Tuesday, November 17

  • Drove the CoreXY motors using Hector’s code. This was a step-based test, not position control.
  • Rebuilt the mechanism with thicker acrylic.
  • Thickened the side pieces as well to keep everything at the same height, which required disassembling and reassembling the mechanism.

Hierarchical BOM

Quantities below refer to assemblies; individual component quantities are not specified.

Subsystem Assembly Qty Components (per assembly) Specifications
Frame Frame Assembly 1 Aluminum extrusions
Corner brackets
T-slot nuts
M5 SHCS
Frame feet / base plate
Aluminum extrusions: V-groove, 20 × 20 mm cross-section
M5 SHCS: M5 nominal thread, Ø5 mm
Linear Guidance Gantry Carriage 2 Gantry carriage mount
Roller wheels
M3/5 SHCS
—
Linear Guidance Extrusion Carriage 1 3D printed X carriage mount —
Transmission Motor-Capstan 2 Motor mount (laser cut)
Drive capstan (3D printed)
Passive capstan (3D printed)
Bearing spacers (3D printed)
NEMA17 stepper motor
Passive capstan bearings
M3/5 SHCS
Passive capstan bearings: 5 × 16 × 5 mm
Transmission Fixed Idler 2 Fixed idler mount (3D printed)
Delrin V-wheels
Kevlar string
M3/5 SHCS + washers
—

CAD Model References

Extrusion

Batter Experimentation

On Saturday, our griddle, batter, and syringes came in! The extrusion team (Hector, Jeannie, Eunice, Stella) got to doing some hard work on characterizing the batter cooking.

As a starting point, we referenced Dancakes' super thorough guide on How to Make Pancake Art. Thank you Dancakes for the inspiration and guidance!

We used his golden ratio of 2 batter mix : 1.25 water, cooking at 225F.

Mixing batter.
Testing batter aspiration with syringe.

Initial pancake experimentation

The first dot of pancake batter...
H for Hector / How to Make Almost Anything!
Clockwise from top left: 2 min, 4 min, 3 min, 1 min on the griddle to test browning.
Our first pancake art by Hector and Jeannie. Left: both layers drawn cold, then cooked altogether. Middle: Both layers drawn at 225F. Right: First layer drawn at 125F, then cooked!
Adding color (~20 drops were needed for a dark black)
We're real artists here
Second experiment (draw at 125F, then cooked)
The reveal
To ideate the extrusion head design, Eunice, Jeannie, Hector, and Stella considered how to add onto an existing syringe pump design that Anthony had. Here are the gallery of ideas we had about multi-color extrusion. We considered multi-headed syringes, syringes being attached at an angle so the batter would still land on the same point, and some other considerations.
H for Hector / How to Make Almost Anything!
H for Hector / How to Make Almost Anything!
The girl toiled. In terms of the other components that were also CADded, Jeannie and Eunice designed the limit switch mount to add limit switches for maximum syringe extrusion. We 3D printed it from PLA and had to do one more cycle of iteration to make sure it aligned with the holes on the acrylic. Jeannie also CADded support structs to hold in place the top and bottom base plates of the syringe extruder. Later, Hector and Jeannie placed in heat set inserts. On Monday, we realized we had a severe stability problem. We noticed that the

Firmware

An at-large description of the firmware can be found in the firmware README, as well as on Tudor’s week 10 page. Roughly speaking, it starts from direct motor control using the UFP protocol, then abstracts it in a Stepper Motor controlled in terms of distances rather than turns. An XY gantry with homing procedures and saftey checks is also implemented, as well as a Syringe wrapper and, at the end (in the Software) a Machine wrapper.

Software

The Software handles the conversion of images into tool movements and extrusion movements. Its documentation is available in the software README. Finally, everything is wrapped into an app with a GUI available here.

SVG to toolpath

Aaron built the design-to-toolpath pipeline. It reads an SVG, assigns each color to a syringe, compensates for nozzle offsets, fits the drawing where every nozzle in use can reach, orders the strokes, and hands back an abstract list of print events plus a preview and some statistics. Aaron also wrote the first end-to-end hardware layer (CoreXY motion, a UFP board driver, and a command-line printer) and the interface spec, so the whole chain could be tested in simulation early on before the gantry existed. More detail is on Aaron’s week 10 page.

Every hardware parameter lives in config/machine.example.yaml, so we could change units, the homing offset, and the syringe values without touching the planner. And the planner stops at an event list (SelectNozzle, Move, ExtrudeOn, ExtrudeOff, Dwell). Later on we dropped G-code for the UFP boards, and Tudor then moved the last stage onto the firmware wrappers.

photo or drawing
    -> Andrin's app (image_to_pancake, GUI)
SVG -> svg_input -> colors -> geometry -> toolpath
                                         |-> preview
                                         |-> motion -> ufp_driver -> firmware wrappers -> UFP boards

The app calls three of the pipeline’s functions: svg_to_job() in pipeline.py, trace() in preview.py for its own drawing, and plan_motor_moves() once it wants motor steps.

def svg_to_job(svg_source, cfg: MachineConfig) -> Job:
    paths = load_svg(svg_source)
    color_map = assign_nozzles(paths, cfg)
    area = cfg.reachable_area(set(color_map.values()))
    d = cfg.design
    paths = place_in_area(paths, area, d.margin, d.fit_to_print_area, d.max_size)
    paths = simplify(paths, cfg.print.curve_tolerance)
    events = plan(paths, cfg)
    return Job(paths, events, stats(events, cfg), color_map)

SVG is evil to parse manually, so svg_input.py uses the existing svgelements library. Each M starts a new stroke. Curves are sampled about every 2 px, pixels become millimeters at 96 dpi. Note that Y is flipped because SVG’s Y points down.

pl.points = pl.points * [PX_TO_MM, -PX_TO_MM]   # px -> mm, flip Y (SVG Y points down)

geometry.py then scales the drawing by one factor, min(avail_w / w, avail_h / h), so the aspect ratio stays to preserve the original drawing, and centers it in the print area minus a margin. Douglas–Peucker simplification (done through shapely) runs after that scale, so the tolerance is in millimeters. On the smiley demo that is 774 points down to 119 at 0.2 mm. The app turns fitting off for photos, which already have a physical size, and uses 0.3 mm so the gantry stops less often.

Toolpath preview of a smiley face centered in the print area
smiley.svg, one nozzle. Dashed lines are travel with the syringe off. The red numbers are the stroke order the greedy planner picked. Footer time is the constant-speed estimate, about 0.7 min.
Toolpath preview of the letters HI, eight separate strokes
hi.svg. The letters are plain strokes, eight of them, so travel jumps to 247 mm. The H alone consists of three strokes.

Each stroke follows the same sequence: travel to the start, extrude on, an optional dwell, the printing moves, extrude off. Ordering is through the greedy nearest-neighbour (which should be more than enough in the scale of problem here).

events.append(_move(cfg, nozzle, pts[0], pr.travel_speed, False))
events.append(ExtrudeOn(nozzle))
if pr.extrude_start_delay > 0:
    events.append(Dwell(pr.extrude_start_delay))
events.extend(_move(cfg, nozzle, pt, pr.print_speed, True) for pt in pts[1:])
events.append(ExtrudeOff(nozzle))

Color and nozzle offsets

colors.py sends each SVG color to the syringe whose configured batter color is closest. The distance is redmean, a cheap perceptual RGB distance. The app’s photo converter writes the three nozzle colors into its SVG, and this step sends each one to its own syringe. Nozzles print in color_order.

The nozzles are fixed on the carriage, each with an offset from the gantry reference. A bed point (x, y) needs the gantry at (x, y) - offset. reachable_area() in config.py intersects the print area with what every nozzle in use can actually reach, and the drawing is placed in that intersection.

Two-color smiley preview, dark features on nozzle 0 and a light outline on nozzle 2
two_color.svg. The dark features map to nozzle 0 (180 mm of line) and the light outline to nozzle 2 (753 mm).
Same two-color smiley pulled into the area both nozzles can reach
Nozzle 2 offset to −80 mm. The green dashed box is the area both nozzles can reach, and it stops at x = 220 mm. The drawing is recentered into that box. Note that print length stays 933 mm because the height of the area is still what limits the scale.

Hardware layer and the app

The first hardware layer was written so the pipeline had somewhere to go and test before the firmware existed. The README said the firmware team could replace motion.py and ufp_driver.py, and Tudor did that on 16 November. CoreXY math now lives in his xy_geometry.py, and the software plans in millimeters. In the first version the plunger was a third motor locked to the XY move; now each stroke is the prime / extrude / retract cycle described in the software README.

Andrin’s pancake_machine app is the part a person actually drives: find boards by MOTOR_ID, connect, home, jog, run the syringes, print, and stop. Photo to a 3-color SVG is also the app (image_to_pancake.py). Some issues were fixed by other people after the initial version:

  • firmware_link.py looked in firmware/ instead of firmware/scripts/. Fern fixed the path.
  • Syringe.extrude() started to block, so the whole line of batter would come out before the gantry moved. Fern’s ufp_driver starts the extrude with wait=False and polls the syringe during the XY move.
  • Hector Astrom found that a fractional plunger step leaves the motor in a weak half hold. His syringe measurements are also what the app uses for real plunger numbers; the example config still has the placeholder of 1 step per mm.
  • The app also works around set_current(1.0) commanding no current, the 500 mm default x_home_pos, and a MOTOR_ID clash in the example config. These are listed in the app README.

Tests

We also prepared tests that check millimeter scaling, aspect ratio, the Y flip, travel versus print, nozzle offset, and the reachable area. The table below is the planned motion on the example config, with the placeholder of 1 plunger step per mm of line. The time includes slowing down at every point. The pictures above assume constant speed, so they read a bit shorter.

Design Strokes Print (mm) Travel (mm) XY moves Time (min) Syringe steps
smiley 4 589 92 123 0.9 e0 589
hi 8 526 247 32 0.8 e0 526
two_color 5 933 96 188 1.3 e0 180, e2 753

Remaining issues and future improvements

  • Measuring SVG arcs at the library default made the tests take about 50 seconds. Measuring length at 1e-4 is what sets the sample count, and it is a few hundred times faster for the same polyline.
  • Only three boards were flashed, and two colors want four motors. Nozzles can share one plunger board, with pause_between_colors so someone can swap the syringe by hand.

Integration

We entered integration hell starting at around 8pm on Tuesday. We had tested the parts individually mostly, so this was a big hold-your-breath moment. First, we tested the homing script with the carriage itself. The homing worked successfully! Then, we started to attach the extruder mount onto the carriage. We realized some of the intended screw locations ran into the USBs on the motors, so we had to turn some of the long screws upside down and only use three out of the intended 6 holes to attach the mount on. Then, with the mount on, the motors stopped working to our dismay. After around an hour of debugging, it was decided the current limit needed to be increased in order to be able to drive the carriage+mount. XX soldered the resistors XX **FILL IN WITH DETAILS** Next, we had a much needed break. Shoutout Anthony for subsidizing froyo from Cafe 472! We had a refresh of our energy for the night as we continued into integration hell. Okay, returning now to the machine! We ran the homing script now with the mount on. New problems arised. Even without hitting the limit switch, the machine stopped; on the other axis, the machine didn't stop when the limit switch was being hit. We switched the orientation of the wires connecting the PCB to the stepper motors, and the movement of the motors now aligned better with what was expected. As we started with pancake extrusion, we began with testing just one syringe. We ran into the problem of not having enough current to drive the carriage, again. The problem with the motor dying is because the USB hub itself was misbehaving and curring in and out. Now, the XY motors are being driven by an external power supply instead of a Other problem: H-bridges oberheating, so the motors are overheating. Not all the energy is efficient, so in the process of driving everything with enough power, it continuously got so hot that it restarted. The minimum required to function could be required than the maximum allowed without thermal throttling Time is not the essence in this case. Instead, it is current. "Should we try homing again?" - Sophia "Was that a joke??!" - Hector ` Other accomplishments: - Exposed Anthony to "gagged" and "that would eat" - Indoctrinated the EECS section on Cafe 472 tofu base

Team