- Posts: 6
- Thank you received: 0
Winding up wire on a coil
- s4nj0k
- Offline
- New Member
-
Less
More
12 years 4 months ago #48358
by s4nj0k
Winding up wire on a coil was created 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.
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.
- cncbasher
- Offline
- Moderator
-
Less
More
- Posts: 1021
- Thank you received: 202
12 years 4 months ago #48361
by cncbasher
Replied by cncbasher on topic Winding up wire on a coil
Please Log in or Create an account to join the conversation.
- s4nj0k
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
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 or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
12 years 3 months ago #48376
by andypugh
All that I see wrong is that there is no "01" after the "G" in the elseif.
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.
The following user(s) said Thank You: s4nj0k
Please Log in or Create an account to join the conversation.
- s4nj0k
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
12 years 3 months ago - 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
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: 12 years 3 months ago by s4nj0k.
Please Log in or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
-
Less
More
- Posts: 22
- Thank you received: 240
12 years 3 months ago #48381
by ArcEye
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
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.
Time to create page: 2.012 seconds