Mach 3 question

Discussion of Mach3 CNC control software
stevensloane
Posts: 5
Joined: Fri Jun 27, 2014 10:11 pm

Mach 3 question

Post by stevensloane » Sun Jul 06, 2014 2:47 am

Does Mach3 and LinuxCNC do the same thing as GRBL and Universal G-Code Sender?

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Mach 3 question

Post by cvoinescu » Sun Jul 06, 2014 11:10 am

Pretty much.

Your system needs to:
  1. read G-code from a file
  2. interpret the G-code
  3. plan the motions
  4. generate step and direction signals
  5. count step pulses to determine the required current in each motor winding
  6. put that much current through the motor
In all cases, your motor drivers (e.g. Allegro A4988, Texas Instruments DRV8825, Toshiba TB6560...) do the last two steps (step 5 is called "indexing"). Cheap, small drivers do both step 5 and 6 on a single chip; larger and/or more advanced drivers (e.g. Gecko) do them with separate components.

LinuxCNC uses the PC to do all the other steps. It generates the step and direction signals on the PC's parallel port (or a specialized card), which connect to the inputs of the motor drivers.

Mach3 does the same, but it also supports doing step 4 (the actual timing and generation of the pulses) on separate, dedicated hardware connected by USB or Ethernet (e.g. SmoothStepper).

With GRBL, Universal G-Code Sender (or GRBL Controller, etc) runs on the PC, reads the G-code, and sends it over to GRBL via serial-over-USB (so the PC does step 1). GRBL runs on the Arduino Uno and does steps 2, 3 and 4. Your driver shield has the drivers that do steps 5 and 6.

For completeness, I should add that some driver chips do not use the step pulse system; instead, they are given motion commands directly from the planner. Steps 4 and 5 are replaced by a single step, "interpret motion commands to determine the required current waveform in each motor winding". GRBL does not support this type of driver, and I doubt it can be used from LinuxCNC or Mach3 either.

Also, there's great leeway in interpreting what step 2 means. GRBL has an intentionally limited G-code interpreter, with no support for user variables, expressions, flow control, canned cycles, spindle synchronization, and so on. It can handle only three linear axes. GRBL can not be used for lathes, nor for milling machines with more than three axes. Both LinuxCNC and Mach3 have pretty much complete G-code support, with all the features, and they understand rotary axes. They can be -- and are -- used with professional machines of many types. Humans who write G-code directly find the lack of variables and flow control in GRBL very limiting. However, G-code generated by CAM packages doesn't need those features, so GRBL works perfectly for that.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Woodworker
Posts: 639
Joined: Tue Mar 11, 2014 1:37 am
Location: 5 miles north of Benson, NC

Re: Mach 3 question

Post by Woodworker » Sun Jul 06, 2014 11:43 am

This was an execellent post, this explains a lot. Thanks cvoinescu .
BRuce - SO2 #4798 - IC's Z axis upgrade, customized Z rail and Z motor mount, spindle Dewalt 611

WillAdams
Posts: 8608
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Mach 3 question

Post by WillAdams » Sun Jul 06, 2014 2:11 pm

Clears up a lot for me too --- I put it on its own page: http://www.shapeoko.com/wiki/index.php/ ... C_operates and found three places to link to it.
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

WillAdams
Posts: 8608
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Mach 3 question

Post by WillAdams » Sun Jul 06, 2014 2:13 pm

It is worth noting that for those who find G-code limiting, there are a variety of pre-processors which will make up for it.

That said, I think a great feature for the G-code senders which are oriented towards Grbl would be to accept the entire G-code standard and interpret and instantiate it as G-code which Grbl can understand.
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

fl0yd
Posts: 87
Joined: Wed Mar 12, 2014 5:37 pm
Location: St. Louis, MO

Re: Mach 3 question

Post by fl0yd » Sun Jul 06, 2014 3:35 pm

WillAdams wrote:It is worth noting that for those who find G-code limiting, there are a variety of pre-processors which will make up for it.

That said, I think a great feature for the G-code senders which are oriented towards Grbl would be to accept the entire G-code standard and interpret and instantiate it as G-code which Grbl can understand.
GRBL v9 has a new gcode parser that aims to be 100% gcode compliant. It will be interesting to see what pre-processing to remove unsupported statements will be needed.

Woodworker
Posts: 639
Joined: Tue Mar 11, 2014 1:37 am
Location: 5 miles north of Benson, NC

Re: Mach 3 question

Post by Woodworker » Sun Jul 06, 2014 5:15 pm

I just searched the wiki and did not find any. Is there a list or link somewhere?
BRuce - SO2 #4798 - IC's Z axis upgrade, customized Z rail and Z motor mount, spindle Dewalt 611

WillAdams
Posts: 8608
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Mach 3 question

Post by WillAdams » Sun Jul 06, 2014 6:42 pm

If you're asking after G-code supported by Grbl, that's in a bit of flux. We do have a section: for that: http://www.shapeoko.com/wiki/index.php/ ... ed_by_Grbl

But it's expanded a bit.

Needs to be tidied up.
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Woodworker
Posts: 639
Joined: Tue Mar 11, 2014 1:37 am
Location: 5 miles north of Benson, NC

Re: Mach 3 question

Post by Woodworker » Sun Jul 06, 2014 10:28 pm

No, was was interested in pre processors. I would like to see what has been done and how it's done.
BRuce - SO2 #4798 - IC's Z axis upgrade, customized Z rail and Z motor mount, spindle Dewalt 611

WillAdams
Posts: 8608
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Mach 3 question

Post by WillAdams » Sun Jul 06, 2014 11:45 pm

These are listed on the Programming page:

http://www.shapeoko.com/wiki/index.php/ ... Generators
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Post Reply