Hello Guest it is April 26, 2024, 08:11:52 AM

Author Topic: G95 mill G99 lathe feed per revolution is it motion controller functn dependant?  (Read 2674 times)

0 Members and 1 Guest are viewing this topic.

As per the title?

How does mach4 obtain the spindle speed?

Encoder feedback?

Single pulse per revolution trigger?
Thanks

Rob
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Hi,
my experience is with the mill profile.

On Configure/Control/Spindle page there is a the opportunity to set a Feedback Ratio, ie number of pules per rev.

You could use a single pulse, eg the index pulse of an encoder or you could use one of the quadrature channels if the feedback
ratio is set appropriately. For example set it to 2500 and use one channel of a 2500 line encoder.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Thanks for that, also trying to figure out if it needs to be enabled (coded) within the motion controller (like treading) of if mach4 gets the feedback and internally adjusts the feedrate before sending the motion out to the motion controller
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
I would think that it is motion controller dependent. 
I am only use the HiCON Integra from Vital Systems now, but we've got 3 lathes with the Integra on them, all with an encoder to give me spindle feedback. 
I had to set up spindle feedback in the Motion Controlelr's Plugin Configuration.  I had to input the encoder counts per rev. X 4 (quadrature encoder).  It works great!
Chad Byrd
Hi,
the Mach settings I alluded to allow Mach to get spindle speed, Mach DOES NOT synchronise motion
for threading for instance, that is a motion controller function.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Craig,
I haven't checked this before...  Can Mach have single pulse feedback without having to go through the motion controller?
Chad Byrd
Hi,
at work at the moment so not able to check on my machine, but yes. There is a dedicated input
ISIG_INDEX, from memory, which Mach treats as an index pulse from the spindle.
It can be treated as a single pulse per rev or multi pulse per rev.

Note that it is a single input.....it wont give you MPG type results. Its perfectly adequate for speed monitoring
purposes but not really suitable for position.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Hi,
just re-reading this thread....Mach4 can and does use an index signal to measure spindle speed but it does not try to control the speed
as a result of the feedback. Nor does Mach attempt to use the feedback for synchronization purposes.

My understanding is that Warp9 had released lathe threading code, unfortunately it had a bug is the synchronization part. When they revisited that they decided to
increase the functionality of their plugin by offering multipulse per rev signaling and offering PID feedback control over the spindle. It is this major increase
in functionality that has delayed the lathe threading code by at least six months now.

The reason I mention it at all is because it highlights the division between a Mach function and a controller function.

Mach has a there-and-back communication delay of about 10ms. That would be way too slow to have an effective feedback control over a spindle, it would need
to be about 100 times faster for a feedback loop to be effective.

An external motion controller like an ESS does not suffer from the extended communication delay, it can respond in microseconds. Warp9 have never made any pretense
that their devices offer feedback control. It is quite a departure for them to work on PID feedback control of the spindle. My understanding is that the ESS will modulate
the PWM output to effect speed control so it is still a long way short of the sophistication required to close a position loop, none the less I am impressed.

Andy (Warp9) indicated that the company was intending to release a low level API which would allow users to program their own feedback solutions. Given the
glacial pace at which Warp9 convert intentions into reality I'm not getting too excited yet. I believe Andy announced this because this PID control of the spindle
is an example of what such an API is capable.

It may be, and is certainly hoped that the developments at Warp9 with regard to lathe threading may dovetail with an API and so we may get a 'python lump'
of new features and functions.

The timely response requirement is such that lathe threading will have to be a control board function, even if Mach's communication loop could be improved ten-fold
it would still not suffice for lathe threading. Even worse is that Windows is not a realtime system so even if Mach could magically communicate at the required speed
Windows would not.

So while Lua offers the possibility of programming for feedback control the underlying communications between Windows, Mach and the hardware are just to slow
for anything but slow processes like thermal control.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Thanks Craig for your post + taking the time.

The discussion is over G95/G99 (feed per revolution) not G33/G76 (threading cycles)

from what I've read on various forums of misinformation is that G95/G99 can be done one of two ways broadlly.

The easy way (1) is:
No spindle speed feedback, and feedback is set (statically) based upon the programmed / commanded spindle speed (S*********x)
eg
Code: [Select]
G95 (feed per revolution)
X100 S10000 F0.01

which translates to 0.01 units / revolution X 10,000 revolutions / min = 100 units / min.

hence it would be exactly the same as specifying
Code: [Select]
G94 (feed per min)
X100 S10000 F100

There is no gain with this sort of implementation really except you get a little less calculation to perform than you would on a lathe for example or even maybe a mill where you may multiply the feed/rev X the no of cutter teeth to get your corrected feedrate.

The more difficult way (2):
With spindle feedback
This basically will slow down or speed up the feedrate based upon the ACTUAL spindle speed.

It does not adjust the spindle speed at all (forget PID loops).  All it does is dynamically, during the motion it will adjust the ACTUAL feedrate relative to the ACTUAL spindle speed.

The feedback does not need to be that great / fast given the change in spindle speed is likely to be small (its not going to go from 10,000 rpm to 1,000 rpm or you'll probably break the tool / its indicated that you've broken the tool).... but what it may do is go from 10,000 to 9 or 8,000 and then back up to 10,000 as PID kicks in (seperatly looped / controlled), and up to 11 or 12,000 when the cut becomes easy before PID kicks in to slow it down.

so when the spindle is doing 8,000 rpm, its a good time to backoff on the feedrate a little (- < 20% from the target feedrate) and when its doing 12,000 rpm it would be a good time to bump the feedrate up a little (+ < 20% from the target feedrate) to compensate for the cut load.

PID is normally programmed under no load conditions from my experience, so under load when the cutter begins to cut or when the load reduces when the cutter comes out of the cut or is doing a zig-zag pocket and not a contour the "P" + "D" (proportional + derivative (if used) factors) will be too low and the "I" (integral factor) will be too high.

I did ask Andy at Warp9 yesterday and was given this reponse
Quote
I talked with one of the Mach4 developers, and he said:
All we need is spindle feedback. Then Mach does it all.  :)

There are a few discussion threads on G95/G99, here is one
https://www.practicalmachinist.com/vb/cnc-machining/milling-using-feed-per-revolution-g95-good-265234/

Apparently G95 is the default setting for Mazak machining centers, never used one {or ever likely to}, but its interesting all he same, another way to skin that same cat ;)
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Not to change the flow of this thread but my lathe manual, which may be out of date, does not state that g94 or g95 are supported.  I haven't tried it with my motion controller and the simulator complains that g95 is an unknown gcode.  G96 (Constant surface speed) is supported.

RT