(Solved) Synchronize multiple spindles? (lathe subspindle)

More
31 Jul 2023 13:14 #276626 by spumco
Working on a new lathe build and have a programming/mental hurdle I've been unable to find an answer to in the user manual or forums.

How to synchronize two spindles?  Specific application is for a lathe sub-spindle and part transfer during parting operation.

NOTE - lathe is not yet finished, but basic design and control scheme is done.  Assembly & fab are 50% done.  Can't test anything physical just yet.

CONTROL
  • Deb 12.x w/ LCNC 2.9
  • Mesa 7i96s and 7i85s
  • GUI - tbd, but likely some modified qtvcp or qtpyvcp based screen
MAIN SPINDLE
  • AC servo
  • S&D control
  • Driven 1.5:1 w/poly-v belt
  • Separate 600ppr encoder w/1:1 timing belt (to 7i96s)
SUBSPINDLE
  • AC servo
  • S&D control
  • Driven 1:1 w/timing belt
  • Feedback from drive encoder outputs (to 7i85s)
What needs to happen is both spindles must start at the same time, then turn at exactly the same speed until the part is cut off.  While not needed for parting-transfer, I can imagine cases where both spindles must also decel and stop at the same rate much like a master-slave axis pair.

A slight speed mismatch might be OK as one or the other motor is 'dragged along' slightly... but I'd think even a half-second mismatch on the start would be Extra UngoodTM.

My main spindle drive can change command mode using a digital input (from S&D to quadrature) and act as a 'follower' drive.  It can even take command from two different input wiring sources (dual encoder inputs).

However, I'm not sure how to get a perfect pass-through of the sub-spindle drive's encoder output in to LCNC and then out to the main drive.  That sounds like a wiring nightmare - encoder splitters and "Y" cables and similar.  Yuck.

Nor am I sure how to manage starting both at once.  If the spindles were moving the same direction M3 S1000 $0 $1 would be fine according to the user manual.  Problem is that the sub-spindle is facing the main, and needs to turn the opposite way for back-mounted tooling.  Thus an "M3" would result in the main and sub turning in opposite directions.

So how to I get M3 S1000 $0 and M4 S1000 $1 to start at the same time?

I'm hoping someone can offer a suggestion on how to achieve the simultaneous start and synchronized speed without resorting to drive config gymnastics.
The following user(s) said Thank You: besriworld

Please Log in or Create an account to join the conversation.

More
31 Jul 2023 13:20 #276627 by andypugh
I think that the answer would be to run the secondary spindle in position control, with a PID loop linking it to the position of the main spindle.

You would need to allow for the accumulated turns so far of the main spindle or the sub-spindle would attempt to catch up.

If I was setting up such a system think that I might look at (mis)using M19 to indicate to the secondary spindle that it it time to synch with the main one.

(I imagine that you might not want to have them synched all the time, so that the sub-spindle could be doing back-side finishing at the same time as the main spindle was doing something else, assuming that there are sufficient axes.)

Please Log in or Create an account to join the conversation.

More
31 Jul 2023 13:50 #276630 by spumco
Andy,

I don't have multiple turrets; it's (will be) a gang-tool lathe with a single X/Z slide and a separate V-axis slide with a parting tool.  Sub is mounted on the X/Z slide, so I won't be using both spindles at the same time other than the part hand-off.

Forgot to mention that both drives will be in position mode internally as I want to be able to position them as an axis.  I plan to use the "C-axis.comp" component shared on the forum a while ago to switch between spindle and axis modes.

It just occurred to me that I need to set both drives' internal max accel higher then the LCNC INI accel so one (or both) of the drives don't fight LCNC when they spindles are synched.

Basically, I want this:


Unfortunately, the person who posted the vid doesn't appear to have shared their config anywhere I can find.  Looks like they bolted a (insanely expensive)  Levin lathe headstock right on the GT27 slide and added a servo.  That collet limits them to 1/2" dia, but it looks to be cranking out parts like mad.

Mine will be a 5C sub-spindle to match the main, but otherwise very similar.

If you look at the video comments, they were kind enough to post a link to photos of the separate parting tool axis.

Please Log in or Create an account to join the conversation.

More
31 Jul 2023 14:13 #276634 by andypugh

Forgot to mention that both drives will be in position mode internally as I want to be able to position them as an axis.  I plan to use the "C-axis.comp" component shared on the forum a while ago to switch between spindle and axis modes.

So I think that the trick would be to set the sub-spindle in position mode tracking the actual position of the main spindle _minus_ the position of that spindle at the point that the synch was enabled. 
One way to do this is with a mux component that feeds back into itself when enabled, but it might be a bit more obvious to use a custom component specific to the task. 
The code here wiki.linuxcnc.org/cgi-bin/wiki.pl?Hobbing shows a  mux2 used as a sample-hold, but if you download the linked .zip file I htink that includes the HAL component that I wrote later to do the same thing. 
 
The following user(s) said Thank You: besriworld, spumco

Please Log in or Create an account to join the conversation.

More
31 Jul 2023 15:32 #276641 by spumco
[Wiki zip file doesn't appear to contain a custom component.  Has a hobbing_gui.hal that refers to a custom comp (I think), but not the comp itself.]

If I follow you... at a higher level, a mux2 would be used to switch between a synch'd and un-sync'd sub-spindle? 

PID #1 = main spindle (spindle mode)
PID #2 = main spindle (C-axis mode)
PID #3 = sub-spindle (spindle mode)
PID #4 = sub-spindle (C2-axis mode)

M100 (sync on)
  • Reset main spindle encoder to 0 (to stop the sub trying to catch-up)
  • set caxis.sub.spindle-on TRUE  (switches to PID #4 - position mode)
  • set mux2.0.sel TRUE  (PID #4 gets command from main spindle fb)
M101 (sync off)
  • set caxis.sub.spindle-on FALSE (switches to PID #3 - velocity mode)
  • set mux2.0.sel FALSE (PID #4 gets command from normal source)
Have I got the gist?

Please Log in or Create an account to join the conversation.

More
31 Jul 2023 18:07 #276651 by dm17ry
i think you should switch both main and counter spindles into position control and just command them synchronously...
i've done that with mitsubishi spindle drives, they have a dedicated "spindle sync" mode where you have to command them with position...
here's how it looks like, at around 0:50
The following user(s) said Thank You: tommylight, besriworld, spumco, Usolutions

Please Log in or Create an account to join the conversation.

More
31 Jul 2023 21:13 #276666 by spumco

i think you should switch both main and counter spindles into position control and just command them synchronously...
i've done that with mitsubishi spindle drives, they have a dedicated "spindle sync" mode where you have to command them with position...

 


Thank you very much for the video.  Well done on the retrofit!

I've got a concern regarding your suggestion to put both spindles in position control if you don't mind giving it some thought.

Both drives will be in position mode internally, but LCNC will switch back and forth between spindle and axis modes depending on what I need done.  However, I don't think I can use CSS if both spindles are in position mode in LCNC.

In your video you did a nice hand-off, but I'd like to run a parting tool to cut the part off of some bar stock while both spindles are clamped on the part.  I'm building a head-stock mounted separate axis with a parting tool as I mentioned earlier.

For this I'd really like to use CSS, especially at the end of the part-off where surface speed is usually low.  And for CSS, I think I need one of the two spindles to be in "spindle" mode.

Any thoughts?

Please Log in or Create an account to join the conversation.

More
01 Aug 2023 12:53 - 01 Aug 2023 12:54 #276696 by andypugh

If I follow you... at a higher level, a mux2 would be used to switch between a synch'd and un-sync'd sub-spindle? 
...
Reset main spindle encoder to 0 (to stop the sub trying to catch-up)



You can use a mux2 to switch between command sources, certainly.

But I was also suggesting using a mux2 as a sample-hold component, to latch the main spindle position at the point that synch is requested, to provide a number to subtract from the main spindle position to give a target for the sub-spindle.

mux2.N.in0 = spindle-pos
mux2.N.in1 = mux2.N.out

When the mux is enabled (sel = 1) then the uutput holds the value of spindle-pos from the moment that the sel pin was set.
Last edit: 01 Aug 2023 12:54 by andypugh.

Please Log in or Create an account to join the conversation.

More
01 Aug 2023 17:38 #276716 by spumco

But I was also suggesting using a mux2 as a sample-hold component, to latch the main spindle position at the point that synch is requested, to provide a number to subtract from the main spindle position to give a target for the sub-spindle.

mux2.N.in0 = spindle-pos
mux2.N.in1 = mux2.N.out

When the mux is enabled (sel = 1) then the uutput holds the value of spindle-pos from the moment that the sel pin was set.


I'm trying to digest the purpose of the sample-hold component.  When you write "subtract from the main spindle position to give a target...", is the next step:
  • commanding the sub to move to the (new) position, or
  • adjusting (subtracting) the sub's encoder position to match the main's position?
Or something else?

Please Log in or Create an account to join the conversation.

More
07 Feb 2024 02:20 #292710 by spumco
Time to revisit this one now that I've got both spindle working.

Main spindle is using caxis.comp.  Subspindle is a regular spindle, but orient works fine.
Main spindle drive is PWM velocity, sub is step-dir position.
In spindle mode, both are turning within a few RPM of each other according to halscope.

Once up to speed I think they'd be OK if both were clamped on to part.  However, some testing with a bit of tape between them shows the spindles are not accelerating at the same rate (tape gets twisted off within a few revolutions).

max_accel is set the same for both in INI.

I have not done it yet, but it would be easy enough to orient the sub to 0 and the main to C0 before starting if that would make a difference.

Suggestions on how to ensure, at least when they are connected through a part, they accelerate at the same rate?  Synchronized decel would also be nice, but less important as the part should (in theory) be separated when the spindles are turned off.

Please Log in or Create an account to join the conversation.

Time to create page: 0.146 seconds
Powered by Kunena Forum