Rotating a profile - 'flower arranging' !

More
11 Jun 2013 00:26 - 11 Jun 2013 00:28 #35498 by grey1beard
I want to produce a mold which will be a 9x6 matrix of daisies.

To keep it as simple as possible, consider that I'm cutting the individual petals with a 4mm ball ended cutter.
I'm cutting towards the centre to give me a cleaner cut in the hdpe I'll use.

g00 x[0] y[0] z[5]
g00 x[20] y[20] (1st daisy petal, location of outer tip)
g00 z[0] (work surface)
g91 (incremental mode)
g01 x[2.4] z[-2] F#3 (cut 1st daisy petal)
g01 x[4.6] z[2]
g90
g00 z[5] (clear)

What I should like to do is to be able to rotate the profile cut in lines 5 and 6, by repeating the lines 2 to 8, but rotating 30 degrees, 12 steps in all, and without calculating all the relevant positions.

I did wonder if there was a version of G10 that would allow roration around the z axis, but I suspect not.
I also briefly looked at the bezel g code generator, but not having python at my fingertips, I thought I'd leave that for the time being.
I'm sure there must be a simple approach that only involves trig functions.

John
Last edit: 11 Jun 2013 00:28 by grey1beard. Reason: sort out quote

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 01:37 #35500 by skunkworks
do you mean... The g10l2p1r[whatever] rotates around the current coordinate system zero.

#20 = 0


g00 x[0] y[0] z[5]
o100 do
G10l2p1 r#20
g00 x[20] y[20] (1st daisy petal, location of outer tip)
g00 z[0] (work surface)
g91 (incremental mode)
g01 x[2.4] z[-2] F[10] (cut 1st daisy petal)
g01 x[4.6] z[2]
g90
g00 z[5] (clear)
#20 = [#20 + 30]
o100 while [#20 lt 360]
m30

Attachments:

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 02:27 #35503 by grey1beard
Thanks skunkworks, that's very close.
I can see the principle, though I'll have to tease it apart to see how to use it, never having come across it before.
The 'petal' is not pointing to the centre, but curing that will teach me how to produce a universal method.
Thanks again, and if I get stuck, I'll give you a shout.
Regards,
John

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 04:13 - 11 Jun 2013 04:17 #35505 by grey1beard
I think I've now got the hang of it, so this is the desired code -


G17 G21 G40 G49 G54 G80 G90 G94

#3= 600
#20 = 0

o100 do
g10l2p1 r#20
g00 x[10] y[0] (1st daisy petal, location of outer tip)
z[0] (work surface)
g91 (incremental mode)
g01 x[-2.4] z[-2] F#3 (cut 1st daisy petal)
g01 x[-4.6] z[2] F#3
g90
g00 z[5] (clearance)
#20 = [#20 + 30]
o100 while [#20 lt 360]
m30

Attachments:
Last edit: 11 Jun 2013 04:17 by grey1beard.

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 04:28 #35507 by skunkworks

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 04:58 - 11 Jun 2013 05:01 #35508 by grey1beard
While you're in a good mood, how do I step the coordinate system in the x axis sideways, so that I can start to build up a matrix of the daisies ?
I thought g92 x- might do it, but doesn't seem to, even after moving the position of the tool first, then setting g92 to the same value.
John

Hang on, I think I've got it.
Last edit: 11 Jun 2013 05:01 by grey1beard.

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 05:04 #35509 by grey1beard
Seems to be the method - left the x axis value out of the new g10 line :blush:
Attachments:

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 05:21 #35510 by grey1beard
Final question on this topic - is it possible to nest the complete g10 instruction 'block' into a repeat loop, so that I can reduce the length of the code for a 54 set matrix ?

John

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 05:54 #35511 by BigJohnT
Sure, just use a variable for the angle. John your having too much fun...

JT

Please Log in or Create an account to join the conversation.

More
11 Jun 2013 15:35 #35524 by grey1beard
Yes, JT, but that's the name of the game :)

When this project if finished, I'll post a picture of it, but at the moment I'm still thinking of the commercial possibilities of ekeing out the pension !

John

Please Log in or Create an account to join the conversation.

Time to create page: 0.131 seconds
Powered by Kunena Forum