Hello Guest it is September 18, 2019, 08:58:06 AM

Author Topic: CNC'ing both quill and knee  (Read 16058 times)

0 Members and 1 Guest are viewing this topic.

Offline N4NV

*
  •  393 393
    • View Profile
Re: CNC'ing both quill and knee
« Reply #10 on: February 11, 2009, 10:41:59 AM »
My big mill has only 5" of travel with the quill.  I too would like to use the knee for tool length offset.  The mechanics are simple.  I would be interested in the Mach solution if someone comes up with one.

vince
Re: CNC'ing both quill and knee
« Reply #11 on: February 11, 2009, 10:51:49 AM »
As a suggestion... dunno if it is practical,

You could use an auto tool zero routine with a touchplate in which only the knee moves for this.

THe routine would be something like this:

-Home the quill
-home the knee (optional)
-move the knee up so that you can put a touchplate on top of the material and wait for the tool to touch it.
-zero the z axis dro (which it already should be at zero)
-zero the knee (optional too)

I guess that would be a work around if you dont have a way of putting the tools with the same lenght every time.

Best regards
Fernando

Offline N4NV

*
  •  393 393
    • View Profile
Re: CNC'ing both quill and knee
« Reply #12 on: February 11, 2009, 11:09:22 AM »
The idea is if you have several different tools set up in the tool table and you do a tool change (M6) then if the tool was long i.e. a drill chuck with a big drill, Mach would automatically move the knee down.  When you changed back to a shorter tool, the knee would come back up at part of the M6 command.

Vince
Re: CNC'ing both quill and knee
« Reply #13 on: February 11, 2009, 11:31:29 AM »
Am I missing something?  Seems to me, my suggestion of modifying the M6End macro is quite simple.  You have access to the tool offset through the tool length DRO.  So, even if Mach does apply that somewhere, it's a simple matter for the macro to un-apply it by adding/subtracting the offset to the Z DRO, re-setting the DRO, then moving the knee by the appropriate amount.

Regards,
Ray L.
Regards,
Ray L.
Re: CNC'ing both quill and knee
« Reply #14 on: February 11, 2009, 11:40:08 AM »
Hey Ray,
Well yes, your suggestion i simple... i was just proposing an alternate solution to whoever wants this and does not use the tool table.

Regards
Fenando

Offline N4NV

*
  •  393 393
    • View Profile
Re: CNC'ing both quill and knee
« Reply #15 on: February 11, 2009, 02:47:20 PM »
Am I missing something?  Seems to me, my suggestion of modifying the M6End macro is quite simple.  You have access to the tool offset through the tool length DRO.  So, even if Mach does apply that somewhere, it's a simple matter for the macro to un-apply it by adding/subtracting the offset to the Z DRO, re-setting the DRO, then moving the knee by the appropriate amount.

Regards,
Ray L.

I guess it would be a simple matter for someone who does VB for a living and knows the ins and outs of Mach.  For me, it would be easier to ask me to levitate.  I'm sure there are many who would love to see a post of all the code required to make this happen, feel free to be our hero.  If you ever need a Piller 400 HZ parallel cabinet installed and wired up or autopilot aileron servo replaced or even an Atos hang glider rib adjustment for racing, I'm your man.

Vince
Re: CNC'ing both quill and knee
« Reply #16 on: February 11, 2009, 03:06:52 PM »
Am I missing something?  Seems to me, my suggestion of modifying the M6End macro is quite simple.  You have access to the tool offset through the tool length DRO.  So, even if Mach does apply that somewhere, it's a simple matter for the macro to un-apply it by adding/subtracting the offset to the Z DRO, re-setting the DRO, then moving the knee by the appropriate amount.

Regards,
Ray L.

I guess it would be a simple matter for someone who does VB for a living and knows the ins and outs of Mach.  For me, it would be easier to ask me to levitate.  I'm sure there are many who would love to see a post of all the code required to make this happen, feel free to be our hero.  If you ever need a Piller 400 HZ parallel cabinet installed and wired up or autopilot aileron servo replaced or even an Atos hang glider rib adjustment for racing, I'm your man.

Vince

Well, I ain't no VB whiz, but I can learn enough to do what I need to do.  Fact is, I consider VB to be one of the most abominable programming languages ever created.  It's a God-awful mish-mash of about a dozen different paradigms, with more excpetions than rules.

In any case, I think we're talking about all of *maybe* a dozen lines of code:

1) Get the tool offset
2) Add/subtract tool offset to Z DRO, and reset Z DRO to this value
3) If necessary, do Z move to undo automatic tool length compensation, if there is one
4) Issue move command on knee axis, to do the tool length compensation

I'm guessing someone who's familiar with how Mach does toolchanges, and up on VB and all the Mach OEM codes, could do this in about 10 minutes.  If I had a machine to work with, I'd guess I could get it done within an hour.

Tell you what, even though I don't have a machine, I'll try to play with it over the next few days, and see if I can do it in simulation.  Should be pretty straight-forward, I think.

Regards,
Ray L.
Regards,
Ray L.

Offline N4NV

*
  •  393 393
    • View Profile
Re: CNC'ing both quill and knee
« Reply #17 on: February 11, 2009, 03:43:27 PM »
I worked on an M6 tool change macro for my lathe for about a week and never got it working properly.  Jason did it in about 5 minutes.  The problem I have with programming is all the hidden syntax that no one ever seems to tell you or all the calls that are undocumented (especially in Mach).  One extra space here, a missing comma there and it doesn't work and and you never know why.  Then someone who knows what they are doing comes along and says, oh yeah, you obviously forgot to capitalize that word. It can be very frustrating to self teach.

It reminds me of a friend who installed his own sprinkler system.  He told me how he meticulously square off every pipe, use the proper primer and glue, everything was perfect.  When I asked him if he beveled the pipe before gluing his jaw dropped (he didn't).  It an obvious thing to do if you know how to do it.

Vince
« Last Edit: February 11, 2009, 03:47:08 PM by N4NV »
Re: CNC'ing both quill and knee
« Reply #18 on: February 11, 2009, 11:06:52 PM »
OK, I'm sure this isn't the most efficient way of doing this, but I believe it works as intended.  Running it in simulation, it appears to work correctly.  I'm assuming here the quill is the Z axis, and the knee is the A axis.  When you change tools, it over-rides the change in the Z DRO due to the change in tool length, and instead moves the A axis by the difference in length between the old and new tools.  So, the effect is Z does not move, or is returned to its previous position if you moved it during the tool change, and the tool length is compensated for entirely by moving the knee.  The knee is moved minus for a longer tool, and plus for a shorter tool.




Put the following in M6Start.m1s:

REM Get the current tool length, and store it in User DRO 1200 for M6End macro
OldToolLength = ToolLengthOffset()
SetUserDRO(1200, OldToolLength)

REM Get the current Z axis position, and store it in USer DRO 1201 for M6End macro
OldZPos = GetOEMDRO(802)
SetUserDRO(1201, OldZPos)

REM Activate the new tool
tool = GetSelectedTool()
SetCurrentTool( tool )





Put the folliowing in M6End.m1s:

REM Get the length of the current tool
NewToolLength = ToolLengthOffset()

REM Figure out how much tool length changed, and in which direction
OffsetChange = NewToolLength - OldToolLength

REM Get the Z DRO value before the new tool length was applied, stored in UserDRO 1201 by M6Start macro
OldZPos = GetUserDRO(1201)
SetOEMDRO(802, OldZPos)

REM Get the cuurent A axis (knee) position, and apply the new tool length
OldAPos = GetOEMDRO(803)
NewAPos = OldAPos - OffsetChange
REM Move the knee to the new position
Code "G00 A" & NewAPos

REM Return the the position we were in before the toolchange

x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )

if(IsSafeZ() = 1) Then
   SafeZ = GetSafeZ
   if  SafeZ  > z then
     GotoSafeZ()
   end if
   Code "G00 X" & x & " Y" & y
   Code "G00 Z" & z
else
  Code "G00 X" & x & " Y" & y
end if



Regards,
Ray L.
Regards,
Ray L.

Offline N4NV

*
  •  393 393
    • View Profile
Re: CNC'ing both quill and knee
« Reply #19 on: February 11, 2009, 11:28:13 PM »
Thanks, I'll play with it this weekend.  If it looks like it will work, then I guess I will have to get started mounting my servo to the knee.

Vince