The PP structure allows us to decide if an X,Y or Z coordinate will always be specified, or only if it changes. Obviously, file size will be larger if always included. Are there any other less obvious consequences? I see that the new Mach3 PP all seem to use the 'only if changed' format, while some of the older M3 drivers use 'Always'. I am trying to write a toolpath viewer / manipulator, and using 'Always' would simplify some parts of the code.
Cheers!
Any downside to always including full XYZ coordinates?
-
- Vectric Wizard
- Posts: 1687
- Joined: Sun Oct 24, 2010 7:28 pm
- Model of CNC Machine: homebuilt 4'x2' (Mach3+G540)
- Location: Guelph, Ontario
- Contact:
Any downside to always including full XYZ coordinates?
Paul Rowntree
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com
- zeeway
- Vectric Wizard
- Posts: 3157
- Joined: Thu Feb 11, 2010 9:24 pm
- Model of CNC Machine: Self-built
- Location: SC, USA
Re: Any downside to always including full XYZ coordinates?
Hmm, I guess you are asking if it is easier to code in "absolute" XYZ rather than "relative" XYZ. The best advice is to stay away from manual coding and let Vectric software handle it
But if you are determined to do it...certain functions such as arcs and circles are easier to do in incremental than absolute coordinates. You can code in absolute, then switch to incremental when convenient, and then switch back to absolute. But you can also keep it purely in one or the other - I don't think the size of the code would be significantly different.
Angie
But if you are determined to do it...certain functions such as arcs and circles are easier to do in incremental than absolute coordinates. You can code in absolute, then switch to incremental when convenient, and then switch back to absolute. But you can also keep it purely in one or the other - I don't think the size of the code would be significantly different.
Angie
-
- Vectric Wizard
- Posts: 1687
- Joined: Sun Oct 24, 2010 7:28 pm
- Model of CNC Machine: homebuilt 4'x2' (Mach3+G540)
- Location: Guelph, Ontario
- Contact:
Re: Any downside to always including full XYZ coordinates?
Hi Angie;
Although you are right that it is best to avoid hand coding in G, that is not exactly what I am thinking of. The VCP code I have seen uses absolute coding everywhere except on arcs, so G90 and G91.1 are seen in the file headers. But even if in absolute mode, if a value of X, Y, or Z do not change, the language spec does not force the code to include them; the following lines from the Mach PP controls this
VAR X_POSITION = [X|C|X|1.4]
VAR Y_POSITION = [Y|C|Y|1.4]
VAR Z_POSITION = [Z|C|Z|1.4]
If the 'C' was an 'A', the values of X,Y and Z would always be output to the file, even if they are not changing from line to line. From the same PP file,
VAR X_HOME_POSITION = [XH|A|X|1.4]
VAR Y_HOME_POSITION = [YH|A|Y|1.4]
VAR Z_HOME_POSITION = [ZH|A|Z|1.4]
My question was just to ask if putting in all these extra, unchanging values had any consequences other than increased file size.
Cheers!
Although you are right that it is best to avoid hand coding in G, that is not exactly what I am thinking of. The VCP code I have seen uses absolute coding everywhere except on arcs, so G90 and G91.1 are seen in the file headers. But even if in absolute mode, if a value of X, Y, or Z do not change, the language spec does not force the code to include them; the following lines from the Mach PP controls this
VAR X_POSITION = [X|C|X|1.4]
VAR Y_POSITION = [Y|C|Y|1.4]
VAR Z_POSITION = [Z|C|Z|1.4]
If the 'C' was an 'A', the values of X,Y and Z would always be output to the file, even if they are not changing from line to line. From the same PP file,
VAR X_HOME_POSITION = [XH|A|X|1.4]
VAR Y_HOME_POSITION = [YH|A|Y|1.4]
VAR Z_HOME_POSITION = [ZH|A|Z|1.4]
My question was just to ask if putting in all these extra, unchanging values had any consequences other than increased file size.
Cheers!
Paul Rowntree
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com
- zeeway
- Vectric Wizard
- Posts: 3157
- Joined: Thu Feb 11, 2010 9:24 pm
- Model of CNC Machine: Self-built
- Location: SC, USA
Re: Any downside to always including full XYZ coordinates?
Hello Paul,
Sounds like you are understanding everything well (likely better than I do). The repeat of the absolute position doesn't do anything positive except to inflate the size of the file, as you suggest. When I learned to hand code NC in the stone age, I was taught to include all three refs as a way to keep your thinking straight. I think eventually I just kept X and Y going like this, and only included Z in the real Z moves.
Angie
Sounds like you are understanding everything well (likely better than I do). The repeat of the absolute position doesn't do anything positive except to inflate the size of the file, as you suggest. When I learned to hand code NC in the stone age, I was taught to include all three refs as a way to keep your thinking straight. I think eventually I just kept X and Y going like this, and only included Z in the real Z moves.
Angie
-
- Vectric Wizard
- Posts: 1687
- Joined: Sun Oct 24, 2010 7:28 pm
- Model of CNC Machine: homebuilt 4'x2' (Mach3+G540)
- Location: Guelph, Ontario
- Contact:
Re: Any downside to always including full XYZ coordinates?
Thanks Angie;
No, I am pretty sure that I am nowhere near the front of the pack on this, and I wouldn't think of hand coding this kind of mess. Automatic translation and modification may be another matter ....
Cheers!
No, I am pretty sure that I am nowhere near the front of the pack on this, and I wouldn't think of hand coding this kind of mess. Automatic translation and modification may be another matter ....
Cheers!
Paul Rowntree
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com