Hi Michael,

On 03/17/2011 06:38 AM, Michael Haberler wrote:
> M19 [R<orientation in degrees; defaults to 0>] [L<orientation cw/ccw>]
> 
> this is how I'd do it: 
> - turn off the spindle

Here I would insert an additional step...

  - wait for spindle-at-zero

...because if we change the spindle drive from spindle mode
to servo mode while the spindle is at full RPM, we're probably
going to break or burn out something.

Most good spindle drives that are suitable for orientation have
multiple sets of parameters available. Two is sort of the minimum,
many have four sets or more. This is what allows you to put a +10V
step function on a spindle drive and get a nice steady ramp up (or
down) over several seconds. But we can't run that way in servo mode,
it has to be instantaneous. Hence the need for two or more drive
parameters.

Since a spindle encoder is used for orientation, the spindle-at-zero
detector (via encoder) should be able to be fairly high quality.

> - set a HAL pin spindle-orientation line to convey the degrees value

I'll leave this step here even though we're early (not in servo yet).
Yes, this might be handy, even machines without a tool changer might
benefit from this for such things as oriented-boring-bar-withdrawal.
But there's a problem with bar-orientation, more on this later.

> - set a HAL pin spindle-direction line to convey the cw/ccw direction

Yes, this might be good, because it would make sure that in-the-hole
boring bars, etc. would always be rotated the "correct" direction
for the tooltip. But won't that play hell with with our PID servoing
action?

I'll have to leave this to others who know more about whether
EMC2/HALs PID loop can be "guided"(?) in such a way. But I have to
wonder if this isn't going to cause more bother than it's worth?

If we don't try to set the bar rotation direction, and the bar
is always withdrawn (we don't offer bar-orientation), then we can
just turn the servo on and let it "flop" to the right position.

Comments and advice on this invited.

> - assert a HAL pin orient-spindle line

Now we're ready to turn the spindle back on (in servo mode).

  - turn spindle back on (now in servo mode)
  - EMC2/HAL begins closing the PID loop on the spindle
    (spindle begins servoing to oriented position)

Watch the spindle encoder, and wait for orientation.

> - wait for a spindle-oriented HAL pin line to become true

Now we're oriented, and we're telling a tool changer that it's
time to start the tool change, but there's a problem.

A tool changer start is an external event, and at some point,
hopefully, we'll get tool change done back as a result. So
there's an external event (long after orientation) that says
"quit M19 and continue with the next g-code step".

With boring-bar-orientation, when the spindle is oriented,
we're done, we want to exit M19 and go on with the next g-code
steps right away to remove the boring bar.

So maybe we need another M19 argument, maybe Q0 (default),
"Stay in M19 forever until some external event occurs" vs.
Q1 "When M19 fully reached, we're done, drop it and move on."

I should add by way of explanation that that M19 doesn't
have to stay on during boring bar withdrawal, since if the
spindle "relaxes" a few degrees at the end of M19, that's
usually good enough to remove a boring bar from a hole. But
M19 usually stays on during a tool change since if the spindle
would relax even a fraction of a degree, that could be enough
to foul a tool change arm.

We stay in servo mode for position holding as long as we
still need the M19 command on. When we're done with M19
(for either reason), we have some cleanup to do before we
can exit:

  - turn spindle back off (still in servo mode)
  - EMC2/HAL can stop closing the spindle servo loop

Cancel the spindle servo mode (drive parameters to "normal").

  - clear the HAL pin orient-spindle line

Now we're out of servo mode with the spindle off.

We don't care about the spindle-oriented HAL pin line now.

I think at this point we're OK to exit the M19 cleanup,
and the M19 command, unless I've forgotten something.

Comments, suggestions and advice invited and appreciated.

Hope this helps.

Kim



------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to