Hello Guest it is April 24, 2024, 04:14:11 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 - zone023

Pages: « 1 2 3 4 »
21
General Mach Discussion / Re: machine running irregular on button script
« on: December 14, 2010, 06:41:47 AM »
Hi TP and rrc1962,

Thanks for the reply.

I think I am encountering the problems TP describes.
The way the machine acts while running a VB script already gave me the feeling things are not in sync.

As a quick solution I will try writing results to an array while probing and write the array to a text-file when finshed.

But I think probing with .NC g-code will work better after all...
That means I have to learn how to write g-code subs, I guess.
Also writing to variables is new for me... ???
Of course I will do some searching myself, but is anybody willing to share an example??


Thanks again!

Rich




22
General Mach Discussion / Re: machine running irregular on button script
« on: December 13, 2010, 08:19:46 PM »
I thought it might help posting the script... :D

Code: [Select]
Option Explicit

Dim POX As Single  '-- probe offset X
Dim POY As Single
Dim TD As Single  '--Tip Diameter
Dim shiftZ As Single

Dim Xwp As Single '-- X work at probe position
Dim Ywp As Single '-- Y work at probe position
Dim Zwp As Single

Dim minX As Single
Dim minY As Single
Dim maxX As Single
Dim maxY As Single

Dim sizeX As Single
Dim sizeY As Single

Dim stepX As Single
Dim stepY As Single

Dim borderX As Single
Dim borderY As Single

Dim ProbeFeed As Single
Dim RapidFeedXY As Single
Dim RapidFeedZ As Single

Dim Datum As String

POX = GetUserDRO(1501)
POY = GetUserDRO(1502)
TD = GetUserDRO(1503)

RapidFeedXY=GetUserDRO(1615)
RapidFeedZ=GetUserDRO(1615)
ProbeFeed = GetUserDRO(1505)

Xwp = GetOemDRO(800) + POX
Ywp = GetOemDRO(801) + POY

sizeX = GetUserDRO(1601)
sizeY = GetUserDRO(1602)

stepX = GetUserDRO(1605)
stepY = GetUserDRO(1606)

borderX = GetUserDRO(1610)
borderY = GetUserDRO(1611)

minX = borderX
minY = borderY

maxX = sizeX - borderX
maxY = sizeY - borderY


Datum = Format(Now, "yyyymmdd")
Datum = Datum & "-" & Format(Time, "hhmm")


If GetOemLed (825)=0 Then

Open "c:\mach3\scan\SCAN-" & Datum & ".txt" For Output As #1 ' Open to write file.


MsgBox ("Probe will move. Make sure work area is clear. Probe-tip must be about 10mm above work!")


Code "G90 G1 X" & minX - POX & " Y" & minY - POY & " F" & RapidFeedXY  'Move to border


Code "G91 G31 Z-15 F" & ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"

Call SetDro (2, 0 + (0.5 * TD))

Code "G4 P0.5" 'Pause for Dro to update.
Code "G91 G1 Z5 F" & RapidFeedZ  'Probe backs off 5mm
While IsMoving()
Wend

Code "G90"

Code "G4 P0.25"

Code "G91 G31 Z-10 F" & ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"

shiftZ = GetVar(2002) + (0.5 * TD)


Code "G4 P0.15" 'Pause for Dro to update.
Code "G91 G1 Z5 F" & RapidFeedZ  'Probe backs off 5mm
While IsMoving()
Wend

Code "G90"

Code "G4 P0.25"

Xwp = GetOemDRO(800) + POX
Ywp = GetOemDRO(801) + POY
Zwp = 0

Write #1, Xwp, Ywp, Zwp


If Xwp + stepX < maxX Then
  Code " G91 G1 Y" & stepY & "F" & RapidFeedXY
While IsMoving()
Wend
End If

Xwp = GetOemDRO(800) + POX


Do Until Xwp + stepX > maxX

Code "G4 P0.1"

Code "G91 G31 Z-10 F" & ProbeFeed
While IsMoving()
Wend
Code "G4 P0.05"

Xwp = GetOemDRO(800) + POX
Ywp = GetOemDRO(801) + POY
Zwp = GetVar(2002) - shiftZ + (0.5 * TD)

Write #1, Xwp, Ywp, Zwp

Code "G91 G1 Z5. F" & RapidFeedZ
While IsMoving()
Wend

 
Do Until Ywp + stepY >= maxY

Code "G4 P0.1"

Code " G91 G1 Y" & stepY & "F" & RapidFeedXY
While IsMoving()
Wend

Code "G4 P0.1"

Code "G91 G31 Z-10 F" & ProbeFeed
While IsMoving()
Wend
Code "G4 P0.05"

Xwp = GetOemDRO(800) + POX
Ywp = GetOemDRO(801) + POY
Zwp = GetVar(2002) - shiftZ + (0.5 * TD)

Write #1, Xwp , Ywp, Zwp


Code "G91 G1 Z5. F" & RapidFeedZ
While IsMoving()
Wend


Loop


If Xwp + stepX < maxX Then

Code "G4 P0.1"

Code "G90 G1 X" & Xwp + stepX - POX & "Y" & minY - POY & "F" & RapidFeedXY
While IsMoving()
Wend
Else

Code "G91 G1 Z5. F" & RapidFeedZ
While IsMoving()
Wend


