Skip to the content
2 layers222.6 × 42.4 mmPlotter, the printed circuit board in 3D

Started as a firmware for https://hackaday.io/project/177237-corexy-pen-plotter, possibly could be adapted to other CNCs as well.

Size
222.6 × 42.4 mm
Copper layers
2
Thickness
1.6 mm
Parts
80
Nets
92
Pads
328
Tracks, vias
732, 299
Pours
1
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
17 Aug 2021
Updated
4 Jul 2023

Overview

Plotter is an open-source printed circuit board by iwasz, from the iwasz/zephyr-grbl repository on GitHub, published under the MIT licence. It is a 2-layer board of 222.6 × 42.4 mm with 80 parts on 92 nets, routed with 732 tracks and 299 vias.

It is built around the PUSB3F96X. Its parts include 45 capacitors, 13 resistors, 9 connectors, 8 ICs and 2 switches. It belongs with the robots and motor control boards and the STM32 boards of this library.

Main components

1

README

README.md

What this is

A GRBL ported to Zephyr RTOS with some additional features like software CDC ACM serial port and SD card support. Developed for my CoreXY pen ploter, so some features of GRBL are commented out. Please create an issue or propose a pull request if you are interested in more functionality (list of unsupported bits is below). The greatest benefit of having the GRBL ported to Zephyr is the ability of running it on variety of platforms with way more powerful CPUs than the original Arduino. As of now this project is targeting the STM32F405RG (earlier tests were performed on the STM32F446RE) and with minor modifications in the boards directory or overlay file (or adding either of those to be precise) it should work on different STM32-s as well.

The only non standard driver this project uses is the modules/hw_timer and this is the only obstacle for running this on MCUs different than STM32-s. modules/hw_timer is derived from the pwm driver and its only purpose is to fire a callback(s) on a timer update event (and possibly on output compare event in the future). Other parts are implemented in stock Zephyr.

The project was written to power my CoreXY pen plotter, and as such has some parts not implemented (probing) and others not tested (Z-axis with stepper motor, see below). It should be a good starting point to develop something more complete that would run the variety of CNC machines. Pull requests are welcome.

How to build

Tested with Zephyr RTOS 2.6.99. Familiarize yourself with the Zephyr RTOS build process first. :

With bootloader

?

Without bootloader (only for troubleshooting)

That is when CONFIG_BOOTLOADER_MCUBOOT=n in the prj.conf.

sh
rm -Rf build
cmake -B build -GNinja -DBOARD=plotter_f405rg -DBOARD_ROOT=. .
ninja -C build
west flash # Or use IDE, or use openocd directly

