1811
Mach4 General Discussion / Re: Zeroing and extents
« on: January 06, 2020, 12:51:39 AM »
Hi,
the <Display Work Envelope> displays the machine boundaries as defined by the soft limits.
There is no feature or function, to my knowledge, that displays the rectangle containing the current Gcode job.
The Gcode toolpath will be displayed within the machine boundaries.
I daresay that it would be possible to have the work extents (distinct from machine extents) displayed.
The method I would adopt is to read the work extent DROs. The DRO's are the registers:
core/inst/PathXmax,
core/inst/PathXmin,
core/inst/PathYmax, etc
I am unfamiliar with how the tooplath is drawn, other than it is an OpenGL window. What I would do, or at least try, is write a macro
that made some fictitious G0 moves which would be prepended to your Gcode job.
Lets say for example your Gcode job has work extents (in machine coordinates units) of
X: 10-120
Y: 12.5-45
then your macro would generate these lines:
g53 g0x10y12.5 --rapid to the lower extent of each axis
g53 g0 x120 ----rapid along the lower X axis extent
g53 g0 y45----rapid along the right hand most Y axis extent
g53 g0 x10-----rapid along the max Y axis extent to X min extent
g53 g0 x10 y12.5-----complete the rectangle
We only wish the last four lines to be visible thus we would use the API:
What I would do is 'obscure' initial rapid by setting the axis color the same as the back color.
Then set the color for the next four lines as green/black/blue as you desire. The set the axis color back to whatever
it was prior to this sequence so the normal machine extents etc display normally.
I have not tried this so I have absolutely no idea if it would work.
There are a number of issues or questions that have to be addressed.
Given that the macro contains API calls it MUST be contained within a macro as the Gcode interpreter would baulk
if it encountered an API call in a Gcode file.
Second issue is: 'will the tooplath of a macro be displayed along with the Gcode toolpath OR is the macro ignored while
loading and drawing'....some experimentation is in order.
Third issue: 'if, as I have proposed the toolpath be the combined view of the Gcode job AND the extents macro how would
the display work if it were subject to user rotation or zoom?
Fourth issue: 'can we write a macro that includes g0 rapids and thus be displayed in the tooplath but WHEN the Gcode
runs actually skip over them? We don't want the machine to actually move at rapid speeds around the work extents,
it would almost certainly collide with the vice. So what we want is for the machine to display a path that will never actually
be executed. I have no idea whether that is possible.
Just thinking about it is giving me a headache!
Craig
the <Display Work Envelope> displays the machine boundaries as defined by the soft limits.
There is no feature or function, to my knowledge, that displays the rectangle containing the current Gcode job.
The Gcode toolpath will be displayed within the machine boundaries.
I daresay that it would be possible to have the work extents (distinct from machine extents) displayed.
The method I would adopt is to read the work extent DROs. The DRO's are the registers:
core/inst/PathXmax,
core/inst/PathXmin,
core/inst/PathYmax, etc
I am unfamiliar with how the tooplath is drawn, other than it is an OpenGL window. What I would do, or at least try, is write a macro
that made some fictitious G0 moves which would be prepended to your Gcode job.
Lets say for example your Gcode job has work extents (in machine coordinates units) of
X: 10-120
Y: 12.5-45
then your macro would generate these lines:
g53 g0x10y12.5 --rapid to the lower extent of each axis
g53 g0 x120 ----rapid along the lower X axis extent
g53 g0 y45----rapid along the right hand most Y axis extent
g53 g0 x10-----rapid along the max Y axis extent to X min extent
g53 g0 x10 y12.5-----complete the rectangle
We only wish the last four lines to be visible thus we would use the API:
Code: [Select]
rc = mc.mcToolPathSetAxisColor(
number mInst,
number axiscolor,
number limitcolor)
What I would do is 'obscure' initial rapid by setting the axis color the same as the back color.
Then set the color for the next four lines as green/black/blue as you desire. The set the axis color back to whatever
it was prior to this sequence so the normal machine extents etc display normally.
I have not tried this so I have absolutely no idea if it would work.
There are a number of issues or questions that have to be addressed.
Given that the macro contains API calls it MUST be contained within a macro as the Gcode interpreter would baulk
if it encountered an API call in a Gcode file.
Second issue is: 'will the tooplath of a macro be displayed along with the Gcode toolpath OR is the macro ignored while
loading and drawing'....some experimentation is in order.
Third issue: 'if, as I have proposed the toolpath be the combined view of the Gcode job AND the extents macro how would
the display work if it were subject to user rotation or zoom?
Fourth issue: 'can we write a macro that includes g0 rapids and thus be displayed in the tooplath but WHEN the Gcode
runs actually skip over them? We don't want the machine to actually move at rapid speeds around the work extents,
it would almost certainly collide with the vice. So what we want is for the machine to display a path that will never actually
be executed. I have no idea whether that is possible.
Just thinking about it is giving me a headache!
Craig