## Wednesday, December 7, 2011

### Junkyard Gems : Part II

Just acquired two more old printers from the local junk place, I was able to harvest some really nice stepper motors, precision rods and bearings along with a handful of limit switches and some random goodies. I think these old printers and scanners are a great way of getting some components on the cheap, highly recommended  !!

## Friday, December 2, 2011

### Updates : Components are here !!

After over a week long waiting period the components i ordered for my CNC have finally arrived !! Its mostly just electronic stuff for the drivers and control circuitry but its a start. I still need to get the material for the structure of the machine (wood or aluminum or a combination of both) but I am hoping that i can source that locally. Another main component that I don't have my hands on yet are the stepper motors but thanks to Anil over at http://www.tinycontrols.com/ I should have them shortly. Anil has graciously decided to provide me with the motors I require for this project. These motors should be able to power my X,Y,Z axis plus a fourth motor for the 3D printing head that I intend to add later. Anil also has some very nice high quality stepper motor driver boards if anyone is interested but for the time being I will be designing and making my own electronics.
Here is a list of all the stuff I got, these are all suppliers I have ordered from many times and their service is quite good :

www.onlineTPS.com

 1 x USB A To B Cable (TPS-00778) Rs.30.00 4 x L298N - H-Bridge Motor Driver (TPS-00126) Rs.440.00 1 x DB25 Right Angle -PCB Mount Connector- Female (TPS-00815) Rs.15.00 1 x SD (Secure Digital) Memory Card Connector (TPS-00220) Rs.20.00 1 x SIM Connector-Slide type (TPS-00222) Rs.20.00 4 x USB Standard-B Plug Receptacle Connector (TPS-00933) Rs.60.00 10 x 10 Pin Box Header (TPS-00227) Rs.50.00 10 x 10 Pin FRC Cable Connector (TPS-00229) Rs.50.00 10 x 2 Pin Screw Terminal (TPS-00233) Rs.50.00 2 x 0.001uF Capacitor Pack - 10 Nos. (TPS-00399) Rs.10.00 1 x 22pF Capacitor Pack - 10 Nos. (TPS-00405) Rs.5.00 5 x 10uF/50V Radial Electrolytic Capacitor (TPS-00412) Rs.15.00 5 x 2.2uF/50V Radial Electrolytic Capacitor (TPS-00415) Rs.10.00 5 x 4.7uF/63V Radial Electrolytic Capacitor (TPS-00419) Rs.15.00 2 x 20 Mhz - Standard Frequency Crystals (TPS-00749) Rs.20.00 32 x BY399 - Fast Recovery Diode (TPS-00285) Rs.192.00 1 x Copper Clad PCB - Glass Epoxy 6*4 Inches (TPS-00015) Rs.55.00 3 x Copper Clad PCB - Paper Phenolic 6*4 Inches (TPS-00013) Rs.90.00 1 x Ferric Chloride (Fe2Cl3) For PCB Etching 500 gms pack (TPS-00002) Rs.160.00 5 x 10 Ω - 20 Watt Resistance (TPS-00826) Rs.60.00 10 x 10K Ω Cermet Preset (Variable Resistance) 3386-P Package (TPS-00484) Rs.70.00 2 x 12V Brushless DC Fan (TPS-00536) Rs.70.00 2 x 12 Volt PCB Mount Relay - 7 Amp (TPS-00509) Rs.28.00 1 x Dip Switch - 8 Pin (TPS-00512) Rs.14.00 1 x DPDT Switch - Center Off - Rocker - Lock Action (TPS-00525) Rs.35.00 8 x Ultraviolet (UV) LED - 5mm (TPS-00201) Rs.80.00 1 x Drill Bit - 2mm (TPS-00911) Rs.25.00

www.nex-robotics.com

QuantityNameProduct IdPriceSubtotal
4L297 Stepper Motor controller NR-L297-DIPRs.115.50Rs.462.00
4PI48 Heat Sink NR-HS-PI48Rs.8.44Rs.33.76
1030mm Plastic Extender Stud NR-PLAS-EXT-STUD-30mmRs.4.73Rs.47.30
2035mm Metal Stud NR-MET-STUD-35mmRs.7.40Rs.148.00
1stepper trainer half heatsink PI 24 127MM NR-HS-PI24-127mmRs.88.20Rs.88.20
4TIP35C 100V, 25A NPN Power Transistor NR-TIP35C-TO218Rs.45.36Rs.181.44
100.5E NR-R0.5E-3WRs.5.25Rs.52.50
50.1E NR-R0.1E-3WRs.5.25Rs.26.25
21E NR-R1E-3WRs.5.25Rs.10.50
39 PIN DB MALE CONNECTOR NR-CONDB-M9Rs.11.34Rs.34.02
39 PIN DB FEMALE CONNECTOR NR-CONDB-F9Rs.12.39Rs.37.17
1FT232 – TTL interface NR-FT232-DIPRs.218.40Rs.218.40
2100Kpf NR-C100KpfRs.4.62Rs.9.24
210Kpf NR-C10KpfRs.4.20Rs.8.40
520PIN FRC Cable NR-CONFRC-C20Rs.7.98Rs.39.90
10Mica Sheet NR-HS-Mica-TO220Rs.3.15Rs.31.50
1Heat Shrink Tube 10mm NR-HST-10MMRs.20.25Rs.20.25
1Heat Shrink Tube 20mm NR-HST-20MMRs.45.00Rs.45.00
1Heat Shrink Tube 35mm NR-H ST-35MMRs.99.00Rs.99.00
1Desolder NR-DSRs.17.10Rs.17.10

http://stores.ebay.in/MYAVRSHOP

Atmega1284p                                                                                                       Rs 495.00

More details will be up soon, design for the stepper drivers is complete, now that I have all the components, I need to etch some boards....

## Monday, November 21, 2011

### Updates: 3D printing and a new CNC Toolchain

After initially running my cnc off a python script and firmware written by me I have decided to move on and adopt a more universal open toolchain. This will save me a lot of development time and make my CNC compatible with standards. What this means is i can simply design something in any popular 3D or CAD program (3DS Max, Sketchup, Solidworks...) and export a model file understood by my cnc and have it make it. This will also enable me to use some of the really cool programs already available out there. I still might write some kind of middleware and/or extensions to add functionality but overall this move should make the CNC a lot more versatile.

On the hardware front, after making a proof of concept from materials of dubious quality, I am shifting to a more durable construction to enable cutting and milling of metal (the original could only cut foam). The eventual goal is to have a machine that can do double duty as a cnc mill and a 3D printer. 3D printing is really awesome and is something that has recently caught my fancy. Sadly there doesn't seem to be anyone making or using them at a non-commercial level in India and the cheapest one I could find was for Rs 2,15,000 !! This is clearly too expensive when machines of comparable quality can be built for much less (kits available for about $700 in the US) . So once i have a fairly steady cnc setup going I will upgrade to support 3D printing. The entire setup should be less than Rs 10,000. Anybody out there interested in helping me out with some ideas is welcome. Will be publishing plans, models and details soon ( expecting delivery of some items) . ## Saturday, October 1, 2011 ### Control Circuitry : CNC Part VI The control circuit for my CNC is fairly straightforward and consists of very few discrete parts. The design is based around an atmega8 microcontroller but can just as easily be made using any arduino board. The atmega8 chip is much cheaper at around Rs 75 (~$1.7) as compared to an arduino board and as that was I had lying around I just used that. I am using the internal oscillator for my design the "support" components typically associated with building your own microcontroller board are few. However, one downside is that you would have to build the serial communication module which is directly accessible in an arduino via USB. I already had a MAX232 level converter module left over from another project so this was not an issue for me.
The other crucial components of this circuit are the dual H-bridge  ICs. One such chip is used to drive each stepper motor for a total of 3 such chips. The H-bridge i used was the L293D as i has some at hand and each chip can handle current of about 0.6A which was well suited to my motors. For bigger motors you may make use of L298 chips which can handle 1A each. Each driver chip requires 4 inputs which are responsible for deciding how each stepper motor coil is excited. By controlling the speed and order in which we excite each coil in succession we can control the speed and direction of the stepper motor.

Here is the schematic and board layout in eagle.
DISCLAIMER : The schematic and board were drawn up after i had actually made the circuit by hand and therefore i cannot guarantee that they are error free. Also i learned eagle about 10 minutes before writing this post so any suggestions or tips are welcome.

My "skills" at eagle have made this seem way more complicated than it actually is...

I will be most grateful to anyone who can help me out by doing a single sided layout of this board. Finally a couple of things to keep in mind before any one goes and tries building this circuit:
1) The motor driver ICs WILL need to be changed to suit individual motor types, especially if you intend to use bigger motors
2) The motor driver ICs absolutely NEED to have a heatsink on them for best outcome. I used a passive aluminum heat sink that i had scavenged from an old PC power supply. The IC can be warm to the touch but NOT hot. Application of a small amount of thermal paste(i have heard Colgate toothpaste works too) helps a lot.

Here is my handiwork......

Made on a peice of perfboard

More pictures of the project at the flickr photostream. All the schematic and board files for EagleCad are available at my github repository https://github.com/ToothOgre/CnC along with all other associated code and design files.

Next up, details on exactly how the code functions and how to use it...

## Friday, September 30, 2011

### The Mutant Tweety Curve : CNC Part V

Until now my CNC required hard-coded parametric equations to draw figures, but as you may imagine this was really limited in functionality and not useful in any practical way. The solution that suited me best was to import images on a connected computer, process it and stream the generated coordinates to the CNC which will then interpret these instructions and move the various axes in compliance to them.
After a couple hour long search online I came to the conclusion that a vector image file (a SVG in particular) would be best suited for my purposes as it contains a legible xml like format for its paths. A python program was written to parse the input SVG file into cartesian coordinates understandable by my machine. A detailed post on how the software works is in the works. The computer only sends one set of coordinates each time and waits for the CNC to finish processing it and return a confirmation before sending the next set of coordinates. The results of a first-run using this setup is shown below.

The original image

The "Mutant Tweety" drawn by the CNC

The horrible results were because of an extremely unstable Y-axis which has since been fixed by adding guide rails for support. The image seems "squished" because of a deliberate forcing of a 1:1 aspect ratio on the image.
A second attempt with the repaired hardware yeilds far better results. However the Y-axis will need to be rebuilt using some better materials to achieve a completely jitter free image.

Much better...

The odd lines marring an otherwise pretty decent result are because the command that tells the cnc to perform a "PenUp" operation is not implemented yet, causing it to drag the marker on the surface when going from one curve to the other.

Here is a video of the machine in action....

## Friday, September 23, 2011

### Code Bytes : CNC Part IV

I will be maintaining a Github repository for all the code related to my CnC and other future projects. The code for the cnc can be accessed HERE . Please keep in mind that the code is still in its starting stages and contains several "hacks" to get to work on my specific setup. This will be addressed in the upcoming version, which will be modular and contain proper Gcode handling and streaming instructions from a connected PC.

Details on electronics coming soon...

## Wednesday, September 21, 2011

### Sneak Peek : CNC Part III

Here is a video of the CNC machine's first run. Currently the instructions are hard coded into the controller board(more on that later). The micro controller accepts a set of x, y and z coordinates from a function which provides these values to it. In the video the machine first draws a circle then inscribes an astroid in it. The instructions for drawing both are provided by their respective parametric equations.

$x = a+r\,\cos t,\,\!$ $y = b+r\,\sin t\,\!$
and

More details to come soon....