CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 13, 2018, 23:05:10 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: NEED POST TO POST INCREMENTAL CODE  (Read 408 times)
coolant slinger
Wookie
****
Offline Offline

Posts: 312



View Profile
« on: November 03, 2018, 13:01:25 pm »

Hello All,
I need my post to post out incremental code. This is why. to do engraving on the fly such as serial #'s and text by the machine set-up personnel at my day gig. I am wanting to write sub programs for all letters and numbers at a given height. Knowing that the text and numbers are always going to be placed at different locations on the parts. I was thinking of writing a macro program with #variables for the text location, which letter to use or sub program for that letter, spacing between letters and so on. Then have every letter written in an incremental sub program so it can be located anywhere on the part. Your thoughts on this if anyone has tried it.

Thanks
Coolant Slinger 
Logged

Bubba
CNC Jedi
*****
Offline Offline

Posts: 2502



View Profile
« Reply #1 on: November 03, 2018, 13:26:35 pm »

Did look in to 'Styles'? It seems would do what you after..
Logged

My 2¢
coolant slinger
Wookie
****
Offline Offline

Posts: 312



View Profile
« Reply #2 on: November 03, 2018, 20:15:26 pm »

I will take a look. I can write the macro by hand. But can someone tell me where to change the fanuc mill post to make it post incremental?
Logged

coolant slinger
Wookie
****
Offline Offline

Posts: 312



View Profile
« Reply #3 on: November 05, 2018, 03:03:57 am »

Bubba,
Could you elaborate on how "styles" will help. Other than that is where the posts are and can be altered somewhat.

Thanks,
Coolant Slinger
Logged

dave benson
CNC Jedi
*****
Offline Offline

Posts: 1009


View Profile
« Reply #4 on: November 05, 2018, 05:07:17 am »

Slinger

If I understand correctly what you want to do, then you would do something like this.
just before the end of your file (and your ready to engrave the text)
navigate the tool to the spot where you want to engrave the text and call the marco or sub
(with the text in it) and in the sub issue a G90
and if you have generated the text at 0,0 the text will be written with the bottom of the bounding box starting at the point you have navigated to. then (if your controller is normally in Abs issue a G91) at the end of the marco.

Dave
Logged
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2502



View Profile
« Reply #5 on: November 05, 2018, 13:26:05 pm »

Bubba,
Could you elaborate on how "styles" will help. Other than that is where the posts are and can be altered somewhat.

Thanks,
Coolant Slinger

I suggested 'Styles' because it seems that it would be of use to you. I don't have enough exact knowledge how to set it up for what you need, and don't want to give you wrong info. Sorry.
Logged

My 2¢
coolant slinger
Wookie
****
Offline Offline

Posts: 312



View Profile
« Reply #6 on: November 06, 2018, 02:26:09 am »

Dave,
This is what I had in mind. I was thinking of moving to where I want to engrave in G90 absolute from the work offset origin. Then doing each letter in G91(incremental)since I will be engraving serial #'s that will change per part. I will write the subs for each letter and number to keep from having to recam for a different serial #. I will only have to change the sub program # in the main program to call different subs. This will work on different materials also, due to using #variable for speed and feeds. They can be changed in the main program also. See the example below:

 %
O5000
(MAIN-ENGRAVE)
(EDITABLE VARIABLES FOR ENGRAVING)
#1=01(TOOL NUMBER)
#2=01(TOOL LENGTH OFFSET H#)
#3=4500(SPINDLE RPM)
#4=3(SPINDLE DIRECTION 3=CW / 4=CCW)
#5=1.0(X LOCATION 1ST DIGIT OR LETTER)
#6=-2.0(Y LOCATION 1ST DIGIT OR LETTER)
#7=.03(Z PART CLEARANCE)
#8=-.015(Z DEPTH INTO PART)
#9=7.5(Z ENTRY FEEDRATE)
#10=15.0(X&Y FEEDRATE)

