Hello Guest it is April 25, 2024, 10:13:38 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 - jestah

Pages: « 1 2 3 4 5 »
21
I am running Mach3 R3.043.066 with an ESS plugin v10hd2

22
Hi Hood,

Thanks for the fast reply!

I have checked the Ignore Mcalls while loading in General config but still getting a trigger on the outputs. Could I mod the button to run a script to somehow lock out the outputs, then run sim then turn them back on?

Your idea about the clear button is perfect! Never would have come up with that myself! 

23

Hi guys,

I am making good progress on my cnc and now ready to start polishing up some of the fine details. I am cutting, changing tools automatic measuring the tool lengths but have found a few things that could lead to big issues down the road!

When I run a Gcode Simulation there is a very short trigger of my dust extractor and mister outputs. I have tested without M7 or M8 in the program and there is no triggering on the relays. Any advice as to how to keep this from starting?

Is it possible to lock out a dro so its value cannot be changed by the operator?  At the moment it is very easy for someone to change the current tool number DRO accidently which applies the wrong offset and would cause that tool to crash on top of another when the next tool change is called.
I have a few vb scripts running now and would like to know if it is advisable to avoid calling more Mcodes from within that script. If it is ok is there a limit to the number of Mcodes that can run at one time?

These are all my questions for this morning but I am sure I will have more shortly as I am doing my best to try to find any way that an inexperienced cnc operator can crash this cnc!

24
General Mach Discussion / macro working!
« on: December 11, 2012, 02:22:21 AM »
Ok I found a clean enough work around for this macro.... I tested it a few times today, ran well from VB editor but from MDI it would do even strange things, I have marked in blue where this would happen.

The odd thing was it would head DOWN and seemed to lump all of the blue lines together (down, x and y movement) at a very slow feed and travel until I got a servo tripping out or my hand hitting the estop. 

Thinking that it should not run them all together I added sleeps(25) between and also a big sleep(500) and a small move off z abs zero and now it seems to run fine... I don't know what it was being so strange but so far after many tests it seems to work well!

Hope it us helpful to others!

' Author: Christopher Esser (Smokingman). Based on the work done by Greolt
' modded by jestah 4th dec 2012

' Define fixed parameters (Currently in Metric )

Tnumber      =  GetDRO(24)  ' gets current tool
ProbeDist     = "-200" 'Set the maximum distance to move the Z-axis before probe touches contact plate.
ProbeFeed     = "500"   'Set the first plunge speed for the probe
ProbeFeed2     = "30"   'Set the second plunge speed for the probe
Retract       = "0.5"    'Set distance to retract after probe (incremental move away from touch plate)
Retract2       = "0"    'Set distance to retract after probe ( in mech. coor.)
Xprobpos   = "2635.74" 'Centre of tool sensor X in mech coor    
Yprobpos   = "31.64" 'Centre of tool sensor Y in mech coor' Declare Global Variables
Probeoffset = "0"' offset from probe top to table surface

' Declare Global Variables
Dim CurrentFeed
Dim CurrentAbsInc
Dim CurrentGmode
Dim StartingPoint

' Begin the Program
Call GetState
Call doProbe
Call RestoreState

' Get the Starting states
Sub GetState()
  CurrentFeed   = GetOemDRO(818)    ' Get the current feedrate to return to later
  CurrentAbsInc = GetOemLED(48)     ' Get the current G90/G91 state (Abs Coordinate Mode)
  CurrentGmode  = GetOemDRO(819)    ' Get the current G0/G1 state
  StartingPoint = GetOemDRO(85) - GetOemDRO(832) ' Get starting Z position in work coordinates (Z Machine Coord DRO - Z Fixture Orig Off DRO)
End Sub

' Restore the states
Sub RestoreState()
  Code "F" &CurrentFeed ' Returns to prior feed rate
  If CurrentAbsInc = 0 Then Code "G91" ' If G91 was in effect before then return to it
  If CurrentGMode = 0 Then Code "G0"   ' If G0 was in effect before then return to it
End Sub

' Probe routine
Sub doProbe()
 

'Start the actual probe

code "G49" 'remove any tool offset (tried both of these options to stop hitting soft limits on z)
sleep(500)

ActivateSignal(OUTPUT5) ' Dust hood up

'Code "G91 G0 Z-0.01"
Code "G90 G0 G53 Z" & Retract2 ' ( this is where the movement hits the solf limits even with the above removing tool lenght offsets...?!??!?)
   While IsMoving()
   Sleep(50)
     Wend
     
