Winding up wire on a coil

More
01 Jul 2014 15:03 #48358 by s4nj0k
Hello, could someone help me please. I want to program a g-code that winds up wire on a coil, by rotation of y-axis.
It should wind up forward and by obtaining the endpoint it should go backwards.

I´m thinking of a program like that. Is it possible for somebody to labour on it, to make it work.

o103 repeat [5] (repitition 5 times)
#2 = 1
#3 = 19
o102 if [#2 LT 10] (wind up forward)
G01 A360 Y[#2]
o102 elseif [#2 GT 10] (by reaching endpoint wind up backwards)
G A360 Y[#3]
o102 endif
#2 =[ #2 + 1 ]
#3 =[ #3 - 1 ]
o103 endrepeat

By the way the A is my y-axis. I hope somebody can help me.

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

More
01 Jul 2014 16:21 #48361 by cncbasher
Replied by cncbasher on topic Winding up wire on a coil
have you seen JT'S winder example program

gnipsel.com/linuxcnc/examples.html

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

More
01 Jul 2014 23:01 #48369 by s4nj0k
Replied by s4nj0k on topic Winding up wire on a coil
Ok thanks, but actually I need just the code, because I´m working with other Software and don´t know how to use this files.

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

More
02 Jul 2014 05:25 #48376 by andypugh
Replied by andypugh on topic Winding up wire on a coil

o103 repeat [5]                   (repitition 5 times)
#2 = 1
#3 = 19
o102 if [#2 LT 10]               (wind up forward)
  G01 A360 Y[#2]
o102 elseif [#2 GT 10]      (by reaching endpoint wind up backwards)
  G A360 Y[#3]
o102 endif 
#2 =[ #2 + 1 ]
#3 =[ #3 - 1 ]
o103 endrepeat


All that I see wrong is that there is no "01" after the "G" in the elseif.
The following user(s) said Thank You: s4nj0k

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

More
02 Jul 2014 14:10 - 02 Jul 2014 14:11 #48380 by s4nj0k
Replied by s4nj0k on topic Winding up wire on a coil
Thank you, I adapt the program. Unfortunately the axis doesn´t rotate after the first 360°. Do someone knows the command to set it to zero after each rotation, without rotating it backwards.



o103 repeat [5]

#2 = 1
#3 = 18

O101 while [#3 GT 0]

o102 if [#2 LT 10]
G01 A360 Y[#2]
o102 elseif [#2 GE 10]
G01 A360 Y[#3]
o102 endif

#2 =[ #2 + 1 ]
#3 =[ #3 - 1 ]

O101 endwhile

o103 endrepeat
Last edit: 02 Jul 2014 14:11 by s4nj0k.

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

More
02 Jul 2014 14:26 #48381 by ArcEye
Replied by ArcEye on topic Winding up wire on a coil

Unfortunately the axis doesn´t rotate after the first 360°.


Try programming the move in incremental mode instead of absolute

Then you are telling it to move 360 deg not go to 360 deg, it probably won't move the second time because it is already there.

regards
The following user(s) said Thank You: s4nj0k

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

More
02 Jul 2014 20:10 #48385 by Rick G
Replied by Rick G on topic Winding up wire on a coil
ArcEye's response sounds like the best answer.

However

Do someone knows the command to set it to zero after each rotation, without rotating it backwards.

You can take a look at G10 or G92.

Rick G
The following user(s) said Thank You: s4nj0k

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

More
02 Jul 2014 22:44 #48388 by andypugh
Replied by andypugh on topic Winding up wire on a coil
The other solution is to run in feed-per rev mode and simply do repeated G1 moves.
This is what I did when winding my magneto, the code here was simply:

G95 F0.12
M3 S400
O100 repeat [200]
G1 X+25
G1 X -25
O100 endrepeat

The following user(s) said Thank You: s4nj0k

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

More
07 Jul 2014 15:16 #48475 by s4nj0k
Replied by s4nj0k on topic Winding up wire on a coil

Unfortunately the axis doesn´t rotate after the first 360°.


Try programming the move in incremental mode instead of absolute

Then you are telling it to move 360 deg not go to 360 deg, it probably won't move the second time because it is already there.

regards


Then the problem is, that it doesn´t stop at the endpoint of ten and is not moving backwards. Incremental distance mode g91 shall apply only to the number of degrees, but I don´t know how to put it in.

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

More
07 Jul 2014 15:19 - 07 Jul 2014 15:20 #48476 by s4nj0k
Replied by s4nj0k on topic Winding up wire on a coil


G95 F0.12
M3 S400
O100 repeat [200]
G1 X+25
G1 X -25
O100 endrepeat


Unfortunately that code doesn´t work for my machine.
Last edit: 07 Jul 2014 15:20 by s4nj0k.

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

Time to create page: 0.082 seconds
Powered by Kunena Forum