## HAAC Plotter — Work Page

This page summarizes the Machine Week work for the **2‑Axis CNC Plotter** (HAAC Plotter) at Hisar Fab Academy.

- **Firmware (Pico / MicroPython)**: 2-axis step/dir + pen servo
- **Command protocol**: line-based (`PENUP`, `MOVE X.. Y..`, `SPEED ..`)
- **Web control**: browser-based control page
- **Backend API (optional)**: REST endpoints that forward commands over serial

### Hardware

- **MCU**: Raspberry Pi Pico (RP2040)
- **Stepper**: 2x TMC2208 (STEP/DIR)
- **Servo**: GP27 (pen up/down)
- **Pins**
  - Motor A: `GP8` (DIR), `GP9` (STEP)
  - Motor B: `GP12` (DIR), `GP13` (STEP)
  - Servo: `GP27`

### Firmware

Firmware file:

- `pico/main.py`

Features:

- **CoreXY / H‑Bot support** (`COREXY`, `SWAP_XY`, `MOTOR_A_SIGN`, `MOTOR_B_SIGN`)
- **Servo mode**:
  - `SERVO_MODE="CR"` (continuous rotation) or
  - `SERVO_MODE="ANGLE"`
- Line-based command parser

### Backend API

Plotter endpoints were added to the backend:

- `backend/src/routes/plotter.ts`
- `backend/src/services/plotterSerial.ts`

See: `docs/plotter/API.md`

### Web control page

A Plotter control page was added to the web app:

- `web/src/pages/Plotter.tsx`

The **Plotter** menu is visible for allowed roles.

### Test notes

Initial tests over serial:

- `PENUP / PENDOWN` worked
- `X200`, `Y200`, `MOVE X200 Y200` motion worked
- Speed change observed via `SPEED`

