What's the easiest way to write and load a simple program?

More
28 Sep 2019 21:44 - 30 Sep 2019 19:37 #146507 by Scot
So I've got some experience with the FAGOR controller programming language and I want to write a first program in LinuxCNC to test the axis I have set up on the lathe I'm retrofitting. On the industrial controllers the programming is kind of simple. You navigate to the editor, edit it if necessary and then load it. But on AXIS, I'm a bit confused where to start when creating a new program.

What I'm attempting to do is just a simple, single axis program moving in rapids and G1 programmed speeds, back and forth to see how it performs. But I'm not sure how what process to use.

What program is used to make the .ngc file that is used for a g-code file? And when I get this file built, do I just drag and drop it into the /usr/share/linuxcnc/ncfiles directory?

Thanks in advance.

Scot
Last edit: 30 Sep 2019 19:37 by Scot.

Please Log in or Create an account to join the conversation.

More
28 Sep 2019 23:34 #146515 by tommylight
Linuxcnc is a machine controller, not a CAM software, so you need something else to generate the tool paths.
In your case for testing and simple programs, use any text editor, write the code, save it to wherever you want, with the .ngc extension, open it from Linuxcnc, press play and watch in amazement.

Please Log in or Create an account to join the conversation.

More
29 Sep 2019 00:01 #146522 by BigJohnT
As Tommy said a text editor is what you use to create a G code file.

You never put anything into any of the base directories, only in your /home/username/linuxcnc/nc_files or other if configured differently.

At a minimum you need a G0 move and a M2 program end, for feed moves you must set a feed rate.
linuxcnc.org/docs/2.8/html/gcode/g-code.html#gcode:g0
linuxcnc.org/docs/2.8/html/gcode/m-code.html#mcode:m2-m30

In Axis if an editor is specified in the ini configuration file then you can edit a loaded file, otherwise for a new file just create it with the text editor.
linuxcnc.org/docs/2.8/html/config/ini-co...tml#_display_section

JT
The following user(s) said Thank You: tommylight, Scot

Please Log in or Create an account to join the conversation.

More
29 Sep 2019 00:01 #146523 by Leon82
You will be able to see your paths on the plot and it will warn you if you have an improper code segment
The following user(s) said Thank You: Scot

Please Log in or Create an account to join the conversation.

More
29 Sep 2019 00:07 #146524 by Leon82
Set your self up some generic programs.

I have one for facing and drilling. It makes it a little quicker and you can save as if you want to make it a specific program
The following user(s) said Thank You: Scot

Please Log in or Create an account to join the conversation.

More
29 Sep 2019 19:29 #146617 by Scot
Yes, I understand that LinuxCNC is not cam software. But I don't need cam software for the parts I'm making. I don't do 3d carving with a mill. I used a lathe, mostly. And the parts I produce are fairly simple. So I just write on the fly.

I sat and tweaked on it for a bit and viola! I figured out that if I open mousepad and write the program as I used to, I could simply save the file in my home/linuxcnc/ncfiles directory and load it up.

So as many times before, I probably asked too soon and didn't get my hands dirty enough.

Thanks for the reply, though. It sincerely helps.

Scot

Please Log in or Create an account to join the conversation.

More
29 Sep 2019 23:40 #146648 by BigJohnT
If this is for a lathe, I have a bunch of subroutines that I use with ngcgui and do 90% of the ops on my lathe using them. If your interested they are here:

gnipsel.com/files/chnc/subroutines/

JT
The following user(s) said Thank You: Scot

Please Log in or Create an account to join the conversation.

More
30 Sep 2019 00:38 #146654 by Scot
Thanks John,

That's a pretty impressive selection of info. I may need some of it in the future. But I still have to get the machines running.

The machine I'm working on is an old Hardinge with an Upgrade Technologies X-Z gang tool slide on it that was retrofitted in the early 90's. Upgrade technologies became CMS back in the mid-late 90's and later became defunct. They made good hardware. But the company business practices were so-so. I bought this machine in 2004, 11 years after it was first retrofitted and I'm putting a new controller/servos/vfd on it after the old easy-to-do, Animatics Smartmotor retrofit I did on it in 2004, died and it sat in a garage between 2016 and a few months back. It's basically a from-scratch controller build on old iron.

With the info I've gotten here and from Jon, I've managed to get that machine to about 2/5's done. I've got one axis up and programmable. The other waits for an encoder that I killed. And right now I'm working with Jon at Pico-systems to get the DAC to run my VFD. The machine needs 2 axes, a programmable collet, a moderately programmable spindle and a programmable output to run a coolant pump. So far, I can turn on the coolant pump and program the Zaxis. Working on the VFD and getting an Mcode to open and close the collet.

I was asking for the info to get a simple program running to test the motion of the axis I have up and moving. And it was simple to figure out between what I understand and what people told me here. Linux has it's quirks for me after being a Micro-softy for so long. So I kind of approach it with a big net of questions to see what I catch. But I got the programs I wrote, going, and I have a clear understanding of how to do that part. The subroutines are great, though. They're likely something for the future.

What I REALLY need now is to understand what files to place the scripts to make the user defined M-codes to open/close the collet. I've got the hardware, and I have a very basic idea of how to make the code function -VERY basic. But I'm unsure of where and how to place the little scripts that are explained in the user defined portion of the M-code section found here:

linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m100-m199

I'm just getting into it now. And it cleared up SOME of the mystery. But it opened another can of questions. The main one being is what's the best way to write the scripts to make those M-codes defined on my system and where do I place the scripts so when I fire up LinuxCNC? I get the option to use the M-codes when I run LinuxCNC. From what little about that part, I understand, the little scripts go in my home/linuxcnc/configs file in either the .ini file or another. Still unsure of that path. Once I know the path and where and in what file to place the code, as well as the proper pins to associate with it, I'm confident that with some tweaking, I can get it to run.

If there is any simplified info on how to configure a user defined M-code that isn't in that section, it will help, too.

Thanks again. I'll likely be putting a question on the forum that isn't muddied up with a long, drawn out story. Feel free to add info there, too. But if there is anything you can do to help me set those M-codes up, let me know.

Scot

Please Log in or Create an account to join the conversation.

More
30 Sep 2019 01:46 #146664 by Todd Zuercher
You can create the files for custom M-codes using any ordinary text editor.

There are a number of places where the M-code file can be saved, One is the ~/linuxcnc/nc_files/ dir, another would be the one specified by USER_M_PATH = in the [RS274NGC] section of your INI file.
linuxcnc.org/docs/2.7/html/config/ini-co...ml#_rs274ngc_section

Where ever you choose to save the file, be sure that the file is marked as executable.

Please Log in or Create an account to join the conversation.

More
30 Sep 2019 06:42 #146682 by pl7i92
hi scott
the fagor controll works like the ncam in linuxcnc
if you are familar with block programming over a given cycle you are full up with no CAM on your mashine

Please Log in or Create an account to join the conversation.

Time to create page: 0.158 seconds
Powered by Kunena Forum