Hello Guest it is June 16, 2019, 07:21:46 AM

Author Topic: machine running irregular on button script  (Read 13017 times)

0 Members and 1 Guest are viewing this topic.

Re: machine running irregular on button script
« Reply #30 on: December 15, 2010, 12:41:15 PM »
Move RefAll to fixture 0,0 is indeed a solution, didn't think about it....
(And when I think about it, rotation also has to be taken in account :()

Taking the time and write some vb code to calculate machine coords to work coords is more elegant, I think.
And that has to be done only once...

Quote
I wonder IF you could apply the surface offsets to the axis correction map or possible use the data to create an offset table of Gcode variables.
 

Not sure what you mean with this, english is not my native language...

The "z-control" program I wrote functions on itself, outside Mach.

My knowlege of vb is far better than my knowledge of Mach, it's variables,  g-code etc
So I thought this was the way to go.

All I need is text-file (CSV, Like M40) of the surface scan and the original g-code.
Those are loaded in z-control.
z-control outputs adjusted g-code with interpolated Z's and broken G1 G2 and G3 parts.

It works. Even with G68 and my crappy button probing script.
Or with Grahams probing g-code and M40 without G68.

Offline BR549

*
  •  6,871 6,871
    • View Profile
Re: machine running irregular on button script
« Reply #31 on: December 15, 2010, 01:03:16 PM »
IF you have a working solution that is all that matters(;-)

(;-) TP
Re: machine running irregular on button script
« Reply #32 on: December 15, 2010, 02:10:39 PM »
Yeah...but I want it all... ;D

Graham's smooth probing g-code, M40/41 AND G68...

Time to start coding and make something to convert machine to work coordinates...I think.. 

   
Re: machine running irregular on button script
« Reply #33 on: December 18, 2010, 06:47:03 AM »
Hi,

I have written a small piece of code.
This to convert the machine x and y coordinates mach3 stores with M40 in G68 mode to work coordinates.

Now I can do exactly what I want....smooth surface probing in G68 mode... ;D

I like to thank the contributors to this post for helping me!

Rich


 

Offline Graham Waterworth

*
  • *
  •  1,856 1,856
  • Yorkshire Dales, England
    • View Profile
Re: machine running irregular on button script
« Reply #34 on: December 18, 2010, 08:07:49 AM »
Don't forget us when you make your millions, I like fast Jags, Terry and the other guys might like one too.  ;)

Graham
Never give up, time will pass, the cloud will clear, the sun will shine once more.
Re: machine running irregular on button script
« Reply #35 on: December 18, 2010, 12:57:50 PM »
 :D

Until now it only costs...

Wonder if I am going to pass break even ever... :D

Offline BR549

*
  •  6,871 6,871
    • View Profile
Re: machine running irregular on button script
« Reply #36 on: December 18, 2010, 02:34:23 PM »
How about taking a minute and posting in the Mach tool Box section  on HOW you did it and post the code you did it with???. It sounds cool and I am SURE someone else could use it as well.

YEP a new Jag would do, (;-) But as long as your are happy I am happy,

Sling some chips

(;-) TP
Re: machine running irregular on button script
« Reply #37 on: December 19, 2010, 05:22:35 AM »
Hi TP

I will consider that.

The code is all in a separate program, written in vb6. It functions on its own, outside mach3.
First of all it has to be refined, there still is some "testing-code" left that has to be removed.

Secondly, I foresee some problems with international use..
Here in Holland we use comma as a decimal separator.
In the US a point is used.
I have some point to comma converters in the program that might become a problem...
I don't know where you are, maybe I can send it to you first to do some testing....when ready...


Rich
 
 
Re: machine running irregular on button script
« Reply #38 on: December 19, 2010, 07:34:13 AM »
I have not left the building yet... one more question... :D

As said, the code I have written functions outside mach3. Including the scan-grid correction part( to correct values M40 writes for probe-offset, G68 rotation, etc.)
I think it is better to do the scan-grid correction INSIDE mach3, with a macro at the end.

Now I have to carry over to many data (probe-offset, G68 offset and rotation) by hand to the program I have written.
This increases the risk of mistakes, and it is inconvenient also...
When it runs in a macro it can read Dro's for getting required data.

What I would like to do is open the DigFile M40 creates again and do the necessary calculations.

So... Is there a way to "remember" the filename M40 asks for?

I have tried giving the file a numeric name and save the name in a variable.
Someting like this:

   'M40

   Dim strFile as string

   SetVar(10, Question (" Scan number? ( = name, MUST be numeric)"))

   strFile= "C:\" & GetVar(10) & ".txt"

   OpenDigFile(strFile)

In this way I would be able to open the file again using varable #10.

But it doesn't work... :-\

Any ideas for a working solution??


Thanks!
« Last Edit: December 19, 2010, 07:38:43 AM by zone023 »

Offline BR549

*
  •  6,871 6,871
    • View Profile
Re: machine running irregular on button script
« Reply #39 on: December 19, 2010, 10:12:30 AM »
I don't believe you can use the opendigfile for that type of use. I would use the normal VB convention to open the text file.

Now IF you were just adding more points thru more probing then opendigfile IS the way to do it.

Comma delimited files are NOT a problem(;-)

(;-) TP
« Last Edit: December 19, 2010, 10:24:37 AM by BR549 »