Hi,

While I have been playing around with EMC since its invention, I have 
only recently started to use it seriously as I've only recently finished 
(as though it will ever be 'finished') a little cnc milling machine for 
making parts for the antique watches I restore and other miniature 
parts. I have been trying to work out a 'universal' script to allow me 
to mill tiny pinions but I've hit a problem in that it is giving me an 
error message I don't understand - I do wish that the developers of EMC 
would address the understandability of the various error messages to we 
simple users....

The machine is set up to use axes XYZA in metric with the 'A' axis set 
parallel to the 'Y' axis in this case so that the end of the work is 
clearly visible. The finished pinion OD is 1.40mm and it has 5 leaves of 
cycloidal profile - radial flanks with semicircular tips. The intention 
of the script is to use a miniature slitting saw 0.09mm thick to cut 
first one flank of each leaf, then the other flank and then to round 
over each side of the tips by taking cuts at 10 degree increments. I 
would ideally have liked to work out a way to make the tips continuously 
rounded but I don't seem to be able to find a way to do this over the 
length of the pinion - i.e. I could do it by sending the X, Z and A axes 
to a finishing point simultaneously and produce a rounded surface at one 
point on the length of the pinion but this would then have to be 
repeated many times to get a continuous edge. Anyway, here is the 
script...  the error message I am getting is "near line 2 .... unknown 
word where unary operation could be" - does this refer to line 2 of the 
script i.e. a problem amongst the variables, or is it a problem with 
line 0200 of the part of the script that runs and why does it say that a 
'unary operation 'could' be there'? Any help would be very much 
appreciated.... Ian

#D = 1.4        ( o.d )
#R = 0.38        (root dia)
#C = [[[#D] - [#R]] / 2]    (cut depth)
#N = 5            (number of teeth)
#L = 4            (lenght of cut)
#A = [360/[#N#]]    (angular increment)
#V = 0.09        (cutter thickness)
#Q = 1            (counter)
#T = 1            (tooth counter)
#S = 10            (step angle for rounding)
#r = [[#D]/2]        (radius of work)
#I = 10            (increment for rounding steps)
#F = 90            (final arc angle)

o100 sub        (cuts one slot in blank)
G1 X[[#C]/2] F4
Y[#L]
Y-[#L]
X[#C]
Y[#L]
Y-[#L]
endsub

o200 sub        (rounds half top of pinion leaf in several steps)
do
Z[[sin[#S]/[#r]] X[[cos[#S]/[#r]]
G1 Y[#L] F4
G0 Y-[L]
A[#I]
#S = [[#S]+[#I]]
while [#S] LT [#F]
endsub

o300 sub        (rounds other half top of pinion leaf in several steps)
do
Z-[[sin[#S]/[#r]] X[[cos[#S]/[#r]]
G1 Y[#L] F4
G0 Y-[L]
A-[#I]
#S = [[#S]+[#I]]
while [#S] LT [#F]
endsub

N0100 G92 X0 Y0 Z0    (set axes to zero)
N0200 G21 G91        (metric units, incremental moves)

N0300 do        (first cut of pinion leaves)
N0400 o100 call
N0500 #Q = [#Q] + 1    (increment counter)
N0600 A[360/[#N]]    (rotate work one tooth distance)
N0700 while #Q LT 5   (should this be 6?)

N0800 #Q = 1        (set counter back to 1)
N0900 A-[[#A]/3]    (rotate by thickness of pinion leaf and)
N1000 Z[#V]        (move cutter - saw - to other side of leaf)
N1100 do        (cut other side of pinion leaves)
N1200 o100 call
N1300 #Q = [#Q] + 1
N1400 A-[360/[#N]]
N1500 while #Q LT 5

N1600 #Q = 1        (set counter back to 1)
N1700 A[[#A]/6]        (move cutter to centre of leaf)
N1800 Z-[[#V]/2]    (                 )
N1900 do        (round over half the leaf and repeat for all leaves)
N2000 o200 call
N2100 #Q = [#Q] + 1
N2200 A[360/[#N]]
N2300 while #Q LT 5

N2400 #Q = 1        (set counter back to 1)
N2500 Z0 A-90        (set cutter and pinion leaf back to centre)
N2600 Z[[#V#/2]
N2700 do        (round over other half the leaf and repeat for all leaves)
N2800 o300 call
N2900 #Q = [#Q] + 1
N3000 A-[360/[#N]]
N3100 while #Q LT 5

N3200 #Q = 1        (clean up)
N3300 X-20 Z40 Y50    (retract tool)
N3200 G40



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to