LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-15-2009, 04:00 AM   #1
foamcuttersg1
LQ Newbie
 
Registered: Dec 2008
Posts: 9

Rep: Reputation: 0
Staring to write simple G code for very basic lathe turning


My foam cutting is going well now and I am building a three axis machine to use Meshcam. As an aside however I have aquired a new (old) lathe and will be converting my old lathe by stripping off all the worn out slide drive mechanisms and driving it with a pair of steppers. I guess I could modify existing G code generated by dedicated software but would like to write my own using something like AutoEditNC. I have the function list but can't work out how to get started in terms of origin, feeds etc. Anyone help?
Reegards
Ken
 
Old 10-15-2009, 05:50 PM   #2
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
I don't know a thing about it, but I'll be willing to give a good old fashioned college try if you can give a better description of the problem.
 
Old 10-16-2009, 03:08 AM   #3
foamcuttersg1
LQ Newbie
 
Registered: Dec 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bartonski View Post
I don't know a thing about it, but I'll be willing to give a good old fashioned college try if you can give a better description of the problem.
Well I guess the whole question revolves around the way the information is sequenced in the first line of the program. I imagine that a start, reference or home positon must be specified as must various feed rates. Is there a convention or order for this or does it depend on the software being used. I am using EMC2. I need to write a file which will undertake some simple turning work followed by a parting off function using a second tool post on my cross slide. I feel thaat I should be able to pull my stock bar out from the chuck/collet onto a reference stop and then set the machine of from a "home" position. If all else fails I will take a file produced by Meshcam and experiment by deleteing the unwanted vericle axis and changeing the first few lines of code as this is where I suspect the home and various feed rates are set up. The ideal way to pass this info on would be to take the first few lines of code and insert statements/explanations into it. I hope this helps to outline my problem.
Regards
Ken
 
Old 10-16-2009, 07:29 AM   #4
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
Ok... let's back up a little bit here... this is a programming forum on a Linux chat board, after all :-) ... we may be able to help with the problem, but we'll need more context (sorry if I wasn't clear about that originally):

What's a Meshcam?
What's G code?
What's AutoEditNC?
What's EMC2
Can you give us the function list?

Quote:
If all else fails I will take a file produced by Meshcam and experiment by deleteing the unwanted vericle axis and changeing the first few lines of code as this is where I suspect the home and various feed rates are set up. The ideal way to pass this info on would be to take the first few lines of code and insert statements/explanations into it. I hope this helps to outline my problem.
Assuming that the code that you're looking for starts at the beginning of the file, you can use a manual binary search to find where it ends... Cut the code in half, see if you're getting the behavior that you want. Cut it in half again, test, repeat. Once the code fails, you know that you've got a lower bound for the size of the code. Then test between this lower bound and the previous upper bound, the same way. You should find the end of your code in log2(n) steps, where n is the number of lines of code.

Can you post a simle example of the file produced by Meshcam?
 
Old 10-30-2009, 03:36 AM   #5
foamcuttersg1
LQ Newbie
 
Registered: Dec 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for your response. Since that post I have been tinkering and have got it cracked now. If you are interested however I can send an explanation of the whole process.
Best wishes
Ken
 
Old 10-30-2009, 11:31 AM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
What would be nice is if you 'answer your own question', by posting the solution here. That way, if someone else comes along with the same or similar question, then we have something to refer them to, or they find it by searching the forum.

CNC is not much discussed here, but there is no reason that it should not be.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning old computer into basic web server. InsertNameHere Linux - Server 6 03-08-2007 04:23 PM
turning of a PC in C code knobby67 Programming 3 02-05-2007 01:38 PM
Turning on write-permission? riwaJR Debian 3 04-03-2006 03:35 PM
turning on dma and write back cache on SATA? niverson Linux - Hardware 16 02-15-2006 12:42 AM
A simple question. turning off phrases. anton_w Slackware 3 09-21-2005 06:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration