Introduction: ARDUINO by Myself Mini-CNC (Plotter)

About: I am 47 years old and I live in Brazil. I am a Telecommunication / Electronics Engineer. twenty years acting in the industry of "Telecommunication and Networking". I like everything that engages Tech…

Arduino Mini-CNC machine (working as a Plotter)

Basic Operation and System Description:


In This project I will guide you on how to easily build your own Mini-CNC machine and with a low cost (using arduino and scraped old DVD/CD drivers).

I decided to write this detailed tutorial in order to help you do do it with a few simple steps.

To the Y and X axis we will use 2 step motors and trays of an old DVD/CD driver and for the Z axis it was used a common servo motor (9g like HXT900), this device will move a pen or pencil up and down on the Z axis.

For the structure I decided to use the DVD/CD's frames. The pen or pencil can be easily plugged to the sistem in the Z axis. I do not advise you to using a mini-drill or other weight object in the z axis cause the step motor has no power to handle that object It has no enough force to do it) so use just light object like pen or pencils.
The circuitry are based on Arduino Uno or compatible (like a stand alone ATMega328p with FTDI connection to the USB port) and it was used two L293D (H Bridge) Integrated Circuit to manage the step motors coils (but you can also build your own H-bridge based on transistors)

I did all adjustments and tests on a bread-board first and after that I developed a strip-board for the step motors driver. In this way I can connect the step-motors to the driver and connect the driver to the Arduino UNO.

For the system power I used a 5V@500mA external power source (to power the step motors) and the Arduino is powered by the USB connector. The Ground pin of Arduino and GND of the external power source must be connected in common.

Starts disassembling the DVD/CD drivers and saving the step motors rail and trail.
We will need to drill some holes in the frame of the DVD/CD and assemble the step motors rails (for the X and Y axis) on it.

The Frame must be mounted as an "L" and we must to ensure that we get a rigid structure (I used solder to join these two parts)
After that you can start to mounting the electronic devices (Arduino, step motors driver and connections)

You will need to identify the coils (A and B) of the step motors and take some notes (use a Ohmmimeter to do it) and after that you must to solder 20cm wires on the step motors terminals.


FURTHER DETAILS IN THE NEXT STEPS

Some photos have comments in it.

Step 1: PART LIST

All material used:

2 x DVD/CD drivels (ensure that the step motors are working properly)
2 x L293D
1 x servo motor HXT900
1 x Arduino UNO
1 x Arduino USB cable
Pin Heads
10mm x 3mm, screws
30mm x 3mm, screws
Plastic spacers with 3mm screw-thread
00mm x 100mm, fenolite board
Pen or pencil (thin point)
Wires and Jumpers for Arduino
Solder tin
Araldite or liquid Epoxy glue
Some tools
Specific parts will be shown in the next steps.

Step 2: INITIAL PREPARATION

Disassemble the CD/DVD drivers and save parts as:


Frame, screws, step motor, shaft and rails;
LASER head without electronics and optical parts;
In the figure above you can see that the LASER head have two holes that will be used later.
Do not discard the damping rubbers we will use it later too...

Step 3: PLOTTER FRAME STRUCTURE

Frame structure:

We need to build a frame structure with an "L" shape. All surface area that will be joined must be sanded and after it will receive a tin solder.
In the figures above you can see the X and Y axis position and direction.

Step 4: FRAME DRILLINGS

Make four marks corresponding to holes of the stepper motor mounting structures (for the X and Y axis) .
For the Y axis, the position must start at the very beginning of the frame structure and centered in the middle of the frame.
For the X axis, the base must be centered on top of the frame structure.


Y-axis - the drillings must be centered on the front in relation to the side and positioned as close as possible to the beginning of structure.
X axis - the drillings must be centered in relation to the upper side and positioned as close as possible to the top of the structure

See the figures above for more details.

Step 5: SOLDERING THE FRAME STRUCTURE

After performed the drillings is time to solder the frame structures Use a gas torch and tin to join the frame parts in order to form an "L" shape Use solder flux to help in this process.
Remembering: the Y-axis is the base of the "L" shape.

Screw the parts that forms the frame structure to be solid.
Use the screws removed and saved during disassembly.

Pass some solder flux in order to facilitate the welding process.
And use the gas torch.
Mounted Structure! We are halfway of our objective...
It is not perfect, i know but it is pretty solid.
The sides just a few soldering points.

Step 6: PREPARING THE STEP MOTORS

If you have not already done....... so..... weld four wires to the step motor terminals use different colors in order to identify the pinout.
See in a later step how to identify the coils for a particular step motor. Most DVD/CD driver use this same configuration.
For this specific step motor, I got this configuration:
- coil A are the Green / Blue wires
- Coil B are the Purple / Gray wires
Solder some pin-heads terminals at the wires ends in order to facilitate the connection to the L293D driver.

Step 7: MOUNTING THE Y-AXIS

The material needed to mounting the Y-axis are:


4 x 10mm spacers (it can be rubber or other material as your choice) 2 of them (the back ones) must be 2mm higher than the front ones (due to the step motor base be a little higher on the back) otherwise the structure will became unlevel.
My spacers was taken from an older printer.

We will need some 30mm x 3mm screws, washers and nuts.

Keep the original dump rubbers.... they will help us to level the system by pressing more one side than another (it is possible to control the flatness and keep pressure)

In the figures above, take a look at:
Spacer position;
Y-axis base position at the frame;
How to screw the Y-axis base to the frame;
As I said before, the original dump rubber will help to level the system and we can adjust till 2mm of hight on each side.

Step 8: MOUNTING THE X-AXIS

Materials needed to assemble the X-axis:


4 x plastic spacers with 3mm threaded

4 x washers 8 x 10mm x 3mm screws, it is not necessary to be plastic (it's what I had left over).

Install spacers in the X-axis structure:.

And finally install the basis of the X-axis, as done for the Y-axis.

Step 9: STRUCTURE - LEVELING

ENSURE THAT ALL FRAME STRUCTURE, X-AXIS AND Y-AXIS ARE LEVEL, HORIZONTAL AND VERTICALLY.

Step 10: MOUNTING THE Z-AXIS

The piece shown in the images above was taken from a old hinge of toilet seat lid... This piece will be used as a guide for our pen plotter (the pen fits very well to this piece without gaps, requiring some lubricant to facilitate the movements). You can use your imagination and skills to create your custom piece.....

Glue the servo motor in a phenolite board of 100mm x 50mm. Make two slots vertically about 40mm from the edge with 3.5 mm wide (they will be used to the pen height fine-tune). Glue the board and servo motor ... use your expertise to align the set (this is very important) The piece that will lift the pen was taken from an old sewing machine, (I will call "tweezers") once again use their skills to build your own tweezers piece.

Step 11: ADAPTING THE Z-AXIS INTO X-AXIS

Use two screws (10mm x 3mm) to hold the Z axis on the shaft base OF X-axis.
On the X-axis base we have two holes that fit just right with 3mm screws.

Now we can mount the Z-axis over the X-axis using two screws and the holes and perform a fine tuning of the pen height.

This fine tune should be done using practical, be very patient .......

Ensure that the tweezer do not touch the pen guide piece.

Step 12: MOUNTING THE Y-TABLE OVER THE Y-AXIS BASE

Materials needed for mounting the "table" plot.
2 x plastic spacers WITH 3MM threaded

4 x (10mm x 3mm) screws

1 x phenolite plate (100mm x 100mm)

2 x metal plate (100mm x 100mm)

Double-sided tape.

Cut into a plate of metal (100mm x 100mm) that will be used as basis of the table (DO NOT DRILL HOLES ON THIS PART), the flatter the better.

Cut a piece of phenolite (100mm x 100mm) and make two drills (centered and spaced like in the Y-axis base header, see the figures above).
So the drilling must be done so that the screw pass through it completely. The drilling must be in line with the holes in the base of the Y-axis (which are existing in the laser head).

Cut a piece of metal plate (100mm x 100mm) and make two drills as above instruction (but just tomput the screws and not to pass it completely) this piece will be used as the basis of the table.
Mine was removed from the old disk (3 1/4) driver.

Note that the existing holes in the head of the LASER will fit very good for the base table structure.
Put the spacers in these holes with (10mm x 3mm) screws.

Now let's make a "sandwich" with phenolite plate and other metal parts

Join the table basis with the phenolite plate using double sided tape

Join the flat metal part with the last one using double sided tape

Take in mind that the screws are internal and should not overpass the phenolite height.

Step 13: ALMOST DONE!

CONGRATULATIONS!!!
If you follow all the steps up to here,....... and if you had a lot of patience and a lot of persistence, your MiniCNC - Plotter should be almost done.

Step 14: PEN OR PENCIL MOUNTING

Use a felt tip pen and bright paper (photographic paper) for better results in the tests.

The special screws was taken from an old sewing machine. They have a smooth surface which will facilitate the "tweezers" movement

Make a hole in the pen body about 800mm from the tip (this height must be adjusted by testing on the machine).

Step 15: MOUNTING THE ELECTRONIC PARTS/MODULES

Now it is time to mount the Electronics modules.

Starting with the stepper motor drive ( using L293D integrated circuit) See all diagrams above. I mounted the electronics components on a standard perforated board. All diagram and photos can be download from the GitHub: https://github.com/Arduinobymyself/ABMsMiniCNC Also the "Fritzing" schem. The board was designed on DIYLC software "Strip_Board_diylc-3.28.0", it can be downloaded for free from: https: //code.google.com/p/diy-layout-creator/download ...

In the diagrams we have the following pins attached to the board: D2, D3, D4 and D5 - connection to Arduino pins; M1A, M1A 'M1B and M1B' connection of the coils A and B to the step motor (Y-axis); D8 axis, D9, D10 and D1 - connection to Arduino pins; M2A, M2A 'M2B and M2B' connection of the coils A and B to the step motor (X-axis)

In the step motor we have 4 wires, take a look in the figures to know how to identify the coils A and B, the wires are A / A ' and B / B'

Material: 2 x L293D2 x socket for IC 16 pins 2 x 220nF poliester capacitors pinhead bars with 4 pins (in my case I used male and female)

The technique I used to mount the perforated board is .... creating all tracks with tin solder to connect the components like in a printed circuit board (see the figures above).

Step 16: CONNECTING ALL MODULES TOGETHER

Using some jumper we can connect all modules (Arduino to step motor driver)

Use double sided tape to glue the modules on the structure frame (on the back)

Connec all jumper as shown on the diagram.

Step 17: SOFTWARE AND PROGRAM

The software that we need are listed below and can be downloaded from GitHub.

https://github.com/Arduinobymyself/ABMsMiniCNC

1 - ArduinoByMyselfMiniCNC.ino file - you must open this file in the Arduino IDE, it must be compiled and sent to the Arduino Board.

2 - CNCTool.pde file - You must open this file using Processing IDE, it is the men-machine interface.

InkScape - If you wanto to create your own G-Code (CNC language - instructions codes), you will need this Image editor and an addon. You can generate the G-Codes from any Images or Texts.

There are a lot of tutorials on Youtube regarding this matter, I will put here (in a near future some tutorial too, stay tuned!)

You must download 0.48 version from:

https://inkscape.org/en/download/windows/Download

And the Add-on "MakerBot Unicorn G-Code Output for Inkscape" (in order you be able to generate G-Codes files) from:

https://github.com/martymcguire/inkscape-unicorn

You can download processing from:

https://processing.org/download/

Arduino codes to testing the Z, X and Y - axis:

Eixo X:
#include

const int stepsPerRevolution = 20;

//Connection pins: Stepper myStepperX(stepsPerRevolution, 8,9,10,11);

void setup() { //Set speed: myStepperX.setSpeed(100); //max 250 steps for dvd/cd stepper motors myStepperX.step(160); delay(100);

}

void loop() { }

Eixo Y:

#include

const int stepsPerRevolution = 20;

// Connection pins: Stepper myStepperY(stepsPerRevolution, 2,3,4,5);

void setup() { // Set speed: myStepperY.setSpeed(100); // max 250 steps for dvd/cd stepper motor myStepperY.step(160); delay(100);

}

void loop() {

}

Eixo Z:

#include const int penZUp = 50;

const int penZDown = 30;

const int penServoPin = 6;

Servo penServo;

void setup(){

Serial.begin( 9600 );

penServo.attach(penServoPin);

penServo.write(penZUp);

delay(200);

}

void loop(){

penServo.write(penZDown);

delay(5000);

penServo.write(penZUp);

delay(5000);

}

After the tests... your are finally able to print the first image or text message. Lets do it together:

1 - connect your computer to the Arduino board via USB cable;

2 - opens the Arduino IDE;

3 -Load the "ArduinoByMyselfMiniCNC.ino" file;

4 - compile the file;

5 - sne d the file to the Arduino;

6 - opens "Processing";

7 - Load the "CNCTool.ino" file (see attached figure);

8 - Play the file (it will be opened the CNCTool application) (see attached figure);

9 - Basics commands from CNCTool by typing (see the figures for further details):

p - it will be selected the serial communication port with Arduino board;

0 - this command configure the initial position of the machine (Zero position, it is so important that the allall axis be in the phisical zero position before this command);

g - loads the G-Code to the machine (in the GitHub repository there are some test purpose files);

x - to stoping the file processing on the machin (stop sending the file to the Arduino) or if anything wrong was happened type "x" command

All G-Code commands performed by the machine can be seen in real time in the "Processing" window.

If all goes well...... CONGRATULATIONS!!! You conclude this project from "ARDUINO By Myself"

Step 18: VIDEOS

See this video on youtube: https://youtu.be/etN0WQvSqrk

I am so sorry but I have not produced videos in English language yet.

SOON...... MORE VIDEOS REGARDING THIS PROJECT! STAY TUNED!

***Feel free to pointing any error on this tutorial (including Inglês language because I am not native speaker) , I will be glad to correct them.

For doubts, comment and suggestions keep in touch.

arduinobymyself.blogspot.com.br

arduinobymyself@gmail.com

Arduino All The Things! Contest

Participated in the
Arduino All The Things! Contest