Re: [Emc-users] Macro Language

2007-08-16 Thread ben lipkowitz
On Wed, 15 Aug 2007, Sven Mueller wrote:

sssnap!
 Also, as I mentioned in my previous mail, it's not clear how you need to
 wire the probe in hal: which input triggers the G38.2 to stop and
 print the position? I couldn't find that mentioned in the docs.

motion.probe-input
see http://www.linuxcnc.org/docs/html/config/emc2hal/index.html

 Finally: I'm not necessarily talking about scripting in the place where
 currently Gcode is executed.

Me either! I don't think gcode would play well with a more free-form 
language because of its weird syntax requirements. I think of g-code as 
more of a data format than a programming language. Whether it's human 
readable or not is irrelevant to the computer, and that's partly why we 
ended up with such an unreadable mess. Mostly my call for a macro 
language was because I couldn't read any g-code programs with lots of 
numeric variables.

 Well documented script (perl, lua, ruby, python) language bindings to 
 the movement and IO parts of emc2 would work just as well for me.

Definitely - the less wheel-reinventing the better. Getting a real 
full-featured programming language is a nice side effect!  I started 
thinking about how best to write a Python API for EMC. Didn't get very 
far, but I think the general idea is sound. In short, I'd rather have the 
script actually running the machine than just spitting out g-code to feed 
the g-code parser.

Please take a look here and add your comments: 
http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?PythonBindings

 Actually, what I would like to see is some relatively optimized version
 of surface scanning implemented with a GUI (perhaps in tkEMC or one of
 the other GUIs?). Since the existing GUIs already allow manual
 movements, I would think that all I would like to see (enter a position
 directly or by doing a manual movement, multiple scan passes with
 differently sized probe tips,...) should be possible using the same
 techniques currently used in the GUIs. Though I'm relatively good at C
 programming as well as Perl programming, I don't know how to build an
 interface between the two or how to use tcl.

i hacked together a probing gui for weyland a while ago based on 
gridprobe.ngc available here: 
http://fenn.dyndns.org/pub/emc/probebuddy.tgz

it's certainly not the most robust code ever.. my first attempt at tcl. i 
wonder if i should check it into cvs.

   -fenn

-
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


[Emc-users] Proglem with EMC script - understanding error message

2007-08-16 Thread [EMAIL PROTECTED]
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


Re: [Emc-users] Proglem with EMC script - understanding error message

2007-08-16 Thread Jeff Epler
When emc shows an error message with a line number, it refers to the
physical line number in the file, not an O- or N-number.

In emc 2.1, parameters are numbers, not letters.  So, for instance, you
can't write
#D=1.4
you must write
#7=1.4
and remember that later on, #7 refers to the o.d. of the part you're
making.

I spotted another error further down:
 Y-[#L]
Unfortunately emc2 gcode omits the negation operator.  You could write
this as
Y[-1*#8]
or
Y[0-#8]
but what you wrote will not be accepted.

Jeff

-
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


Re: [Emc-users] Proglem with EMC script - understanding error message

2007-08-16 Thread Gene Heskett
On Thursday 16 August 2007, [EMAIL PROTECTED] wrote:
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

I'm also a relative newbie at this, but all the examples, and all the code 
I've written (that worked, such as a hole in a stack of rubber sheets 
yesterday  which I need to do 2 more runs of today) have used numerical 
values for the storage locations of variables where you have used 
alphabetical characters.

Try this:
#1 = 1.4( o.d  Was #D)
#2 = 0.38   (root dia was #R)
#3 = [[[#1] - [#2]] / 2](cut depth was #C)
#4 = 5  (number of teeth was #N)
#5 = 4  (length of cut was #L)
#6 = [360/[#4]] (angular increment was #A, also removed extra #)
#7 = 0.09   (cutter thickness was #V)
#8 = 1  (counter was #Q)
#9 = 1  (tooth counter was #T)
#10 = 10(step angle for rounding was #S)
#11 = [[#1]/2]  (radius of work was #r)
#12 = 10  

Re: [Emc-users] Proglem with EMC script - understanding error message

2007-08-16 Thread Stephen Wille Padnos


Gene Heskett wrote:

[big snip]

Then, down in the call statements, the syntax I've found that works involves 
passing the vars to the subroutine like this example:

N0400 o100 call [#1][#2][#3][#4][#5][#6][#7][#8][#9][#10][#11][#12][#13]

The brackets are required to protect the variables from interpretation within 
the call statement itself.  You want to pass the variable, not its value, to 
the subroutine.

This seems to be required because of the isolation between the subroutines 
idea of variables and the main loops idea.  Also, anything a subroutine does 
to a variable is thrown away at the endsub, and that the call, sub, and 
endsub statements all need to have matching o word numbers.  Ditto for the 
start and end of 'conditional' statements.
  

I think the variables #1 through #30 (maybe #0 through #30 - I'm not 
sure if they start at 0 or 1) are locals, so any changes made to them 
in a subroutine are not visible to the calling program.  If you want to 
use a subroutine to modify a global variable, use #31 and higher.  You 
also don't need to pass in anything #31 or higher since they're global, 
so you can use higher var numbers for any constants and simplify the calls.

Using [#10] passes the value of var 10, just as #10 (without the 
brackets) does, AFAIK.  The difference is that after variable 
substitution is done, there is no way for the interpreter to decide that 
you really wanted one long number (made by concatenating the digits of 
all the vars you passed) - remember, the interp removes all spaces from 
the input line.  I'm not sure what order the variable replacement vs. 
numerical interpretation is done, but I'm pretty sure this is the reason 
that things work with brackets and may not without.

[medium snip]


-
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


Re: [Emc-users] Proglem with EMC script - understandin g error message

2007-08-16 Thread Gene Heskett
On Thursday 16 August 2007, Stephen Wille Padnos wrote:
Gene Heskett wrote:
[big snip]

Then, down in the call statements, the syntax I've found that works
 involves passing the vars to the subroutine like this example:

N0400 o100 call [#1][#2][#3][#4][#5][#6][#7][#8][#9][#10][#11][#12][#13]

The brackets are required to protect the variables from interpretation
 within the call statement itself.  You want to pass the variable, not its
 value, to the subroutine.

This seems to be required because of the isolation between the subroutines
idea of variables and the main loops idea.  Also, anything a subroutine
 does to a variable is thrown away at the endsub, and that the call, sub,
 and endsub statements all need to have matching o word numbers.  Ditto for
 the start and end of 'conditional' statements.

I think the variables #1 through #30 (maybe #0 through #30 - I'm not
sure if they start at 0 or 1) are locals, so any changes made to them
in a subroutine are not visible to the calling program.  If you want to
use a subroutine to modify a global variable, use #31 and higher.  You
also don't need to pass in anything #31 or higher since they're global,
so you can use higher var numbers for any constants and simplify the calls.

I was going to point that out too, but the verbosity meter was already pegged.
However, I make active use of this isolation in most of my code, as I see that 
as an advantage.

Using [#10] passes the value of var 10, just as #10 (without the
brackets) does, AFAIK.  The difference is that after variable
substitution is done, there is no way for the interpreter to decide that
you really wanted one long number (made by concatenating the digits of
all the vars you passed) - remember, the interp removes all spaces from
the input line.  I'm not sure what order the variable replacement vs.
numerical interpretation is done, but I'm pretty sure this is the reason
that things work with brackets and may not without.

The bottom line is that it doesn't work without them for what I've written, so 
I use them.  Your explanation is the correct one I suspect, since I've not 
even looked over the fence, let alone walked around in that code. :)

Thanks Stephen.

-- 
Cheers, Gene
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
The good life was so elusive
It really got me down
I had to regain some confidence
So I got into camouflage

-
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


Re: [Emc-users] Just a Thought

2007-08-16 Thread paul_c

Hi Ray

On Tuesday 14 August 2007 15:45, Ray Henry wrote:
 There was a heated discussion at that long ago FEST meeting in Ann Arbor
 when we created the EMC board.  It was related to it's (us) becoming a
 legal entity.

Outside of the USA, any entity would have little, if any power or status.

 It was my opinion, still is, that we need such an entity 
 so that we can accept and use contributions to the central benefit of
 the project -- contributions of code, cash, or whatever.

If you remember, part of the boards mandate was to act as an intermediatory 
to put interested parties in touch. e.g. Party A would offer hardware in 
exchange for suitable driver code.

 As for code contributions - Who decides what is good or bad ?

 I certainly respect the opinions of the others there that disagreed.  In
 fact as a condition of the creation of a board we voted that it would
 not become a legal entity and it would not accept nor distribute funds.

Setting up a legal entity would end up being a cash cow with little benefit 
for the majority - Who would audit the accounts, fund legal representation, 
or a whole other bunch of stuff...

 What those at the meeting did not know was that I had a couple thousand
 dollars in my pocket at that moment,

Likewise, there is still quite a considerable sum of dollars from the proceeds 
of BDI disks available - Some has already been used to purchase IO cards from 
the likes of Adlink, the remainder could be used for similar purposes.

 I wonder if it isn't time to rethink the legal entity.

If certain board members overstep their mandate, or fall back on a FU/O 
attitude to sidestep any issues/arguments, I doubt a legal entity would have 
any more credibility outside a gin house.


Regards, Paul.


-
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


Re: [Emc-users] Proglem with EMC script - understanding error message

2007-08-16 Thread [EMAIL PROTECTED]
Hi again,

Thanks to everyone who responded to my earlier mailing. As a result and 
after a considerable rewrite and correction I have now managed to get 
the script to load - however, it does nothing!! When I hit 'R' or press 
the play button, the screen flashes briefly and returns to the stop 
state - the machine doesn't even twitch...
Do I have a problem in trying to run nested 'do - while' loops, its the 
only thing I can think of that might do nothing. there are no error 
messages displayed.
Here is the rewritten script - any advice would be very welcome. 
Thanks.. Ian

%
#10 = 1.4( o.d )
#11 = 0.38(root dia)
#12 = [[#10 - #11] / 2](cut depth)
#13 = 5(number of teeth)
#14 = 4(length of cut)
#15 = [360/[#13]](angular increment)
#16 = 0.09(cutter thickness)
#17 = 1(counter)
#18 = 1(tooth counter)
#19 = 10(step angle for rounding)
#20 = [[#10]/2](radius of work)
#21 = 10(increment for rounding steps)
#22 = 90(final arc angle)

o100 sub(cuts one slot in blank)
G1 X[[#12]/2] F4
G1 Y[#14] F4
G0 Y[0-[#14]]
G1 X[#12] F4
G1 Y[#14] F4
G0 Y[0-[14]]
endsub

o200 sub(rounds half top of pinion leaf in several steps)
do
G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]
G1 Y[#14] F4
G0 Y[0-[#14]]
G0 A[#21]
#10 = [[#10]+[#21]]
while [#10] LT [#22]
endsub

o300 sub(rounds other half top of pinion leaf in several steps)
do
G0 Z[0-[[sin[#10]/[#20]] X[[cos[#10]/[#20]]]
G1 Y[#14] F4
G0 Y[0-[#14]]
G0 A[0-[#21]]
#10 = [[#10]+[#21]]
while [#10] LT [#22]
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 [#12][#14]
N0500 [#17] = [#17] + 1(increment counter)
N0600 G0 A[360/[#13]](rotate work one tooth distance)
N0700 while [#17] LT 5

N0800 [#17] = 1(set counter back to 1)
N0900 G0 A[0-[[#15]/3]](rotate by thickness of pinion leaf and)
N1000 G0 Z[#16](move cutter - saw - to other side of leaf)
N1100 do(cut other side of pinion leaves)
N1200 o100 call [#12][#14]
N1300 [#17] = [#17] + 1
N1400 G0 A[0-[360/[#13]]]
N1500 while [#17] LT 5
N1600 [#17] = 1(set counter back to 1)
N1700 G0 A[[#15]/6](move cutter to centre of leaf)
N1800 G0 Z[0-[[#16]/2]( )
N1900 do(round over half the leaf and repeat for all leaves)
N2000 o200 call [#10][#14][#20][#21][#22]
N2100 #17 = [#17] + 1
N2200 G0 A[360/[#13]]
N2300 while #17 LT 5

N2400 #17 = 1(set counter back to 1)
N2500 G0 Z0 A-90(set cutter and pinion leaf back to centre)
N2600 G0 Z[[#16]/2]
N2700 do(round over other half the leaf and repeat for all

leaves)
N2800 o300 call [#10][#14][#20][#21][#22]
N2900 #17 = [#17] + 1
N3000 G0 A[0-[360/[#13]]]
N3100 while #17 LT 5

N3200 #17 = 1(clean up)
N3300 G0 X-20 Z40 Y50(retract tool)
N3200 G30
%

-- 
Best wishes,

Ian

Ian W. Wright
Sheffield  UK

The difference between theory and practice is much smaller in theory 
than in practice...


-- 
Best wishes,

Ian

Ian W. Wright
Sheffield  UK

The difference between theory and practice is much smaller in theory than in 
practice...


-
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


Re: [Emc-users] Proglem with EMC script - understanding error message

2007-08-16 Thread Alan Condit
Ian,

I would not recommend using #1 - #30 as global variables. Try  
something like this.  It works for me.

#510 = 1.4  ( o.d )
#511 = 0.38 (root dia)
#512 = [[#510 - #511] / 2](cut depth)
#513 = 5(number of teeth)
#514 = 4(length of cut)
#515 = [360/[#513]] (angular increment)
#516 = 0.09 (cutter thickness)
#517 = 1(counter)
#518 = 1(tooth counter)
#519 = 10   (step angle for rounding)
#520 = [[#510]/2]   (radius of work)
#521 = 10   (increment for rounding steps)
#522 = 90   (final arc angle)

   (cuts one slot in blank)
o100 sub [1] [2]( declare the formal parameters -- I don't  
know if this is necessary but it helps keep things straight )
G1 X[[#1]/2] F4
G1 Y[#2] F4
G0 Y[0-[#2]]
G1 X[#1] F4
G1 Y[#2] F4
G0 Y[0-[#2]]
endsub

O100 CALL [#512] [#514]  (pass the variables or values that you want  
to use as local parameters)

Good luck,
Alan

---

Alan Condit
1085 Tierra Ct.
Woodburn, OR 97071

Email -- [EMAIL PROTECTED]
Home-Office (503) 982-0906

On Aug 16, 2007, at Aug 16, 2007--3:23 PM, emc-users- 
[EMAIL PROTECTED] wrote:

 Message: 7
 Date: Thu, 16 Aug 2007 23:24:07 +0100
 From: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Subject: Re: [Emc-users] Proglem with EMC script - understanding error
   message
 To: emc-users@lists.sourceforge.net
 Message-ID: [EMAIL PROTECTED]
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 Hi again,

 Thanks to everyone who responded to my earlier mailing. As a result  
 and
 after a considerable rewrite and correction I have now managed to get
 the script to load - however, it does nothing!! When I hit 'R' or  
 press
 the play button, the screen flashes briefly and returns to the stop
 state - the machine doesn't even twitch...
 Do I have a problem in trying to run nested 'do - while' loops, its  
 the
 only thing I can think of that might do nothing. there are no error
 messages displayed.
 Here is the rewritten script - any advice would be very welcome.
 Thanks.. Ian

 %
 #10 = 1.4( o.d )
 #11 = 0.38(root dia)
 #12 = [[#10 - #11] / 2](cut depth)
 #13 = 5(number of teeth)
 #14 = 4(length of cut)
 #15 = [360/[#13]](angular increment)
 #16 = 0.09(cutter thickness)
 #17 = 1(counter)
 #18 = 1(tooth counter)
 #19 = 10(step angle for rounding)
 #20 = [[#10]/2](radius of work)
 #21 = 10(increment for rounding steps)
 #22 = 90(final arc angle)

 o100 sub(cuts one slot in blank)
 G1 X[[#12]/2] F4
 G1 Y[#14] F4
 G0 Y[0-[#14]]
 G1 X[#12] F4
 G1 Y[#14] F4
 G0 Y[0-[14]]
 endsub

 o200 sub(rounds half top of pinion leaf in several steps)
 do
 G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]
 G1 Y[#14] F4
 G0 Y[0-[#14]]
 G0 A[#21]
 #10 = [[#10]+[#21]]
 while [#10] LT [#22]
 endsub

 o300 sub(rounds other half top of pinion leaf in several  
 steps)
 do
 G0 Z[0-[[sin[#10]/[#20]] X[[cos[#10]/[#20]]]
 G1 Y[#14] F4
 G0 Y[0-[#14]]
 G0 A[0-[#21]]
 #10 = [[#10]+[#21]]
 while [#10] LT [#22]
 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 [#12][#14]
 N0500 [#17] = [#17] + 1(increment counter)
 N0600 G0 A[360/[#13]](rotate work one tooth distance)
 N0700 while [#17] LT 5

 N0800 [#17] = 1(set counter back to 1)
 N0900 G0 A[0-[[#15]/3]](rotate by thickness of pinion leaf and)
 N1000 G0 Z[#16](move cutter - saw - to other side of leaf)
 N1100 do(cut other side of pinion leaves)
 N1200 o100 call [#12][#14]
 N1300 [#17] = [#17] + 1
 N1400 G0 A[0-[360/[#13]]]
 N1500 while [#17] LT 5
 N1600 [#17] = 1(set counter back to 1)
 N1700 G0 A[[#15]/6](move cutter to centre of leaf)
 N1800 G0 Z[0-[[#16]/2]( )
 N1900 do(round over half the leaf and repeat for all leaves)
 N2000 o200 call [#10][#14][#20][#21][#22]
 N2100 #17 = [#17] + 1
 N2200 G0 A[360/[#13]]
 N2300 while #17 LT 5

 N2400 #17 = 1(set counter back to 1)
 N2500 G0 Z0 A-90(set cutter and pinion leaf back to centre)
 N2600 G0 Z[[#16]/2]
 N2700 do(round over other half the leaf and repeat for all

 leaves)
 N2800 o300 call [#10][#14][#20][#21][#22]
 N2900 #17 = [#17] + 1
 N3000 G0 A[0-[360/[#13]]]
 N3100 while #17 LT 5

 N3200 #17 = 1(clean up)
 N3300 G0 X-20 Z40 Y50(retract tool)
 N3200 G30
 %

 -- 
 Best wishes,

 Ian
 
 Ian W. Wright
 Sheffield  UK

 The difference between theory and practice is much smaller in theory
 than in practice...


 -- 
 Best wishes,

 Ian
 
 Ian W. Wright
 Sheffield  UK

 The difference between theory and practice is much smaller in  
 theory than in practice...


-
This SF.net email is sponsored 

Re: [Emc-users] Proglem with EMC script - understandin g error message

2007-08-16 Thread Gene Heskett
On Thursday 16 August 2007, [EMAIL PROTECTED] wrote:
Hi again,

Thanks to everyone who responded to my earlier mailing. As a result and
after a considerable rewrite and correction I have now managed to get
the script to load - however, it does nothing!! When I hit 'R' or press
the play button, the screen flashes briefly and returns to the stop
state - the machine doesn't even twitch...
Do I have a problem in trying to run nested 'do - while' loops, its the
only thing I can think of that might do nothing. there are no error
messages displayed.
Here is the rewritten script - any advice would be very welcome.
Thanks.. Ian

%
#10 = 1.4( o.d )
#11 = 0.38(root dia)
#12 = [[#10 - #11] / 2](cut depth)
#13 = 5(number of teeth)
#14 = 4(length of cut)
#15 = [360/[#13]](angular increment)
#16 = 0.09(cutter thickness)
#17 = 1(counter)
#18 = 1(tooth counter)
#19 = 10(step angle for rounding)
#20 = [[#10]/2](radius of work)
#21 = 10(increment for rounding steps)
#22 = 90(final arc angle)

o100 sub(cuts one slot in blank)
G1 X[[#12]/2] F4
G1 Y[#14] F4
G0 Y[0-[#14]]
G1 X[#12] F4
G1 Y[#14] F4
G0 Y[0-[14]]
endsub

o200 sub(rounds half top of pinion leaf in several steps)
do
G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]
G1 Y[#14] F4
G0 Y[0-[#14]]
G0 A[#21]
#10 = [[#10]+[#21]]
while [#10] LT [#22]
endsub

o300 sub(rounds other half top of pinion leaf in several steps)
do
G0 Z[0-[[sin[#10]/[#20]] X[[cos[#10]/[#20]]]
G1 Y[#14] F4
G0 Y[0-[#14]]
G0 A[0-[#21]]
#10 = [[#10]+[#21]]
while [#10] LT [#22]
endsub

There is the M101 command, which can be used to print out the values as they 
exist here and there, which can also be educational.

N0100 G92 X0 Y0 Z0(set axes to zero)

And one could start with Z preset several inches high, giving you time to hit 
the pause button and then single step it while its running down to the zero 
point.

N0200 G21 G91(metric units, incremental moves)

N0300 do(first cut of pinion leaves)
N0400 o100 call [#12][#14]
N0500 [#17] = [#17] + 1(increment counter)
N0600 G0 A[360/[#13]](rotate work one tooth distance)
N0700 while [#17] LT 5

Ahh, I think your do  while need to be matching o words.

N0800 [#17] = 1(set counter back to 1)
N0900 G0 A[0-[[#15]/3]](rotate by thickness of pinion leaf and)
N1000 G0 Z[#16](move cutter - saw - to other side of leaf)
N1100 do(cut other side of pinion leaves)
N1200 o100 call [#12][#14]
N1300 [#17] = [#17] + 1
N1400 G0 A[0-[360/[#13]]]
N1500 while [#17] LT 5
N1600 [#17] = 1(set counter back to 1)
N1700 G0 A[[#15]/6](move cutter to centre of leaf)
N1800 G0 Z[0-[[#16]/2]( )
N1900 do(round over half the leaf and repeat for all leaves)
N2000 o200 call [#10][#14][#20][#21][#22]
N2100 #17 = [#17] + 1
N2200 G0 A[360/[#13]]
N2300 while #17 LT 5

N2400 #17 = 1(set counter back to 1)
N2500 G0 Z0 A-90(set cutter and pinion leaf back to centre)
N2600 G0 Z[[#16]/2]
N2700 do(round over other half the leaf and repeat for all

leaves)
N2800 o300 call [#10][#14][#20][#21][#22]
N2900 #17 = [#17] + 1
N3000 G0 A[0-[360/[#13]]]
N3100 while #17 LT 5

N3200 #17 = 1(clean up)
N3300 G0 X-20 Z40 Y50(retract tool)
N3200 G30
%

--
Best wishes,

Ian

Ian W. Wright
Sheffield  UK

The difference between theory and practice is much smaller in theory
than in practice...

Now that's a true statement if there ever was one...

-- 
Cheers, Gene
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
I've got a bad feeling about this.

-
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


[Emc-users] This is a test

2007-08-16 Thread amtb
This is a test

-
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


Re: [Emc-users] Proglem with EMC script - understanding error message

2007-08-16 Thread Jeff Epler
I spotted several more errors in your program.

 #10 = 1.4( o.d )
...
 #22 = 90(final arc angle)
Parameters up to 30 are used for subroutine arguments.  Use parameters
above 30 for global variables:

#40 = 1.4( o.d )
...
#52 = 90(final arc angle)

 o200 sub(rounds half top of pinion leaf in several steps)
 do
 G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]
 G1 Y[#14] F4
 G0 Y[0-[#14]]
 G0 A[#21]
 #10 = [[#10]+[#21]]
 while [#10] LT [#22]
 endsub

Numbers are required for the beginning and end of a subroutine, loop, or
conditional.  So your code should look more like:
O200 sub ...
O201 do
...
O201 while ...
O200 endsub
It's the missing O100 for the first endsub that makes emc run off
the end of the program without doing anything -- it's looking for O100
endsub and nothing else will do.

 while [#10] LT [#22]
the correct syntax is
O201 while [#10 LT #22]

 G1 Y[#14] F4
Brackets are not necessary here, but not harmful either

 N0500 [#17] = [#17] + 1(increment counter)
The correct bracketing is:
#17=[#17+1]
In addition to the original, these are both incorrect:   
[#17]=[#17+1]
#17=[#17]+1

 G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]
The correct bracketing is:
G0 Z[sin[#10]/#20]
if you want to compute what would be written sin(x)/y in many other
languages, or
G0 Z[sin[#10/#20]]
if you want to compute what would be written sin(x/y) in many other
languages.

 N2000 o200 call [#10][#14][#20][#21][#22]
Inside O200 sub, you refer to #10, #14, #21, #21, and #22 which are the
numbers of the variables you intended to be global.  You could either
omit these parameters from O200 call and use the global variable numbers
once you renumber them to be above 30.  Or, inside O200 sub you could
refer to them as #1 through #5.

On Thu, Aug 16, 2007 at 11:24:07PM +0100, [EMAIL PROTECTED] wrote:
 Hi again,
 
 Thanks to everyone who responded to my earlier mailing. As a result and 
 after a considerable rewrite and correction I have now managed to get 
 the script to load - however, it does nothing!! When I hit 'R' or press 
 the play button, the screen flashes briefly and returns to the stop 
 state - the machine doesn't even twitch...
 Do I have a problem in trying to run nested 'do - while' loops, its the 
 only thing I can think of that might do nothing. there are no error 
 messages displayed.
 Here is the rewritten script - any advice would be very welcome. 
 Thanks.. Ian
 
 %
 #10 = 1.4( o.d )
 #11 = 0.38(root dia)
 #12 = [[#10 - #11] / 2](cut depth)
 #13 = 5(number of teeth)
 #14 = 4(length of cut)
 #15 = [360/[#13]](angular increment)
 #16 = 0.09(cutter thickness)
 #17 = 1(counter)
 #18 = 1(tooth counter)
 #19 = 10(step angle for rounding)
 #20 = [[#10]/2](radius of work)
 #21 = 10(increment for rounding steps)
 #22 = 90(final arc angle)
 
 o100 sub(cuts one slot in blank)
 G1 X[[#12]/2] F4
 G1 Y[#14] F4
 G0 Y[0-[#14]]
 G1 X[#12] F4
 G1 Y[#14] F4
 G0 Y[0-[14]]
 endsub
 
 o200 sub(rounds half top of pinion leaf in several steps)
 do
 G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]
 G1 Y[#14] F4
 G0 Y[0-[#14]]
 G0 A[#21]
 #10 = [[#10]+[#21]]
 while [#10] LT [#22]
 endsub
 
 o300 sub(rounds other half top of pinion leaf in several steps)
 do
 G0 Z[0-[[sin[#10]/[#20]] X[[cos[#10]/[#20]]]
 G1 Y[#14] F4
 G0 Y[0-[#14]]
 G0 A[0-[#21]]
 #10 = [[#10]+[#21]]
 while [#10] LT [#22]
 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 [#12][#14]
 N0500 [#17] = [#17] + 1(increment counter)
 N0600 G0 A[360/[#13]](rotate work one tooth distance)
 N0700 while [#17] LT 5
 
 N0800 [#17] = 1(set counter back to 1)
 N0900 G0 A[0-[[#15]/3]](rotate by thickness of pinion leaf and)
 N1000 G0 Z[#16](move cutter - saw - to other side of leaf)
 N1100 do(cut other side of pinion leaves)
 N1200 o100 call [#12][#14]
 N1300 [#17] = [#17] + 1
 N1400 G0 A[0-[360/[#13]]]
 N1500 while [#17] LT 5
 N1600 [#17] = 1(set counter back to 1)
 N1700 G0 A[[#15]/6](move cutter to centre of leaf)
 N1800 G0 Z[0-[[#16]/2]( )
 N1900 do(round over half the leaf and repeat for all leaves)
 N2000 o200 call [#10][#14][#20][#21][#22]
 N2100 #17 = [#17] + 1
 N2200 G0 A[360/[#13]]
 N2300 while #17 LT 5
 
 N2400 #17 = 1(set counter back to 1)
 N2500 G0 Z0 A-90(set cutter and pinion leaf back to centre)
 N2600 G0 Z[[#16]/2]
 N2700 do(round over other half the leaf and repeat for all
 
 leaves)
 N2800 o300 call [#10][#14][#20][#21][#22]
 N2900 #17 = [#17] + 1
 N3000 G0 A[0-[360/[#13]]]
 N3100 while #17 LT 5
 
 N3200 #17 = 1(clean up)
 N3300 G0 X-20 Z40 Y50(retract tool)
 N3200 G30
 %
 
 -- 
 Best wishes,
 
 Ian
 
 Ian W. 

[Emc-users] Floating Z (solenoid on PCB Mill) Hal configuration

2007-08-16 Thread [EMAIL PROTECTED]
In case anyone else has one of these PCB mills with the solenoid driven floating Z, I thought I would share my configuration changes. The premise I worked with was that if I could take the commanded Z position and convert it to a bit output to my solenoid relay I could use the standard drill and move codes with it. So I connected the Zpos-cmd and a constant "0" to a comparator and then routed that to the par-port. Now any commanded Z position 0 or greater results in the head up and any Z command less than 0 puts the head down. Here is what I did, let me know if it could use any adjustments, I am new to this hal thing.
In stepper_inch.ini I added a line for my new hal file:
HALFILE= solenoid_Z.hal
My new hal file solenoid_Z.hal contains:
loadrt blocks constant=1 comp=1
constant.0.value=0
newsig constcomp float
linksp constcomp comp.0.in1
linksp Zpos-cmd comp0.in0
newsig discrete_Z bit
linksp discrete_Z comp.0.out
linksp discrete_Z parport.0.pin-07-out
addf constant.0 servo-thread
addf comp.0 servo-thread
That's it. After a few syntax problems it worked. I am quite happy.
Have fun,
Tony-
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


Re: [Emc-users] Proglem with EMC script - understandin g error message

2007-08-16 Thread Gene Heskett
On Thursday 16 August 2007, Jeff Epler wrote:
I spotted several more errors in your program.

 #10 = 1.4( o.d )

...

 #22 = 90(final arc angle)

Parameters up to 30 are used for subroutine arguments.  Use parameters
above 30 for global variables:

#40 = 1.4( o.d )
...
#52 = 90(final arc angle)

 o200 sub(rounds half top of pinion leaf in several steps)
 do
 G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]
 G1 Y[#14] F4
 G0 Y[0-[#14]]
 G0 A[#21]
 #10 = [[#10]+[#21]]
 while [#10] LT [#22]
 endsub

Numbers are required for the beginning and end of a subroutine, loop, or
conditional.  So your code should look more like:
O200 sub ...
O201 do
...
O201 while ...
O200 endsub
It's the missing O100 for the first endsub that makes emc run off
the end of the program without doing anything -- it's looking for O100
endsub and nothing else will do.

 while [#10] LT [#22]

the correct syntax is
O201 while [#10 LT #22]

 G1 Y[#14] F4

Brackets are not necessary here, but not harmful either

 N0500 [#17] = [#17] + 1(increment counter)

The correct bracketing is:
#17=[#17+1]
In addition to the original, these are both incorrect:
[#17]=[#17+1]
#17=[#17]+1

 G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]

The correct bracketing is:
G0 Z[sin[#10]/#20]
if you want to compute what would be written sin(x)/y in many other
languages, or
G0 Z[sin[#10/#20]]
if you want to compute what would be written sin(x/y) in many other
languages.

 N2000 o200 call [#10][#14][#20][#21][#22]

Inside O200 sub, you refer to #10, #14, #21, #21, and #22 which are the
numbers of the variables you intended to be global.  You could either
omit these parameters from O200 call and use the global variable numbers
once you renumber them to be above 30.  Or, inside O200 sub you could
refer to them as #1 through #5.

Thanks for the lengthy explanation Jeff, I'm learning things from this myself.  
I wasn't aware that the subs treated passed arguments as a completely 
different numbering system, starting I assume at 1, and going up in the order 
of their location in the 'oxxx call' lines list. 

The wiki would be better if some of this reasoning was included, it is a 
bit 'dry' shall we say?

[...]

-- 
Cheers, Gene
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
It's God.  No, not Richard Stallman, or Linus Torvalds, but God.
(By Matt Welsh)

-
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


Re: [Emc-users] Floating Z (solenoid on PCB Mill) Hal configuration

2007-08-16 Thread Jeff Epler
Thanks -- I imagine this will be helpful to anyone with a similar
system.

the only thing that comes to mind is that the time emc spends on the Z
motion had better be long enough for the solenoid to completely lower --
does this take long on your machine, or does it snap right down to the
right depth before you can blink?

Jeff

-
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