Thank you Joe, I’m an old guy manual machinist that’s been thrown into the CNC world because of the Covid 19 layoffs. I have to say it’s pretty overwhelming. I’m working with a 1996 Fadal VMC 4020. Your videos have really helped me to get a better understanding of how the Fadal controller works. I’ve been able to use the subroutines to spot drill, deep drill, counterbore, and countersink bolt hole circles. They turned out perfect. Because of several videos, of yours, that I watched! Your information is invaluable for someone, like me, who is just learning CNC.
@joepie2214 жыл бұрын
Thanks for the comment. Feel free to ask a specific question if you have a problem. You can reach me through the contact page of my website.
@bcbloc024 жыл бұрын
Being that I have an ancient CNC lurking in the corner of my shop daunting me to attempt to use it the videos like this are a big help to me.
@joepie2214 жыл бұрын
Use a wood dowel instead of an end mill, set the height high and play. keep one finger on that big RED button.
@dominic66344 жыл бұрын
its basically graphing coordinates. So your just plotting the shape with math. When i first started no one explained that to me. eventually I had a very smart boss explain it to me.
@BobH77774 жыл бұрын
I don't know anything about G code and CNC, but this takes me back to the 60s learning Fortran and assembly language computer coding. Even then structuring programs, subroutines, and so on was well advanced over what you show here. Now, I understand CNC has a different set of constraints, but then too programing has been advancing from that for 60 years... 😊
@joepie2214 жыл бұрын
This is basic stuff, but very powerful and saves a ton of space on your system.
@mmoorehct4 жыл бұрын
Thank you for explaining this. I Remember running CNC machines and watching the code and not understanding how the machine was doing so many operations with just a couple lines of code that was 17 years ago and I finally have explanation for it now! :-)
@joepie2214 жыл бұрын
Mystery solved. Glad to help.
@rdavit4 жыл бұрын
“Stop treating CNC like a Bridgeport”......this is me! I use Fusion 360 for pretty much anything that requires any type of interpolation, but for most “jobs” as a hobbyist, I face mill and square up manually. I use Fusion as a safety measure to avoid crashes as well (simulation will show conflicts) as well as a missed decimal point, etc. Great videos, subscribed!
@joepie2214 жыл бұрын
My jog button really got a workout early on too !
@bostedtap83994 жыл бұрын
Excellent, it took to the last few minutes to understand your explanation/rationale. Thanks Joe. Great vlog thanks for sharing. Best regards John.
@joepie2214 жыл бұрын
Thanks John.
@robertoswalt3194 жыл бұрын
Wow, this takes me back to my college days when I was learning to program in Basic. I decided to take the hardware route as I found coding too much like proofreading term papers. Happy 4th and blessings to you and your loved ones.
@joepie2214 жыл бұрын
Thanks. I hope yours was good as well.
@TheSolarPoweredEngineer4 жыл бұрын
Thank you for this Joe, I am writing code at the mo on an Arduino to read G-Code and control my milling machine that I am converting to Brushless CNC (just a home hobby one and a homemade controller). Your videos are helping me understand how I need to control my machine, effectively my machine will be running Pie G-Code 😁😉
@joepie2214 жыл бұрын
I'm no expert by far, but I know enough to get around obstacles that will stop you in your tracks. Good luck.
@TheSolarPoweredEngineer4 жыл бұрын
@@joepie221 Thank you, it's a bit of a mission, currently working through Pi, cos and sin for arc control 🤕, you're very good at explaining everything in engineering terms, so you get my vote 👍
@joepie2214 жыл бұрын
@@TheSolarPoweredEngineer Thanks Neil. Unless your arc control is something unique, any controller that reads G code can execute with a G2 or G3. Once you understand the 'I' and 'J' location, arcs are very easy.
@TheSolarPoweredEngineer4 жыл бұрын
Joe Pieczynski Yeah, it's a little unique, I'm writing a new micro-controller program that reads G code and converts to brush-less motor position control for machine movement, so I am making my own CNC controller and conversion drives for my hobby mill. It's all to speed up the manufacture of components for an Electric Vehicle Conversion that I am working on. It was taking me 6 hours per part to manually mill, hence why I started the CNC conversion project, haha. I have I and J elements included, so it has the start, end and center positions calculated and then works out arc speed to ensure the speed is maintained at different radii. I should have just bought a CNC 😉
@plasmaman95924 жыл бұрын
I have a cnc router and plasma and I am glad I have software that does this stuff for me because that looks like it would take years to learn. I use aspire which I save $2500 by buying the bootleg copy that is on Ebay and I also use enroute which I wish I could have found a bootleg copy of because it was not cheap but still way cheaper than going to school to learn g code. I was looking at a school but the instructor kept telling me I should get a job for some other company after graduation instead of running the business I just invested over 100k in. I figured I would go through a year of him trying to get me to go make $15/hr from someone else instead of selling my signs and other stuff on my own
@maruthupandian37284 жыл бұрын
loved the video! thank you. i have a similar machine like yours but it runs on mach3 with chinese servo drives. i edit g codes in notepad, copy and paste the same code five times and just add the depth for each iteration. never knew or bothered to learn what incremental was for. i hope you make more videos like tjhis in the future too. by the way your manual milling techniques have helped me a lot in the past too. thanks once again.
@joepie2214 жыл бұрын
Thanks for the comment.
@TandaMadison4 жыл бұрын
Happy 4th Joe! Enjoyed the video and think I may go off and write a separate routine for my logo so I can drop it in on parts where I don't want to edit it into the 3D model. For those who haven't done any CNC and are thinking about diving in, I hope they understand that with modern CAM tools they don't have to become a G-Code wizard or even know much G-code just to get started. Alternately, for those that have jumped into CNC in the era of Fusion360 and Mastercam I hope they appreciate the utility of being able to understand and hand code G-code to do things that can be super frustrating or impossible in CAD/CAM but pretty straight forward with a little G-code!
@joepie2214 жыл бұрын
Its a real advantage to be able to scroll a huge program and identify the line you need because you know what you're looking at. Onsite edits can be very beneficial for streamlining a process.. Good comment Tanda. Thanks for stopping by.
@TandaMadison4 жыл бұрын
@@joepie221 Your "under the hood" CNC videos always strike a chord with me because of my odd combination of background and interest in low level programming (formal education in computer science and career in embedded systems) and the fact that I own and operate a Fadal 3016 CNC.
@miles323234 жыл бұрын
Good stuff joe! Happy fourth and hope all is well. I work with mastercrash everyday on my hurco at work and what you are demonstrating is a function in mastercrash called depth cuts. It generates code based on incremental depths of cuts to avoid snapping a tool. I doesn't use subroutines but the end result is the same.
@joepie2214 жыл бұрын
CAM programs do your thinking for you, but its good to know what you're looking at.
@tunafish32164 жыл бұрын
Great lesson, I used this for years on my Fadals.
@joepie2214 жыл бұрын
Its a good thing to figure out.
@bikefarmtaiwan1800 Жыл бұрын
Very interesting as usual ! Thank you
@TrPrecisionMachining4 жыл бұрын
very good video..thanks for your time
@redleg10134 жыл бұрын
We had to learn how to program variable in school. I was supposed to write a variable polygon program, but got my sin/cos reversed and it came out as a star program, it got saved as an engraving sub.
@joepie2214 жыл бұрын
Nice.
@matspatpc4 жыл бұрын
As a programmer, that does everything on my machines by hand, that reminds me of when I was writing Basic programs some 30-40 years ago. Especially the "re-number the lines". I'm quite happy I don't have to do that in modern programming languages, and if I ever decide to do CNC machining, I'll definitely work on something that writes the G-code for me. That's not a criticism of people who write G-code, or the people who invented G-code many years ago. They had to work with what was available at the time, and you can't just change it now, as there are still machines out there - and programs out there - that need to work with modern software, and old software that need to work with modern machines, etc.
@sharg04 жыл бұрын
Most machines don't require numbers for every line, depending on controller they can be left out completely or treated as labels. They are however very good to have if you get an error so you know where the issue is. (CNC controllers use read ahead and always buffers some lines in advance thus it might stop on block N90 but the error might lie in N120.) Then there are machines that use other types of programming but G-code / ISO-programming is by far the most common base.
@joepie2214 жыл бұрын
That read ahead can be frustrating to trouble shoot.
@wildin134 жыл бұрын
Not going to lie... I'm SOOO glad I run heidenhain! It just seems so much simpler to write code and sub routines(heidenhain calls them labels) and sub programs are easier to read and work with it seems
@joepie2214 жыл бұрын
I guess its all about what you are most familiar and comfortable with. When you have to explain something, it always takes longer and appears more difficult.
@mikejensen-fogt46624 жыл бұрын
thank you very much joe, when i head in to work on Monday i will see if i can get this to work for me! i have an exact job in mind that this type of program would be perfect for and I've been putting it off for a few weeks. this will speed things up massively if i can get it to work... the part is basically a washer that has the od, then id turned and then i would like to part off about 10 of them, then advance the bar stock out of the chuck and start over. last time i was just moving the z zero back the needed amount and running the program again. this will be much easier. thank you very much joe :)
@joepie2214 жыл бұрын
Did it work?
@drbrono4 жыл бұрын
Another technique available on some machines is to use a variable in your macro/subprogram. You set up the macro so some value (s) is replaced by a variable. Each time you call the macro you specify the value you want to use. Can be handy for changing the cutter depth, but could apply to any word in the code so it might be used to change the start location, feedrate, etc.
@joepie2214 жыл бұрын
You have to first be able to write that macro.
@tansit23444 жыл бұрын
You'll need a machine that eats macro language, not all of them do. Generally frowned upon to alias a G or M code instead of just XYZ etc unless you have some logic built to safeguard the input.
@ISILENTNINJAI4 жыл бұрын
Sub programs are awesome. Couple that with a few simply macro lines and you can do basically anything.
@joepie2214 жыл бұрын
I agree.
@hensleysmachine21304 жыл бұрын
I definitely agree. Its the only way to fly for those of us who work in shops that dont even have a CadCam software package, even copying and pasting in notepad to get the required Z depth in steps can sometimes make the program too big for the memory on an older controller. Subprograms and subroutines are a lifesaver in those instances.
@patwicker13584 жыл бұрын
Nice explanation, looking forward to more examples and something on sub-programs
@joepie2214 жыл бұрын
Sub programs are even easier. Risky, but easier to code.
@jerseyjoe26844 жыл бұрын
Happy 4th of July, Joe! 🇺🇲
@joepie2214 жыл бұрын
Thanks. I hope yours was safe.
@thigtsquare9504 жыл бұрын
This type of programming reminded me of my first computer (Atari 800) and my first Basic program (before Visual Basic); around 40 years ago...
@dekutree644 жыл бұрын
lol, it looks incredibly tedious compared to even hand writing G-code in Notepad, where you at least have a mouse to quickly scroll around and copy/paste stuff. I write C++ programs to generate G-code, which is wonderfully flexible and readable compared to direct G-code. Even cutting out a complex cycloidal curve with spiral-down rough cut followed by high speed finish pass only takes 55 lines of code pastebin.com/9sgQCZnS
@mrq13 жыл бұрын
Have you ever looked into macro programming? It's great for making repeatable cycles with different variables especially if you are doing long runs. It also has the benefit of reducing operator setup time. Take the rough dimensions and your finish dimensions and input them into the pre-assigned variables and cycle start. Granted its a lot of coding initially and it's not standard G-code since your are programming in a similar way to C or Java. Fun stuff though.
@joepie2213 жыл бұрын
Not yet.
@christurley3914 жыл бұрын
Good explanation. Thanks for the video Joe.
@bobblaine14374 жыл бұрын
Great video, as always. Based on your description of subroutine versus sub program, I would hazard a guess that you'd use a subroutine in a one-off part program that needed a lot of repetition and a subprogram to do something repetitiously that multiple part programs may use, like drilling a specific size hole, or embossing a logo in a part.
@joepie2214 жыл бұрын
Quite the opposite. Subroutines are perfect for drilling, pockets, chamfering holes and general features like that. Sub programs are great when you need to incorporate features from one part into another, or utilize code that may have been tough to write.
@Treehouse17304 жыл бұрын
Happy Fourth of July Holiday, Joe!
@lindsayjelleff4964 жыл бұрын
Great stuff, thanks Joe, I watch a lot of your videos. Kindly help to suggest when and why you would use a Sub Routine vs a Sub program. Don't they achieve the same result? Thanks
@TomChame4 жыл бұрын
Interesting, even if I was lost right after hearing Hi, Joe pie here.
@joepie2214 жыл бұрын
Thanks for hanging in. These machines are smart, but only do what they are told.
@EDesigns_FL4 жыл бұрын
Happy 4th Joe. Incremental commands can also be used to step the mill to make multiples of an operation without having to manually relocate.
@SuperAWaC4 жыл бұрын
a superior way to do that would be using g92
@joepie2214 жыл бұрын
Thats exactly what was just demonstrated.
@wildin134 жыл бұрын
Now thats lateral thinking...
@andywander4 жыл бұрын
Hi Joe, it would go to 9.9 deep, (not .990) if you used an L199
@joepie2214 жыл бұрын
In my head, it was 9 inches, 900 thou. Depending on my environment, I often refer to smaller moves as a 1.4 or 2.6 when I'm actually referring to thousandths and tenths.
@CraigLYoung4 жыл бұрын
Thanks for sharing! Happy 4th
@joepie2214 жыл бұрын
Same to you!
@gamegood4 жыл бұрын
Our shop do have a macro for looping simple xy movement using variable of ext offset.
@joepie2214 жыл бұрын
Nice.
@amysilva32264 жыл бұрын
@@joepie221 spidersspidpoprts P OP big dpider5d June spidets
@bowez94 жыл бұрын
Is there a way to run step until a set value is reached? Similar a GOTO, IF, THEN commands in BASIC. This way only the setup value would need to be changed. I assume is outside the scope of basic G code.
@redleg10134 жыл бұрын
Not outside the scope of basic G Code, we use variable commands all the time
@SuperAWaC4 жыл бұрын
basic g-code doesn't have macro variables but most modern controllers do. haas is pretty great for that.
@DevilDog36th4 жыл бұрын
Depends on how you want to do it, but there's pretty much a way to do anything with variables, goto, if/then, and while commands. On FANUC controls at least, all I have experience with
@joepie2214 жыл бұрын
I just divide the depth by how many cuts I want to take and use that as my Z value.
@TheTsunamijuan4 жыл бұрын
So Mr. Pie, do you do most of your programming manually? Rather than using some form of cam package? Or is it a mix these days depending how your own proficiency and efficiency of time? Just curious is all. Once again thanks for sharing your knowledge with us all. Plus a Happy late 4th of July.
@joepie2214 жыл бұрын
Both! if the part is easy and straight forward, my manual programming skills can get the job done very quickly. For surface contours or complex profile geometry, I use Pro-Engineer Wildfire 4.0 to generate my code offline. I then transfer the code to a USB and download it, right at the machine. I believe my engineering CAD package is now called CREO.
@quickturn663 жыл бұрын
Instead of switching to g91 to down feed then switching back to g90 can you use w- .100 ?
@bulletproofpepper24 жыл бұрын
Thanks for sharing
@joepie2214 жыл бұрын
Thanks for watching!
@samterian76944 жыл бұрын
what software are you using? wish this video was around when I was learning cnc .
@joepie2214 жыл бұрын
This code was entered manually. The CNC88 controller has a conversational capability so a lot of programming is done at the machine. For offline stuff, I use Pro Engineer Wildfire. Now its called Creo.
@MCEngineeringInc4 жыл бұрын
There’s always another way. 👍🏻
@joepie2214 жыл бұрын
Many.
@Karim_teran4 жыл бұрын
is it strange that I run a CNC router and use fusion on a daily basis and I have not the slightest clue what a subprogram or routine is? what situation or program would you have to use and be knowledgeable about this?
@wildin134 жыл бұрын
The applications I use them are when running multiple parts with multiple tools. You can create a sub routine/program for each tool, then call a datum shift with the program and make more parts with less toolchanges and less code. Being honest while it can make programming multiples quicker the biggest advantage is for older controls with limited memory. So instead of a program telling the machine to do a path 100 times, you tell it the path once but to repeat 100 times, potentially cutting file size by 90%.... there aren't actually too many real world applications but it can be usefull.
@Rob_654 жыл бұрын
No, that is not strange at all. Your code is driven by a high end CAD system. Independent of this, it is always good to know some manual programming and understand how a program is built up and how it runs. This will help you to track down any problems you have. I started as a CNC programmer, creating all G-code by hand. Parts were simple enough and when we started we had no money to buy an advanced CAM system (and Fusion was not around 12 years ago). Nowadays I almost always use a CAM system to write my programs but sometimes I optimize the CAM programs for production. Creating sub routines/progams and use a datum shift as windin13 wrote can be a good idea. Instead of creating a CAM pattern in Fusion you may implement this by hand. Using extra G-code commands for looping and calculating values, this allows me to create one program to make multiple parts in a pattern with different X and Y counts. So now, if a customer asks for 20 more of the same parts I did before, I can just but up a piece of stock of the right size, put the stock in my mill and tell the program to make 4 rows of 5 parts without having to go back to Fusion, update my CAM program and reload it into the mill. I also use subroutines to do stuff like engraving of serial numbers
@joepie2214 жыл бұрын
@wildin 13 An obvious real world application for a subroutine is a drilled hole.
@wildin134 жыл бұрын
@@joepie221 you know, I never thought of that as I always use canned cycles, which basically is a sub routine. I could use this for gun drilling to control the spindle entering and exiting pilot holes. Good shout!
@MrTomsawyer1014 жыл бұрын
The m30 doesn't need to be at the end of the program? Does the m17 call the pointer up to the m30 from end of feature?
@joepie2214 жыл бұрын
For my controller and software package, the M17 and M30 commands must seperate the subroutines / subroutine block, from the main code body. The M30 doesn't need to be in each subroutine, but does needs to be present at the very end of the main program.
@MrTomsawyer1014 жыл бұрын
@@joepie221 thank you. Keep making great content i learn new things and new techniques every video.
@mr.t.8074 жыл бұрын
O Gee now my head hurts, Where was very good Joe
@joepie2214 жыл бұрын
It only looks complex. Its easy once it sinks in.
@donsmith97974 жыл бұрын
Man I need to learn G code
@SuperAWaC4 жыл бұрын
cnc programming handbook by peter smid is the only book you need on the subject
@SouthJerseySkids4 жыл бұрын
Does anyone know if utilizing the re-number lines function on a haas would also update an M98 call? Fairly certain I may have made a pretty gnarly mistake if not.
@joepie2214 жыл бұрын
I believe it does not. Don't press the 'go' button until you confirm that.
@Masspanic1004 жыл бұрын
Brain is scrambled..... My Brain I mean!!!!
@SuperAWaC4 жыл бұрын
You can't be a CNC Machinist without being a CNC Programmer, and you can't really be a CNC Programmer if you don't know G-Code.
@joepie2214 жыл бұрын
A good understanding would be an advantage.
@QoTheGreat4 жыл бұрын
I use fusion360 to generate gcode and I don't know this programimng language at all
@joepie2214 жыл бұрын
Thats the problem. Fusion 360 is doing all the work.
@fredcreer19294 жыл бұрын
Eyes glazed over!.
@joepie2214 жыл бұрын
Its tough to follow the first time, but worth understanding.