Where are predefined variables set?

Having problems with or questions about SheetCam? Post them here.
Post Reply
Dmitry_K
Posts: 8
Joined: Thu May 26, 2022 4:43 pm

Where are predefined variables set?

Post by Dmitry_K »

Hello.
The documentation for the postprocessor contains information about predefined variables and that they exist. Such as endX, endY and endZ.
But I couldn't find information on how to set their values. I'm specifically interested in endZ.
Somewhere, by default, apparently the value is set to 170. But my Z axis has a final displacement equal to 110. How and where can I override this?

Regards, Dmitry.
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Where are predefined variables set?

Post by djreiswig »

Those variables are set in sheetcam based to the cut path. You can't set them. Are you trying to get your machine to park? There is a parking position in the settings.
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: Where are predefined variables set?

Post by bLouChip »

endZ and most other Predefined Variables described in the Post Documentation are SC "internally" managed variable, meaning they're managed outside the scope of post processors. I don't believe they are intended to be written or changed, but they certainly are intended to be read and referenced by post processors as need be. endX, 'Y, and 'Z are set by SC prior to a call to .scpost functions and they represent the destination of the next motion, where currentX, 'Y, 'Z represent the current position of XYZ and thus just prior to the next motion. So the absolute value of currentZ - endZ is the distance of the next motion on that axis, and so on. I'm assuming your mention of "final displacement of 110" means the distance of the motion in question.

Also, depending on the function that SC calls in the .scpost, only predefined variables relevant to that function will have meaningful values. You can examine a variable by placcing a debug breakpoint on the first stmt in the function of interest and then click on the Stack tab of the window just below the Edit Post window, you have to resize the Edit and Stack window separator to see the variables.

In the attached .scpost there is quite a bit of currentX, Y, Z and endX, Y, Z usage.
Attachments
GRBL plasma LDC v24-12 (2) - Copy.scpost
(10.29 KiB) Downloaded 64 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
Dmitry_K
Posts: 8
Joined: Thu May 26, 2022 4:43 pm

Re: Where are predefined variables set?

Post by Dmitry_K »

Hello.

I'm trying to adapt the LinuxCNC_plasma_rotatif.scpost postprocessor for my pipe cutting machine. I have a question about how the endZ position is calculated. For different pipe diameters, different values are given. It happens that the Z movement value is much greater than how much my axis can physically travel. For control I use LinuxCNC.
In principle, for a round pipe it is possible to eliminate the operations of calculating the movement along the Z, but for a square pipe this cannot be done.
In general, I have problems with the square pipe. The movement in the Z is calculated incorrectly.

My machine has an option to search for a pipe surface in the Z.

Regards, Dmitry.
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Where are predefined variables set?

Post by djreiswig »

On a rotary axis the Z is calculated from the center of the pipe not the surface.
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Re: Where are predefined variables set?

Post by Les Newell »

Looking at that post, the height of the surface of the pipe is passed to the touch-off subroutine. Your touch-off subroutine needs to set the current Z position based on that value.
Post Reply