Hello Guest it is December 08, 2019, 07:07:42 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 - TPS

251
added some more debug info in this code. pls run this code and (assume you use Mach3 Standard
turn screenset) go to Diags. an use the History Button.
post the Textfile after running the macro.

Code: [Select]
OldTool = GetCurrentTool()
Tool = GetSelectedTool()
MaxToolNum = 4      'Max number of tools for the changer
debug = true

If debug = true Then
Message "OldTool: " & OldTool & " NewTool: " & Tool
Sleep(200)
End If

If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If

While Tool > MaxToolNum
Tool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend

Call StartTool

While NewTool <> Tool
   Call CheckPins
   While IsMoving()
   Wend
Wend

Call StopTool

SetCurrentTool(NewTool)

'//// Subroutines /////////

Sub StartTool
   ActivateSignal(Output8)
   If debug = true Then
Message "Output8 On"
Sleep(200)
   End If
   'Code "G4 P4.0"    'Wait for the tool to rotate past the sensor
      While IsMoving()
      Wend
End Sub

Sub CheckPins
   If IsActive(Input22) Then
      NewTool = 1
      End If
   If IsActive(Input21) Then
      NewTool = 2
      End If
   If IsActive(Input20) Then
      NewTool = 3
      End If
   If IsActive(Input19) Then
      NewTool = 4
      End If
  If debug = true Then
Message "NewTool= " & NewTool
Sleep(200)
  End If
End Sub

Sub Stoptool
   DeActivateSignal(Output8)
   If debug = true Then
Message "Output8 Off"
Sleep(200)
   End If
      While IsMoving()
      Wend
   ActivateSignal(Output9) 
   If debug = true Then
Message "Output9 On"
Sleep(200)
   End If
      Code "G4 P1.0"    'Wait for the tool to rotate onto ratchet stop
      While IsMoving()
      Wend
   DeActivateSignal(Output9)
   If debug = true Then
Message "Output9 Off"
Sleep(200)
   End If
      While IsMoving()
      Wend
End Sub 

252
General Mach Discussion / Re: Ref All Home
« on: April 25, 2019, 02:23:34 AM »
for the Moment i can not see the real benefit of your script, because the
G0 X/Y25 moves are done in the actual fixture Offset (G54..).
let's say for example your G54 0,0 is in machine coords at 200,200 the machine
will go to 225/225 and do the ref X/Y.

faster would be to use G53 G0 X/Y25 then machine will go to 25mm from Limit Switches,
but this is dangerous if machine has not been homed before, because this 25,25 can be somewhere.

this are only my insignificant thoughts. ;)

253
try this code, now you should see in Status line witch TC place is detected by the Inputs

Code: [Select]
OldTool = GetCurrentTool()
Tool = GetSelectedTool()
MaxToolNum = 4      'Max number of tools for the changer

Message "OldTool: " & OldTool & " NewTool: " & Tool
Sleep(200)

If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If

While Tool > MaxToolNum
Tool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend

Call StartTool

While NewTool <> Tool
   Call CheckPins
   While IsMoving()
   Wend
Wend

Call StopTool

SetCurrentTool(NewTool)

'//// Subroutines /////////

Sub StartTool
   ActivateSignal(Output8)
   'Code "G4 P4.0"    'Wait for the tool to rotate past the sensor
      While IsMoving()
      Wend
End Sub

Sub CheckPins
   If IsActive(Input22) Then
      NewTool = 1
      End If
   If IsActive(Input21) Then
      NewTool = 2
      End If
   If IsActive(Input20) Then
      NewTool = 3
      End If
   If IsActive(Input19) Then
      NewTool = 4
      End If
  Message "NewTool= " & NewTool
  Sleep(200)
End Sub

Sub Stoptool
   DeActivateSignal(Output8)
      While IsMoving()
      Wend
   ActivateSignal(Output9) 
      Code "G4 P1.0"    'Wait for the tool to rotate onto ratchet stop
      While IsMoving()
      Wend
   DeActivateSignal(Output9)
      While IsMoving()
      Wend
End Sub 

254
CS-Lab / Re: CSMIO-ENC Spindle Orientation
« on: April 24, 2019, 12:03:34 PM »
i have also linked my Encoder Output from spindle servo to c axis and ENC module.
but i am doing the spindle orientation (for the ATC) on the servo drive, this is enabled
by a digital Input on the servo and reported back by a digital Output from the servo.

255
Mach Screens / Re: chinese cnc probing macros?
« on: April 24, 2019, 06:03:15 AM »
My thought was that they may be writing to OEMDRO2000, 2001,2002, ...

But maybe their notes are completely wrong.

you seem to be right, missed the post with the Changelog notes.
Looks like they are writing UserDro 2000...

256
dspMC/IP Motion Controller / Re: PC requirements for Mach4 with DSPMC
« on: April 24, 2019, 03:13:17 AM »
Mach4 Recommended Requirements

PREFERRED: 32 or 64-bit Laptop or Desktop – Using an External Motion Controller
Windows XP, Windows Vista, Windows 7, and Windows 8
An appropriate external motion controller
Mach4 Plugin for the selected Motion Controller
2Ghz CPU
1GB RAM
Video Card with 256MB RAM(Large G-code files, especially 3D files will require a video card with 512MB RAM or higher)


