Pancake CNC

Video Block
Double-click here to add a video by URL or embed code. Learn more

Overview

Pancake CNC is a compact, two-axis robotic arm that prints edible art in pancake batter. I designed it from the ground up—mechanical structure, control electronics, and firmware—to explore PCB design and remote command and control in a playful medium.

Contributors

All mechanical and electrical designs are my own. A significant portion of software was written with the aid of / by Chat GPT Codex.

CNC Design

The CNC is designed with two rotational degrees of freedom. This design was chosen over a gantry setup for storage compactness and an opportunity to solve inverse kinematics.

Pump and Fluids Design'

Pancake batter pumping and routing was designed for ease of cleaning. A single, silicone tube runs from a mixing bowl, through a peristaltic pump, and to the tip of the CNC. A nozzle is formed by deforming the end of the tube. Only my food safe tube contacts the batter. The tube is easily removed from the device and washed.

Documentation

My GitHub repo contains:

  • Source code for the CNC controller and ground station

  • KiCad files for the controller PCB

  • Design documentation, including a channelization and bill of materials

The mechanical CAD is viewable on OnShape

Avionics Design

The avionics design is comprised of the following components:

  • A custom controller PCB: Hosts and ESP32-s3, provides 5v and 3v buses.

  • Three off the shelf stepper motor drivers

  • An external 12 volt DV power supply

CNC Controller PCB

A custom, 4 layer PCB provides a breakout for an ESP32-s3 module. Trace routing is grouped as follows:

  • Top layer: SMDs, signals, linear regulator heat sinks

  • Inner Layer 1: 5V plane

  • Inner Layer 2: Ground plane

  • Bottom Layer: Signals

Software Design

Firmware Architecture

The pancake CNC application runs on top of Free RTOS. Seven threads control the CNCs operation:

  • A simple safety thread: Monitors the limit switches and controls power to the stepper driver enable pins.

  • Wifi Handler: Establishes and maintains a local network connection.

  • Cmd And Tlm: Aggregates, packetizes, and transmits telemetry to an Influx DB instance. Monitors for commands pushed to an Influx DB instance.

  • Motor Control: Parses CNC GCode, runs guidance routines, and commands motors.

  • 3 x Stepper Motor Control: Three hardware timer + interrupt pairs control the stepper motor step signal.

Path Planning and Control Algorithms

The motion of the Pancake CNC is built from three fundamental path primitives: spirals, arcs, and lines. Each primitive defines a desired toolhead position in Cartesian coordinates as a function of time.

The inverse kinematics solution converts these Cartesian targets into individual joint angles for the two rotary axes. Only position-level kinematics are solved—velocity and acceleration are derived implicitly by the controller.

Motor control follows a parabolic switching law. Each motor rotates toward its target angle at a computed angular rate. As the commanded position approaches the target, the controller transitions along the parabolic switching line: the angular rate decelerates linearly with respect to time, resulting in a parabolic decrease relative to the remaining angle error.

Ground Software

Telemetry and commands are routed through Influx DB Cloud. Grafana Cloud is used to monitor and plot telemetry from the CNC.

Commands are written to the Influx DB instance via a local, python based command terminal. This python terminal allows for manual commanding as well as execution of a pre-built gcode file.