- Posts: 65
- Thank you received: 0
writing gcode with variables to cut angles
4 years 1 month ago #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.
Code:
F100 G1 @.5 ^90
I need to cut 10 foam pieces, same angle, different lengths
would appreciate any help
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
4 years 1 month ago #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-code
If 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
Code:
G1 X[10COS30]Y[10SIN30]F100.
Please Log in to join the conversation.
4 years 1 month ago #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 to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
4 years 1 month ago #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.
Code:
G1 X[10*COS[30]]Y[10*SIN[30]]F100.
Please Log in to join the conversation.
4 years 1 month ago #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 to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
4 years 1 month ago #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 to join the conversation.
Time to create page: 0.090 seconds
