writing gcode with variables to cut angles
- foam man
- Offline
- Senior Member
Less
More
- Posts: 58
- Thank you received: 3
07 Sep 2022 16:38 #251420
by foam man
writing gcode with variables to cut angles was created by foam man
is it possible to cut angles through variables in gcode?
in the linux gcode overview it talks about polar coordinates. is that what to use?
eg.
in the linux gcode overview it talks about polar coordinates. is that what to use?
eg.
F100 G1 @.5 ^90
I need to cut 10 foam pieces, same angle, different lengths
would appreciate any help
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
08 Sep 2022 03:47 #251460
by Todd Zuercher
Replied by Todd Zuercher on topic writing gcode with variables to cut angles
You can do it with a bit of trigonometry.
For example to make a 10inch move at a 30deg angle to the X-axis use the following line of g-codeIf that isn't what you had in mind, perhaps you could use G10L2Rn (n=angle of rotation) to rotate the X,Y axis about the Z. (But I've never used it so am abit unsure of all of the ramifications of using it.)
For example to make a 10inch move at a 30deg angle to the X-axis use the following line of g-code
G1 X[10COS30]Y[10SIN30]F100.
The following user(s) said Thank You: arvidb
Please Log in or Create an account to join the conversation.
- foam man
- Offline
- Senior Member
Less
More
- Posts: 58
- Thank you received: 3
08 Sep 2022 15:28 #251496
by foam man
Replied by foam man on topic writing gcode with variables to cut angles
thanks I'll give it a shot
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
08 Sep 2022 15:46 - 08 Sep 2022 15:52 #251497
by Todd Zuercher
Replied by Todd Zuercher on topic writing gcode with variables to cut angles
Oops I made some mistakes. I think that the expressions above may need a multiplication symbol between the travel distance and the sin/cos terms and needed brackets around the angles.
So should have been this.
So should have been this.
G1 X[10*COS[30]]Y[10*SIN[30]]F100.
Last edit: 08 Sep 2022 15:52 by Todd Zuercher. Reason: fix errors in the expressions.
The following user(s) said Thank You: arvidb, foam man
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
17 Sep 2022 10:20 #252158
by andypugh
Replied by andypugh on topic writing gcode with variables to cut angles
Polar coordinate might be an option, but the origin is always the current coordinate system zero.
I have never tried polar coordinates in incremental motion mode, that might do what you want. Maybe experiment in a simulator?
I have never tried polar coordinates in incremental motion mode, that might do what you want. Maybe experiment in a simulator?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
20 Sep 2022 16:37 #252413
by Todd Zuercher
Replied by Todd Zuercher on topic writing gcode with variables to cut angles
Incremental polar coordinate moves still move about the origin, but step incrementally outward from the origin. This is a good way to approximate/make a spiral, but I'm not sure it is what the original poster was after.
Please Log in or Create an account to join the conversation.
Time to create page: 0.054 seconds