Winding up wire on a coil

More
12 years 3 months ago #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 to join the conversation.

More
12 years 3 months ago #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 to join the conversation.

More
12 years 3 months ago #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 to join the conversation.

More
12 years 3 months ago #48376 by andypugh
Replied by andypugh on topic Winding up wire on a coil

s4nj0k wrote:

Code:
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.

Please Log in to join the conversation.

More
12 years 3 months ago #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

Please Log in to join the conversation.

More
12 years 3 months ago #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

Please Log in to join the conversation.

More
12 years 3 months ago #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

Please Log in to join the conversation.

More
12 years 3 months ago #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

Please Log in to join the conversation.

More
12 years 3 months ago #48475 by s4nj0k
Replied by s4nj0k on topic Winding up wire on a coil

ArcEye wrote:

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 to join the conversation.

More
12 years 3 months ago #48476 by s4nj0k
Replied by s4nj0k on topic Winding up wire on a coil

andypugh wrote:
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.

Please Log in to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum