Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: thespindoctor on September 20, 2011, 08:49:14 AM

Title: importing coordinate list
Post by: thespindoctor on September 20, 2011, 08:49:14 AM
How can I get a x y coordinate file into lazy cam or mach?  I need to switch
from a comma delimited text file to a plot so I can do some tool compensation
of the tool path.  I am using a linear encoder to digitize a surface so I have
a list of coordinates generated by Mach.  Any ideas?

Thanks
Title: Re: importing coordinate list
Post by: Graham Waterworth on September 20, 2011, 03:03:10 PM
You can load the list into Mach if you modify the data.

Do a search and replace in a text editor, search the comma and replace with a Y then do a CR,LF search and replace with CR,LF,X (you may need to do a Special/Advanced search for this), this will give you g-code.

Add a G01 F100. on the first line and a M30 after the last line and you should get a profile in Mach.

Title: Re: importing coordinate list
Post by: thespindoctor on September 20, 2011, 03:43:02 PM
Thanks!  I have a nice program running but I need to do tool compensation to allow for a 3 inch grinding wheel.  I have a G code file working well which is generated through CB but the tool path is not correct because the wheel is hitting the profile I am trying to shape.  If I could get the shape out to a cad/cam and add a compensated path the problem would be solved.  I had hoped lazy cam or if needed I could convert from CSV file format to dxf or dwg through a conversion program and then send it to BobCad but that seems like so many extra steps that should not be needed.

Keith
Title: Re: importing coordinate list
Post by: BR549 on September 20, 2011, 04:18:33 PM
Could You explain  what you are trying to do?. Some of the Normal CNC grinding fiunctions do not work well EASILY with Mach.

I have a CNC Cam Grinding Modual running and it took a LOT of work AND HELP from LES at Scam to make it grind the profile correctly. BOTH require tool comp for the wheel.

Still working on the Crank Grinder Modual to go with  Cam Grinder Modual.  One would have thought that both worked about the same (;-) NOT even close.


(;-) TP
Title: Re: importing coordinate list
Post by: BR549 on September 20, 2011, 04:20:55 PM
Can you post a copy of the File you want to use?

(;-) TP
Title: Re: importing coordinate list
Post by: RICH on September 20, 2011, 04:58:52 PM
Post the gcode file and i will convert it to dxf for your use.
RICH
Title: Re: importing coordinate list
Post by: thespindoctor on September 20, 2011, 05:13:04 PM
Thanks guys, I am trying to grind an ice skate blade.  I have the edge digitized with x and y coordinates from
a linear encoder.  I can create a nice g code and follow the blade with the wheel but I need tool compensation.
The problem is easy to fix if I could enter the points manually to BobCad, my Cad/Cam software but I need to
do this many times and I hope one day to market this machine so I need a permanent and convenient method
for future users.  Perhaps I will need to do the calculations in CB like the old machinists from days of yore..

The program is probably in the range of 1600 lines so posting it would not be too cool.  However, I could
email.

Keith
Title: Re: importing coordinate list
Post by: BR549 on September 20, 2011, 06:23:01 PM
OK still can't get it in my head what you are actually doing. Is the balde laying flat to the table and you are grinding the curvature of the Blade or is it vertial and you are grinding the angle. Is your wheel infeeding from the Z? X y UW????

So many questions, We don't do much ice skating in Florida(;-)

Pictures would help, you know where to find the email address(;-)

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 20, 2011, 09:03:07 PM
I have x,y and z axes set up like a milling machine.  The grinding wheel is mounted
in a chuck as one would mount an endmill or face mill with the 3 inch grinding wheel
oriented horizontally.   The blade is mounted on its side and the wheel moves in
X along the length of the blade and the curvature or "rocker" of the blade is
followed by moves in Y.  Moves in Z align the wheel with the blade but do not
change as the blade is sharpened.  Imagine a traditional milling machine with a
3 inch grinding wheel mounted on a mandrel placed into the spindle with the wheel
horizontal.
Title: Re: importing coordinate list
Post by: BR549 on September 20, 2011, 09:31:05 PM
NOW I gotcha(;-) I have spent too much time cam grinding I was stuck in that mode,

Tool comp should not be a problem in that mode just use the MACh3 tool comp G42/43 G40 cancel. Set the grinder wheel UP in the tool table and YES you can Change the values ON THE FLY, just in case you ask about probing the wheel diameter.

Take your points and IMPORT them into the cad program then clean them up as ARCS and lines  as best you can.  Most Cads have an import Macro to do just that. You might be able to set up a WIZARD to do what you need and have it write the code for you.

(;-) TP
Title: Re: importing coordinate list
Post by: BR549 on September 20, 2011, 09:32:23 PM

NOW I gotcha(;-) I have spent too much time cam grinding I was stuck in that mode,

Tool comp should not be a problem in that mode just use the MACh3 tool comp G42/43 G40 cancel. Set the grinder wheel UP in the tool table and YES you can Change the values ON THE FLY, just in case you ask about probing the wheel diameter.

Take your points and IMPORT them into the cad program then clean them up as ARCS and lines  as best you can.  Most Cads have an import Macro to do just that. You might be able to set up a WIZARD to do what you need and have it write the code for you. SIde step the Cad/Cam with a conversational Program.

DO you have prest profiles to cut or need to do some probing as well?

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 20, 2011, 09:49:08 PM
TP,

If I use tool comp in Mach will it not just make a move away from the tool path right or left by the radius of the wheel rather
than actually changing the path shape?

Also, you mention importing the points into a cad/cam and that is exactly my problem.  I have not been able to get the text
file into a cad program to clean up the tool path.  The file is a text file such as below consisting of X and Y values separated
by a comma.  I have searched the net and can't find a csv to dxf converter(or other format accepted by BobCad). 

-.2,-.8890
-.3,-.8895
etc

Thanks!
Title: Re: importing coordinate list
Post by: BR549 on September 20, 2011, 10:01:21 PM
NO, tool comp actually adjusts the tool PATH to comp the diameter differrence.

IF you import those number into a spread sheeet then you can ADD the X and Y letters and remove the COMMAS then ADD a G1 to the top of the file and you have a Gcode file.  NOW you can convert the Gcode file BACK to a dxf. REcam as needed then Post up a new Gcode file.

I am surprised that BOBCAD cannot import a data file. HAVE you asked BobCad about it?

Email me the file as is and let me look at the whole file. there may be an easier way to convert to a Gcode file.    Maybe can convert stright to a DXF if I can remember the format string.

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 20, 2011, 10:10:54 PM
Ok, then I may be in business!  Tool comp saves a lot of trouble and for now
will allow the machine to work well.  I was not sure from the docs and until
now have always used BobCad for tool comp.  I have already made the g code
file directly and used it to sharpen and it shows up in Mach toolpath.

I talked to BobCad today and described the problem and was told that I would
have to enter the points individually by hand.  There is apparently no way to take
a data file of points like this and get them into their software.  It seems like a
relatively easy thing to do...

The next problem for me is to take this data file and analyze the shape to identify
the best curves that fit the shape.  Any ideas as to how to do that?  The blades
are supposed to be made of 3 curves - a larger 8 foot radius segment over most
of the blade and 2 smaller radius curves near the front of the blade.   I hope to
be able to describe the blade is this way and be able to correct to ideal shape...
Title: Re: importing coordinate list
Post by: thespindoctor on September 20, 2011, 10:36:16 PM
http://www.ransen.com/Pointor/Archaeological_survey_work_software.htm  here is a data point to dxf convertor!
Title: Re: importing coordinate list
Post by: RICH on September 21, 2011, 06:52:52 AM
Have you considered using Copycat which would give you a gcode file. Accuracy depends on the viewing device used.
It basicaly will allow you to select points and will generate the gcode. You can then use a converter to change the code to a dxf
file (backplot) for manipuation by CAD if so desired. Been a while, but believe you can modify the gcode file on the fly and put your owne points in instead of viewing them.
FWIW,
RICH

BTW, what you are trying to do has been done. ie; My friend has written programs to do what you want and even backplot them but unforetunately won't share them .
   
Title: Re: importing coordinate list
Post by: thespindoctor on September 21, 2011, 07:32:50 PM
I gave a try to tool compensation and the tool path is a series of approaches to each
line segment so it did not behave as I was expecting.  The docs talk about having
to use an approach at least one diameter of the diameter offset away to start but I
don't have that much room.

Also cant find Copycat through an internet search but will keep trying.

Thanks
Title: Re: importing coordinate list
Post by: BR549 on September 21, 2011, 09:17:17 PM
Normally with grinding you want to move into the cut on a very shallow arc  or line with your leadin move so the stone picks up the load gradually.   With the TComp you have to be far enought away based on tool Diam to give the machine ROOM to do the comp move BEFORE it gets to the start of cut point.  IF you do not 1 or 2 things happen the program erros out (rarely) OR the machine will do a silly jig dance in an attemp to comp the move.

Copycat is a Mach3 wizard and can be found on the Main page /download programs section. It works very well IF you are patience(;-).

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 22, 2011, 09:07:43 AM
TP,

Thanks for the continued help.  Copycat is my next mission, did not realize it was in Mach.

My problem with this machine is that I only have 1 inch of travel in the Y axis.  Maybe BobCad will
be necessary to make the toolpath and then I can shorten the lead-in.  Do you think there is a way to do
this in Mach with the 1" limitation?  What Mach is doing now is a series of leadins every 1/2 inch instead of one lead-in at the start of the part.

Keith
Title: Re: importing coordinate list
Post by: BR549 on September 22, 2011, 07:45:02 PM
Can you post the code? A look at the code can save a thousand guesses (;-). That would normally mean load the file to the site not copy all of the file to the screen(;-)

(;-) TP
Title: Re: importing coordinate list
Post by: BR549 on September 22, 2011, 07:47:57 PM
IF you use CAM such as Sheetcam IT will do the tool offsetting and then you would NOT need ANY toolcomp in mach. JUST a simple leadin.

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 22, 2011, 08:35:40 PM
IF you use CAM such as Sheetcam IT will do the tool offsetting and then you would NOT need ANY toolcomp in mach. JUST a simple leadin.

(;-) TP
  I am trying to do it in BobCad but keep getting an error but I think i am close!
Title: Re: importing coordinate list
Post by: BR549 on September 23, 2011, 12:12:21 AM
IF you only have MAX 1 inch of travel then I don't think trying to Tcomp a 1.5"radius wheel is going to work well (;-).   When you say Bobcad do you mean  BOBCAD/CAM or just CAD?

Some CAMs have a problem Tool comping and OPEN profile as it is HARD for it to tell what is INSIDE or OUTSIDE to comp TO.

(;-) TP

Title: Re: importing coordinate list
Post by: BR549 on September 23, 2011, 01:04:44 AM
Keith, (or anybody else)  could you give this DXF file a try to see IF BobCad, OR any other CAD, can open it ok.

It should be the import of the points file you sent.

(;-) TP
Title: Re: importing coordinate list
Post by: RICH on September 23, 2011, 06:15:19 AM
Opens in CAD here.

RICH
Title: Re: importing coordinate list
Post by: BR549 on September 23, 2011, 08:40:46 AM
Thanks Rich it was created from an X/Y points file that was converted straight to DXF from inside MACH3 using CB. Hopefully it will be a HELP to those who do 2.5D probing and need a way to get the points into a CAD format for further processing.

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 24, 2011, 12:11:34 AM
Thanks Rich it was created from an X/Y points file that was converted straight to DXF from inside MACH3 using CB. Hopefully it will be a HELP to those who do 2.5D probing and need a way to get the points into a CAD format for further processing.

(;-) TP
 TP  that is just what I was trying to do.  Will you tell us how it was done?  That would save a step for me.  I am generating the x/y point file in CB too.

Also, I am able to get my original x/y point file into BobCAD/CAM but had to use an intermediary program (Pointor) to do it.  There I am able do to the proper tool compensation but it would be nice to do it in LazyCam or Mach.  Thanks
Title: Re: importing coordinate list
Post by: BR549 on September 24, 2011, 01:09:13 AM
Keith do yo have another Test points file I can convert so you can check it in Bobcad. DXFs can be tricky at times, I hope I have created a universal dxf format that everyone can read.

How are you collecting points ??  Probing????

I have 2 versions of the convertor running. One is in MachCB and the other is in VB. I am testing both as to the best overall approach as to a MACH only solution OR a stand alone VB version anyone can use.

The convertor at this point ONLY brings in the points as POINTS no line work is done.  You would have to open it in CAD and do the needed cleanup then repost as a new DXF.

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 24, 2011, 01:35:55 AM
Keith do yo have another Test points file I can convert so you can check it in Bobcad. DXFs can be tricky at times, I hope I have created a universal dxf format that everyone can read.

