Introduction: Tim's 10 Colour Plotter Pen

About: Retired due to health. Oldish. My background is in Structural Engineering. Also smith of many trades. The majority of my project will be what can be made sat in a chair within arm's reach, on a plotter, 3D pri…

Most CNC (Computer Numerical Control) D.I.Y. Pen Plotters have only one pen holder, so if you want to plot something with multiple colours, you have to physically change the pen from time to time.

There are more advanced plotters that have carousels to hold multiple pens, these plotters have more complex mechanisms and code commands to enable their use.

I thought I would have a go at making something that could be used on most D.I.Y. Plotters and uses something readily available to buy.

I also wanted to make something that could be use using the most common free Firmware currently used, grbl.

Supplies

3D Printer is required to print the parts for this project.

The Multi Colour Tool is designed to fit my plotter Tool Holder, details can be found here: Tim's XY Plotter Tool Holder.

It is also designed around a 10 colour pen I found on eBay. when searching look for one with the Rabbit on the top, like the ones in the image, there may be slight differences in some.

Other bought items are:

  • An SG90 Servo is required for the pen up/down moment.
  • Screws: 2 number M1.7x10mm. About 20 M1.7x6mm.
  • 2 number 3mm diameter linear rods about 90mm long.
  • One N20 Motor with gearbox. The one I have used is 3 to 6 volts, about 104 RPM, has a about an 8mm long shaft, 3mm diameter with a flat. Something close to the specs should do, it does not want to be too fast.
  • One Micro Switch. The size of the I have used is about (body) 12.6mm X 6.5mm X 5.7mm. hole centres are 6.5mm.
  • 2 resistors are needed: one 10k, one 100R.
  • One Transistor. A general PNP will do, I have used a 2N3904 (TO-92 EBC).
  • Cable. I used 3 core flat JR cable 32 awg. Needs to long enough to reach from the motor on the tool at whatever position the pen is, to your controller (CNC Shield).
  • Connectors, Whatever connectors you need to connect to your CNC Shield.


I have attached the files to be printed.

  • There are two versions of "Up-Down_Cam_Servo" One with support, One without support.

Step 1: Print All the Parts

The first thing to do is print all the parts.

I have used PLA.

I have designed the parts to be printed a certain way, so take a look at the image for reference.

The wall thickness was set to 1.6mm, these are functional parts, so they need a good wall thickness.

The fill density won't really matter. I had it set at 20%.

Layer thickness was 0.2mm.

Nozzle size I have is 0.4mm.

Step 2: Motor Circuit

A small circuit is required to control the motor.

The current that the motor uses, is too much for a pin on a microcontroller to handle, so we need to use a transistor to switch the motor on and off, the transistor will be switched by the microcontroller.

Basically, we are making a SSR (Solid State Relay), but because the current the motor uses, is low, about 600 mA, we can use a transistor.

To keep the Transistor stable and we want to protect the microcontroller we will also need two resistors.

So, because the circuit consists of only a transistor and two resistors, I feel there is no need to make a PCB, the components will be mounted onto the micro switch. (Old school, before we had PCB, Hehe).

I have done the circuit using Fritzing to make it easier to follow.

Connection:

  • Red = 5v
  • Brown = GND
  • Orange = Microcontroller.

Cable. I used 3 core flat JR cable 32 awg. Needs to long enough to reach from the motor on the tool at whatever position the pen is, to your controller (CNC Shield).

  • The length of cable between the motor and the switch needs to be about 60mm.

The switch lever needs to be a little wider on the end.

  • I just soldered a little piece of metal strip on the end.
  • About 8mm.
  • You will have to remove the chrome plating with some abrasive paper, to enable you to solder to it.

Try to keep all the components to one side of the switch as show in the photos, where it fits is a tight area and one of the linear bars fit verry close to the contacts of the switch.

Step 3: Pen Top Removal

The pen top is a push in fit that is not supposed to come out.

  • It has a shape on the end inside that pushes into a hold and not come out.

To get the pen top out, the end of the pen top has to squeezed/miss-shaped so that it can be pulled back out of the hole.

  • The end can only be accessed from inside after removing the pen bottom.
  • The pen bottom just unscrews.

Hope you can see what needs to be done from the photos.

  • The pen top is not going to be used again, so any damage done to it to remove it does not matter.
  • Make sure you don't damage any of the other parts.

After you have removed the pen top, you can replace the pen bottom.

  • The pen bottom just screws back on.

Step 4: Tool Holder

As I have stated: The Multi Colour Pen is designed to fit my plotters, Tool Holder.

You will have to make some mount for it to fix it to your plotter, it is best to use the four slotted holes to mount it, this will give you some adjustment.

  • I have done a sketch to show the position of the mount holes.

The Tool Holder requires a Servo fitted; the type is a SG90.

  • The servo is fitted from the back of the tool holder and held in place with two screws.
  • The servo requires a single horn fitted, held in place with one screw.
  • The horn should be set horizontal pointing to the right when the servo is set at mid-way.

The multi coloured pen will be held in place using two 3mm diameter, 90mm long linear rods.

  • The rods are held in place with two clips.

Step 5: Assembly [Pen Holder Support / Up-Down Slide]

Slide the Up-Down Slide over the Pen Holder Support as shown.

  • Do any fettling to make the Up-Down Slide, slide freely over the Pen Holder Support.

Step 6: Assembly [Up-Down Cam]

Place the Up-Down Cam Servo from the back into the hole at the top of the Pen Holder Support as shown.

  • The place for the servo horn should be pointing up.

Place the Up-Down Cam Pen from the front into the hole at the top of the Pen Holder Support and mate it up with the Up-Down Cam Servo as shown.

  • The cam should be pointing up, the same way the place for the servo horn points.
  • Fix in place with a screw.
  • Do any fettling to make the cam rotate freely.

Step 7: Assembly [Up-Down Stops]

Fix the Up-Down Stops to the front of the Up-Down Slide using four screws.

  • Make sure the Up-Down Stops is fitted the correct way around as shown.

Step 8: Assembly [Rotation Spring]

Fit the Rotation Spring to right side of the Up-Down Stops using a screw as shown.

  • There is nothing to align the Rotation Spring, just try to keep it at its correct alignment while you tighten the screw.
  • You will be able to align it perfectly once the Pen Selector is fitted.

Step 9: Assembly [Switch Mount]

Fit the Switch Mount on the front of the Pen Holder Support as shown using two screws from the rear.

  • Note the orientation of the notch.
  • The notch is where the switch will be mounted.

Step 10: Assembly [Switch]

Fit the switch to the Switch Mount as shown using the two 10mm long screws as shown.

  • Note the orientation.
  • The motor will have to hang loose for the moment, take care.
  • Check that the 3mm diameter linear rod dose not foul any of the terminals or components.

Step 11: Assembly [Pen Rotator Cam]

Fit the Pen Rotater Cam to the end of the Motor.

  • Take note that there is a flat to be aligned when fitting.
  • The side of the Pen Rotater Cam that has a hole with a flat goes to the outside.

Step 12: Assembly [Pen Pre-fit]

Place the Pen Selector into the top of the pen.

  • Make sure all the pens are located in their slots.

Loosely fit the Pen Holder Top and Pen Holder Bottom onto the pen.

  • Do not tighten the clamps yet.

Step 13: Assembly [Pen]

Put the pen in place, so that the Pen Selector sits inside the Up-Down Stops.

  • Use two screws to secure the Pen Holder Top in place.
  • Use two screws to secure the Pen Holder Bottom in place.

Position the height of the pen so that the joint of the pen top and bottom where they are screwed together is in line with the bottom of the Pen Holder Top.

Align the Black pen to the front.

  • Adjust so that when the Up-Down Cam is rotated to push a pen down, other pens go inside slots in the Pen Selector.
  • There is a section that has no slot, this is where the selected pen is. It is a good idea to mark the top of the Pen Selector on the top so you can see which pen is selected.

When all is aligned, carefully tighten the clamps on the Pen Holder Top and Pen Holder Bottom.

  • One screw at the front of each.

Step 14: Preparation [Pen Rotator]

The face of the little hook on the Pen Rotator needs to be smooth.

  • Make the face smooth using some grit paper or a smooth file.

Step 15: Assembly [Pen Rotator]

The Pen Rotator is held in place by the Pen Rotator Retainer and a screw.

  • Don't over tighten the screw. The Pen Rotator Retainer is recessed to give a close tolerance fit of the Pen Rotator.
  • The screw may need backing of a little to allow the Pen Rotator to move.
  • Adjust the screw just tight enough so that the Pen Selector rotates when the Pen Rotator is moved back and forth.

Step 16: Assembly [Motor Pre-fit]

Clamp the Motor into the Motor Mount using the Motor Mount Cap and two screws.

  • Note the orientation of the Motor.
  • It does not matter which way up it is, it's the motor body needs to be on the thicker side of the Motor Mount.

Step 17: Assembly [Motor]

Fit the Pen Rotater Cam into the Pen Rotator and fix the Motor Mount to the Pen Holder Support using two screws.

Step 18: Assembly [Complete]

