# Home made CNC controller



## Galoot (Mar 21, 2020)

I have been at this for a while, but finally finished and tested it tonight. It works well and all I need now is a mill to connect the steppers
up to. I built this initially to do isolation milling on PCB's, but since that time I started to think about other projects as well. This is based
around an Arduino and GRBL of course. The Arduino is in the bottom right hand side and I added a couple of other boards also. The one
with the most LED's displays XYZ direction as well as limit switch status. The limit switches enter via the left side of the box into the display
board. This was built on prototype PCB using point to point wiring. On the left side of the same board I added an optocoupling circuit so
everything is isolated from the outside world (much like I am these days).  The steppers are dual shaft 267oz NEMA23's and the drivers
are 2DM556's. Using a 48V power supply with it all. In the middle left there is a solid state relay for coolant control later if I get that far. I do have
a box pan and brake so I bent up my own enclosure. Probably could have left out the display board I suppose as it is only for indication of axis
movement, limit switch and probe status but all the blinking LED's looks impressive!


----------



## Johnwa (Mar 21, 2020)

Nicely done.  I wish my wiring projects looked that neat and organized.


----------



## CalgaryPT (Mar 21, 2020)

That's really nice. And neat. Those Arduinos (yours looks like an UNO maybe?) are such great platforms. Just too bad they can only run one process/sketch at a time. I guess I need to learn Pi next.


----------



## Johnwa (Mar 21, 2020)

Apparently you can have more than 1 “void loop()” on an Arduino duo. I don’t know what that actually accomplishes though.


----------



## CalgaryPT (Mar 21, 2020)

Johnwa said:


> Apparently you can have more than 1 “void loop()” on an Arduino duo. I don’t know what that actually accomplishes though.


I've tried that a few times, but because things aren't multi-threaded, it's glitchy. At least the code I write is. I usually end up blocking code and because many of my sketches involve timed functions this is an issue. I think the loop() trick only works in certain cases that aren't time dependent. I think it's a bit of an improvement over the delay function, but still too clumsy for me.

I'm hesitant to go down the Pi rabbit hole because I know I'll never get out. Not super anxious to learn Python either, as I vowed to never learn another language again. It just sucks you in. What I love about the Arduino is how easily it interfaces with hardware. But I always end up looking at all those leftover input/output pins and thinking, "what a waste."

Have you tried Pi @Johnwa ?


----------



## Galoot (Mar 21, 2020)

CalgaryPT said:


> That's really nice. And neat. Those Arduinos (yours looks like an UNO maybe?) are such great platforms. Just too bad they can only run one process/sketch at a time. I guess I need to learn Pi next.


You're right; only one process at a time. For this application (controlling steppers) that is a plus. I thought initially of using LinuxCNC and
a parallel port interface, but the uncertainty of finding the right H/W combo to ensure minimum latency became too much to bother with.
Yes, that's just an UNO. I also have a Arduino clone which works too as a backup. I don't have a PI. Have worked in computer S/W eng most
of my career and now retired, so now on to other things!


----------



## Johnwa (Mar 22, 2020)

@CalgaryPT 
I have a couple but never really found an urgent need for them. I do have a couple of Pi projects on my list though.

Right now I’m down the Esp32/esp8266 rabbit hole.


----------



## CalgaryPT (Mar 22, 2020)

Johnwa said:


> @CalgaryPT
> I have a couple but never really found an urgent need for them. I do have a couple of Pi projects on my list though.
> 
> Right now I’m down the Esp32/esp8266 rabbit hole.



I may pick your brain on the ESP8266 at some point. That looks promising. I know you make your own boards, but can't recall it you use SMD? Another thing I have to play with, but worried my eyesight isn't good enough.


----------



## Galoot (Mar 22, 2020)

Not sure if I'm straying too far off topic here so I'll stop after this one! Happy to see though a wide range of interest
on this forum. My objective in doing light CNC work was to enable my main interest in building RF circuits for amateur
radio transmitters/receivers.  This was my most recent SMD build:




It may be ugly but it works really well.
I want go to this type of construction:




I made many PCB's over the years and progressed from using nail polish as a resist to UV sensitized boards and my last attempt
was iron laser jet layouts from KiCad onto PCB and good old Ferric Chloride. It worked ok but not so much for narrow traces
when I began more SMD work. This led me to PCB isolation routing which needed a CNC controller/mill. Probably I'll get a Sherline. 
I found an old Leica microscope which eases the strain on 70+ year old eyeballs too, so never fear SMD work! I prefer it now and
I never, ever expected that to happen. I was trying to stay away from too much computer work as after making a living at software for 
decades, my goal was/is RF work since it's part science and part art. I suppose after turning out a few projects I'll be tempted to
give in and look at LinuxCNC again since I'm seeing so much more I can do with CNC's. First things first though!
But now after the mention of ESP8266's and finding the Arduino is as much fun as a Sun workstation & Unix was, and reading up on
ESP's this morning, yet another rabbit hole is waiting for me.


----------



## CalgaryPT (Mar 22, 2020)

So nice....great stuff. A lot of us here play with this stuff as well. My project a few posts ago was an RC Lawnmower: https://canadianhobbymetalworkers.com/threads/rc-mower-complete-on-to-next-project.1938/
&





Nice to have more interests combined with metalworking. And backup spotters to pull each other from the rabbit hole. Or maybe it's more of a Sarlacc pit.


----------



## Johnwa (Mar 22, 2020)

So far I’ve stuck with through hole stuff. 
I did one smd Arduino board at a protospace workshop. Best thing about smd is not having to drill so many holes. 

I only do a couple of boards a year, nothing too complex. My best success has been with UV photoresist. A pcb board Cnc does sound interesting.

The smaller ones on aliexpress are reasonably priced, too bad our $ has tanked.


Sent from my iPad using Tapatalk


----------



## YYCHM (Mar 22, 2020)

Johnwa said:


> I only do a couple of boards a year, nothing too complex.



Boards for what purpose?

Craig


----------



## Johnwa (Mar 22, 2020)

The one I’m working on now is a kiln controller.


----------



## YYCHM (Mar 22, 2020)

Johnwa said:


> The one I’m working on now is a kiln controller.



What feature(s) do you need that a PID can't provide?

I did a small project for @TheLocalDrunk on one of these https://docs.ghielectronics.com/hardware/duino/fez-cerbuino-bee.html?q=FEZ.  Was great fun.  Gadgeteer is defunct, so I had to reverse engineer a lot of stuff.

Craig


----------



## Johnwa (Mar 22, 2020)

I’m sticking with the original mechanical relay so PID doesn’t do anything for me.
Besides why would I spend $20 for a controller from China when I can spend tens of hours designing my own.

I do have a PID controller that I will use if my heat treat furnace project ever sees the light of day.


----------

