DIY csCNC Controller – 3 (DIY Arduino Board and Programming with BusPirate)

For CNC controller, we have two choices, PC or dedicated controller card. Most DIY designs use Mach-3 or LinuxCNC. They use LPT port for interfacing and PC side software take care of everything. The problem is that LPT port is not an option today PC even for a bit outdated one. I searched for opensource CNC controller with simple, cheap, DIY friendly building solution ūüôā . Most are not meet up for me.

Finally, I keep my eye on Grbl.

https://github.com/grbl/grbl

https://github.com/grbl/grbl/wiki

– It is opensource, Arduino base, quoted from Grbl wiki

“Makers who do milling and need a nice, simple controller for their system that will run the ubiquitous Arduino Uno. People who loathe to clutter their space with legacy PC-towers just for the parallel-port. Tinkerers who need a controller written in tidy, modular C as a basis for their project.”

I am a PIC guy but the simplicity and rich full featured lib and software support of Arduino swayed my mind. Every programming language and platform has it’s learning curve but Arduino is not. If you have experience on any microcontroller paltform, you can build it up Arduino within a few hours.

In short, I built my own Arduino board (based on UNO core). I don’t want to scarified my ¬†Arduino board in CNC project and want to save a few¬†bucks and also wanna to have fun.

1# Started using a perfboard, a ATMEGA328P, crystal, some capacitor and resistor, headers, pin base and some jumper wires and also FTDI FT232 board.

Started with basic design, I omitted power supply parts. Here is my basic sketch schematic.

MY_DIY_Arduino-Circuit

DIY-Arduino-Hardware (1) DIY-Arduino-Hardware (2)

2# Soldered headers, LED at PIN-13 and Reset switch. Also a header for FTDI board, external power connector, jumper for USB power, Power LED, pulled up resistors for SDA and SCL are soldered. Dont forget FTDI-DTR pin to connect RESET pin of ATMEGA328. If not, you cannot program Arduino.

DIY-Arduino-Hardware (5)

DIY-Arduino-Hardware (6)

3# The back side or perfboard PCB.

DIY-Arduino-Hardware (7)

After building the board, I have to program the ATMEGA328 with bootloader. The procedure is simple but I need a programmer for this. There are some alternative methods for burning bootloader to Arduino.

–¬†http://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

–¬†https://learn.adafruit.com/arduino-tips-tricks-and-techniques/arduinoisp

–¬†https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader

I picked my buspirate and follow the procedure from this blog. Thanks, BP support as AVR programmer.

http://blog.allthingsgeek.com/article/index/index/id/27

http://dangerousprototypes.com/docs/Bus_Pirate_AVR_Programming

1# Connected the Arduino board and Buspirate .

buspirate-AVR_Programmer

DIY-Arduino-Buspirate

2# Download “optiboot-master” from Arduino source. ¬†Installed WinAVR for AVRdude programmer support for Windows.

https://github.com/Optiboot/optiboot

http://winavr.sourceforge.net/download.html

According to Eric’s blog post, I created a .bat file for easy programming.

PAUSE
avrdude -c buspirate -p m328p -P COM7 -U lock:w:0x3f:m
avrdude -c buspirate -p m328p -P COM7 -U efuse:w:0x05:m -U hfuse:w:0xD2:m -U lfuse:w:0xFF:m -U flash:w:optiboot_atmega328.hex -U lock:w:0x0F:m
PAUSE

3# Then, simply run in command line, waited for 10 mins (yes, it is a bit slow) and the job was done.

DIY-Arduino-Firmware (8) DIY-Arduino-Firmware (9)

DIY-Arduino-Firmware (1)

4# Plug USB cable, just build¬†a “blink” sketch and successfully upload and run. LED at PIN-13 is blinking successfully ūüėÄ .

DIY-Arduino-Hardware (15)

Finished DIY Arduino board.

DIY-Arduino-Hardware (16)

5# Side by side with original Arduino.

DIY-Arduino-Hardware (17)

Last job is need to attach all and make the first run.

By Oakkar7

okelectronic.wordpress.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s