(;-) TP
Yes I can get you a file but I am realizing that the Cad program cannot really do much to help so it seems some mathematical manipulation is going to work better for me.  I am using a linear encoder and running along the x axis in a series of set increments and adjusting the Y values by an offset for the grinding wheel

I don't know how to attach a file as your have done...
Title: Re: importing coordinate list
Post by: BR549 on September 24, 2011, 11:57:25 AM
What your asking is a little beyond the basic CNC (;-) .  What points you are gathereing will create lines not arcs on curves.  You would better off using the COPYCAT function and use a probe tip profile the same as your wheel diameter. This will auto comp the profile back to the wheel diameter . You would use the COPYCAT to create arcs and lines in G CODE  not just a series of points.

I thought that skates were just ground on specifc contours (;-)

(;-) TP

Title: Re: importing coordinate list
Post by: thespindoctor on September 24, 2011, 12:23:53 PM
What your asking is a little beyond the basic CNC (;-) .  What points you are gathereing will create lines not arcs on curves.  You would better off using the COPYCAT function and use a probe tip profile the same as your wheel diameter. This will auto comp the profile back to the wheel diameter . You would use the COPYCAT to create arcs and lines in G CODE  not just a series of points.

I thought that skates were just ground on specifc contours (;-)

(;-) TP


Yes they are ground on a specific contour at the factor originally but done
mostly by hand.  The sharpening process is done by hand which gradually destroys
the proper shape.

I can't find Copycat.  What you describe is just what i need with arcs being created.  Is there
any docs on Copycat and do you mean using G31?

Thanks
Keith
Title: Re: importing coordinate list
Post by: BR549 on September 24, 2011, 12:56:07 PM
Keith your encoder will work fine BUT you need to create a contactpoint that touches the blade that is the same radius as the wheel. You really don't want to get into the math to do a wheel comp on a curve with a linear infeed axis it will make your brain hurt. That is a CAM grinding problem as well.

I'll round up the info on the copycat for you.

SO would you not want to restore the factory contours or grind in a CUSTOM contour  OR are you just trying to collect contour data??

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 24, 2011, 01:10:03 PM
TP, i found Copycat and the documentation.  I will begin to study it but maybe the best idea
is to load some kind of probe in place of the grinding wheel that is the same diameter and
do the probing with Copycat like you suggest.  I am not sure how that probe would be
designed.  Is there anything like that available?

Yes we want factory specs on the shape but from measuring blades have discovered
that the factory does not put out consistently shaped blades.  I hope to create an
environment to describe the blade and indicate graphically or numerically how it differs
from the ideal then correct gradually to the original design or to a custom shape. 
Naturally I need to be able to leave the shape constant if desired and not introduce
changes over time by mistake...
Title: Re: importing coordinate list
Post by: BR549 on September 24, 2011, 01:41:38 PM
NOW you are talking CNC(;-)  It can replicate the exact shape over and over again.

There is also a free plugin called Jcode on the plugins page that may be of interest.

ALSO I had an idea standing here loading the pen plotter and watchin it FIND the paper.

Useing the encoder approach you could move back and forth across the blade to locate the key points ,staight lines(inside a deadband value say +/- .005 )
Then locate the startpoint  and end point of the arc. Then calculate the MIDPOINT of the arc (startpoint - endpoint /2) then use the startpoint ,endpoint, midpoint offset to create the arc.  

You then can then use these values for the program to write a Gcode GRINDING program based on those values. IF you used the contact tip of the encoder that was the radius of the wheel then NO further comp needed. You would then have a very GOOD (corrected for bad grinding ) grind profile. that represents what the PROFILE should have been. AND you can replicate it exactly over and over again (save the Gcode file(;-) ).

AND this should be doable inside of MACH3 and CB

What do you think, (;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 24, 2011, 11:21:17 PM
TP,

By George, I think you've got it!  It seems so obvious now. No Dxf convertor,
and no Cad/Cam software needed. Excellent!javascript:void(0);

If we know what the blade's arcs should be we can probe in the 3 critical spots for each
sub-curve then calculate an array of coordinates for the ideal blade  if
I can identify staight lines inside a deadband value say +/- .005.  See comment below. 

Then do a comparison between the theoretical array and the actual blade probed array using
a sharp tipped encoder probe. Then come up with descriptive stats for the
variance to allow us to tell how good or bad the blade is. 

We could start correcting the discrepancies slowly over future sharpenings or just keep
current shape. 

We can use arcs and generate a tool path then mount the pseudo-grinding
wheel probe tip and run the blade collecting
the points for a compensated toolpath!  I could make several probe tips in
different size ranges to match smaller wheel diameters to account for wheel wear because
eventually the wheel will get much smaller.

The biggest problem we have is the difficult of finding the deadbands.  I ordered
an encoder that is +/- .0005".  The one I have is +/- .001"  Plus the current probe tip
is not pointed so the raw values are off because the shoulder of the probe tip hits the
blade

I will get going on the Jcode and Copycat learning curve.  Thanks!  It is making more sense
to talk it through.  I really appreciate the careful thought!
Title: Re: importing coordinate list
Post by: BR549 on September 24, 2011, 11:31:59 PM
NOW you got your thinking cap on.(;-)

How about instead of using a standard grinder wheel you could use a rigid carburumdiumdumbdumb (;-) wheel that never wears down(to a point) it is a solid wheel that is COATED with that funny sounding stuff. It works well on certain grinding as the wheel never looses dimension over its useful life.
Or use a belt grinder system, just replace the belt when needed.

Never have to worry about wheel diameter as it will always be the same AND the Zero point will ALWAYS be the same.

AT least I will know WHERE to send my ICE skates when Florida freezes over and I need to get around.

Just a thought, (;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 24, 2011, 11:45:41 PM
I wish I could use a permanent wheel but the blades have a hollow ground that varies with the blade type.
3/8, 7/16, 1/2, 9/16  Have to shape the grinding wheel for each blade...

Keith
Title: Re: importing coordinate list
Post by: thespindoctor on September 25, 2011, 12:20:17 AM
How to get Copycat and Jcode?  I have installed Jcode to plugins directory but only
video plugin is showing on drop down in Mach.  Can't find Copycat in wizards.

Thanks
Keith
Title: Re: importing coordinate list
Post by: BR549 on September 25, 2011, 12:26:29 AM
the Jcode plugin has to be turned on in Config/Pluginconfig then restart mach3 and you should see in the top bar the plugin tab.  I will have to look for copycat for you. Be right back
Title: Re: importing coordinate list
Post by: BR549 on September 25, 2011, 12:28:54 AM
CopyCat is here

http://www.machsupport.com/forum/index.php/topic,10536.0.html
Title: Re: importing coordinate list
Post by: thespindoctor on September 25, 2011, 12:42:27 AM
Got Jcode now but still working on Copycat.  Isn't this mach amazing.  Probing, video - all
kinds of stuff to make a day fun...
Title: Re: importing coordinate list
Post by: BR549 on September 25, 2011, 12:53:55 AM
You need to unzip the copycat and make sure it goes into the right directory. normally c:\mach3\addons\copycat  Then start go to mach3 and select "Select wizards" then select copycat.

There are 2 screens one manual copy and the other Probe copy.

NOW IF the copingkatting does not suit you there MAY be another way Using a new page program that does some magic with the encoder. But that is a last resort,(lot of work)

(;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 25, 2011, 01:05:18 AM
Ok, got Copycat, I had an old Mach demo version on this computer, Copycat
comes with default stuff.  Just had to download current Mach version.  

Docs show a video versus probe and that is exciting! Cant get to bed, too much
to think about
Title: Re: importing coordinate list
Post by: BR549 on September 25, 2011, 12:02:30 PM
OH boy another one HOOKED on Machcrack, the lastest designer drug.

LOLOLOLOLOL go for it, (;-) TP
Title: Re: importing coordinate list
Post by: thespindoctor on September 25, 2011, 12:35:53 PM
OH boy another one HOOKED on Machcrack, the lastest designer drug.

LOLOLOLOLOL go for it, (;-) TP
  I've been hooked for years with 4 machines now running Mach!  The 4th one is
a retrofit for a Mori Seiki SL1 lathe that I am just starting.  That will be a real upgrade in
difficulty and require learning to program a PLC.  So if I sound lost now, just wait until
I start that project...