Hello Guest it is May 11, 2021, 12:32:13 PM

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 - Highspeed1964

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13
121
FAQs / Re: Zero Tool not reading allowance
« on: July 20, 2016, 05:28:34 PM »
"Sleep 200"  should read "Sleep(200)".  Sleep is not a command but a function.  So it may be that the DRO is still updating when it is trying to make the next move.  Also, I find it is good practice to put a sleep function with just a short time (i.e. Sleep(10)) within my While/Wend loops.  This is supposed to give time back to the main processes (like updating DROs, etc.) while you're waiting on the machine to complete its' move.

Hope this helps,

Stephen "Highspeed" Kruse

122
I've just recently gotten into the CNC world myself and one of the first things I did was learn a good bit of VBScripting.  I started with an Auto Tool Zero macro that was provided with the MPG pendant I added in to my system and progressed by studying that as well as some of the good documentation available on the ArtSoft website.  However, I've now built up a nice tool change macro that will move the spindle to a specified location (user definable, more details below), prompt for the new tool and when the new tool has been acknowledged, perform and Auto Tool Zero using the touch "plate" (it's actually a cylinder with a metal surface) or allow you to perform a manual touch-off.  Then when you press "Cycle Start" to continue, the M6End.m1s macro will return to the work location the machine was at prior to the T1 M6 (or T2, T3, etc. - whichever tool is called for) and continue running the part program.

This is all done using the default Mach 3 1024.set screen set configuration.

First, here is the M6Start.m1s macro I've written (you'll have to forgive the formatting, it didn't come across very clean when I pasted it in below):

' Set variables to store some current, selected and user defined values

tool = GetSelectedTool()            'Value for Tool DRO at completion of tool change
CurrentFeedMode = GetOemDRO(819)          'Get current G0/G1 state
CurrentUnitsMM = GetOemLED(802)            'Get Current MM Units state
CurrentAbsCMode = GetOemLED(48)          'Get current G90/G91 state
CurrentFeedRate = GetOemDRO(818)          'Get the current Feed Rate
ToolChangeX = GetUserDRO(1200)            'Get user defined tool change location
ToolChangeY = GetUserDRO(1201)
ToolChangeZ = GetUserDRO(1202)            'NOTE: Z will be used for Auto Tool Zero start height
GageH = GetOEMDRO( 1001 )            'Gage Block Height
ProbeD = 20                  'Depth to probe for touch plate

' Move to user defined tool change location

If CurrentUnitsMM = FALSE Then            'Ensure measurement mode is in MM for macro
   Code "G21"
End If
If IsSafeZ() Then               'If SafeZ is defined,
   safeZ = GetSafeZ()            'use it for positioning commands
Else
   safeZ = 0               'Otherwise, moves are made at MC Z0
End If
Code" G53 G0 Z" & safeZ               'Position spindle for tool change
Code"G53 G0 X" & ToolChangeX & "Y" & ToolChangeY
While IsMoving()
   Sleep(10)
Wend
PText = "Tool #" & tool & " requested.  (See Setup Sheet for details.)" _
   & Chr(10) & "Insert requested tool and press OK to continue."
MachMsg(PText,"Tool Change Request",0)
SetCurrentTool( tool )               'Set the Tool DRO to the new tool number

' Auto tool zero

AutoZeroPrompt = "Place probe for Auto Tool Zero and press OK" _
   & Chr(10) & "Or press CANCEL to zero tool manually"
AutoZero = MachMsg(AutoZeroPrompt,"Auto Tool Zero",1)
If AutoZero = 1 Then               'AutoZero = 1, User pressed OK
   Code "G53 G0 Z" & ToolChangeZ         'ToolChangeZ is MC for starting location of probing
   While IsMoving()
      Sleep (10)
   Wend
   ZCurrent = GetOemDro(802)         'Current Z DRO
   ZNew = ZCurrent - ProbeD         'Probe depth end height
   Code "G90F100"               'slow feed rate to 100 MM/MIN
   Code "G31 Z" &ZNew            'Start the probe move
   While IsMoving()
      Sleep(10)
   Wend
   If GetOEMLed(825) = True Then         'Probing successful
      ProbeTouch = GetVar(2002)      'Exact height touch plate was contacted
      Code "G1 Z" & ProbeTouch      'Go there (corrects for potential over-run)
      While IsMoving()
         Sleep(10)
      Wend
      Call SetDro(2,GageH)         'Set Z DRO to adjusted value
      FinalMove = GageH + 10
      Code  "G0 Z" &FinalMove         'Raise probe off of touch plate
      While IsMoving()
         Sleep(10)
      Wend
      Message("Press Cycle Start to continue...")
   Else                  'Probe did not contact touch plate
      Message("Zero not achieved - Check probe and try again manually")
   End If
Else                     'User selected Cancel on Auto Tool Zero prompt
   Message("Zero tool manually and press Cycle Start to continue...")
End If

'RESTORE MACHINE STATE VALUES

'Feed Rate

Code "F" &CurrentFeedRate            'restore starting feed rate

'G0/G1 State

If CurrentFeedMode = "80" Then            'Machine still in initial state at start of macro
   Code "G0"               'so set move mode to G0
Else
   Code "G" & CurrentFeedMode         'Otherwise set move mode to previous value
End If

'G20/G21 State

If CurrentUnitsMM Then               'Units was previously set to mm
   Code "G21"
Else                     'Units was previously set to inches
   Code "G20"
End If

'G90/G91 State

If CurrentAbsCMode Then               'System was using absolute coordinates
   Code "G90"
Else                     'System was using incremental coordinates
   Code "G91"
End If      


Next is the slightly modified M6End.m1s file:

'The (modified) default script here moves the tool back To m6start If Any movement has occured during the tool change..

x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
If(IsSafeZ() = 1) Then
   SafeZ = GetSafeZ()
   Code "G53 G0 Z" & SafeZ
Else
   Code "G53 G0 Z0"
End If
Code "G0 A" & a' & "B" & b & "C" & c
Code "G0 X" & x & "Y" & y
Code "G0 Z" & z  


Now for the specifics:

1.  At the beginning of the tool change macro, the spindle will be moved to Safe-Z if the machine is configured for it or Z0 if not.
2.  Then the spindle is moved to the X and Y location (in Machine Coordinates!) specified in the "Tool Change Location" DRO on the "Settings" screen.
3.  The user is then prompted by way of a dialogue box to change to the specified tool and then press OK.
4.  The next pop-up dialogue box prompts the user to position the touch plate and click OK, or you can click CANCEL to perform a manual touch-off.
5.  The Auto Tool Zero routine in the macro uses the Z location in the Tool Change Location DROs as the starting height of the of probe movement, again in Machine Coordinates.  It will perform a Feed Rate move to this height and then execute a G31 command for a depth of 20mm (my preferred unit of measure for the parts I make).  The depth is defined in the variable ProbeD and can be changed to your preference.
6.  Finally the spindle will be moved back up a short amount (10mm) for removing the touch plate.

All previous machine settings (G0/1, G20/21 and G90/91) are restored at the end of this macro so it should work even if you're working in inches instead of mm.

As mentioned earlier, pressing "Cycle Start" will then run the M6End macro which returns the spindle to the location it was at when the M6 macro was first called and then continue running the part program.

If you use this macro, PLEASE NOTE that the Tool Change Location DROs should be set IN MACHINE COORDINATES and configured prior to running the part program which may call the M6 command.  Also, the Z location specified is the starting height IN MACHINE COORDINATES for the beginning of the probe move.

Finally, I've also added a set of Digitize LEDs on the Program Run screen, one on each side of the Auto Tool Zero button (even though this button won't be used unless you choose to "manually" set the tool zero).  This is for three purposes:

1.  The operator can verify that the probe is not shorted prior to the zeroing operation.
2.  The operator can test the probe quickly and easily by touching the plate to the tool prior to clicking OK to begin the operation.
3.  The operator has visual confirmation that the tool has touched off.  The LEDs will light up briefly until the tool is raised back up, off of the touch plate.

I haven't done extensive/exhaustive testing on this macro, but it does work for my purposes.  If you do use it, you are responsible for understanding its' operation and potential safety risks.

Hopefully this helps someone get a better experience with their equipment.

Lastly, I'd appreciate any feedback from you kind folks as to any consideration which I may have overlooked in programming this macro - particularly any safety concerns one may have.

Thanks,

Stephen "Highspeed" Kruse

123
I know it's an old thread and you've probably gotten it all figured out by now, but I've just joined the forums and thought I'd share my insight on this.

I just started with the whole CNC Milling thing within the last couple of months.  I'm using FreeCAD for the modeling software, BobCAD/CAM for generating the tool paths and G-code files and of course Mach 3 for the controller piece.  I ran into what I believe is the same or at least similar situation when getting things set up.  What I found is that the I/J mode needed to be changed to "Incremental" in the General Configuration page.  Prior to this change I was getting an error message about I/J moves.  Once I changed that setting, no more problems.