What has been done in order to port GRBL

  • Added a new macro for my machine named DEFAULTS_ZEPHYR_GRBL_PLOTTER in the config.h and globally in the CMakeLists.txt. Used mostly in the defaults.h
  • Coolant control, spindle comented out.
  • Added extern "C" { to most of the *.h files to enable C++ interoperability.
  • Added definitions for my machine in the defaults.h.
  • Eeprom support ported.
  • Zephyr PWM module was modified to accept a timer output compare ISR callback.
  • AVR GPIO registers code ported to zephyr
  • Homing and limiters ported.
  • Probe implementation commented out.
  • Control switches support commented out. I'll have an OLED display and I can add those features there.
  • Spindle control commented out.
  • Gpio inverting functionality stripped down as from now the Zephyr's device tree configuration is used for this.
  • Logging ported to Zephyr. Rolled back.
  • Port uart code to zephyr.
    • Make use of new async uart functionality merged recently to zephyr. Analogous to this.
      • Modify the overlay.
      • Turn DMA on in Kconfig.
      • Interrupt UART API and Zephyr ring buffers.
  • GRBL seems to lack any call to a delay function in the main loop. This prevents scheduler from switching to other lower-priority threads which in my case were : idle, logging and shell_uart. I've lowered the main thread priority to 14 (from 0) and added k_yeld, so other low priority threads have a chance to run now. This include logging, shell and others.



Topics to mention in a write up

  • Software
    • Out of tree driver for timer callback.
    • TMC driver?
    • GRBL obviously.

Driver

Derived from PWM driver. Changes:

Header:

  • Names (file names & all the names in the code). PWM -> HW_TIMER.
  • A typedef for the callback.
  • Few macro / defines.

Source file:

  • Names
  • Callback setter
  • Datadield for the callback.
  • TODO remove unused code.

Parts

80
QtyValueFootprintReferences
35100nFCapacitor_SMD:C_0603_1608MetricC2, C3, C10, C11, C12, C13, C14, C15, C17, C18, C19, C22, C26, C27, C28, C30 +19
81kResistor_SMD:R_0603_1608MetricR5, R6, R7, R8, R9, R10, R11, R12
422RResistor_SMD:R_0603_1608MetricR1, R2, R3, R4
31µFCapacitor_SMD:C_0603_1608MetricC23, C24, C25
3PUSB3F96iwasz:Diodes_UDFN-10_1.0x2.5mm_P0.5mmU4, U7, U8
2100µFCapacitor_SMD:CP_Elec_8x10C29, C35
22.2µFCapacitor_SMD:C_1206_3216MetricC20, C21
2bigtreetech-tmc2130iwasz:Pololu_Breakout-16_15.2x20.3mmU2, U3
110kResistor_SMD:R_0603_1608MetricR13
122µF 16VCapacitor_SMD:CP_Elec_8x10C1
1330µF, 50VCapacitor_SMD:CP_Elec_8x10C37
14.7µFCapacitor_SMD:C_1210_3225MetricC16
1AP1117-33Package_TO_SOT_SMD:SOT-223-3_TabPin2U6
1Barrel_Jack_Switchiwasz:BarrelJack_HorizontalJ6
1ConsoleConnector_PinHeader_1.27mm:PinHeader_1x03_P1.27mm_VerticalJ3
1Ferrite_BeadInductor_SMD:L_0603_1608MetricFB1
1Limit switchesConnector_JST:JST_PH_B8B-PH-K_1x08_P2.00mm_VerticalJ10
1MPRB2405S-6Wiwasz:MPRB2405S-6WU5
1Micro_SD_Card_Detiwasz:microSD_HC_Hirose_DM3AT-SF-PEJM5J4
1Motor1Connector_JST:JST_PH_B4B-PH-K_1x04_P2.00mm_VerticalJ9
1Motor2Connector_JST:JST_PH_B4B-PH-K_1x04_P2.00mm_VerticalJ8
1PolyfuseFuse:Fuse_1812_4532MetricF1
1ResetTestPoint:TestPoint_Pad_1.5x1.5mmTP1
1Rotary_Encoder_Switchiwasz:RotaryEncoder_Alps_EC11E_Vertical_H20mmSW1
1SH 1106 Displayiwasz:SH1106J1
1STM32F405RGTxPackage_QFP:LQFP-64_10x10mm_P0.5mmU1
1SWDConnector_PinHeader_1.27mm:PinHeader_1x04_P1.27mm_VerticalJ2
1SW_SPDTiwasz:MFP 201 NR_copySW2
1USB_B_Microiwasz:USB_Micro-B_Amphenol_10104110_HorizontalJ5

Similar boards

  • 6 layers54.6 × 57.1 mmCM5 MINIMA 2, the printed circuit board in 3D

    CM5 MINIMA 2

    piecol/CM5_MINIMA_REV2

    Compact, feature-filled CM5 carrier board

    102 parts170CERN-OHL-S-2.0
  • 6 layers100 × 70 mmSa800u baseboard hw, the printed circuit board in 3D

    Sa800u baseboard hw

    antmicro/snapdragon-845-baseboard

    https://antmicro.com/blog/2022/04/open-source-snapdragon-845-baseboard/

    616 parts70Apache-2.0
  • 6 layers107 × 68 mmCm4-baseboard, the printed circuit board in 3D

    Cm4-baseboard

    antmicro/cm4-baseboard

    Experimental baseboard supporting System on Modules with Raspberry Pi CM4/CM5 pinout

    516 parts36Apache-2.0
  • 6 layers52 × 43 mmCm4-lvds adapter, the printed circuit board in 3D

    Cm4-lvds adapter

    antmicro/cm4-baseboard-lvds-adapter

    Adapter board converting MIPI DSI into LVDS with additional circuitry for integrating custom displays

    155 parts7Apache-2.0
  • 4 layers100 × 100 mmCm5-module, the printed circuit board in 3D

    Cm5-module

    Dominik-Workshop/moducard-cm5-module

    ModuCard module for CM5

    306 parts5MIT
  • 4 layers39.5 × 96.3 mmJetson orin baseboard storage expansion, the printed circuit board in 3D

    Jetson orin baseboard storage expansion

    antmicro/job-storage-expansion

    This project contains open hardware design files for an expansion board compatible with Antmicro's Jetson Orin Baseboard.

    110 parts4Apache-2.0
  • 4 layers230 × 42 mmHomelabio, the printed circuit board in 3D

    Homelabio

    nrwiersma/homelabio

    Rack mountable CM4 carrier board

    104 parts2
  • 4 layers171.5 × 243.8 mmTentalab, the printed circuit board in 3D

    Tentalab

    regymm/PCIe-DMA-DDR3-Accelerator

    Open-source accelerator platform for large FPGAs

    360 parts1

Questions

How big is the Plotter PCB?

It measures 222.6 × 42.4 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Plotter use?

80 parts, built around the PUSB3F96X. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Plotter KiCad files?

From the iwasz/zephyr-grbl repository on GitHub, at the commit this page was made from: the board is pcb/plotter/plotter.kicad_pcb and its schematic pcb/plotter/motors.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Plotter design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).