Staring to write simple G code for very basic lathe turning
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
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?
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.