CAD CAM EDM DRO - Yahoo Group Archive

Re: M-functions and remarks

Posted by Ray Henry
on 1999-12-05 11:15:31 UTC
From: "Jan" <postmaster@...>
>Subject: M-functions and remarks

>1. I noticed some problems with the M-functions. I'm using M7-M8-M9 to
fulfil some tasks. The program code is like this:
>
>N1 G21 F500
>N2 G0 X0 Y0 Z0
>N3 M7
>N4 Z5
>N5 M9
>N6 M0
>...
>
>The problem hereby is that M9 will not be executed (sometimes) unless the
program is restarted.

I tried you're code on my stepper. (50+ automated runs) Got something goofy
one time but couldn't figure it out 'cause the loop I was using didn't trap
it soon enough.

Your problem may be with the read ahead in the emc and the option stop.
Seems to me that I had a similar problem some time back with something that
tended to stop to soon. I've also heard of option stop problems with
commercial machines.

I'd try a dwell before m0. For the same length dwell that you get with z5
you can use (g4 p0.1). (5mm move/500mm feed) If you put the dwell on the
same line as the m0, the dwell will be executed first. (N6 M0 G4 P0.1)

>3. Fred, if we all on this list send you a birthday-card can we convince
you for the need of two additional functions in EMC.
>The first is that we can nest programs.

I think that this can be done already -- within limits. Each nest would
have to be a separate file and you would have to be sure that each file
assumes the default set of modal codes when it starts. You'd just have to
write an extension to a Tkgui to call and autostart the next file when the
previous one completes. I'll play with the idea some and get back.

>A further way of thinking is when programs can work with 'parameters',
read variables who can be placed for every value in a program, it could
look like:
>
> G0 X = P1 Y= P2 F=P3
>
>then our private library is even more friendly. By example; when a user
needs to mill an ellipse he can make a program for every size he needs.
But when working with parameters he can just fill in the value for A and B
to have any size wanted.

You example assumes two things. The first is fixed value parameters that
can be read into a part program. That's in there. The .var file will do
it. EMC will accept and use any number up to 5000+ as a variable. Those
already in the generic var are reserved for coordinate offsets but i think
that you could use most any other lower number as a parameter in your
program. The pound (#??) sign followed by the parameter number will use
the second number on the same line as the (??) in your .var file. This is
explained in the RS274NGC files on the EMC download site. (It's also in the
G and M code help file on my gui.)

There are even a bunch of operators (+ - sin ...) that you can use as long
as the program word you are constructing can be computed to a real number
at the time of execution.

The second half of your example suggests the computation of one value based
on a change in another value. I don't think that you can directly take the
value of the x axis and use it to compute a value for a y move -- yet. The
circular arc functions do this with the equation (x + y = c) where c is
figured from the i,j,k,r input. Elliptical, parabolic, or Mandelbrot
interpolation just ain't there - yet.

A Tcl interface could do elliptical interpolation, but it would be really
clunky to load the result into EMC and any part produced that way would
have pretty bad surface finish.

I believe that you could approximate an ellipse using a set of circular
arcs and the computation functions in the EMC interpreter. Then you could
load parameters and have the program cut different size ellipses. I did
this once, long ago, with a Mazak, a Commodore Vic 20, and a drip feed.

Ray

Discussion Thread

Jan 1999-12-03 05:08:45 UTC M-functions and remarks Ray Henry 1999-12-05 11:15:31 UTC Re: M-functions and remarks