585,700 active members*
4,347 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 23
  1. #1
    Join Date
    Feb 2011
    Posts
    0

    Exclamation How does a computer trasmit Gcode?

    I am interested in writing my own CNC control program. How does the computer actually transmit the gcode? I assume one line of gcode is transmitted at a time and there must be some kind of response by the hardware-based interpreter giving the go-ahead to continue on.

    Can someone point me towards a communications spec?

    1. Open parallel port
    2. ??

  2. #2
    Join Date
    May 2007
    Posts
    781
    That is going depend on the "hardware-based interpreter".
    You need to pick one and read the programming manual and have a chat with the manufacture of the unit.
    Any decent unit would come with souce code samples and a library of functions to make things easier.

  3. #3
    Join Date
    Feb 2011
    Posts
    0
    Quote Originally Posted by Andre' B View Post
    That is going depend on the "hardware-based interpreter".
    You need to pick one and read the programming manual and have a chat with the manufacture of the unit.
    Any decent unit would come with souce code samples and a library of functions to make things easier.
    How does a program like Mach3 work then? Mach3 can talk to a number of different drives, and you just provide it an XML configuration file about your drive and that tells it how to talk to the drive.

    Surely there has to be general purpose guidelines for this. This stuff has been around since the 70s!

  4. #4
    Join Date
    Dec 2003
    Posts
    24220
    Quote Originally Posted by JJDennon View Post
    This stuff has been around since the 70s!
    But in different formats and methods, the original commercial systems used (uses) all in one proprietary co-processors for the HMI, CNC & PLC controllers.
    Then came the PC based Motion cards such as Delta-Tau, Galil and Acroloop and the PC just provided the HMI, the cards closed the motion loop the same way the commercial systems do.
    The method Mach uses is an HMI that also calculates the machine trajectory, this is then passed over to the motion drives via the P.P. Mach then relies on the stepper or in the case of servo's closed loop drives to complete the move.
    IOW, there is no feedback to Mach (non-closed loop).
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  5. #5
    Join Date
    Feb 2011
    Posts
    0
    So what does Mach actually transmit to the drive then? It's it gcode or some modified, compiled thing?

    Quote Originally Posted by Al_The_Man View Post
    The method Mach uses is an HMI that also calculates the machine trajectory, this is then passed over to the motion drives via the P.P. Mach then relies on the stepper or in the case of servo's closed loop drives to complete the move.
    IOW, there is no feedback to Mach (non-closed loop).
    Al.

  6. #6
    Join Date
    Mar 2004
    Posts
    1804
    Basically, Mach sends a timed data string of pulses for step and direction out the parallel port. Nothing more, nothing less. All of the computation to covert G-code to timed pulses is done in the computer.
    Art
    AKA Country Bubba (Older Than Dirt)

  7. #7
    Join Date
    Mar 2003
    Posts
    35538
    and you just provide it an XML configuration file about your drive and that tells it how to talk to the drive.
    All the .xml file does is contain the Mach3 configuration. All it really does is tell mach3 which pins to send the step and direction signals.

    If you want to know more about how Mach3 works, download the plugin SDK.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  8. #8
    Join Date
    Feb 2011
    Posts
    0
    Quote Originally Posted by ger21 View Post
    All the .xml file does is contain the Mach3 configuration. All it really does is tell mach3 which pins to send the step and direction signals.

    If you want to know more about how Mach3 works, download the plugin SDK.
    Great idea, should give me a better understanding on that. There is also EMC2 as well.

  9. #9
    Join Date
    Mar 2003
    Posts
    35538
    How does the computer actually transmit the gcode? I assume one line of gcode is transmitted at a time and there must be some kind of response by the hardware-based interpreter giving the go-ahead to continue on.
    What Mach3 does (when used with the parallel port), is take control of the PC to get very precise timing. It then calculates the required step and direction signals, and places them in a buffer, sending them out in the correct time slice. There is no response with the go ahead, the signals are sent at the pre-determined time. What Mach3 does is extremely complex, and it took Art (the author) years to get it where it is now.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  10. #10
    Join Date
    Apr 2010
    Posts
    486
    Quote Originally Posted by JJDennon View Post
    I am interested in writing my own CNC control program.

    My question is WHY? What do you hope to achieve which can't be done with the two fine machine controllers on the market today, Mach3 and EMC2? What features do you plan to add?

    The US Government spent several million dollars developing EMC, and it was no great shakes.

    Then a handful of independent programmers took over the program and spent years and untold (and unpaid) thousands of man-hours turning it into the product it is today (EMC2). It's a robust product which will run all sorts of different machinery with as many as 9 different axes. And at least 8 programmers still spend a lot of time trying to improve different functions and keep EMC2 up-to-date. Al has already mentioned the blood, sweat, and tears which Art has poured into Mach3.

    I don't pretend to be a brain surgeon, but consider the many functions required to run just a single line of G-code. A single line might request a cutting move with 5 axis of movement. The controller has to calculate all the geometry to the moves, and keep the cutter moving at a constant rate along the material, (which will frequently involve changing the speed of each different axis drastically). A rapid move, for example, requires not only the calculations to accelerate each axis up to speed, but needs to frequently calculate the distance left for the move and then calculate the amount of deceleration required to slow the move as to not overrun the move end points.

    Tom

  11. #11
    Join Date
    Feb 2011
    Posts
    0
    My question is why not?

    I've done some work professionally developing front ends for Fanuc and Seimens controls, and it was pretty fun work. I had the opportunity to really re-think the UI and make some improvements. The response from the machine operators and programmers was pretty positive compared to the software they were using before. The Mach3 UI is pretty archaic and rough on the eyes, the same with EMC2.

    Really there is more work here than I want to take on at this point in time, but the end result would be software that would be enjoyable to use.

    Quote Originally Posted by TarHeelTom View Post
    My question is WHY? What do you hope to achieve which can't be done with the two fine machine controllers on the market today, Mach3 and EMC2? What features do you plan to add?

    Tom

  12. #12
    Join Date
    Mar 2003
    Posts
    35538
    The Mach3 UI is pretty archaic and rough on the eyes, the same with EMC2.
    It's much easier to create a Mach3 screen, then create a new mach3.

    Here's two that I've done.

    The CNC Woodworker - Mach3
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  13. #13
    Join Date
    Apr 2010
    Posts
    486
    Quote Originally Posted by JJDennon View Post
    I've done some work professionally developing front ends for Fanuc and Seimens controls, and it was pretty fun work. I had the opportunity to really re-think the UI and make some improvements. The response from the machine operators and programmers was pretty positive compared to the software they were using before. The Mach3 UI is pretty archaic and rough on the eyes, the same with EMC2.
    Interesting point about EMC2 is that one of the config entries is the interface. There are currently three different interfaces in common use (that I'm aware of), axis, touchy, and Sherline.

    The hooks are there to hook a new interface into. Many of us might welcome a new interface.

    One thing I'd like to see is a USB output for a remote (read large) DRO display with EMC2. One interesting feature might be something to compare the output from glass slides with the position output from EMC2 (and perhaps Mach3). The one minor failing point of using steppers is that you have no way of knowing if the steppers are still in sync with the controller.

    So have at it. Develop for us a new interface for EMC2.

    I'm not a Mach 3 user, so can't comment on their interface, or their hooks (if any).

    Tom

  14. #14
    Join Date
    Dec 2003
    Posts
    24220
    Quote Originally Posted by JJDennon View Post
    My question is why not?

    I've done some work professionally developing front ends for Fanuc and Seimens controls, and it was pretty fun work. I had the opportunity to really re-think the UI and make some improvements. The response from the machine operators and programmers was pretty positive compared to the software they were using before.
    If you really need a project, look in to making a CNC HMI interface for Galil.
    The only one on the market is Camsoft, and they price it out of the market.
    If anyone comes up with a decent one cheap, I reckon they could make good money out of it.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  15. #15
    Join Date
    Feb 2011
    Posts
    0
    Really a lot cleaner UI than some of the screensets I've seen. The major problem I see with the way Mach3 does things is the guts of the screen are bitmaps. The text is part of the bitmap, so not localizeable.

    This was the best way of doing it when Mach was originally developed, but there are better options now for developing really rich UI with tools built into Windows or by using Mono on Linux.

    With EMC2, it would be interesting to investigate the possibility of creating a front in C# end using Moonlight/Silverlight. Definitely something I'll be looking into at some point.

    Quote Originally Posted by ger21 View Post
    It's much easier to create a Mach3 screen, then create a new mach3.

    Here's two that I've done.

    The CNC Woodworker - Mach3

  16. #16
    Join Date
    Apr 2010
    Posts
    0
    There are a few reasons why people are looking for alternatives to EMC and Mach3:

    1. They don't want a PC in the workshop
    2. The parallel port is DEAD
    3. These products are overkill for many users

    We build machines and drivers, why not controllers?

  17. #17
    Join Date
    Mar 2003
    Posts
    35538

  18. #18
    Join Date
    Apr 2010
    Posts
    0
    You're hanging onto the past, Gerry ... after all, there are places where you can still buy buggy whips, car starter handles and other transport archaeology, but you don't often see them in modern car showrooms

    Go to a major computer retailer and count the number of notebooks and netbooks that have parallel ports. You MIGHT find one. Count the number of desktops that have parallel ports. Heck, it is getting hard to FIND desktops in many retailers, the tide of notebooks and netbooks is washing them away. Count the number of Macs and iPads that have parallel ports. None. Android? None.

    The commercial USB interfaces have proven that it is possible to drive CNC machines without a parallel port. The Arduino guys (self included) have probably 20 competing projects running, none of which use a parallel port.

    I'm really surprised that the EMC and Mach guys are so rusted on to the past.

  19. #19
    Join Date
    Mar 2003
    Posts
    35538
    Quote Originally Posted by Ron Dunn View Post
    I'm really surprised that the EMC and Mach guys are so rusted on to the past.
    Well, there's only one "Mach guy", so development is a bit slow. There hasn't been a new version in a few years, although one is being worked on.

    There are at least 3 USB options that work with Mach3, as well as a few other options. I've heard that parallel port support will go away, though. Possibly in the next version, probably for sure in the one after that.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  20. #20
    Join Date
    Apr 2010
    Posts
    486
    Quote Originally Posted by Ron Dunn View Post
    I'm really surprised that the EMC and Mach guys are so rusted on to the past.
    The EMC2 team is working on a USB interface, which will probably have to have some sort of a hardware interface on the computer end.

    If I'm not mistaken, "Smoothstepper" is an interface used to drive steppers from Mach3.

    Problem is that EMC2 relies on precise timing to drive the steppers. The timing on USB is not at all predictable. So (in my limited understanding) you need to feed lots of instructions to the interface board plus some timing information as well.

    The parallel port does all that in real time.

    Despite the similar name, don't heap EMC and EMC2 in the same basket. EMC was created by the government, and wasn't a bright light. Only when some outside, independent programers started working on it did #MC2 start to shine.

Page 1 of 2 12

Similar Threads

  1. What is the difference between an industrial computer and a normal computer?
    By Apples in forum Controller & Computer Solutions
    Replies: 9
    Last Post: 09-18-2008, 10:27 PM
  2. Running a gcode output file in the computer
    By Palafox in forum Uncategorised CAM Discussion
    Replies: 3
    Last Post: 06-10-2008, 11:56 PM
  3. Replies: 0
    Last Post: 03-10-2005, 07:46 PM
  4. fast computer as server, slow computer as terminal
    By replicapro in forum Computers / Desktops / Networking
    Replies: 1
    Last Post: 07-01-2004, 08:05 PM
  5. gcode to gcode converter
    By july_favre in forum Uncategorised CAM Discussion
    Replies: 4
    Last Post: 05-25-2004, 12:51 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •