Hello Guest it is March 28, 2024, 06:31:04 AM

Author Topic: Step/Dir control of spindle?  (Read 8974 times)

0 Members and 1 Guest are viewing this topic.

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Step/Dir control of spindle?
« Reply #10 on: March 17, 2018, 10:19:47 PM »
Hi Craig

I understand about your enthusiasm for AC servos - no worries. Sounds well-supported.

But I have a rather large Baldor industrial DC motor already mounted on my CNC. 180 V nominal, 3 A nominal, although it has run at 6-8 A briefly (an oops moment). I don't want to replace this motor right now as it runs so well, and has so much guts.

Yes, one could go with the up/down counter approach as well. It's the feedback around the counter or the phase-lock loop that manages the PID bit. Or you could program the TI chip with PID software, working in the s-plane. All the same thing in some ways.
So my Q is what is the least effort to get to where I want to be - precision spindle speed and STABLE threading, with my hardware. With a background thought that i wonder how many others would be interested in such a small black box?

Thinking ...

Cheers
Roger
Re: Step/Dir control of spindle?
« Reply #11 on: March 18, 2018, 12:03:15 AM »
Hi Roger,
yes those Baldor servos are the very best quality, you certainly want to keep using it, whats the bet it outlasts us both.

Is it fitted with an encoder or a resolver? I know a lot were fitted with resolvers. I have a big kick-arse servo  fitted with a resolver and I'm making a Field Oriented
Control for it. The TI micro does a very nice job of producing sinusoidal excitation and synchronous detection. It could be done analogue, in fact I did make an
analogue exciter while I was experimenting but it becomes very time consuming. In fact, except for very simple stuff, high quality analogue is more time consuming
than digital.

If I were designing/making something that might find some modest market appeal I would go digital because of the flexibility it confers. Rather than change a resistor
or capacitor for adjustment of a PID loop for instance a simple parameter change with a digital solution. If I were making for myself I would be more inclined to an
analogue solution, I still get a blast out of designing my own analogue circuits. Under those circumstances I would be doing it as a hobby and any time I spend is
for fun.

How close or tight do you want the control to be? I would guess that a load/no-load regulation of a few percent would suffice for lathe threading...would you agree?
Either digital or analogue would achieve that easily. Beyond that level of control analogue becomes increasingly difficult, any drift or leakage current or noise.....
and control accuracy goes out the window.

My AC servo, within its torque limit (rated 6Nm, O'Load 18Nm) is good to (20/8000)=0.0025 or 0.25%. You can see why I like these AC servos ....1/4%... straight out
of the box!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Step/Dir control of spindle?
« Reply #12 on: March 18, 2018, 12:23:12 AM »
Hi Roger,
when I was programming my controller for the servo I required only a PI loop. I did it using delays, I guess you'd say a Z plane approach, very similar
to the s plane approach. I found that how you managed integrator wind-up rather more important or at least as important than the PI gain constants.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Step/Dir control of spindle?
« Reply #13 on: March 18, 2018, 12:38:27 AM »
Hi Craig

Yes, it's very robust. And I have it. :-) Plus some spares by EEG I think.

It is fitted with an encoder - 256 line or 512 line, A+B+I. Old HP (or subsequent) unit, same as on axis servos. Reliable.

Either analog or digital control. If I went for a phase-lock loop, it would of course be 'analog'. I have built those before for some very strange things, and they work very well. Some delicate design needed to get the start-up right, to avoid massive hunting at the start. Most of my designs in the past have had a known centre frequency: this would be different.

If I go digital with an up/down counter, it would be an s-plane servo control using a microP.

In either case I would expect the ESS to be outputting the Step pulses at the required rate of spin*encoder. In this case I would expect overall spin accuracy of well under 0.01% at most speeds. That is good enough for some very fine threading. Stability - not so sure, but with a 512 line encoder I would be expecting fairly fast and effective response to any transients. The spindle drive PS is a KBWT-26 MOSFET switcher. Very gutsy with huge overload capacity, albeit also with incredible RF noise possibilities. I had to deal with that to keep the CNC positions stable.

To my mind, the difficulties in either case would be handling the transients at start-up and what happens when you accidentally stick a threading tool into the stock a bit too far. So I am wondering whether anyone else has already done this and is willing to share info. Much easier if someone else has banged their knuckles first.

S-plane vs z-plane: well, we tend to use the phrase s-plane even though we are working in digital space. But yes. As for wind-up on the integrator - one can do all sorts of good tricks there in the digital space, like limiting the size of any term in the equation. One can also do some very nice things like introducing 'anti-dither' at the digital level, to prevent servo grumbling. I WISH the Gecko servos had this.

Cheers
Roger

Re: Step/Dir control of spindle?
« Reply #14 on: March 18, 2018, 02:07:08 AM »
Hi Roger,
I've always battled with phaselock loops, I've had some good successes but they can be very hard fought.

I made a fairly simple estimation of my servo accuracy, 20/8000=0.25%  That number comes from the Following Error window, 20 is its default.
Thus if the commanded position gets any more than 20 encoder counts away from the actual encoder position the drive faults 'Following Error'
The 'Zero Error' window is by default 4 encoder counts, thus if the error is less than 4 counts then the drive doesn't bother to try to reduce the error
further, you might say its ultimate position error is 4/8000=0.01%

Really these sorts of numbers are not truly reflective of the performance of the machine for lathe threading purposes. As you point out its ability to recover
from sudden changes in load like a tool digging into the start of a thread. My servo drive will fault if the commanded position lags by more than 0.9 degree
but whether it will fault is all about its torque reserve and the time it takes for the drive to apply the extra current. The control loop in my Allen Bradley
servo drive is 16kHz and in my own home grown one 20kHz. If I assume 10 control cycles is sufficient to have the drive increase current to match a sudden
increase in load I would expect a lag of 500-600us.

If of course the applied load exceeds the torque available from the servo it will fault no matter what happens. I can stall my Allen Bradley spindle by crashing
it into a job but it makes a hell of a bang....you may have heard it after all your only 2000nm away!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Step/Dir control of spindle?
« Reply #15 on: March 18, 2018, 02:46:08 AM »
All sounds good to me.

Very low frequency PLLs can be a pain, but the real situation is not that bad. Assume 512 lines and 60 RPM: that's 512 Hz for the PLL. Manageable. Below that - digital perhaps.

Yes, a tool digging in would require a solid response, but it is rarely that bad. Assume a 2 mm pitch at 100 RPM with the tool seriously digging in: it is going to take the job 1/2 rev for the load to get up high, and it will start from zero. That's 5 mS. I imaging your servo loop could handle that fine? And I tend to be a coward and always run very lightly anyhow.

I am going to have to ask Andy at Warp9 some Qs about just what data the ESS can get from Mach3. Could the ESS get the commanded spin from Mach3 and generate its own Step rate from that and from knowing the encoder count? That way Mach3 would only have to worry about the Index pulse and nothing else.  There is a place in this world for external hardware engines!

Cheers
Roger

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Step/Dir control of spindle?
« Reply #16 on: March 18, 2018, 07:39:32 AM »
Quote
So my Q is what is the least effort to get to where I want to be - precision spindle speed and STABLE threading,

I've never done any threading, but I've read tens of thousands of Mach3 forum posts over the years. My understanding is that threading in Mach3 is fundamentally flawed, and best results require constant spindle speed. Meaning the more powerful the spindle, the better the results will be.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Step/Dir control of spindle?
« Reply #17 on: March 18, 2018, 05:23:31 PM »
Hi Gerry

I have to fundamentally disagree with you. Threading in Mach3 works very well on small diameters of aluminium and plastic. I have done a lot of such threading and sold the results.

I would not talk in terms of 'best results', rather I would say that constant spindle speed is essential if the Z axis movement is to be solely dependent on the Index pulse. The problem comes when the part is large diameter and steel: most lathes do not have the huge amount of torque needed to keep the spindle speed constant using only the Index pulse. Geared lathes don't care of course if the spindle slows down a bit.

The alternative would be to have an encoder on the spindle and to use the encoder signals to control the Z axis. This would be analogous to mechanical gearing. Mach was not designed this way unfortunately, but then, not all lathes can do threading either.

I don't know how Mach4 implements threading: does it too rely solely on the Index pulse? A good question.

Cheers
Roger
Re: Step/Dir control of spindle?
« Reply #18 on: March 18, 2018, 05:27:57 PM »
Hi,
Mach4 doesn't handle threading per se, the motion controller handles it. The only one I'm familiar with is the ESS
and it not not capable of threading currently but the preliminary code is written and it looks like one pulse per
revolution at this at stage.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Step/Dir control of spindle?
« Reply #19 on: March 18, 2018, 05:45:07 PM »
However, a group of us are hassling Andy & Greg to put a PID servo into the ESS to stabilise the spindle speed using encoder feedback. The index pulse would still be returned to Mach for thread-start sync. It has become a priority item at Warp9, but whether there is enough room in the FPGA is an open question.

Cheers
Roger