LinuxCNC for low level stepper motor control?

  • Smecky
  • Smecky's Avatar Topic Author
  • Visitor
  • Visitor
24 Apr 2012 12:19 #19484 by Smecky
Hello LinuxCNCers. I must first apologise for my lack of knowledge about numerical control as I’m merely on the first step of my amazing automation adventure.

I wonder if there would be anyone gracious enough to answer the following:

1. Can linuxCNC be used for much lower-level numerical control? Say for example, running a program which loops every half an hour, which simply tells a bunch of stepper motors to step forward and backward at reasonably precise timings. If not, or if there is a better alternative for me, what might that be (preferably linux based)?

2. Is there a good resource for learning how to program G-Code? I know some coding basics for C based languages, but I’d like some further knowledge on the language.

My thanks in advance for anyone taking the time to answer my enquiries.

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

More
24 Apr 2012 13:07 #19485 by BigJohnT
1 You can do that several ways with Linuxcnc but by far the easiest way is with G code and loops.

2 The manual would be the best place to learn about Linuxcnc flavor of G code. Anything else you find on the web would not be accurate and only create problems. Basic linear moves in G code are G0 and G1... so not much to learn there. Arcs are handled by G2 and G3... between these 4 G codes you do 95% of your coding.

linuxcnc.org/docview/html/gcode/overview.html
linuxcnc.org/docview/html/gcode/gcode.html

John

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

More
24 Apr 2012 13:26 - 24 Apr 2012 13:28 #19487 by ArcEye
Hi,

1. Can linuxCNC be used for much lower-level numerical control? Say for example, running a program which loops every half an hour, which simply tells a bunch of stepper motors to step forward and backward at reasonably precise timings.

Depends what you mean by low-level.
LinuxCNC is quite high level, in that all the pulse generation to run steppers etc is done below the radar and you just have to worry about where you want the tool to go.

But it would be quite possible to do something like that in a combination of gcode and some hal connections, you will have to expand upon exactly what you want to do, someone has probably done it before, saving you the re-invention of the wheel.

Is there a good resource for learning how to program G-Code?

The best learning is actually doing, but obviously there needs to be some input before you get to that.
Search the net, what you want is something that covers RS-474 standard which is what Linuxcnc is based upon.
What you don't want is anything that is aimed at old controllers, with strict line numbering blocks etc

This is one I found for a simple start ..... cncutil.org/gcode-introduction.html
Then you want to read the LinuxCNC documentation on gcode to understand the principles of offsets etc
linuxcnc.org/docs/2.5/html/gcode/overview.html

As a more advanced tutorial, Ed Nisleys articles entitled 'Along the G code way' in the Digital Machinist magazine
are always worth checking, especially as he works purely in LinuxCNC and goes into the more complex areas
of named variables, calling subs etc.

If you have done some programming in C you will have a head start regards conditional tests / loops etc. so should quite quickly pick it up.

One of the easiest ways to learn and test out g code is to use one of the simulator configs and you can do whatever you like, without danger of crashing bits of rotating tool steel into things.

regards
Last edit: 24 Apr 2012 13:28 by ArcEye.

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

More
24 Apr 2012 14:04 #19489 by BigJohnT
Actually Linuxcnc is based on the RS274 interpreter.

linuxcnc.org/docview/html/common/emc-history.html

Unless the writer is talking about the current Linuxcnc G code you can't rely on the specifics of the articles you find on the web. Even the RS274 is no longer relevant due to the numerous improvements EMC and Linuxcnc has made to the original RS274 G code.

Do you have any links to Ed Nisley's articles? Google fails me...

John

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

  • Smecky
  • Smecky's Avatar Topic Author
  • Visitor
  • Visitor
24 Apr 2012 16:03 - 24 Apr 2012 17:14 #19493 by Smecky
My, that was quick, I'm just digesting the links, and I'll edit this post (*topic, whoops) with some thouper-thimple psuedo-code to better explain what I plan to achieve once I'm done, thanks chaps.
Last edit: 24 Apr 2012 17:14 by Smecky.

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

More
24 Apr 2012 16:38 #19494 by ArcEye

Actually Linuxcnc is based on the RS274 interpreter.

Oops, thats what you get for writing off the top of your head.

Do you have any links to Ed Nisley's articles?

I don't think they are published anywhere on the web, I have some hard copies and a digital subscription to the Digital Machinist.
Unfortunately Eds articles are possibly the best thing about the magazine and I don't think I will be renewing.
There are 'blow by blow' descriptions and there are 8 pages of text where one decent photo would have sufficed and the magazine definitely fits into the latter verbosity model!

I'll try to send you something as a taster John

regards

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

Time to create page: 0.159 seconds
Powered by Kunena Forum