New to CNC ? Loop that code and stop breaking cutters !!

  Рет қаралды 15,498

Joe Pie

Joe Pie

Күн бұрын

Пікірлер: 113
@randyharsey8739
@randyharsey8739 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
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.
@bcbloc02
@bcbloc02 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
Use a wood dowel instead of an end mill, set the height high and play. keep one finger on that big RED button.
@dominic6634
@dominic6634 4 жыл бұрын
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.
@BobH7777
@BobH7777 4 жыл бұрын
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... 😊
@joepie221
@joepie221 4 жыл бұрын
This is basic stuff, but very powerful and saves a ton of space on your system.
@mmoorehct
@mmoorehct 4 жыл бұрын
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! :-)
@joepie221
@joepie221 4 жыл бұрын
Mystery solved. Glad to help.
@rdavit
@rdavit 4 жыл бұрын
“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!
@joepie221
@joepie221 4 жыл бұрын
My jog button really got a workout early on too !
@bostedtap8399
@bostedtap8399 4 жыл бұрын
Excellent, it took to the last few minutes to understand your explanation/rationale. Thanks Joe. Great vlog thanks for sharing. Best regards John.
@joepie221
@joepie221 4 жыл бұрын
Thanks John.
@robertoswalt319
@robertoswalt319 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
Thanks. I hope yours was good as well.
@TheSolarPoweredEngineer
@TheSolarPoweredEngineer 4 жыл бұрын
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 😁😉
@joepie221
@joepie221 4 жыл бұрын
I'm no expert by far, but I know enough to get around obstacles that will stop you in your tracks. Good luck.
@TheSolarPoweredEngineer
@TheSolarPoweredEngineer 4 жыл бұрын
@@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 👍
@joepie221
@joepie221 4 жыл бұрын
@@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.
@TheSolarPoweredEngineer
@TheSolarPoweredEngineer 4 жыл бұрын
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 😉
@plasmaman9592
@plasmaman9592 4 жыл бұрын
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
@maruthupandian3728
@maruthupandian3728 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
Thanks for the comment.
@TandaMadison
@TandaMadison 4 жыл бұрын
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!
@joepie221
@joepie221 4 жыл бұрын
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.
@TandaMadison
@TandaMadison 4 жыл бұрын
@@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.
@miles32323
@miles32323 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
CAM programs do your thinking for you, but its good to know what you're looking at.
@tunafish3216
@tunafish3216 4 жыл бұрын
Great lesson, I used this for years on my Fadals.
@joepie221
@joepie221 4 жыл бұрын
Its a good thing to figure out.
@bikefarmtaiwan1800
@bikefarmtaiwan1800 Жыл бұрын
Very interesting as usual ! Thank you
@TrPrecisionMachining
@TrPrecisionMachining 4 жыл бұрын
very good video..thanks for your time
@redleg1013
@redleg1013 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
Nice.
@matspatpc
@matspatpc 4 жыл бұрын
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.
@sharg0
@sharg0 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
That read ahead can be frustrating to trouble shoot.
@wildin13
@wildin13 4 жыл бұрын
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
@joepie221
@joepie221 4 жыл бұрын
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-fogt4662
@mikejensen-fogt4662 4 жыл бұрын
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 :)
@joepie221
@joepie221 4 жыл бұрын
Did it work?
@drbrono
@drbrono 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
You have to first be able to write that macro.
@tansit2344
@tansit2344 4 жыл бұрын
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.
@ISILENTNINJAI
@ISILENTNINJAI 4 жыл бұрын
Sub programs are awesome. Couple that with a few simply macro lines and you can do basically anything.
@joepie221
@joepie221 4 жыл бұрын
I agree.
@hensleysmachine2130
@hensleysmachine2130 4 жыл бұрын
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.
@patwicker1358
@patwicker1358 4 жыл бұрын
Nice explanation, looking forward to more examples and something on sub-programs
@joepie221
@joepie221 4 жыл бұрын
Sub programs are even easier. Risky, but easier to code.
@jerseyjoe2684
@jerseyjoe2684 4 жыл бұрын
Happy 4th of July, Joe! 🇺🇲
@joepie221
@joepie221 4 жыл бұрын
Thanks. I hope yours was safe.
@thigtsquare950
@thigtsquare950 4 жыл бұрын
This type of programming reminded me of my first computer (Atari 800) and my first Basic program (before Visual Basic); around 40 years ago...
@dekutree64
@dekutree64 4 жыл бұрын
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
@mrq1
@mrq1 3 жыл бұрын
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.
@joepie221
@joepie221 3 жыл бұрын
Not yet.
@christurley391
@christurley391 4 жыл бұрын
Good explanation. Thanks for the video Joe.
@bobblaine1437
@bobblaine1437 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
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.
@Treehouse1730
@Treehouse1730 4 жыл бұрын
Happy Fourth of July Holiday, Joe!
@lindsayjelleff496
@lindsayjelleff496 4 жыл бұрын
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
@TomChame
@TomChame 4 жыл бұрын
Interesting, even if I was lost right after hearing Hi, Joe pie here.
@joepie221
@joepie221 4 жыл бұрын
Thanks for hanging in. These machines are smart, but only do what they are told.
@EDesigns_FL
@EDesigns_FL 4 жыл бұрын
Happy 4th Joe. Incremental commands can also be used to step the mill to make multiples of an operation without having to manually relocate.
@SuperAWaC
@SuperAWaC 4 жыл бұрын
a superior way to do that would be using g92
@joepie221
@joepie221 4 жыл бұрын
Thats exactly what was just demonstrated.
@wildin13
@wildin13 4 жыл бұрын
Now thats lateral thinking...
@andywander
@andywander 4 жыл бұрын
Hi Joe, it would go to 9.9 deep, (not .990) if you used an L199
@joepie221
@joepie221 4 жыл бұрын
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.
@CraigLYoung
@CraigLYoung 4 жыл бұрын
Thanks for sharing! Happy 4th
@joepie221
@joepie221 4 жыл бұрын
Same to you!
@gamegood
@gamegood 4 жыл бұрын
Our shop do have a macro for looping simple xy movement using variable of ext offset.
@joepie221
@joepie221 4 жыл бұрын
Nice.
@amysilva3226
@amysilva3226 4 жыл бұрын
@@joepie221 spidersspidpoprts P OP big dpider5d June spidets
@bowez9
@bowez9 4 жыл бұрын
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.
@redleg1013
@redleg1013 4 жыл бұрын
Not outside the scope of basic G Code, we use variable commands all the time
@SuperAWaC
@SuperAWaC 4 жыл бұрын
basic g-code doesn't have macro variables but most modern controllers do. haas is pretty great for that.
@DevilDog36th
@DevilDog36th 4 жыл бұрын
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
@joepie221
@joepie221 4 жыл бұрын
I just divide the depth by how many cuts I want to take and use that as my Z value.
@TheTsunamijuan
@TheTsunamijuan 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
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.
@quickturn66
@quickturn66 3 жыл бұрын
Instead of switching to g91 to down feed then switching back to g90 can you use w- .100 ?
@bulletproofpepper2
@bulletproofpepper2 4 жыл бұрын
Thanks for sharing
@joepie221
@joepie221 4 жыл бұрын
Thanks for watching!
@samterian7694
@samterian7694 4 жыл бұрын
what software are you using? wish this video was around when I was learning cnc .
@joepie221
@joepie221 4 жыл бұрын
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.
@MCEngineeringInc
@MCEngineeringInc 4 жыл бұрын
There’s always another way. 👍🏻
@joepie221
@joepie221 4 жыл бұрын
Many.
@Karim_teran
@Karim_teran 4 жыл бұрын
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?
@wildin13
@wildin13 4 жыл бұрын
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_65
@Rob_65 4 жыл бұрын
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
@joepie221
@joepie221 4 жыл бұрын
@wildin 13 An obvious real world application for a subroutine is a drilled hole.
@wildin13
@wildin13 4 жыл бұрын
@@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!
@MrTomsawyer101
@MrTomsawyer101 4 жыл бұрын
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?
@joepie221
@joepie221 4 жыл бұрын
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.
@MrTomsawyer101
@MrTomsawyer101 4 жыл бұрын
@@joepie221 thank you. Keep making great content i learn new things and new techniques every video.
@mr.t.807
@mr.t.807 4 жыл бұрын
O Gee now my head hurts, Where was very good Joe
@joepie221
@joepie221 4 жыл бұрын
It only looks complex. Its easy once it sinks in.
@donsmith9797
@donsmith9797 4 жыл бұрын
Man I need to learn G code
@SuperAWaC
@SuperAWaC 4 жыл бұрын
cnc programming handbook by peter smid is the only book you need on the subject
@SouthJerseySkids
@SouthJerseySkids 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
I believe it does not. Don't press the 'go' button until you confirm that.
@Masspanic100
@Masspanic100 4 жыл бұрын
Brain is scrambled..... My Brain I mean!!!!
@SuperAWaC
@SuperAWaC 4 жыл бұрын
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.
@joepie221
@joepie221 4 жыл бұрын
A good understanding would be an advantage.
@QoTheGreat
@QoTheGreat 4 жыл бұрын
I use fusion360 to generate gcode and I don't know this programimng language at all
@joepie221
@joepie221 4 жыл бұрын
Thats the problem. Fusion 360 is doing all the work.
@fredcreer1929
@fredcreer1929 4 жыл бұрын
Eyes glazed over!.
@joepie221
@joepie221 4 жыл бұрын
Its tough to follow the first time, but worth understanding.
CNC Surface Milling  -- Trial and Error
7:06
Joe Pie
Рет қаралды 19 М.
Faster Milling and Longer Cutter Life...Watch this One !!
18:46
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 119 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 16 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 27 МЛН
Миллионер | 2 - серия
16:04
Million Show
Рет қаралды 1,9 МЛН
Grip Stock - How to Access 100% of your Part Perimeter
20:44
Hand Programming with M98 and M97 sub programming routines
12:17
Get Your Steady Rest Aligned
25:55
Joe Pie
Рет қаралды 228 М.
How To Calculate Speeds and Feeds (Inch Version) - Haas Automation Tip of the Day
14:26
Eric Weinstein - Are We On The Brink Of A Revolution? (4K)
3:29:15
Chris Williamson
Рет қаралды 9 МЛН
I Travelled 20 Hours to Go Tool Shopping in Japan
16:08
Scott Brown Carpentry
Рет қаралды 127 М.
Dogbone Milling - A Great Way to Hold a Small Part
16:01
Joe Pie
Рет қаралды 137 М.
Unique Shop Tools - Revealed Vol. 1
23:42
Joe Pie
Рет қаралды 126 М.
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 119 МЛН