G86 Boring Cycle, Spindle Stop, Rapid Move Out

More
07 Sep 2016 08:42 - 07 Sep 2016 16:37 #80119 by snujcnc
hi
i am looking solution for g86 cycle

my expected cycle g86 is

first tool make bore
after make bore spindle stop on my desired position (may be orient position)
then axis shift in opposite direction of tool tip (little travel )
then tool come out from bore

i am not able to understand how to resolve this issue

in haas fanuc siemens fagor mitsubishi all system this solution is presents
Last edit: 07 Sep 2016 16:37 by snujcnc.

Please Log in or Create an account to join the conversation.

More
07 Sep 2016 10:15 #80122 by andypugh
I think that the boring cycles have not yet caught up with the addition of spindle orientation to LinuxCNC.
There are some undocumented cycles.
github.com/LinuxCNC/linuxcnc/blob/master...ngc/interp_cycles.cc
They may be undocumented because they don't work.

If you have spindle orient working then making a subroutine should be relatively easy. You could even remap it to your preferred G8x code

Please Log in or Create an account to join the conversation.

More
07 Sep 2016 16:26 #80129 by snujcnc
thanks for information

Please Log in or Create an account to join the conversation.

More
07 Sep 2016 20:23 #80169 by andypugh
Now i have a keyboard and not an iPhone, I can be more verbose.

The docs on remap are extensive and detailed, So much so that you might think it is hard. Pay special attention to the "minimal remap" part and skim the rest for the stuff you need to know.

linuxcnc.org/docs/2.7/html/remap/remap.h...s_including_tt_m6_tt

You can remap G86.1 to do what you want with one aded line in the INI file and a four-line G-code file that does a feed per-rev followed by an orient, move and retract.
The following user(s) said Thank You: Rick G, snujcnc

Please Log in or Create an account to join the conversation.

More
07 Sep 2016 20:40 #80173 by Rick G
Good point Andy.

By just reading the minimal remap section it all makes sense and seems quite powerful. I will have to give it a try!

Rick G

Please Log in or Create an account to join the conversation.

More
08 Sep 2016 09:48 #80212 by snujcnc
thnaks for information

i am not aware for all things about linuxcnc

if i want to make modification in interp_cycles.cc

can i add some custom M-Code like m119 in this script

in g86 cycle

where

STOP_SPINDLE_TURNING(); is given

i want to use m199 code at this place

.........
also for remap things if you have example config please send me sample

how to write in ini

what other things i need to set in hal etc..

i tried g84.2 code but it doesnt work
that time i set in ini
[RS274NGC]
REMAP=G84.2 argspec=xyzqp python=g842 modalgroup=1

it show unknown g code error
when i commad from mdi

thanks

Please Log in or Create an account to join the conversation.

More
08 Sep 2016 19:33 - 08 Sep 2016 19:33 #80242 by andypugh

if i want to make modification in interp_cycles.cc
can i add some custom M-Code like m119 in this script
in g86 cycle
where
STOP_SPINDLE_TURNING(); is given
i want to use m199 code at this place


No, these are all very different things.

Some background: The G-code interpreter converts G-code to "Canonical Commands" such as STRAIGHT_TRAVERSE or, the one you have noticed, STOP_SPINDLE. Those commands are put in a queue which is then run through by the realtime code, which uses it to change the pins in the HAL layer, where you hook up your hardware interfaces.

interp_convert.cc is a source file of Linuxcnc (written in C++). It is part of the G-cde interpreter. No changes made there will have any effect unless you recompile all of LinuxCNC. I just gave you that link to see that there are some other G-codes you can use, and so see exactly what each canned-cycle does. For practical purposes interp_convert.cc is a fixed part of linuxCNC, though that isn't to say that the developers wouldn't accept extra features that would be coded in there.

M199 codes are something that is acted on by the G-code interpreter (of which interp_convert.cc is a part). G-code execution stops and the executable file is run. Note that this is an executable Linux file, not a G-code routine or (for that matter) a C or C++ file. It would typically be interpreted by the Linux shell (bash) or it could be a Python script. Both methods can work with the HAL layer, setting and reading pin values. Additionally Python can read interpreter state and send some commands, including G-code commands to the MDI interface.
I am not 100% certain that if a Python routine is called by M1xx that an MDI command in the script will be interpreted and run. MDI is normally only valid when the machine is not running in auto mode, and as there is only one queue it is hard to see how the system would decide what to do.

Remap is a bit different. It adds new G-code commands and you are effectively adding new code to the G-code interrupter. This is rather more powerful than an M199 script, because a remapped routine can send canonical commands directly, or can be a bit of G-code that is run through the standard interpreter.

To complete the set there are the MDI_COMMANDS in the INI, which alls HAL pin changes to run G-code routines (which can be remapped codes, or M1xx codes, or G-code subroutines). However MDI_COMMANDs have to swim upstream, Normally G-code causes changes in HAL, not the reverse, so MDI_COMMANDs are only possible when the interpreter is idle, i.e. G-code is not running.

also for remap things if you have example config please send me sample


You already have a sample, takes look in the sample configs in the config picker.
sim/axis/remap/rack-tolchange
That uses the line in the INI here:
github.com/LinuxCNC/linuxcnc/blob/master...cktoolchange.ini#L58
to redefine the M6 command to call a python file (which yo wouldn't need) then run a G-code file called rack_change which is here:
github.com/LinuxCNC/linuxcnc/blob/master...ines/rack_change.ngc

The config is a complete one, it has special g-code routines to handle tool-change abort, and the python routines make sure that the routine has the right info.
The point is that you can relatively easily convert a new G-code to a sequence of existing G-code commands kept in a file somewhere.

Having said all this, I do quite a lot of boring-bar work on my CNC mill (I have two different sizes of Wohlhaupter head, and have a special shank for one of them to make it CNC itself. (a partial success).) I typically don't care on the sizing passes, and just stop the spindle at the bottom and manually retract on the finish pass. Not an option when doing may holes in G-code though.
Last edit: 08 Sep 2016 19:33 by andypugh.

Please Log in or Create an account to join the conversation.

More
09 Sep 2016 03:29 #80253 by snujcnc
Thank you
I will look in details and come back to you after results

Please Log in or Create an account to join the conversation.

More
05 Oct 2016 04:27 #81242 by stiles
as long as g19 works it's really easy to do with just a few lines of gcode. This is presudio code but it will give you an idea:

<modal preamble inch per rev, absolute, g54 yadda yadda>
xy position
z rapid approach move
g1 z-xx.x f.004
z-xx.xx f.002 (for slowing down the feed inside an interrupt cut)
m19 r<whatever orientation you require> p1
g94 (if you want to make a controlled feed move, if you want to rapid this isn't required)
g91 (make the next move incremental, we can now start at any xy position and be a ok)
x-.005 f1 (this is still a feed move, wont work in g95, if you want to rapid do g0 x-.005)
g0z2.
g53z0
g0


this give you some advantages like having 2 feed rates depending on cutting conditions, you could change speeds too if you saw fit.

Just a few ideas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum