Pen Plotter Using CoreXY

Pilvi the Plotter

I teach creative coding classes at Aalto University. Quite often, the students want to use plotters to draw the outcomes of their code. We don’t have a plotter at the Aalto Media Lab so I thought it would be nice to use this opportunity to make a plotter.

Team

  • Matti Niinimäki (Fab Academy student)
    • Overall machine design
    • Software configuration
    • Electronics
  • Arthur Tollet (Fab Academy student)
    • Limit switch brackets
  • Darren Bratten (Aalto Digital Fabrication course student)
    • Designing and fabricating the pen mechanism
  • Yikun Wang (Aalto Digital Fabrication course student)
    • 3D model of the entire machine
    • Designing and fabricating the frame, chassis and belt pulleys
  • Yoona Yang (Aalto Digital Fabrication course student)
    • Designing and fabricating the paper holder/carrying plate

License

MIT License

Benchmarking

I have an AxiDraw plotter and we used that as our benchmark and started with the following goals:

  • Using the CoreXY setup so that the stepper motors will stay in a fixed position
  • Drawing Size: A3
  • Pen up/down mechanism with a servo motor

We also used the 4xiDraw as a reference. It was very helpful for figuring out the software side.

Available parts

A large part of our design was driven by the parts we happened to have available. We only had certain types of linear bearings, shafts, belts, pulleys etc.

Finding parts for the plotter

First prototype

Firstly, we want to quickly build the model with the makeblock beams we had available, to figure out how the mechanism works.

After this testing we were confident that we have all the parts needed to build the machine and we started to replace the Makeblock parts with 3D printed or laser cut parts that we fabricated ourselves. the video below shows us testing the CoreXY mechanism just by moving the motors manually.

Second prototype

This version had the X and Y axis movements working, but the pen was permanently fixed in the down position. This version allowed us to test the electronics, different grbl versions, as well as start on configuring the Gcode settings for the machine.

Problems identified at this stage

At this point, we had some issues with the machine. It would randomly just pause while running a job. At first, I thought we were sending some incompatible commands, but it didn’t seem to be associated with any specific line. It seemed to happen quite randomly.

The other hypothesis was that perhaps our power supply was not able to provide enough current. We used a 12V/3A power supply and the motors were rated for 1.68A (we had configured the stepper drives a little lower than this). We changed the power supply to a 19V/4.7A one but it did not solve the issue.

Later we found out that the issues seemed to be with the version of grbl. Updating to version 1.1 seemed fix this freezing issue.

Third prototype

We built a prototype of the pen mechanism using parts that we had available. This allowed us to test the proper grbl version with servo support. The sled that held the pen in place was a little bit loose so the pen would wobble quite a lot. Everything worked though!

Darren was hard at work designing a new pen holder mechanism to replace the wobbly one.

(picture/video here)

Pilvi the Plotter V1

The version we presented during the global lecture was almost complete. The only parts that were missing were the limit switches and the last piece for the pen mechanism that actually holds the pen. The sled for the up/down mechanism for the pen works really well and smoothly though!

(picture/video here)

Yoona had made the bottom plate for the machine that has engraved lines to align the paper. The paper holding mechanism with magnets was still missing so we are taping the paper down for now.

(picture/video here)

Arthur added the limit switches to the machine after the globabl presentation.

(picture/video here)

Configuring the GShield

G shield test points for reference voltage The gShield (version 5) uses a 0.1 ohm current sense resistor so the formula is Vref = 0.8 * I

stepper motor specification

The stepper motor we are using has a maximum current rating of 1.68 amps per phase. To set the maximum current limit for this motor, we need to set the potentiometer to (0.8 * 1.68 amps) = 1.34 volts.

Part List

Amount Part
1 Arduino Uno
1 Synthetos gShield (grblShield) V5
1 Power Supply (we used 19V/4.7A)
2 NEMA-17 Stepper Motor (We used M42STH47-1684S but any decent stepper will work)
1 9g Micro Servo (TowerPro SG90 or similar)
4 Linear Bearing Platform (Small) - 8mm Diameter - SC8UU
2 Linear Bearing Platform (Large) - 8mm Diameter - SC8LUU
4 D8x496mm Linear Motion Shaft
2 Stepper Motor Mount with Hardware - NEMA-17
4 6x150mm shafts (or bolts, can be shorter also)
4 4x80mm shafts (for the middle belt pulleys)
3 4x80mm shafts (for the pen holder mechanism)
10 4x8x3mm bearings (for the belt pulleys)
16 4mm shaft collars
8 6mm shaft collars
2 GT2/18T belt pulley
1 2m GT2 belt
1 Makeblock Belt Connector (one set of two)

Laser Cut Parts

Amount Part Download
1 Bottom Middle Chassis link
1 Top Middle Chassis link
1 Y+ Frame link

3D Printed Parts

Amount Part Download
5 3D Printed Pulley link
1 Left Side Frame link
1 Right Side Frame link

Software

grbl

In order to be able to send G-Code to the plotter, we need to upload a special G-Code interpreter on the Arduino Uno board. Grbl is an open-source project that does exactly that. However, the standard grbl/g-code does not support servo motors like we are using for the pen up/down control.

We need to use a specific version of grbl that sends servo PWM commands on pin 11 of the Arduino Uno. Gladly, there are friendly people on the internet that have done this for us.

  1. Download Grbl-Pen-Servo
  2. Install it as an Arduino Library (copy the grbl folder to your)
  3. Edit the config.h file of the library and find the line that says: #define COREXY and uncomment that line.
  4. You might also need to edit the spindle_control.c file to adjust the servo positions (more on this later).
  5. Save all edited files.
  6. Open the example code grblUpload from the library’s examples in Arduino IDE and upload it to your board.

Universal GCode Sender

Download Universal GCode Sender

These settings will depend on the step count of your motors and the stepper motor controller you are using and how you have configured the microstepping mode of it.

The settings for Pilvi are as follows:

Command Value Explanation
$0 10 Step pulse time
$1 25 Step idle delay
$2 0 Step pulse invert
$3 0 Step direction invert
$4 0 Invert step enable pin
$5 0 Invert limit pins
$6 0 Invert probe pin
$10 1 Status report options
$11 0.010 Junction deviation
$12 0.002 Arc tolerance
$13 0 Report in inches
$20 0 Soft limits enable
$21 0 Hard limits enable
$22 0 Homing cycle enable
$23 0 Homing direction invert
$24 25.000 Homing locate feed rate
$25 500.000 Homing search seek rate
$26 250 Homing switch debounce delay
$27 1.000 Homing switch pull-off distance
$30 1000 Maximum spindle speed
$31 0 Minimum spindle speed
$32 0 Laser-mode enable
$100 52.000 X-axis travel resolution
$101 52.000 Y-axis travel resolution
$102 52.000 Z-axis travel resolution
$110 3000.000 X-axis maximum rate
$111 3000.000 Y-axis maximum rate
$112 3000.000 Z-axis maximum rate
$120 1000.000 X-axis acceleration
$121 1000.000 Y-axis acceleration
$122 1000.000 Z-axis acceleration
$130 200.000 X-axis maximum travel
$131 200.000 Y-axis maximum travel
$132 200.000 Z-axis maximum travel

CNCjs

We could also use UGS to send the plotter files, but I prefer to use another tool after I have tested and configured the gcode settings. We are using CNCjs to control the machine.

Drawingbot V3

To create the Gcode, we use Drawingbot V3