Code "G90 G1 X" & minX - POX & "Y" & minY - POY & "F" & RapidFeedXY
While IsMoving()
Wend

End If


Loop

Code "G90"
Close #1

MsgBox ("Scan File saved as c:\mach3\scan\SCAN-" & Datum & ".txt")


Else
Code "(Probe is active, check setup and try again)"
Exit Sub
End If


                          

23
General Mach Discussion / Re: machine running irregular on button script
« on: December 13, 2010, 08:05:12 PM »
Hi,

Missing the pause isn't the real problem...
It just also happens on an irregular basis.

The real problem is missing the steps...
When I scan say 300 points on a surface, in my opinion the machine should make a repeated regluar sound... probe and step to the next piont.....probe and step to the next point....probe and step to the next point....etc...
But the sound is not regular, like it hessitates sometimes...or sometimes it seems to react faster, skip a pause..

As said, the machine normally never looses steps when running a .NC-file.
Loosing steps while probing from a vb (button) script only occurs on the y-axis.
The y-axis is driven on both sides. It has dual motors, master and slave setup.

My guess for now is that, because of the irregularity, master-y and slave-y are not receiving their commands simultaneous.  
Thus tension builds up in the y-axis and steps are lost... ( I hear a "bang" when loosing steps...)

.NC-files, even with repeated operations, never give me this problem... :-\
 

Thanks again.




 



24
General Mach Discussion / Re: machine running irregular on button script
« on: December 13, 2010, 06:50:04 PM »
Hi Graham,

I have no idea how to do what you say.
I will have to find out how to use # variables...
Are there enough variables available to store 300 to 500 xyz values?   (thus 1500 values)
Some searching and reading will help, I guess... ???

Is it normal that g-code in a button scrip is executed like described, with irregularities?
Does this happen because the VB-script is interrupted by windows, or something like that?

 
Thanks for helping!

Rich



25
General Mach Discussion / machine running irregular on button script
« on: December 13, 2010, 03:49:30 PM »
Hi All,

I am encountering a problem when running a button script.

It is a fairly simple probing script, for measuring flatness of a surface.
There are a few dro's involved for surface size, grid size, etc.
The script uses some Do Until...Loops to scan a surface for flatness in a regular grid.
Scanned XYZ values are written to a textfile.

For instance, on a surface of 270 x 400 mm with a 20mm measuring grid about 300 points are beeing probed.
This takes about 10 minutes.

During this scan my machine sometimes acts strange, it looses steps and is running irregular.

Also, when the probe hits the surface "G4 P.25" is used, a pause to allow for writing values to the textfile.
About 1 in every 100 times the pause is skipped, the probe backs off immediately to go to the next piont.
XYZ Values are written okay though..


Is there some explanation for this strange behaviour?

I never loose steps when running g-code.
I can run complex programs without a problem.

So, is there a way to scan with a g-code file?
Can XYZ values  be written to a textfile while using g-code?
I mean g-code in a .NC-file, not g-gode in a button script.

Thanks for helping!

Rich
  
  
 
 

 

26
VB and the development of wizards / Re: check if G68 is active
« on: May 20, 2010, 06:14:02 PM »
Thanks Dave.

With the Led and Dro it is possible to do what I want(ed)
I'll try without deactivating first.
Not having to program myself seriously reduces the risk of damage...  ;D
The same reason why I was looking for mach g68 readouts.
It also would have been possible to assign a UserDro and led, but this increases the risk of making  mistakes (for me...)

Rich

27
VB and the development of wizards / Re: check if G68 is active
« on: May 20, 2010, 04:54:43 PM »
Hi,


I did a G68 search, that's why I didn't find OemLed(108)...
And in fact I was looking for a way to read the state of G68, degrees of rotation, etc.
In that way I would be able to store the settings, switch it off for a toolchange, and switch on again afterwards with the correct settings.
But because of your testing it is clear that a toolchange can be executed without deactivating G68.

Thanks again!

Rich
  

28
VB and the development of wizards / Re: check if G68 is active
« on: May 19, 2010, 10:52:23 AM »
Hi,

Thanks for warning. From this forum I already understood that you have to be careful when using G68. :o

Just need to find out now if G68 really doesn't affect a toolchange in machine coords.

I'll do some testing later on...need to find a foam vise and cardboard toolsetter first... ;D



Rich

29
VB and the development of wizards / check if G68 is active
« on: May 18, 2010, 04:51:00 AM »
Hi,

I am setting up my machine so that it can handle a G68 job rotation.

Button-scrips for measuring the angle and setting G68 are already functioning.

From what I understood you have to switch off G68 before toolchange.
(Obvious: The toolsetter has a fixed location stored in machine coordinates.)

So I want my toolchange macro (M6) to check if G68 is active, switch it off, do the toolchange and switch on G68 again.

Does anybody know how to check if G68 is active? ???

Are there any other G-codes or macro's that require G68 to be deactivated?

Thanks for helping!

Rich
  


 

30
General Mach Discussion / Re: helix toolpath problem...
« on: May 05, 2010, 02:54:20 PM »
Hi,

The code consits of small segments.

LookAhead is only 20 right now, I'll change it to 200 or 300 and have a go.
(In a day or 2, busy with work till the weekend... >:D)


Thanks!

Rich



Pages: « 1 2 3 4 »