Hello Guest it is April 19, 2024, 09:33:59 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Davek0974

581
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 25, 2018, 01:19:30 PM »
Hmm, after spending an hour trying to figure out why it does nothing, i filled it with msgbox calls to examine why

"ToolLengthOffset" seems to do nothing at all and returns zero, this is why the macro failed.

what is the correct way to get tool length offset???


582
General Mach Discussion / Re: Cut not going into corners?
« on: January 25, 2018, 09:40:01 AM »
My first guess would be that your acceleration settings are too low for the speed travelled.

If this is a new issue then something must have changed - corner rounding is nearly always due to poor acceleration/speed settings

Try going into exact-stop mode instead of constant velocity (CV) mode.

583
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 25, 2018, 05:09:49 AM »
Ok, major changes below, my learned friend and mentor has enlightened me to a simple way by just comparing old and new tools, seems to make more sense now and needs no DRO's adding etc.

I have also made the last 3mm of move at F100 rather than G0 all the way so it gives the best chance of hitting the spot.


Code: [Select]
Sub Main()

If GetSelectedTool() = GetCurrentTool() Then Exit Sub ‘***Do nothing if current tool is called again

If GetOEMLED(1866) Then Exit Sub ***Ignore M6 calls LED

‘***Get the current G90/G91 state
CurrentAbsInc = GetOemLED(48)

‘***Get Axis Scale factors in use
XScale = GetOEMDRO(59)
YScale = GetOEMDRO(60)
ZScale = GetOEMDRO(61)
CScale = GetOEMDRO(64)

‘***Set All Axis Scales to 1
Call SetOEMDRO(59,1)
Call SetOEMDRO(60,1)
Call SetOEMDRO(61,1)
Call SetOEMDRO(64,1)
Sleep(250)

‘***Get old tool length
OldToolLength = roun(ToolLengthOffset)

‘***Set the requested tool to be the current tool
SetCurrentTool(GetSelectedTool())

‘***Get new tool length
NewToolLength = roun(ToolLengthOffset)

‘***Switch to absolute distance mode
Code "G90"

‘***Move Z axis to machine zero - fully retracted for tool change
Code "G53 G0 Z0”
While IsMoving()
  Sleep(100)
Wend

'========================================================================================
' Start of Knee Positioning Code
'========================================================================================
‘Get the knee position in machine coordinates
CurrentKneePosition = roun(GetOEMDRO(88))

‘***Get the respective backlash clearance allowance for downwards knee moves
If GetOEMLED(801) Then ‘***On  = English Measure INCH
    ClearAllow = 0.125 
Else                   ‘***Off = Metric Measure MM
    ClearAllow = 3.0   
End If

‘***Calculate the knee machine move value based on tool length difference
If OldToolLength > NewToolLength then ‘***We need to RAISE the knee
    Message “Knee Will Lift ” & OldToolLength - NewToolLength ‘***Use this line for debugging
    Code “G53 G0 C” & (CurrentKneePosition - (OldToolLength - NewToolLength)) + ClearAllow
    While IsMoving ()
      Sleep(100)
    Wend
    Code “G53 G1 C” & (CurrentKneePosition - (OldToolLength - NewToolLength)) & “ F100”
    While IsMoving ()
      Sleep(100)
    Wend
End If

‘***If the knee is currently higher than it needs to be, we first
‘***move it down, to ensure the final move is always UP.  This ensures
‘***backlash is taken out and provides more consistent positioning.

If OldToolLength < NewToolLength then ‘***We need to LOWER the knee
    Message “Knee Will Lower ” & NewToolLength - OldToolLength ‘***Use this line for debugging
    Code “G53 G0 C” & ((CurrentKneePosition + (NewToolLength - OldToolLength)) + ClearAllow
    While IsMoving ()
      Sleep(100)
    Wend
    Code “G53 G1 C” & (CurrentKneePosition + (NewToolLength - OldToolLength)) & “ F100”
    While IsMoving ()
      Sleep(100)
    Wend
End If

If OldToolLength = NewToolLength then
    Message “Knee Will Not Move” ‘***Use this line for debugging
End If

'========================================================================================
' End of Knee Positioning Code
'========================================================================================

‘***If G91 was in effect before then return to it
If CurrentAbsInc = 0 Then
  Code "G91"
End If

‘***Put previous Axis Scale factors back
Call SetOEMDRO(59,XScale)
Call SetOEMDRO(60,YScale)
Call SetOEMDRO(61,ZScale)
Call SetOEMDRO(64,CScale)
Sleep(250)

End Sub
   

584
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 24, 2018, 04:20:49 PM »
Couple of small errors in that code, fixed now - i'm calling axis scale factor DRO for A axis but i'm using C axis  and i called my hidden DRO an OEMDRO where it should be UserDRO I think.


So, presuming this code mostly works, if i check OEMLED(812) (C Ref Led) a value of 1 would indicate if the knee has been homed yes?
My reason is so that i can abort the tool change macro somewhere as it could be dangerous unless the knee is homed and its exact position known.

Is it worth also zeroing my UserDRO when the knee is homed - a latent value in this DRO could be dodgy if it was from a previous job, I can check for a zero value in the macro and abort.
Maybe also zero the UserDRO when the LoadFile button is pressed?

I'm just trying to look for pitfalls before they happen and possibly building the fix in - seems there can be quite a lot can go wrong when you have mixed length tools and the knee going up and down along with the Z axis etc :)

585
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 24, 2018, 10:42:43 AM »
Something like this maybe, I think I have it all working in Machine Coords for the C axis(knee) - it needs a hidden user DRO adding to the screen, unless we go down the variable route;)
Its not that long, I just like adding LOTS of text descriptors :)
Note - this code is UNTESTED


Code: [Select]
Sub Main()

If GetSelectedTool() = GetCurrentTool() Then Exit Sub ‘***Do nothing if current tool is called again

If GetOEMLED(1866) Then Exit Sub ***Ignore M6 calls LED

‘***Get the current G90/G91 state
CurrentAbsInc = GetOemLED(48)

‘***Get Axis Scale factors in use
XScale = GetOEMDRO(59)
YScale = GetOEMDRO(60)
ZScale = GetOEMDRO(61)
AScale = GetOEMDRO(62)

‘***Set All Axis Scales to 1
Call SetOEMDRO(59,1)
Call SetOEMDRO(60,1)
Call SetOEMDRO(61,1)
Call SetOEMDRO(62,1)
Sleep(250)

‘***Set the requested tool to be the current tool
tool = GetSelectedTool()
SetCurrentTool( tool )

‘***Switch to absolute distance mode
Code "G90"

‘***Move Z axis to machine zero - fully retracted for tool change
Code "G53 G0 Z0”
While IsMoving()
  Sleep 100
Wend

'========================================================================================
' Start of Knee Positioning Code
'========================================================================================
‘Get the knee reference position - set when pressing “Z Zero” at probing stage of setup
KneeRefPosition = roun(GetOEMDRO(1012)) ‘***This is a hidden DRO

‘***Get the respective backlash clearance allowance for downwards knee moves
If GetOEMLED(801) Then ‘***On  = English Measure INCH
    ClearAllow = 0.125  
Else                   ‘***Off = Metric Measure MM
    ClearAllow = 3.0    
End If

‘***Get the tool length whose offset number we are to use
‘***Tool has already been set to “currenttool” above
ToolOffsetNum = GetCurrentTool()

‘***Lookup the offset in the tool table, round it to 4 places, T100 is our 3d Haimer Probe
ToolOffset = roun(GetToolParam(ToolOffsetNum, 2))
ProbeOffset = roun(GetToolParam(100, 2))

‘***Calculate the difference between the probe and the new tool - can be negative or positive
OffSetDifference = ProbeOffset-ToolOffset

‘***See where the knee is now in machine coordinates
CurrentKneePos = roun(GetOEMDRO(88))’***Mach C Axis DRO
  ‘Message "CurrentKneePos=" & CurrentKneePos & " OffsetDifference=" & OffsetDifference ‘***Use this line for debugging

‘***Calculate the new knee machine coordinate value based on tool length difference
TargetKneePosition = KneeRefPosition - OffsetDifference

  ‘Message “Target Knee Pos = " & TargetKneePos ‘***Use this line for debugging

‘***If the knee is currently higher than it needs to be, we first
‘***move it down, to ensure the final move is always UP.  This ensures
‘***backlash is taken out, and provides more consistent positioning.
If TargetKneePosition > CurrentKneePosition Then
  Code “G53 G0 C“ & (TargetKneePosition + ClearAllow)
  While IsMoving ()
    Sleep 100
  Wend
End If

‘***Now move the knee UP to its final position
Code “G53 G0 C“ & TargetKneePosition
While IsMoving ()
  Sleep 100
Wend

'========================================================================================
' End of Knee Positioning Code
'========================================================================================

‘***If G91 was in effect before then return to it
If CurrentAbsInc = 0 Then
  Code "G91"
End If

‘***Put previous Axis Scale factors back
Call SetOEMDRO(59,XScale)
Call SetOEMDRO(60,YScale)
Call SetOEMDRO(61,ZScale)
Call SetOEMDRO(62,AScale)
Sleep(250)

End Sub
  

586
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 24, 2018, 09:08:17 AM »
Ok, so i have a general dislike of going near variables - you have little idea of which one is free and i don't like cherry-picking a number just in case its used elsewhere and causes big trouble :)

So, my next idea to enable me to use machine coords for the knee is this...

Hide a user DRO on my screen somewhere,
Zero this DRO upon Mach loading,
When i press "Set Z Zero" it copies the value of OEMDRO(88) (C axis machine coords) into the hidden DRO - this is now my reference value for all TL calculations,
In my M6Start I can read the hidden DRO, use the value to calculate a move based on the difference between my probe and tool,
Make the move in G53 on the C axis

I'm guessing a test/abort/message will need going in the M6start to abort if the hidden DRO is zero i.e. Z is not set or a rapid dent of the knee could occur if a tool change is manually called etc.

Sound like a workable idea?

587
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 24, 2018, 05:56:38 AM »
Re the coordinates to use for knee moves?

My original idea was to have the C(knee) axis zeroed along with the Z axis so that when i use my Haimer probe to set work coordinates, the C and Z will both be reading zero, then when the next tool is called the macro can simply send the difference between my probe height and the tool height to the knee axis C.

Now, a learned friend has suggested a safer option is to use machine coordinates for the knee.

So, if its in machine coordinates, when i set the work zero ref (Z), the knee may be reading -250 or somewhere like that, now unless i get jiggy with variables and store the knee machine DRO when i press Z zero, how will i calculate the amount to move the knee upon tool change??

I may just not have seen the light yet but don’t know:)

It would certainly be safer to use machine coords of course.

IIRC variables are system wide so i can set one in the Z Zero call and read it later in the M6 macro's ??

588
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 23, 2018, 05:00:38 PM »
LOL

589
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 23, 2018, 04:53:05 PM »
Ok, great its set on 500mm/min so i can go a little more if wanted i guess, it seems ok though at that speed.

I'm using a stainless kiosk keyboard which has a lot of keys missing (including all the F buttons :( ) I'll see what there is.


590
General Mach Discussion / Re: Bridgeport Knee Mill Conversion?
« on: January 23, 2018, 04:20:13 PM »
Yes, i was pleased i sorted it - hate sleeping on a problem.

Its homing ok with the index pulse too.

Need to sort out soft limits, what sort of speed to limit it to, keyboard shortcut keys and so on.