Tme = 0
While(GetOEMLED(822) = fulse)
Sleep(100)
Tme = Tme +.1
If(Tme > 2)Then
MsgBox("Hood up signal Timed out - please check!")
Exit Sub
End If
Wend
         
 Code "G0 G53 X" & Xprobpos
   While IsMoving()
   Sleep(50)
     Wend
  Code "G0 G53 Y" & Yprobpos
    While IsMoving()
    Sleep(50)
      Wend
 
  Code "F" &ProbeFeed        ' Set the probe plunge speed
  Code "G91 G31 Z" &ProbeDist ' Probing move using incremental move mode.
  While IsMoving()           ' Wait while it happens
 Sleep(50)
  Wend


  ZProbePos = GetVar(2002)   ' Get the axact point the probe was hit
 
  If (ProbeDist+StartingPoint = ZProbePos) Then ' No contact was made during plunge
    Code "(Probe failed!)"
    Exit Sub
  End If

Code "G90 G0 Z" &ZProbePos ' Go back to that point. Always a very small amount of overrun.
  While IsMoving ()
  Sleep(50)
  Wend
 
  Code "G91 G0 Z" & Retract      ' Retract
    While IsMoving()           ' Wait while it happens
   Sleep(50)
 Wend
 
  Code "F" &ProbeFeed2       ' Set the probe plunge speed
  Code "G91 G31 Z-" &Retract+0.5 ' Probing move using incremental move mode.
  While IsMoving()           ' Wait while it happens
  Sleep(50)
Wend
 
  ZProbePos = GetVar(2002)   ' Get the axact point the probe was hit

  Code "G90 G0 Z" &ZProbePos ' Go back to that point. Always a very small amount of overrun.
  While IsMoving ()
 Sleep(50)
 Wend
   
  SetToolParam(Tnumber,2,ZProbePos)
 
  Code "G0 G53 Z" & Retract2     ' Retract to mech zero
  While IsMoving ()
  Sleep(50)
Wend

Code "G43 H" &Tnumber' apply offset to tool

  Code "(Tool offset set)" 'is it possible to but the actual offset set in this box?
 
 DeActivateSignal(OUTPUT5)
 
  End Sub

25
Ok had to put this down to get other issues sorted but now that my manual tool release brain is working nicely time to get back into measuring these tools!

So  I have pulled together a few different auto tool zero macros and really happy with this mashup as it has a few key protection features and leave the cnc in the state it was found in. The only issue is I am constantly hitting my z+ soft limit and getting movement that is not what I expect from the G53 command.

I will highlight the lines below to show you where I am having issues but it was my understanding that G53 is in machine coordinates and therefore any offset should have NO effect. With the 0 in the tool offset table I have no issues and the script runs well. Once the offset is set tho on the G53 to Z0 the cnc seems to want to go much higher ( I am assuming the offset value but have a +1mm soft limit on the z at the moment to stop my ball screw nut slamming into bearing block….)

I have tried many different work arounds but none worked well and I would prefer to fine the problem than have to back road methods to be honest.


'Author: Christopher Esser (Smokingman). Based on the work done by Greolt
' modded by jestah 10 dec 2012

' Define fixed parameters (Currently in Metric )

Tnumber      =  GetDRO(24)  ' gets current tool
ProbeDist     = "-50" 'Set the maximum distance to move the Z-axis before probe touches contact plate.
ProbeFeed     = "500"   'Set the first plunge speed for the probe
ProbeFeed2     = "30"   'Set the second plunge speed for the probe
Retract       = "0.5"    'Set distance to retract after probe (incremental move away from touch plate)
Retract2       = "0"    'Set distance to retract after probe ( in mech. coor.)
Xprobpos   = "100" 'Centre of tool sensor X in mech coor    
Yprobpos   = "100" 'Centre of tool sensor Y in mech coor

' Declare Global Variables
Dim CurrentFeed
Dim CurrentAbsInc
Dim CurrentGmode
Dim StartingPoint

' Begin the Program
Call GetState
Call doProbe
Call RestoreState

' Get the Starting states
Sub GetState()
  CurrentFeed   = GetOemDRO(818)    ' Get the current feedrate to return to later
  CurrentAbsInc = GetOemLED(48)     ' Get the current G90/G91 state (Abs Coordinate Mode)
  CurrentGmode  = GetOemDRO(819)    ' Get the current G0/G1 state
  StartingPoint = GetOemDRO(85) - GetOemDRO(832) ' Get starting Z position in work coordinates (Z Machine Coord DRO - Z Fixture Orig Off DRO)
End Sub

' Restore the states
Sub RestoreState()
  Code "F" &CurrentFeed ' Returns to prior feed rate
  If CurrentAbsInc = 0 Then Code "G91" ' If G91 was in effect before then return to it
  If CurrentGMode = 0 Then Code "G0"   ' If G0 was in effect before then return to it
End Sub

' Probe routine
Sub doProbe()
 
'Check to see if the probe is already grounded or faulty
  If isActive(DIGITIZE) Then   
    MsgBox "Ground fault in probe detected. Fix probe and try again. "
    Exit Sub
  End If
   