The assembly is now complete.

  • Hopefully have made a mount to fix my Tool Mount to your machine.
  • The 10 Colour Plotter Pen should now be fitted to the Tool Mount using two 3mm Linear Rods.
  • The Linear Rods can be held in place using two Bar Caps.

Step 19: GRBL [Install]

I have a bespoke plotter; I can wire it as I like and create commands to control special functions.

I know that most people will be using grbl Firmware on the plotters. So, I will show you how to connect the 10 Colour Plotter Pen to a grbl system.

Well actually it needs to be a modified version of the grbl Firmware.

Use the version of grbl Firmware that has been modified to control a Servo on my GitHub.

  • I have made some updates to make it work, that may not have been pulled yet.

Note!

There is a setting in the code prior to uploading the firmware that may need to be changed.

  • In the file grbl/spindle_control.c line 41.
//#define RC_SERVO_INVERT       /* RC Servo , Uncomment to invert servo direction */

Un-comment this line if the Servo direction needs reversing.

Install details

  • Upload the firmware to your device the same way you would do with the original grbl.
  • Copy the folder grbl to the libraries folder in your Arduino folder. drive:\user\Documents\Arduino\libraries\
  • (Replace the original if you have it)
  • Start Arduino IDE,
  • Select Tools and set your Board and COM Port,
  • Select File => Examples scroll to grbl => GrblUpload,
  • Click Upload Button.

Step 20: GRBL [Wiring]

The Power to the Servo and Motor is 5 volts.

  • Make sure it is a good 5 volts, the Servo uses quite a bit of current.
  • The ground needs to be a common ground to Servo, Motor and Microcontroller.

The Servo Signal wire goes to the Spindle PWM pin (which is Stop pins +-Z on old CNC Shields)

  • Whichever Shield you have; it is the pin that is Arduino Pin D11.

The Motor Switch wire goes to the Spindle Direction pin.

  • Whichever Shield you have; it is the pin that is Arduino Pin D13.

Step 21: G-Code

I have used the M03 and M04 commands to control the 10 Colour Plotter Pen.

The Servo version of grbl accepts a value with the M03 Command.

  • The value used is a value between the max and min settings set for the Spindle speeds in the settings of the firmware.
  • The code used to set the spindle min and max settings is:
 $30=180
$31=0
  • I recommend setting them to what I have shown.
  • The value in the G-Code is preceded with an S.

Example G-Code:

  • M03 S0
  • M03 S180

Setting the value of Spindle Speed min and max, gives a relation to the angle of the horn on the Servo.

The M04 G-Code command is just used as is. But it must be followed by a M03 S0 command immediately after.

Important

The Pen must be up before using the M04 command to change colour.

So, it is best to always use both commands when changing colour.

  • Start with: M03 S0 (To make sure the pen is up)
  • Next: M04 (To start colour change)
  • Then: M03 S0 (To make sure the pen change stops)

To use the currently selected pen.

  • M03 S180 (Pen Down)
  • M03 S0 (Pen up)

Some delays may need inserting between the commands. To give time for the Servo or Motor to move.

  • G04 P0.5 (Half Second Delay)

I have attached some modified code that should work with this version of grbl.

  • You may want to test the Tool like I did in my first video before running a full script.

Step 22: Video

Step 23: Addendum

Now that I have a multi colour pen, I thought I should try some colour plots.

I managed 3, before the ink in this cheap pen ran out, well the 4 colours I was using.

I must admit the plots had a lot of lines to draw, the amount of ink soon adds up.

So, I tried to find some refills, when it comes to looking for coloured refills, the options are limited.

I ended up getting some cheaper and better 10 colour pens, they come as a six pack.

These pens are longer and so I was not able to swop-out the actual pen.

The actual individual pen tubes inside where ok.

  • With them being longer, the tops just needed trimming down to the length of my original ones.
  • The pen tubes were also transparent, you could see how much ink there was.
  • I have taken a picture of one to show how much ink was used on one of the plots I did, it was much the same for the other colours.

I have decided to rearrange the colours in the pen holder, because of the colours I use to do this type of image.

  • Cyan, Magenta, Yellow and black.
  • This is so it only has to move one position for each colour.

I made a coloured label for the top of the Pen Selector, and a new Up-Down Stops.

  • Note the sequence on the label is opposite to the actual sequence of pens when viewed from the top.
  • This is because it is the plunger that moves and not the pens.
  • Black on the label will go to the opposite side to where the plunger was marked.

If anyone is interested in doing similar plots on their plotter, I have done an Instructable on how I did one using the Linedraw Algorithm.

Did a video of the first three images I did; it may give a better representation of how they look.

CNC and 3D Printing Contest

First Prize in the
CNC and 3D Printing Contest