iDRY Vacuum Kilns

Sponsors:

Raspberry pi as a standalone CNC controller

Started by Crusarius, November 08, 2022, 04:37:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Crusarius

Many of you know I recently built a CNC router. I have a DDCSV3.1 standalone controller I purchased from Amazon. It works pretty well, does a decent job at running g-code. 

Yesterday I had about an 18" cookie I wanted to quickly surface. Normally I would run to my computer and use my custom excel programmer to write a quick program to surface it. This time I did not feel like dealing with all that so I attempted to surface it manually.

This attempt worked just fine. definitely took more time but the extra control was nice.

What I am finding is that I want to have more capability with the CNC controller. I was thinking of a quick pattern tool for quick surfacing.

I want to be able to have a square pattern and a round pattern so I can just set the cutter at the start point and input dimensions then hit run. I think the best way to do this is a raspberry pi. The trick here is making the pie run the two quick surfacing programs and still being able to use it just like my current controller.

can anyone help me with ideas? The deepest I have gotten into electronics is building this CNC. I know I can figure it out, but don't want to invest a ton of time and money on something that may never pan out.

If I could find a way to just run an excel file on the controller to create the g-code then export, that would be the easiest since I can write the excel files without any issues.

Ianab

Would your Excel system work with the web based Office 365? It doesn't have all the features of the full version, but because it's browser based it doesn't care what your processor or OS actually is.
Weekend warrior, Peterson JP test pilot, Dolmar 7900 and Stihl MS310 saws and  the usual collection of power tools :)

rusticretreater

Hey guy,

I can help you with this but it would probably be better to take the conversation to PMs and you can post a final solution if you wish.

Check your PM in a bit.
Woodland Mills HM130 Max w/ Lap siding upgrade
Kubota BX25
Wicked Grapple, Wicked Toothbar
Homemade Log Arch
Big Tex 17' trailer with Log Arch
Warn Winches 8000lb and 4000lb
Husqvarna 562xp
2,000,000th Forestry Forum Post

Old Greenhorn

It's been a very long time for me, but how complex of a G-code program can your controller handle? Can it take loops, macros, variables, or IF statements? If so, you could do the square pattern at least with a loop or a macro. The round pattern would have to be an academies spiral and I am not sure how to do that.  I would have to spend a day getting my head back into that game, maybe more, before I could give you some simple code, but that would be my first and simplest choice. It amazing how fast you can forget things you did for over 40 years if you really want to. ;D
Tom Lindtveit, Woodsman Forest Products
Oscar 328 Band Mill, Husky 350, 450, 562, & 372 (Clone), Mule 3010, and too many hand tools. :) Retired and trying to make a living to stay that way. NYLT Certified.
OK, maybe I'm the woodcutter now.
I work with wood, There is a rumor I might be a woodworker.

Crusarius

Quote
G90
G21
G0
M03S10000
G1 X0 Y0 Z15 F2000
Y-127 Z-0.254
Y723.9
X62.992
Y-127
X62.484
Y723.9
X125.984
Y-127

above is a snippet of what my excel program outputs. typically I just copy and paste it into notepad then save a .nc file. One day it will be macro enabled so I do not have to copy and paste. but for now, it is unfinished quick and dirty program :)

My controller can handle complex g-code with program calls and everything else without problem. At least it appears to, I have not tried it.

The big thing I am looking at is trying to make a super easy user interface with program calls that can load a program but have it so you can input dimensions to run.

Lets say I have a cookie I want to flatten. I want to place the cutter roughly in the center of it, call the program, then input the tool diameter and the cookie diameter and possibly amount to remove, then run it. 

Currently I have to go to my computer and make the program. and worst of all I only have a square program setup. 


now the next part of the challenge is I also want to be able to just load a standard .nc file and run it like any file I currently run.

I keep drooling over the masso G3 touch but I don't think that has the programmable parts I am after.

so I really am looking at a full controller replacement with a lot of programming involved.

The ddcsv3.1 works well but being a guy that is used to manual machining with a mill I really miss manual machining with the CNC :)

Old Greenhorn

Yeah basic code, I get it, but that G21 I could not recall what that means (machine specific?). I used to be able to spit this stuff out without thinking, but now it is fading fast.  ;D Up until now I thought that was a good thing.
 I am getting the picture, I think. SO if I may, is it fair to say that you can't read (or write) the G-code directly and want another program to interpret your numbers and generate the code? (This is not a criticism, it is a question.) I know it may not seem easier and I have seen this in countless programmers that came after my generation, it is 'the norm' in fact. But I come from the days when we would cut a punched tape and if there was an error, we could read the code in the tape, cut out the error and tape in a new section with the correction. The point is, for me, I could write the G-code directly nearly as fast as some other programs could generate it, as long as it wasn't too complex. Where this paid off was in macros, loops, and using variables and calls. I have found precious little software that could handle this at all, let alone do it well. If you understood the process and could write the code, you could write a program that would run for 30 minutes with just 4 or 5 lines of code. BUT you have to do it manually.

 The concept is, you state your variables i.e. V1 = width, v2 =length, v3=stepover, etc. Those are the only numbers you need to edit based on the job (what are the dimensions of my area, and what is my cutter size?). The program does a move using the variable values, then another and another always calling the variables. There needs to be a limit statement, either a number of iterations (loop), or a variable dimension (using an IF statement).
 I am being very general here because I don't recall the syntax as I could have 3 years ago. Actually 3 years ago I would have run you off some code and said 'try this and see if it runs ok'. Sorry but I have lost those skills already. But once you go through the pain of learning this, the programming takes minutes because the program is so short. I would drive guys crazy because I could type out a manual program for simple routines in 1/10th the time it took them to generate it through a software program and then have to edit it anyway for functionality. In 40 years of programming I NEVER found a software platform that would generate macros worth a darn and we did some pretty complex ones. Everyone was handwritten, but man were they efficient. When you wanted to change size or shape or depth or whatever, you just went in and edited a single value and it all trickled out through the whole program.

 Lots of words here to say that it might be something to consider.
Tom Lindtveit, Woodsman Forest Products
Oscar 328 Band Mill, Husky 350, 450, 562, & 372 (Clone), Mule 3010, and too many hand tools. :) Retired and trying to make a living to stay that way. NYLT Certified.
OK, maybe I'm the woodcutter now.
I work with wood, There is a rumor I might be a woodworker.

Crusarius

I can read and write the code no problem, that is how I managed to write an excel program to spit out the code. (I am not offended at all just to be clear :))

But I want to completely replace the chinese controller I am running now with one that I can have preset programs that allow you to change numbers for quick operations like surfacing or pocketing. (G13 just found that one apparently it does not work on fanuc machines) and also run normal programs generated by other software. 

I want to have the ability to have easily editable programs right at the controller but not have to be an expert in writing g-code. I am hoping to produce this unit for more users in the future.

Old Greenhorn

Many of the G codes were purchased options on the Fanuc's. In the early days you could 'take care' of your installation tech and add a bunch of options on the machine when it was being installed and checked out. Nowadays, not so much. They even put geostationary chips in the machines now that will disable them if they are moved and have timers in them so you have to make your payments and get a code to run another few months, if you don't put the code in, the machine shuts down. G13 was one of those options you had to buy and I don't recall ever trying that one out. (Pocketing) I never ordered it on the machines I spec'd out.
 Yes, I now have a picture of your end goal, and that makes sense for what you are doing. You could accomplish this with Variable programs, but they can't be generated through software. What we always did was document what those variables were in the heavy comments, which made it very easy for the operator to know which numbers to edit to get what they needed.
 But you've gotta follow your own path. I was just trying to give you some options. You can do a lot with those controls that the manufacturers say won't work. Back in the 80's I wrote a program to do 3 axis milling on a machine that was stated to only do 2-1/2 axis milling and the job came out great. (The program was so long I had to dump everything in the machine control to make room and cut the program in half and run the 2 sections separately.) In the 70's I wrote the first program to mill threads on a K&T MM180 after the manufacturer told us it wouldn't work. 3 months later they were advertising that their machine was accurate enough to mill threads on aircraft parts and sharing my code (which was extremely simple since I figured it out). They never thanked me. One of their techs saw us using it in production and asked lots of questions and apparently passed the intelligence on.
 Your limits remain boundless. Find your path and follow it, but keep your mind open. You will do well with it.
Tom Lindtveit, Woodsman Forest Products
Oscar 328 Band Mill, Husky 350, 450, 562, & 372 (Clone), Mule 3010, and too many hand tools. :) Retired and trying to make a living to stay that way. NYLT Certified.
OK, maybe I'm the woodcutter now.
I work with wood, There is a rumor I might be a woodworker.

Crusarius

Thank OGH, I always try to keep an open mind. I was mostly hoping someone with a little more pi experience would be able to give me some pointers or a direction to go. I found some stuff online where somone was using a pi being driven by arduino uno with a voltage converter to balance everything since the pi runs at 3.3v and the arduino uno at 5v

my biggest issue is I know enough to be dangerous but not enough to know what I don't know. and I really do not have any extra funds to just start buying stuff and trying it.

I did learn more about variables last night which may be a step in the right direction. Unfortunately, with my controller getting into the g-code to edit it is not very easy and will not work for inexperienced users.

