Page 1 of 2 12 LastLast
Results 1 to 12 of 23

Thread: How does a computer trasmit Gcode?

  1. #1
    Registered JJDennon's Avatar
    Join Date
    Feb 2011
    Location
    USA
    Posts
    40
    Downloads
    0
    Uploads
    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
    Registered
    Join Date
    May 2007
    Location
    US
    Posts
    779
    Downloads
    0
    Uploads
    0
    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
    Registered JJDennon's Avatar
    Join Date
    Feb 2011
    Location
    USA
    Posts
    40
    Downloads
    0
    Uploads
    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
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    18,928
    Downloads
    0
    Uploads
    0
    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 (Skype Avail).

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


  • #5
    Registered JJDennon's Avatar
    Join Date
    Feb 2011
    Location
    USA
    Posts
    40
    Downloads
    0
    Uploads
    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
    Registered Bubba's Avatar
    Join Date
    Mar 2004
    Location
    LaGrange, GA USA
    Posts
    1,494
    Downloads
    0
    Uploads
    0
    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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22,285
    Downloads
    0
    Uploads
    0
    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

    Mach3 2010 Screenset
    http://home.comcast.net/~cncwoodworker/2010.html

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


  • #8
    Registered JJDennon's Avatar
    Join Date
    Feb 2011
    Location
    USA
    Posts
    40
    Downloads
    0
    Uploads
    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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22,285
    Downloads
    0
    Uploads
    0
    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

    Mach3 2010 Screenset
    http://home.comcast.net/~cncwoodworker/2010.html

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


  • #10
    Registered
    Join Date
    Apr 2010
    Location
    USA
    Posts
    464
    Downloads
    0
    Uploads
    0
    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
    Registered JJDennon's Avatar
    Join Date
    Feb 2011
    Location
    USA
    Posts
    40
    Downloads
    0
    Uploads
    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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22,285
    Downloads
    0
    Uploads
    0
    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

    Mach3 2010 Screenset
    http://home.comcast.net/~cncwoodworker/2010.html

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


  • Page 1 of 2 12 LastLast

    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, 05:27 PM
    2. Running a gcode output file in the computer
      By Palafox in forum General CAM Discussion
      Replies: 3
      Last Post: 06-10-2008, 06:56 PM
    3. Replies: 0
      Last Post: 03-10-2005, 01:46 PM
    4. fast computer as server, slow computer as terminal
      By replicapro in forum Computers and Networking
      Replies: 1
      Last Post: 07-01-2004, 03:05 PM
    5. gcode to gcode converter
      By july_favre in forum General CAM Discussion
      Replies: 4
      Last Post: 05-24-2004, 07:51 PM

    Tags for this Thread

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.