CNC
CNC lathes and CNC mills repair,
CNC machine repair forums for machinists, cnc programing and manufacturing community.   
   CNC Store
Go Back   CNC Professional Forums > CNC Machinst Help & CNC Troubleshooting Forums > Programming / Applications
Members List Calendar Register FAQ/Rules/Policies Mark Forums Read
Home Recent Posts HELP-FORUMS (ask/answer) Classifieds-freeFile Sharing / Documents Photo Galleries Polls Newsletter   Machinetoolhelp.com.

Programming / Applications All CNC programming, CNC applications, milling, turning, tooling, macro programming, and other CNC machine tool related questions.

Reply
 
Bookmark or Share Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-12, 12:34 AM
gordon
 
Join Date: Oct 2010
Location: South Africa
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Fanuc Macro To Cut A Scroll

Help Please. I am looking for a macro B program to cut a scroll on a cnc vertical mill with a Fanuc 0i-MC control. The sroll is on the top face i.e. circular interpolation in the X & Y axis with the depth in Z.Thanks.
Reply With Quote
  #2 (permalink)  
Old 01-28-12, 03:19 AM
Senior CNC Specialist
 
Join Date: Jan 2012
Posts: 172
Thanks: 0
Thanked 23 Times in 20 Posts
Default Re: Fanuc Macro To Cut A Scroll

Quote:
Originally Posted by gbod View Post
Help Please. I am looking for a macro B program to cut a scroll on a cnc vertical mill with a Fanuc 0i-MC control. The sroll is on the top face i.e. circular interpolation in the X & Y axis with the depth in Z.Thanks.
Your control may be able to generate a Spiral path without having to use a User Macro program. Your control may have SPIRAL INTERPOLATION, and CONICAL INTERPOLATION.

If your control does not have the above functions, Post more information regarding the accuracy of the scroll. For example:
1. Is the scroll to be an approximation. In that case circular interpolation may be used in the Macro Program to give an approximate Spiral.
2. Is the scroll to be an accurate form. In this case I can supply the math routines so you can write your own Macro, or supply the Macro. You will learn more if you write your own.

Regards,

Bill
Reply With Quote
  #3 (permalink)  
Old 01-31-12, 05:05 AM
gordon
 
Join Date: Oct 2010
Location: South Africa
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: Fanuc Macro To Cut A Scroll

The control does not support spiral / conical interpolation.
The accuracy of the scroll is not to important. An approximation would be good enough in this case.
Reply With Quote
  #4 (permalink)  
Old 01-31-12, 05:43 PM
Senior CNC Specialist
 
Join Date: Jan 2012
Posts: 172
Thanks: 0
Thanked 23 Times in 20 Posts
Default Re: Fanuc Macro To Cut A Scroll

Quote:
Originally Posted by gbod View Post
The control does not support spiral / conical interpolation.
The accuracy of the scroll is not to important. An approximation would be good enough in this case.
Following is a routine for machining a scroll point to point, the accuracy of which will depend on the number of points required.

The following arguments can be passed using a G65 call. You could also create a custom G Code by registering a number corresponding to the G code in, say, parameter #6050 so as to call macro program O9010.

For example, register 101 in #6050 to call O9010 with G101

G65 P9010 X0.0 Y0.0 A0.0 C2.0 H50.0 K50.0 R100.0 F200
or
G101 X0.0 Y0.0 A0.0 C2.0 H50.0 K50.0 R100.0 F200


Start angle of scroll = A(#1) (3 o'clock is 0 degree, 12 o'clock is 90 degree, etc)
Number of rotations of scroll commencing at A = C(#3)
X Centre of Scroll = X(#24)
Y Centre of Scroll = Y(#25)
Start Radius of Scroll = R(#18)
Increase of Scroll Radius from Start to End = H(#11)
Number of points = K(#6)
Cut Feed Rate = F(#9)

O9010
'Calculate the incremental angle and rise between points.
#4 = (Incremental angle between points)
#4 = [360*#3] / [#6-1]

#5 = (Incremental rise between points)
#5 = #11 / [#6-1]

The following relies on the tool being positioned at the Start Point of the Scroll. The first point calculated is the second point on the scroll. To calculate the start point of the scroll and drive the tool there via the Macro, initialize both #27 and #28 to Zero. Otherwise, the following initialization will calculate the second point of the scroll.
#27 = (nth number of point, after the Start point being calculated)
#27 = 1
#28 = (the accumulated incremental angle to be added to the start angle)
#28 = #4

WHILE [#27 LT #6] DO1
#29 = #24 + [Cos[#1 + #28] * [#18 + [#5 * #27]]]
#30 = #25 + [Sin[#1 + #28] * [#18 + [#5 *#27]]]
G01 X#29 Y#30 F#9
#28 = #28 + #4
#27 = #27 + 1
END1

The above only applies the X,Y moves. You could expand on the above by passing a Retract Level, a Z Depth, and a Z Feed Rate as arguments in the call block, and incorporate these in the Macro program. To do this, you would have to do the following before executing the WHILE/END loop:
1. Calculate the first point on the scroll in X,Y
2. Rapid to the coordinates found in 1.
3. Rapid to Retract Level
4. Feed to Z Depth

The above is a conversion of a routine from software I wrote. I know for sure that the routine works perfectly in the software, but I haven't tested it as a Macro program with a CNC machine. However, I can't see that I've made any mistakes, so it should be OK, but check it out in single block in fresh air first.

I can also show you a technique of repeating the scroll at various levels, if the scroll has to be cut to a depth greater than the tool will cope with in one go.

Post back if you require any further explanation, or help.

Regards,

Bill

Last edited by angelw; 02-01-12 at 02:54 PM. Reason: Correct the program number of the Macro Program
Reply With Quote
The Following 2 Users Say Thank You to angelw For This Useful Post:
gbod (02-01-12), MMMMM (02-01-12)
  #5 (permalink)  
Old 02-01-12, 05:27 AM
gordon
 
Join Date: Oct 2010
Location: South Africa
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: Fanuc Macro To Cut A Scroll

I have run the program on the graghics and it performs brilliantly. Many thanks.
Reply With Quote
  #6 (permalink)  
Old 03-23-12, 04:00 AM
CNC Professional
 
Join Date: Feb 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Fanuc Macro To Cut A Scroll

Quote:
Originally Posted by angelw View Post
Following is a routine for machining a scroll point to point, the accuracy of which will depend on the number of points required.

The following arguments can be passed using a G65 call. You could also create a custom G Code by registering a number corresponding to the G code in, say, parameter #6050 so as to call macro program O9010.

For example, register 101 in #6050 to call O9010 with G101

G65 P9010 X0.0 Y0.0 A0.0 C2.0 H50.0 K50.0 R100.0 F200
or
G101 X0.0 Y0.0 A0.0 C2.0 H50.0 K50.0 R100.0 F200


Start angle of scroll = A(#1) (3 o'clock is 0 degree, 12 o'clock is 90 degree, etc)
Number of rotations of scroll commencing at A = C(#3)
X Centre of Scroll = X(#24)
Y Centre of Scroll = Y(#25)
Start Radius of Scroll = R(#18)
Increase of Scroll Radius from Start to End = H(#11)
Number of points = K(#6)
Cut Feed Rate = F(#9)

O9010
'Calculate the incremental angle and rise between points.
#4 = (Incremental angle between points)
#4 = [360*#3] / [#6-1]

#5 = (Incremental rise between points)
#5 = #11 / [#6-1]

The following relies on the tool being positioned at the Start Point of the Scroll. The first point calculated is the second point on the scroll. To calculate the start point of the scroll and drive the tool there via the Macro, initialize both #27 and #28 to Zero. Otherwise, the following initialization will calculate the second point of the scroll.
#27 = (nth number of point, after the Start point being calculated)
#27 = 1
#28 = (the accumulated incremental angle to be added to the start angle)
#28 = #4

WHILE [#27 LT #6] DO1
#29 = #24 + [Cos[#1 + #28] * [#18 + [#5 * #27]]]
#30 = #25 + [Sin[#1 + #28] * [#18 + [#5 *#27]]]
G01 X#29 Y#30 F#9
#28 = #28 + #4
#27 = #27 + 1
END1

The above only applies the X,Y moves. You could expand on the above by passing a Retract Level, a Z Depth, and a Z Feed Rate as arguments in the call block, and incorporate these in the Macro program. To do this, you would have to do the following before executing the WHILE/END loop:
1. Calculate the first point on the scroll in X,Y
2. Rapid to the coordinates found in 1.
3. Rapid to Retract Level
4. Feed to Z Depth

The above is a conversion of a routine from software I wrote. I know for sure that the routine works perfectly in the software, but I haven't tested it as a Macro program with a CNC machine. However, I can't see that I've made any mistakes, so it should be OK, but check it out in single block in fresh air first.

I can also show you a technique of repeating the scroll at various levels, if the scroll has to be cut to a depth greater than the tool will cope with in one go.

Post back if you require any further explanation, or help.

Regards,

Bill
Hi Bill,
Happy to meet you here too.
I wrote a lot of this type "path generating"acros. The oriblem is, that the movement of the machine is not smooth. If the number of steps wasn't very big and the machine had extended 500 variable memory, I firstly loaded the coordinates into variables and then only run the program. Is there any other way to overcome this problem ?
Reply With Quote
  #7 (permalink)  
Old 03-23-12, 06:56 PM
Senior CNC Specialist
 
Join Date: Jan 2012
Posts: 172
Thanks: 0
Thanked 23 Times in 20 Posts
Default Re: Fanuc Macro To Cut A Scroll

Quote:
Originally Posted by Probe View Post
Hi Bill,
Happy to meet you here too.
I wrote a lot of this type "path generating"acros. The oriblem is, that the movement of the machine is not smooth. If the number of steps wasn't very big and the machine had extended 500 variable memory, I firstly loaded the coordinates into variables and then only run the program. Is there any other way to overcome this problem ?
Hi Probe,
Likewise with the greeting.

For those reading Probe's first post, he is a pretty smart cookie and has a lot to offer to the Forum.

I've not done this with a Macro program, but many times in software, were speed of process was critical, few variables available relative to the amount of data generated, and the calculations verbose. I would build a FIFO rotary buffer, fill the buffer with data initially as you suggested and then reuse the variables as they became available.

With a machine tool being run DNC, this is easy to do, as there is Handshaking between the Machine and External Device; accordingly, its simple to know when the variable is available. I actually wrote software that would interpret User Maco language and send the resulting coordinates to a machine that didn't have the Macro option. Without giving it much thought, you may be able to do something in an Endless Loop and use the Block End Point variables, #5001–#5008, and a counter, to determine when X number of variables are again available. The escape from the Loop could be via a counter, or predetermined coordinate.

As you're aware, the movement of the machine is not smooth simply because the control is running out of data and is forced to wait until the Macro Routine catches up. Another main issue with small line segment profiles, is Acceleration/Deceleration and its effect on feed rate. Sinha, another poster, and I had quite a discussion in another forum regarding this. Unless the control is equipped with a Look Ahead function such as Fanuc's G08, then the physical feed rate will struggle to get anywhere near the set feed rate. Even G08 struggles if the change of direction between blocks is consistently abrupt.

In a timed run over one metre made up of incremental moves of 0.02mm, and at a feed rate of 5000mm/min, the travel consistently tool 12 seconds when G08 was initiated. Without G08, the time taken was something like 6 minutes. With the same number and length of moves as in the first straight line test, but this time with the slide dithering 0.02 each side of Zero, the time taken when G08 was invoked was the same as the straight line speed without G08; there was no opportunity for the control to optimize the Acceleration/Deceleration.

Regards,

Bill

Last edited by angelw; 03-23-12 at 07:07 PM.
Reply With Quote
  #8 (permalink)  
Old 03-24-12, 03:38 AM
CNC Professional
 
Join Date: Feb 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Fanuc Macro To Cut A Scroll

Thank you Bill.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
IMPORTANT DISCLAIMER
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Although The CNC Professional Forum has attempted to provide accurate information on the forum, The CNC Professional Forum assumes no responsibility for the accuracy of the information. All information is provided "as is" with all faults without warranty of any kind, either express or implied. Neither The CNC Professional Forum nor any of its directors, members, managers, employees, agents, vendors, or suppliers will be liable for any direct, indirect, general, bodily injury, compensatory, special, punitive, consequential, or incidental damages including, without limitation, lost profits or revenues, costs of replacement goods, loss or damage to data arising out of the use or inability to use this forum or any services associated with this forum, or damages from the use of or reliance on the information present on this forum, even if you have been advised of the possibility of such damages.


All times are GMT -5. The time now is 04:06 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
| Copyright ©2010-2011 CNC Professional Forum LLC
CNC Machinist Forums