Close
0%
0%

Minimal Pico Vertical Plotter

Building and improving a Raspberry Pi Pico-based, wall-hanging vertical plotter.

Similar projects worth following
This project contains the development log and additional information about vertical plotter designed to hang on a wall, using a Raspberry Pi Pico W as the controller.

The plotter was originally described with basic (but incomplete) details in the May 2022/issue 55 of HackSpace magazine, as a fork of a cheap Arduino-based machine bought online (that did not work!).

Here’s a chronicle of my efforts to identify the missing information from the article, to improve the build, and to update the code.

The story of building a vertical plotter.

  • 1 × Raspberry Pi Pico W
  • 1 × 50 x 70mm protoboard (could be any suitable size, this just about worked for my Pico + buttons)
  • 8 × simple pushbuttons
  • 1 × 9g basic Servo motor
  • 2 × 28BYJ-48 5V Stepper motor + ULN2003 driver board

View all 11 components

  • Software shenanigans

    Andy Piper14 hours ago 0 comments

    So close to getting things running. I am waiting on a longer cable for the pen servo (I've tested with some Dupont connections but want something a bit better before running it in place on the hanging plotter).

    I've been trying to get the computer to talk gcode to the plotter.

    In the original article, Universal GCode Sender (UGS) is the recommended and documented way to get things going. The firmware code is written so that when the start button is pressed, the Pico outputs a couple of lines of information to the serial connection, identifying as a build of the GRBL firmware for CNC machines. The idea appears to be that given those two lines of information, UGS should say "OK, that's a machine running GBRL", and then you should be able to hit the "play" button to send the gcode file across.

    I've spent a fair bit of time trying to follow Ben's description in the article, with the latest version of UGS on macOS, and it just will not open a clean and complete connection to the board. I've been as far as checking the debug logs from UGS; putting a build of grblHAL on another Pico and trying to get UGS to talk to that (UGS doesn't properly support grblHAL at the moment, AFAIUI); and comparing the serial output and conversation sequence between UGS and other CNC machines, based largely on blog posts and reports from GitHub issues and wiki descriptions.

    It looks as though UGS sends $I followed by $$ followed by $G to check on board capabilities.

    I've added a small amount of  GRBL command handling to the firmware. I have the Pico respond to these commands in a meaningful(ish) manner, but the connection never seems to fully resolve to a point where UGS will let me hit play. This is fair, because the controller is not running full GRBL, but it is a bit annoying that the recommended software cannot be persuaded to act as a simple sender and pipe gcode over serial.

    (I believe the controller is doing its job, though; I've pasted in some of the gcode commands from one of the sample files at the serial prompt in the terminal, and had the servo and stepper motors start to move around, indicating that they are being driven by the commands)

    Basically, either my setup is behaving differently to Ben's system from the HackSpace article; UGS has been updated since May 2022 (very likely); or, something else. There's a possibility it's an OS-specific thing, too - I'm trying this on macOS Sonoma; the article appeared to use Windows (?); I do have a Linux machine available as well, but I haven't tried on there as yet.

    I've tried bCNC (a Python GUI); but for some reason that is not even wanting to find my USB serial port. As an aside, it also looks absolutely terrible / barely readable in dark mode on macOS.

    I finally hit potential success with CNCjs, an Electron-based GUI, which is letting me connect... which I installed using homebrew. I did have to make a small tweak (specifically, turning off system quarantine for the app via xattr -d com.apple.quarantine /Applications/CNCjs.app) to get it to run without complaints. When I have the last piece of wiring, I should be able to try one of the test plots.

    In the end though, this minimal approach may be too little, and it may be that I should switch across to a more functional (grblHAL?) firmware of some kind, assuming that I'd be able to figure out how to have that drive a hanging wall plotter...

  • Firmware setup

    Andy Piper14 hours ago 0 comments

    Getting the firmware (code on the Pico) into shape was one of the more interesting parts of this project.

    The code shared alongside the HackSpace magazine article is incomplete, forked and modified from a repo that is primarily in Chinese, and over a year old.

    I've created my own fork of Ben's fork, and inside that right now there's a pico-w-build branch which is getting commits as I get to grips with the code.

    Quick run-down of changes and approach:

    • I primarily code for the Pico using MicroPython (and I may come back to this project with some MicroPython another day), this is based on Arduino, so to get started I needed to install the RP2040 / Pico W support for the Arduino IDE. The repo didn't contain specific instructions, but I've noted that I needed to install the board support by adding https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json to the Arduino Boards Manager preferences.
    • The repo contains various libraries, I chose to install the TinyStepper driver "properly" via the Arduino IDE.
    • I moved the .ino file containing a datestamped filename up out of the WallDrawGCODERP2040 sketch directory, to avoid compilation collisions.
    • I chose to step through the whole of the source code and translated the Chinese versions of the comments using Google Translate, to help myself to understand the control flow.
    • As noted in the previous log, I added the Fritzing schematic to the hardware folder.
    • I added a small piece of code to switch the onboard LED on when the start button is pressed for long enough to move the Pico from "buttons control the pen and gears" mode (how it starts up), to "ready to receive gcode commands" mode.
    • I made a couple of adjustments to hack in some additional "pretend" GRBL command parsing. As noted in the original article, the initial serial output from the Pico is supposed to trick the GCode sender software into thinking the plotter is running GRBL (a CNC firmware), I extended this very slightly in an effort to get things to work (see the log on Software support); in the end this has probably been a bit of a waste of time so far.
    • This was all rebuilt with the latest Pico W SDK / Arduino board support, vs the ~May 2022 .uf2 file supplied with magazine article.

    All of this took a fair bit of build/reset/upload work, with the motors and servo wired to the Pico, in order to confirm that the firmware is good. That's a large part of why I ended up adding the (white) reset button to the protoboard.

    At this stage I'm able to compile and upload the sketch to the Pico W, and also, have the buttons trigger the expected actions (motor 1 & 2 up and down, pen up and down, and switching into GCode command receiver mode). I've been checking serial output using tio, Serial.app for macOS, and Arduino Serial Monitor. Assuming that the code supplied with the article will in fact plot from a GCode file as intended, this means that I'm most of the way there.

    In theory, the final steps here are getting desktop software to talk to the plotter, and having the plotter do something useful.


    I have some ideas for changes to the firmware if I stick with this minimal, sub-GRBL implementation:

    • Ben's repo has notes on a potential use of an SD card, that could be useful
    • Wifi upload of GCode (?? I now think that's a lot more effort than I initially thought, largely because I've now dug into GRBL and CNC software more than I expected to...)
    • Improvements around homing and control
    • (maybe??) MicroPython rewrite, but that will involve having to properly understand the GCode translation into stepper control logic, which I haven't gone anywhere near as yet.

  • Assembling the electronics

    Andy Pipera day ago 0 comments

    The electronics side of the project was where I started to hit some bumps in the road from the original article.

    First of all, although the article contains a list of required components, I don't think it's fully accurate. 

    Exhibit A:

    ... so that's 7 buttons, then 🤓

    I've mounted the Pico (W) on a protoboard and laid out 7 buttons, with a bit of colour-coding since I had some coloured ones to hand - orange for the "up" buttons, and green for "start". After a bit of testing with the firmware, I also added an 8th button as a broken-out reset for the Pico.

    I also decided to make a diagram to help me to sort out the wiring, since the original project didn't contain one (although it does helpfully explain which pin connects to what, as above). I created this using Fritzing, which needed me to track down parts for the Pico W and the motors. The Fritzing sketch is inside my fork of the original GitHub project, on the pico-w-build branch.

    A possible future revision could include a nicer, possibly custom-designed PCB to contain the Pico, the buttons, and maybe even with space for the ULN2003 motor drivers to be attached so that it's an all-in-one control panel. Just an idea.

  • Getting started - 3D printed parts and components

    Andy Piper2 days ago 0 comments

    Back in April 2023, I built a Brachiograph, which set me off down a rabbit hole around pen plotters and mechanical drawing machines. I subsequently purchased an AxiDraw SE/A4 (and then upgraded it with a coreless servo).

    I've been wanting to build a vertical plotter for my studio wall for a while, and remembered an article from Ben Everard in HackSpace magazine issue 55 (now available online).

    I printed the 3D parts from Ben's Printables page, and ordered the various parts I needed - specifically I needed to order a pair of stepper motors. I already had a Raspberry Pi Pico W - which was an upgrade on the Pico that was used in the original piece, and got me thinking along the lines of updating the project to support wifi uploads for plots further down the line. I also already had a spare servo from the Brachiograph project, and a selection of push buttons.

    The 3D prints were pretty straightforward - loaded straight into Bambu Studio and printed on the Bambu X1C in basic PLA. Two mounts for the stepper motors, and a gondola (that Ben had borrowed from elsewhere) for the pen. I realised that I wanted to be able to adjust the pen slightly more comfortably than directly adjusting a screw so I added another part that I found on Printables to make it easier to turn the bolt.

View all 4 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates