Winding up wire on a coil
- s4nj0k
- Offline
- New Member
- Posts: 6
- Thank you received: 0
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
- Posts: 1776
- Thank you received: 292
Please Log in or Create an account to join the conversation.
- s4nj0k
- Offline
- New Member
- Posts: 6
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23563
- Thank you received: 4859
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 or Create an account to join the conversation.
- s4nj0k
- Offline
- New Member
- Posts: 6
- Thank you received: 0
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 or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
- Posts: 25
- Thank you received: 761
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 or Create an account to join the conversation.
- Rick G
- Offline
- Junior Member
- Posts: 28
- Thank you received: 156
However
You can take a look at G10 or G92.Do someone knows the command to set it to zero after each rotation, without rotating it backwards.
Rick G
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23563
- Thank you received: 4859
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 or Create an account to join the conversation.
- s4nj0k
- Offline
- New Member
- Posts: 6
- Thank you received: 0
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.
- s4nj0k
- Offline
- New Member
- Posts: 6
- Thank you received: 0
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 or Create an account to join the conversation.