Coordinate Rotations, Subroutines
- electrosteam
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 6
20 Aug 2025 07:15 #333717
by electrosteam
Coordinate Rotations, Subroutines was created by electrosteam
RPI 4B 4GB with Gmoccapy 2.9.4
First efforts at using G10 L2, and subroutines.
The attached code produces two arbitrary short curves.
Simulation only, steppers off.
1) Spent hours chasing down anomalous z value when this code executed.
It seemed like G10 needed full population of values to avoid ambiguous DRO:
- G10 L2 P1 x0 y0 z0 R0 to get sensible G54 datum point.
Is this always the case ?
Eventually I discovered persistent parameters that had incorrect values.
Cleared them, and now all good.
I will ensure in future that the start-up procedure includes a check on parameters.
2) My O100 subroutine must be located prior to what I call the "main".
The main short x20 y20 move checks that the main executed before the subroutine.
If I position O100 after main, the Gmoccapy editor refuses to save the file.
This seems odd to me, but I cannot see my error.
What is the correct way to use subroutines ?
John.
First efforts at using G10 L2, and subroutines.
The attached code produces two arbitrary short curves.
Simulation only, steppers off.
1) Spent hours chasing down anomalous z value when this code executed.
It seemed like G10 needed full population of values to avoid ambiguous DRO:
- G10 L2 P1 x0 y0 z0 R0 to get sensible G54 datum point.
Is this always the case ?
Eventually I discovered persistent parameters that had incorrect values.
Cleared them, and now all good.
I will ensure in future that the start-up procedure includes a check on parameters.
2) My O100 subroutine must be located prior to what I call the "main".
The main short x20 y20 move checks that the main executed before the subroutine.
If I position O100 after main, the Gmoccapy editor refuses to save the file.
This seems odd to me, but I cannot see my error.
What is the correct way to use subroutines ?
John.
Attachments:
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4461
- Thank you received: 1998
20 Aug 2025 08:11 #333720
by Aciera
Replied by Aciera on topic Coordinate Rotations, Subroutines
Subroutines 'may only be called after they are defined'.
linuxcnc.org/docs/html/gcode/o-code.html
linuxcnc.org/docs/html/gcode/o-code.html
Please Log in or Create an account to join the conversation.
- electrosteam
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 6
20 Aug 2025 09:20 #333726
by electrosteam
Replied by electrosteam on topic Coordinate Rotations, Subroutines
Thanks Aciera,
That requirement eluded me when researching this subject.
John
That requirement eluded me when researching this subject.
John
Please Log in or Create an account to join the conversation.
- electrosteam
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 6
21 Aug 2025 06:12 #333749
by electrosteam
Replied by electrosteam on topic Coordinate Rotations, Subroutines
Parameters still seem to be a problem to me.
Doing a polar pattern based on the test file posted earlier.
8 coordinate systems at 45 degree steps.
Shutdown overnight, now polar pattern off by 45 degrees rotation, and X,Y datum shifted.
The problem is most likely something silly by me, but the questions are still valid.
I used G10 L2 P1 X0 Y0 Z0 R0 to ensure G54 was where I started the polar pattern.
I this unnecessary and may complicate things ?
Should coordinate offsets be cleared before shutting down ?
How can I avoid parameters biting me in the future?
Should something be included in the shutdown.hal ?
John.
Doing a polar pattern based on the test file posted earlier.
8 coordinate systems at 45 degree steps.
Shutdown overnight, now polar pattern off by 45 degrees rotation, and X,Y datum shifted.
The problem is most likely something silly by me, but the questions are still valid.
I used G10 L2 P1 X0 Y0 Z0 R0 to ensure G54 was where I started the polar pattern.
I this unnecessary and may complicate things ?
Should coordinate offsets be cleared before shutting down ?
How can I avoid parameters biting me in the future?
Should something be included in the shutdown.hal ?
John.
Please Log in or Create an account to join the conversation.
Time to create page: 0.186 seconds