Hope this helps,

Stephen "Highspeed" Kruse

124
General Mach Discussion / Re: Motors are not operating correctly
« on: July 18, 2016, 10:00:13 PM »
I suspect you may have gotten cleaner/lubricant into the motors or motor wiring.  Or maybe even just jostled the wires loose in the connectors.  Just my $.02

Stephen "Highspeed" Kruse

125
No, there isn't.

Any way to put one in there?  There is one on the default screen set so I'm sure it could be added.  Or am I way off here?

Stephen "Highspeed" Kruse

126
Mach Screens / Re: Screen4 Strange behaviour
« on: July 18, 2016, 03:30:07 PM »
Hi Stephen

are you using Mach3Screen or MachScreen?


Klaus

I've tried Mach3Screen and had the weird issues I mentioned earlier.  Never tried MachScreen.  I'm currently using Screen4 as that seems to work the best for me.

127
Mach Screens / Re: Screen4 Strange behaviour
« on: July 18, 2016, 12:43:55 PM »
Hi guys,

Sorry for bringing up an old(ish) thread, but I think this is the best place for this.

I am running Screen4 on a Windows 10 machine and if I try to use any of the menus, the program goes "Not Responding".  I've tested it on a Windows 7, 64-bit machine and do not have the same issue.  I've tried running the earlier version of Screen Designer and have major troubles with that one.  Nothing lines up correctly, if I click one of the buttons to change to a different screen it shows the cross-hairs and starts resizing the background image, etc.  So I'm using Screen4 as is, I just have to use the icons for the menu functions but feel I may be missing some features that are only available on the menus (i.e. no icons available on the tool bar).

Anyway, thought I'd give my findings on this and hope there may be a solution for the newer Windows versions forth-coming.

Thanks,

Stephen "Highspeed" Kruse

128
Hi,

So this is my first post in this forum and I am fairly new to CNC Milling and Mach 3.  However, I've gotten things running pretty well and am pleased with the results I am getting so far.

In addition, I am running the XHc HB04 pendant (MPG) and have an issue.  I have the Macro buttons (1, 2, 3, 6 and 7) set for the functions I want and they work well... after a workaround.  The issue is that when I first start Mach 3, the macro buttons do not function.  The work around is to go into the Config | Config Plugins menu and configure the XHc plugin.  I do not have to make any changes, I just need to go there and then click "OK" on the HB04 plugin screen and on the "Config Plugins" page.  At this point, everything then works well.

So the question is:  Is this a Mach 3 problem or a problem with the plugin itself?  If it is a problem with the plugin, is there any contact info for XHc that anyone is aware of that can help out?

Thanks in advance,

Stephen "Highspeed" Kruse

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13