G0G40G80G90G94
G54
T[#1]G43H[#2]
S[#3]M[#4]
G0X[#5]Y[#6]M8
M98P0
G91X.125
M98P1
M30

O0000(NUMBER 0)
(.125 HEIGHT)
G90(NEEDS TO BE G91)
G0 X0.0562 Y-0.125
Z[#7]
G1Z[#8][F#9]
G2 X0.0465 Y-0.1239 I-0.0004 J0.0418 [F#10]
X0.0375 Y-0.1201 I0.0062 J0.027
X0.026 Y-0.1069 I0.0186 J0.0276
X0.0202 Y-0.0872 I0.0611 J0.0287
X0.0186 Y-0.0629 I0.1718 J0.0235
X0.0202 Y-0.0388 I0.1721 J0.0007
X0.026 Y-0.0191 I0.0669 J-0.009
X0.0375 Y-0.0057 I0.0299 J-0.014
X0.0465 Y-0.0018 I0.0152 J-0.0228
X0.0562 Y-0.0008 I0.0094 J-0.04
X0.0659 Y-0.0018 I0.0004 J-0.0411
X0.0749 Y-0.0057 I-0.0063 J-0.0267
X0.0863 Y-0.0191 I-0.0185 J-0.0274
X0.0921 Y-0.0388 I-0.0579 J-0.0278
X0.0938 Y-0.0629 I-0.1619 J-0.0234
X0.0921 Y-0.0872 I-0.1649 J-0.0007
X0.0863 Y-0.1069 I-0.0638 J0.0081
X0.0749 Y-0.1201 I-0.03 J0.0144
X0.0659 Y-0.1239 I-0.0152 J0.0232
X0.0562 Y-0.125 I-0.0094 J0.0407
X0.0465 Y-0.1239 I-0.0004 J0.0418
X0.0375 Y-0.1201 I0.0062 J0.027
X0.026 Y-0.1069 I0.0186 J0.0276
X0.0202 Y-0.0872 I0.0611 J0.0287
X0.0186 Y-0.0629 I0.1718 J0.0235
X0.0202 Y-0.0388 I0.1721 J0.0007
X0.026 Y-0.0191 I0.0669 J-0.009
X0.0375 Y-0.0057 I0.0299 J-0.014
X0.0465 Y-0.0018 I0.0152 J-0.0228
X0.0562 Y-0.0008 I0.0094 J-0.04
X0.0659 Y-0.0018 I0.0004 J-0.0411
X0.0749 Y-0.0057 I-0.0063 J-0.0267
X0.0863 Y-0.0191 I-0.0185 J-0.0274
X0.0921 Y-0.0388 I-0.0579 J-0.0278
X0.0938 Y-0.0629 I-0.1619 J-0.0234
X0.0921 Y-0.0872 I-0.1649 J-0.0007
X0.0863 Y-0.1069 I-0.0638 J0.0081
X0.0749 Y-0.1201 I-0.03 J0.0144
X0.0659 Y-0.1239 I-0.0152 J0.0232
X0.0562 Y-0.125 I-0.0094 J0.0407
G0 Z[#7]
X0Y0
M99

O0001(NUMBER 1)
(.125 HEIGHT)
G90(NEEDS TO BE G91)
G0 X0.0479 Y-0.0006
Z[#7]
G1Z[#8][F#9]
G2 X0.0472 Y-0.0074 I-0.0299 J-0.0003 F[#10]
X0.0446 Y-0.0137 I-0.0191 J0.0043
X0.0365 Y-0.0218 I-0.0232 J0.0152
X0.0269 Y-0.0261 I-0.0189 J0.0293
X0.0186 Y-0.0275 I-0.0118 J0.0434
G3 X0.0269 Y-0.0261 I-0.0035 J0.0449
X0.0365 Y-0.0218 I-0.0093 J0.0336
X0.0446 Y-0.0137 I-0.0152 J0.0232
X0.0472 Y-0.0074 I-0.0165 J0.0106
X0.0479 Y-0.0006 I-0.0292 J0.0066
G1 Y-0.125
Y-0.0006
G0 Z[#7]
X0Y0
M99
%





Logged

dave benson
CNC Jedi
*****
Offline Offline

Posts: 1009


View Profile
« Reply #7 on: November 06, 2018, 05:04:12 am »

Hi Slinger
Can't fault the code or your logic.
So what you can do is Create a New Fanuc PP Fanuc1 for example and then modify it to suit you needs.
The Docs on how to do this are here :http://www.cambam.info/doc/plus/cam/PostProcessor.htm

You can call the new PP by changing it in the part on a per part basis.
I am going to be scarce for a few weeks as the NBN (National BroadBand Network) is being rolled out here from today on wards, in my suburb and they are replacing the copper with Optic Fibre, so internet will more even Flaky  than usual for next 3 weeks. Router dropped out a couple of times while trying to post this.


Dave
Logged
coolant slinger
Wookie
****
Offline Offline

Posts: 312



View Profile
« Reply #8 on: November 06, 2018, 17:32:55 pm »

I will take a look at the link
Thanks Dave
Logged

coolant slinger
Wookie
****
Offline Offline

Posts: 312



View Profile
« Reply #9 on: November 07, 2018, 02:48:54 am »

According to the link G91 incremental is not yet supported. See below


G Codes - Distance Absolute, Distance Incremental
[New! 0.9.8h]
Typically absolute=G90, incremental=G91. NOTE! Incremental distance mode is not currently supported.
Logged

SquibLoad
CNC Ewok
*
Offline Offline

Posts: 8


View Profile
« Reply #10 on: November 08, 2018, 06:05:04 am »

There are gcode editors that will convert between absolute and incremental, and back, if needed.
I've used GWizard Editor for just this sort of task in the past.
I created individual MOPS with a generic XY = 0,0 origin, convert them into subprograms, then used GWizard Editor to convert the individual subprograms to incremental.
In your main calling program, then position where you need to be for each subprogram, and then call the subprogram.
If you do this, don't forget to terminate incremental mode at the end of each subprogram, or you will get a nasty surprise (ask me how I know!).
This method worked like a champ for me, and i've used it often.
Hope it works for you.
I found it handy to position using G52 and variables.
You can download a fully functioning copy of GWizard Editor for free to test.
Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 1009


View Profile
« Reply #11 on: November 10, 2018, 07:03:59 am »

Quote
Typically absolute=G90, incremental=G91. NOTE! Incremental distance mode is not currently supported.
It is now!
I also looked around for a converter, and also looked at many of the code repositories, but Huh no luck It seemed that if you wanted one, you were going to have to buy for it or do what squibload did.

That didn't seem satisfactory, so I've made a post processor for cb to do that.
Pop the PP and the .exe in the Post folder. and the style lib in the styles folder.
play around with the cb file.
Remember you have to change the clearance height in the PP it's metric and set to 3 mm, but in imperial files that would be 3 inches, you can also remove the clearance = 3 altogether and the default is 1 so for you that would be 1 inch.
the code sets and unsets the G91 G90 pair also.
I've ran out of attachments here so I'll post the Gcode file for the cb file so that you and look at it.
edit just realized I didn't add the zip!
Dave


* Abs To Incremental GCode Converter Simulating ok.PNG (101.11 KB, 1357x700 - viewed 9 times.)
* abs to inc.cb (9.65 KB - downloaded 5 times.)

* Abs To Incremental GCode Converter IncPP in the post lib of cb.PNG (199.54 KB, 1351x686 - viewed 8 times.)
* Abs To Incremental GCode Converter.zip (5.94 KB - downloaded 5 times.)
« Last Edit: November 10, 2018, 07:32:56 am by dave benson » Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 1009


View Profile
« Reply #12 on: November 10, 2018, 07:09:27 am »

Here is the .nc File
Dave

* abs to inc.nc (11.58 KB - downloaded 2 times.)
Logged
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7636



View Profile
« Reply #13 on: November 10, 2018, 12:09:26 pm »

Dave, thanks!  I don't have one now that actually requires incremental code, but I know some day I'll bump up against a controller that does.

Good job!

This is going to be a busy year!  We just got a year-round contract for more material each week than I was normally delivering during peak 'seasonal' times -- and the seasonal work hasn't gone away, either!

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
dave benson
CNC Jedi
*****
Offline Offline

Posts: 1009


View Profile
« Reply #14 on: November 10, 2018, 13:23:20 pm »

Well I hope people can get some use out of it, personally I've not much use for it either.

I'm glad your got more work coming in, it sure bests "Not Enough" , but that presents it's own challenges.

Streamlining your work flow has probably taken on more importance now, although on a very small scale I'm been looking at ways to to be more efficient at making the turrets, and one job making the indexer wheel (think small bicycle sprocket) where i was spiral milling the
scallops with a 3mm end mill, this was taking forever to do. If I went too fast I was getting some draft to the cut, from top to bottom.
So I re evaluated the task and tried drilling the tooth centers out and finishing on the lathe.
Not only did this get the job done much faster, I hit my tolerances better and the finish of the tooth profile was better too.

Dave
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.146 seconds with 20 queries.

Copyright © 2018 HexRay Ltd. | Sitemap