btulloh

No doubt it could be handled by a pi.  Add a monitor and a keyboard and the pi is just another desktop computer with the ability to run various operating systems. Details are important though, as always. I don't know anything about your controller so it's hard to give specific advice.

I use a pi as a server to manage the 3d printer after producing the gcodes on my main desktop. I use a remote desktop application to deal with the pi instead of a separate monitor and keyboard. Different way of doing the same thing. Thing is with the 3d printer there's ready-baked software do all that. I would think that's true with your controller as well, but just guessing. Only difference would be you don't need a slicer to produce the gcodes. Or do you?  There's no real difference between a 3d printer and your cnc router except for the tool at the end of the line. 

I use autodesk Fusion 360 for design work and it will deal with either 3d printers or cnc for output files. I see that some of the open source cad stuff will also.  A lot of learning curve and other aggravations involved though.  

Surely there's a way to do what you're asking but I don't understand your specifics enough to really help!  This stuff is always a science project!

BTW - using the pi as a server for the 3d printer gives me the ability to remotely monitor a print from my phone or whatever using a cheap pi camera module. Very handy for long prints - I can see when it screws up and starts doing that air printing thing where I get a big ball of cotton candy instead of an object. 
HM126

btulloh

HM126

rusticretreater

The issue with going with a RaspberryPi is that it is simply a computer.  You still need to add the peripherals(LCD screen, CNC hookups, etc.) to make it work.  Then you also need the software to run the controller.  User input is a problem in that you want a touch screen or buttons on the console to eliminate a mouse and keyboard. In short, you are rebuilding what you currently have.

I have seen a few hacks online where people are hooking a Pi to the controller but also people using a CNC Hat(another board added on top of the Pi) to give CNC outputs.  Then there are folks running LinuxCNC on the Pi too.  LinuxCNC has a programmable interface that would allow you to make the input areas you want.

I use LinuxCNC and have been successful in getting a game controller to move the machine and have modified the interface several times so I am sure you can get inputs to work.  Still, I use a PC, mouse and monitor to control the machine.

According to the manual for the DDCSV3.1, it has a linux OS which means that it probably can be hacked.  But who knows what the controller software is and whether you can modify that or find a suitable open source project to replace it with.  Once this figured out, you can simply load the production image of the code on the controller, test and ship. Of course, you also run the risk of bricking the controller.

The solution of building your own controller from scratch is probably not workable in your case as a one man shop currently.  Not only do you have to build machines, but also controllers and there are certainly many issues with quality control and business management to deal with.

So, after going through the various possible methods and still not finding an easy add-on solution, it appears to me that there are three scenarios to pursue.

1. You provide the user with the basic .nc program file that uses parameter references and instructions how to use the program and set the variable values through the current interface.  This should work.

2. You find a roll-your-own solution online that has a hackable controller and open source software that you can quickly use to get to your desired solution.

3. Find a vendor that will work with you to give you a custom interface or the software development license and tools to set this up.
Woodland Mills HM130 Max w/ Lap siding upgrade
Kubota BX25
Wicked Grapple, Wicked Toothbar
Homemade Log Arch
Big Tex 17' trailer with Log Arch
Warn Winches 8000lb and 4000lb
Husqvarna 562xp
2,000,000th Forestry Forum Post

Crusarius

my controller is just a basic CNC controller, it has the simple jog functions, tool offsets and all the normal CNC stuff. Nothing fancy.

if I try the pi it will have a touchscreen so I can have everything in one small convenient package. 

The g-code is not run through a slicer per se, but it does need to be processed. currently I use carbide create for complex stuff otherwise excel for simple stuff.

I love the idea of remote monitoring. that could be very helpful in the shop. Especially when its cold out there and I want to be warm :)

I will try to lay everything out so I can get an idea what I would need to do this but for now I have to get a cutlist together to get some stuff ordered for the big bad mamma jamma :)

Thanks everyone for the help so far. This is definitely far from over. I am trying to find the best and easiest to use CNC control I can. It will be a fully functioning CNC but will cater towards flattening large surfaces. 

Crusarius

Rustic, I like your ideas.

option1: super simple, probably the way I should lean instead of getting to crazy making my own controller. Still curious if my own controller would be a good investment in time and money.

option2: buildbotics actually makes a real nice open source controller. and I have thought about using that instead of the ddcsv3.1 my biggest issue is the graphical interface is lacking.

option3: is probably big money with minimum purchases and guarantees. but in the grand scheme of things if I can get this to take off would be the best way to go.

Not sure I am brave enough to try to hack the ddcsv3.1. the controller works well but is just a little cumbersome for someone like me that is so used to manual controls on everything.

Thank You Sponsors!