32-bit Desktop – Parallel Port Recommended Requirements
32-bit version of Windows XP, Windows Vista, or Windows 7
Mach4 Parallel Port Legacy Plugin (cost applicable)
2Ghz CPU
1GB RAM
Non-integrated Video Card with 256MB RAM(Large G-code files, especially 3D files will require a video card with 512MB RAM or higher)
*Use of Parallel Port for machine control only with desktop style computers with 32-bit versions of windows 7 and below.

257
Mach Screens / Re: chinese cnc probing macros?
« on: April 24, 2019, 02:15:43 AM »
from Mach3Mill_1.84 doc
chapter 10.7.12 Straight Probe – G31

description:

After successful probing, parameters 2000 to 2005 will be set to the coordinates of the
location of the controlled point at the time the probe tripped and a triplet giving X, Y and Z
at the trip will be written to the triplet file if it has been opened by the M40
macro/OpenDigFile() function (q.v.)


example code:


N010 (probe to find center and diameter of circular hole)
N020 (This program will not run as given here. You have to)
N030 (insert numbers in place of <description of number>.)
N040 (Delete lines N020, N030, and N040 when you do that.)
N050 G0 Z <Z-value of retracted position> F <feed rate>
N060 #1001=<nominal X-value of hole center>
N070 #1002=<nominal Y-value of hole center>
N080 #1003=<some Z-value inside the hole>
N090 #1004=<probe tip radius>
N100 #1005=[<nominal hole diameter>/2.0 - #1004]
N110 G0 X#1001 Y#1002 (move above nominal hole center)
N120 G0 Z#1003 (move into hole - to be cautious, substitute G1 for G0 here)
N130 G31 X[#1001 + #1005] (probe +X side of hole)
N140 #1011=#2000 (save results)
N150 G0 X#1001 Y#1002 (back to center of hole)
N160 G31 X[#1001 - #1005] (probe -X side of hole)
N170 #1021=[[#1011 + #2000] / 2.0] (find pretty good X-value of hole center)
N180 G0 X#1021 Y#1002 (back to center of hole)
N190 G31 Y[#1002 + #1005] (probe +Y side of hole)
N200 #1012=#2001 (save results)
N210 G0 X#1021 Y#1002 (back to center of hole)
N220 G31 Y[#1002 - #1005] (probe -Y side of hole)
N230 #1022=[[#1012 + #2001] / 2.0] (find very good Y-value of hole center)
N240 #1014=[#1012 - #2001 + [2 * #1004]] (find hole diameter in Y-direction)
N250 G0 X#1021 Y#1022 (back to center of hole)
N260 G31 X[#1021 + #1005] (probe +X side of hole)
N270 #1031=#2000 (save results)
N280 G0 X#1021 Y#1022 (back to center of hole)
N290 G31 X[#1021 - #1005] (probe -X side of hole)
N300 #1041=[[#1031 + #2000] / 2.0] (find very good X-value of hole center)
N310 #1024=[#1031 - #2000 + [2 * #1004]] (find hole diameter in X-direction)
N320 #1034=[[#1014 + #1024] / 2.0] (find average hole diameter)
N330 #1035=[#1024 - #1014] (find difference in hole diameters)
N340 G0 X#1041 Y#1022 (back to center of hole)
N350 M2 (that's all, folks)


as written, a good Motion Controller or PP machine will have the exact result of G31 in
uservars 2000...2002

258
I moved the " mark from in front of the G00 to In front of the X and now the machine works as it should.

imho by doing this, you should see a scripter Compiler error in the Status line, and the M6End macro
will not be executed at all. -> so no move

259
Mach Screens / Re: chinese cnc probing macros?
« on: April 23, 2019, 12:53:21 PM »
there is a big difference between GetVar(2000...2002) and GetOEMDro(2000...2002)

a good Motion controler uses the Variables 2000.2002 to strore the axis values exactly when
the probe was hit (allmost realtime), nothing will happen with OEMDro 2000...2002

Quote
V2.38.4 2015.7.8
1. add probe variable 2000-2003,but it maybe still could not compatible with mach3 screen 2010.
if you want to probe with screen 2010, please replace the GetVar(2002) with getoemdro(802),
GetVar(2001) with getoemdro(801),GetVar(2000) with getoemdro(800).

if you use OEMDro 800...802 you will allways get the value from the probe hit + overtravel depending
on the time the axis Needs to stop.

260
General Mach Discussion / Re: Ref All Home
« on: April 23, 2019, 12:42:05 PM »
This will home at the homing speed in Config>Homing/Limits, then home again at 1/10 the speed.

So if you set the Homing speed at 50%, it will home at 50% first, then 5%.

DoButton(24)
DoButton(23)
DoButton(22)
While IsMoving()
Wend
SetParam("XRefPer", GetParam("XRefPer")/10)
SetParam("YRefPer", GetParam("YRefPer")/10)
SetParam("ZRefPer", GetParam("ZRefPer")/10)
DoButton(24)
DoButton(23)
DoButton(22)
While IsMoving()
Wend
SetParam("XRefPer", GetParam("XRefPer")*10)
SetParam("YRefPer", GetParam("YRefPer")*10)
SetParam("ZRefPer", GetParam("ZRefPer")*10)

sometimes i wonder why a searchfunction has been invented ;)