Hello Guest it is April 18, 2024, 05:34:38 PM

Author Topic: Coordinate Rotation  (Read 3560 times)

0 Members and 1 Guest are viewing this topic.

Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: Coordinate Rotation
« Reply #10 on: March 05, 2018, 09:50:41 PM »
Anytime you use mcCntlGcodeExecuteWait or mcCntlGcodeExecute, you are firing up an new interpreter (which hasn't any rotation applied to it).  So you will need to check for rotation in those macros and apply it to the G code that those functions will execute. 

-- SV_ROTATION_X                   2135 stores X value from G68
-- SV_ROTATION_Y                   2136 stores Y value from G68
-- SV_ROTATION                       2137 stores Z value from G68


local inst = mc.mcGetInstance()
local grp15 = mcCntlGetModalGroup(inst, 15) -- G68 and G69 are in modal group 15.
CodeLine2 = ""

if (grp15 == 68) then
CodeLine2 = 'G68 X#2135 Y#2136 R#2137\n'
end

CodeLine2 = CodeLine2 .. 'G00 Z' .. PierceHeight .. '\n'
CodeLine2 = CodeLine2 .. 'F' .. ProgramFeedrate
mc.mcCntlGcodeExecuteWait(inst, CodeLine2)

Steve
Re: Coordinate Rotation
« Reply #11 on: August 08, 2018, 06:11:08 AM »
FANUC G68 ROTATE COORDINATE MAIN PROGRAM & SUB PROGRAM EXAMPLE
August 08, 2018 - FANUC G68 ROTATE COORDINATE SYSTEM [M]

 

MAIN PROGRAM

N10  G54 X0 Y0 ;
N20  M06 T05 ;
N30  G43 H5 ;
N40  M03 S1500 ;
N50  M08 ;
N60  G98 F300 ;
M98  P034321 ; sub program call
N70  G00 Z100 ;
N80  M05 M09 M30 ;

SUB PROGRAM

O4321
N10  G91 G68 X10 Y10 R22.5 ;
N20  G90 X30 Y10 Z5 ;
N30  G01 Z-5 ;
N40  X47 ;
N50  G00 Z5 ;
N60  M17 ;

DESCRIPTION OF PROGRAM
Main program
N10- Work co-ordinate system command  ( Offset point) , where X0 and  Y0
N20- Tool change command , select tool no 5
N30- Tool height offset compensation  H5(we set tool height of z axis )
N40- Spindle on clockwise at speed 1500 rpm
N50- Coolant on
N60- Feed rate per minute F300
M98- Sub program call , P03- no same operation repeat ,4321- no. of sub program.
N70- Rapid command , where  Z100 [ tool up ]
N80- Spindle off , coolant off , main program end
Sub program
N10- Incremental co-ordinate command , rotate coordinate system command where  X10 , Y10 and angle of rotation               R22.5
N20- Absolute co-ordinate command , X axis distance count from 0 to starting position ,Y at same place 10           and tool is 5 mm up.
N30- linear interpolation command , cutting depth is 5
N40- Operation end position 47 along X

my link is
www.hdknowledge.com