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

DIY csCNC – 2 (Linistepper Driver and testing with Buspirate)

Since I started building DIY CNC, I checked the free, opensource motor controller. There are several alternatives. I chose linisteppr controller.

http://www.piclist.com/techref/io/stepper/linistep/index.htm

http://www.romanblack.com/lini.htm

  • – Simple and cheap (my first priority ūüôā ) and I can source required parts locally
  • – ¬†microstepping, open design (Especially, it’s PIC16F628A based. I’m PIC guy and a lot 16F628A in my stock)

Build log is fast, simple and straight. I used a simple perfboard for faster development.

DIY-linistepper (1) DIY-linistepper (2)

 

After building the driver, I tested it with my buspirate using PWM function for generating stepping pulse. I started with 1kHz and increased to 4 kHz.

  • – Buspitrate GND and AUX pin were connected to driver STEP and GND pins
  • – For full step, motor was stalled at 1 kHz
  • – The¬†motor is smoothly run at 1 kHz at half step and 6th microstepping
  • – The motor running faster and smoother at 4kHz for 16th microstepping
  • Need bigger heatsink or small fan, sa mention in linistepper page,it is hot a lot

linistepper-buspirate (2) linistepper-buspirate (3)

DIY-linistepper (4)

The next part is the CNC controller and software.

By Oakkar7

okelectronic.wordpress.com

 

Bus Pirate Necktie Clip Case

Last year, I got Bus Pirate kit from Dangerousprototypes as a prize for last year 7400 competition. Thanks again DP. This is now an essential tool in by bench. It is not only BP. It came with a box, LCD back pack, test probe, lots of jumpers,.. a complete kit.

 

buspirate

After getting BP, I try to make a case as usual. Mostly, I prefer acrylic style case like my OBLS and PICKit2. DP calls it “Sick of Begie” case. This time, I found out something which was suitable for the Bus Pirate case.

BusPirate_case (1)

Yes, a necktie clip case.

BusPirate_case (2)

GOOD, BP fits inside it.

BusPirate_case (3)

First, make holes for plastic snap-in fasteners.

BusPirate_case (4)

Second, filing the edge for USB cable connector.

BusPirate_case (6)

Then, make a rectangle for probe cable. And fitted the snap-in rivets.

BusPirate_case (7)

 

 

Finally, the case for BP was finished. It took about 15 minutes.