'Start the actual probe

code "G49" 'remove any tool offset (tried both of these options to stop hitting soft limits on z)
'SetToolParam(Tnumber,2,0)
'Code "G43 H" &Tnumber


Code "G0 G53 Z" & Retract2 ' ( this is where the movement hits the soft limits even with the above removing tool length offsets...?!??!?)
   While IsMoving()
     Wend
     
 Code "G0 G53 X" & Xprobpos
   While IsMoving()
     Wend
  Code "G0 G53 Y" & Yprobpos
    While IsMoving()
      Wend
 
  Code "F" &ProbeFeed        ' Set the probe plunge speed
  Code "G91 G31 Z" &ProbeDist ' Probing move using incremental move mode.
  While IsMoving()           ' Wait while it happens
  Wend

  ZProbePos = GetVar(2002)   ' Get the exact point the probe was hit
 
  If (ProbeDist+StartingPoint = ZProbePos) Then ' No contact was made during plunge
    Code "(Probe failed!)"
    Exit Sub
  End If

Code "G90 G0 Z" &ZProbePos ' Go back to that point. Always a very small amount of overrun.
  While IsMoving ()
  Wend
 
  Code "G91 G0 Z" & Retract      ' Retract
    While IsMoving()           ' Wait while it happens
    Wend
 
  Code "F" &ProbeFeed2       ' Set the probe plunge speed
  Code "G91 G31 Z-" &Retract+0.5 ' Probing move using incremental move mode.
  While IsMoving()           ' Wait while it happens
  Wend
 
  ZProbePos = GetVar(2002)   ' Get the axact point the probe was hit

  Code "G90 G0 Z" &ZProbePos ' Go back to that point. Always a very small amount of overrun.
  While IsMoving ()
  Wend
   
  SetToolParam(Tnumber,2,ZProbePos)
 
  Code "G0 G53 Z" & Retract2     ' Retract to mech zero Have seen this drive z- into the tool sensor but not recently so may have solved this somewhere
  While IsMoving ()
  Wend

Code "G43 H" &Tnumber' apply offset to tool

  Code "(Tool offset set)" 'is it possible to but the actual offset set in this box? not really a issue but would be nice  ;D
End Sub

26
General Mach Discussion / Re: my very simple brain just wont work.....
« on: December 09, 2012, 10:02:14 PM »
Hi Russ,


***** edit **** sorry i just found your thread had a page two! Working in a -8c work shop is effecting my ability to function normally

Thanks for posting your progress as well…. I love mach3, run in to an issue and the answer is out there or people are willing to help solve it!

27
General Mach Discussion / Re: my very simple brain just wont work.....
« on: December 09, 2012, 09:38:12 PM »
ok for any one else who may run into this problem

SetTriggerMacro:

Sub SetTriggerMacro(MacroNum As Integer)

This function allows an M-macro to be associated with OEM code 301. This can be used
to cause one of the OEM Trigger signals to automatically run a macro when asserted.

1) To do this, the OEM Trigger signal must first be configured in Config->Ports&Pins>InputSignals.

2) Then the OEM Trigger must be associated with OEM code 301 in
Config->SystemHotKeys. Finally, SetTriggerMacro must be used to define which Mmacro
will be executed when OEM button code 301 is executed.

28
General Mach Discussion / Re: my very simple brain just wont work.....
« on: December 09, 2012, 09:32:21 PM »
ok found button "1034 - Execute Button Script"

Dropped M200 into my int string in general config.
Made two macros
------------
 M200:
‘Start up macro for atc
ActivateSignal(OUTPUT3)' release z brake
SetTriggerMacro(201) 'Trigger macro for manual spindle release
--------------------------
M201:
'Manual tool release macro
ActivateSignal(OUTPUT4)
sleep(500)
DeActivateSignal(OUTPUT4)


Running from MDI M201 works as expected
brain viewer show the macros should be run

M200 turns the z brake off but im not sure it is setting up the trigger macro set up right…

Suggestions or help please as I am so keen to start cutting!!!



29
General Mach Discussion / Re: my very simple brain just wont work.....
« on: December 09, 2012, 08:44:20 PM »
is it possible to have a brain run a macro/vb command rather than output4 directly ?

It seems that the brain when its running will not allow output for to run even from MDI so I would like to find a workaround for this

At the moment the only other option is to use my only free output and run a parallel lead to the spindle clamp release so that the manual release is separate from the "auto" release

30
General Mach Discussion / Re: my very simple brain just wont work.....
« on: December 09, 2012, 08:29:53 PM »
ok so inverting and using a nop lobe worked well but then when I went to run a tool change I found that the tool clamp release would not work!

Turning of the brain then solved the tool change issue!

Is it because the draw bar signal even outside the brain is now permanently flipped?

Pages: « 1 2 3 4 5 »