589,272 active members*
5,651 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > Gecko Drives > Advice on using a servo as a spindle
Results 1 to 17 of 17
  1. #1

    Question Advice on using a servo as a spindle

    Greetings,

    I have an NEMA 34 servo (part number KL34-180-90:https://www.automationtechnologiesin...ft-servo-motor) and a G320X servo driver. I am using a C11G BOB and an ESS to connect the drive to my PC. On my PC I am running Mach 4.

    In Mach 4, when I issue an M03 S100 command, the servo spindle turns at around 100 RPM. I can increase the spindle speed to around 1,000 RPM ok. At around 1,2000 RPM, the servo will fault. The rated no-load max RPM of the servo is 3,200 RPM, so I'm not sure why the servo is faulting at such a low RPM.

    I am using an AMT 10 encoder. The max step pulse frequency of the G320X is 300kHz. Using the calculation in the G320X manual, 3,200 * 80% = 2,560. 2,560 / 60 = 43 revolutions per second. 300Khz = 300,000 hertz. 300,000 Hertz/43 revolutions per second = 7,031 max counts per revolution. 7,031 / 4 = 1,758 max line count. The first standard line count (which I believe is synonymous with PPR) is 1,024, which is the PPR I have the AMT 10 encoder setup for. By my math, that is the correct PPR for the encoder according to the G320X manual, but perhaps I'm in error. Does anyone have any guesses why the motor is faulting at about 1,200 RPM?

    In addition, then I send a M04 S100 command, the motor faults immediately. I have checked the voltage at the DIR pin, and it is 5 V. I have no idea why the servo will not rotate counter clockwise; as far as I can tell, the G320X is receiving the correct signals, and should be able to drive the servo CCW just fine.

    Does anyone have any advice regarding how to achieve the max RPM on this servo and enable the servo to rotate CCW?

    Regards,
    John

  2. #2
    Join Date
    Aug 2005
    Posts
    1110

    Advice on using a servo as a spindle

    Hi John,

    The reason why it faults when you reverse the spindle speed is that the servo cannot respond quickly enough to the change in direction. You’ll need to reduce the acceleration for the spindle axis, so that the spindle can keep up with the commanded changes.
    This may also be the issue for why it faults at higher speeds.

    Also look at the manual for the G320X. Dip switches 4 and 5 set how many encoder counts the motor position can be behind the commanded position before the drive faults.
    From memory, it is set to 256 from the factory.
    Set it to something larger like 1024 or 2048. This will make it less sensitive to rapid changes in speed. It will also help with changing cutting loads.

    Then there is also the drive tuning. It could be that the tuning is too soft so the motor is not keeping up with the commanded changes. You might need to stiffen the drive response by increasing the P parameter, then the D parameter to tune out any overshoot.

    Also reduce the encoder count setting to 512 or 256.

    Cheers

    Peter.


    Sent from my iPhone using Tapatalk Pro
    -------------------------------------------------
    Homann Designs - http://www.homanndesigns.com/store

  3. #3
    Join Date
    Nov 2013
    Posts
    4666

    Re: Advice on using a servo as a spindle

    Hi,
    1024 lines per rev equates to 4096 counts per rev. I don't quite know why you are using 80% of rated speed, but at 43 rev/sec that equates to a pulse rate of 176.13kHz.

    How are you signalling the G320? 176kHz should be achievable using single ended signalling, but its getting up there. Everything will need to be spot on to signal at that rate. What breakout board are you using?.

    I use Delta B2 servos. With electronic gearing I've got the counts (pulses) per rev set at 5000/rev. At 5000 rpm, ie 83.33 rev/sec that equates to 416.7kHz. The max single ended (open collector) signalling rate is 200kHz,
    so I use differential signalling, which is good to 500kHz. Works perfectly.

    I also have a 1.8kW Allen Bradley servo as a secondary spindle motor. Its rated at 3500rpm or 58.33 rev/sec. It has an 8000 count per rev (2000 line) encoder...so at full speed (3500rpm) the signalling rate is
    466.7kHz. Again I use differential signalling and it works a treat.

    Craig

  4. #4

    Re: Advice on using a servo as a spindle

    Thanks Craig for the response. Replies inline.

    QUOTE=joeavaerage;2591122]Hi,
    1024 lines per rev equates to 4096 counts per rev. I don't quite know why you are using 80% of rated speed, but at 43 rev/sec that equates to a pulse rate of 176.13kHz.

    [JO: I am using 80% of the rated max RPM b/c that is what the instructions in the G320X indicate to do when calculating the optimal encoder line count.]


    How are you signalling the G320?

    [JO: I don't think I understand the question. Do you mean, what is generating the step pulses that are being sent to the G320X? If so, I am using a C11 G BOB attached to an Ethernet Smooth Stepper.]

    176kHz should be achievable using single ended signalling, but its getting up there. Everything will need to be spot on to signal at that rate. What breakout board are you using?.

    [JO: I am using a C11G BOB from CNC4PC: https://cnc4pc.com/c11g-multifunction-cnc-board.html]

    I use Delta B2 servos. With electronic gearing I've got the counts (pulses) per rev set at 5000/rev. At 5000 rpm, ie 83.33 rev/sec that equates to 416.7kHz. The max single ended (open collector) signalling rate is 200kHz,
    so I use differential signalling, which is good to 500kHz. Works perfectly.

    I also have a 1.8kW Allen Bradley servo as a secondary spindle motor. Its rated at 3500rpm or 58.33 rev/sec. It has an 8000 count per rev (2000 line) encoder...so at full speed (3500rpm) the signalling rate is
    466.7kHz. Again I use differential signalling and it works a treat.

    Craig[/QUOTE]

  5. #5
    Join Date
    Nov 2013
    Posts
    4666

    Re: Advice on using a servo as a spindle

    Hi,
    well the C11 has TTL outputs, and so should be good for several MHz, downside is that the Gecko will never keep pace with that.
    I would suggest that you put an oscilloscope on the Step pulse and observe the pulse shape at 100kHz and faster. You might be surprised or even disappointed at how degraded
    pulse become at higher speeds. If, as I suspect, the pulses are badly degraded then you might well expect that beyond some signalling rate the comms will fail.

    Craig

  6. #6

    Re: Advice on using a servo as a spindle

    Quote Originally Posted by joeavaerage View Post
    Hi,
    well the C11 has TTL outputs, and so should be good for several MHz, downside is that the Gecko will never keep pace with that.
    I would suggest that you put an oscilloscope on the Step pulse and observe the pulse shape at 100kHz and faster. You might be surprised or even disappointed at how degraded
    pulse become at higher speeds. If, as I suspect, the pulses are badly degraded then you might well expect that beyond some signaling rate the comms will fail.

    Craig
    Ok, thanks Craig. If that is the case, what does one do? Decrease the encoder line count setting to 512 or 256?

  7. #7
    Join Date
    Aug 2005
    Posts
    1110

    Re: Advice on using a servo as a spindle

    Quote Originally Posted by johnobrien12321 View Post
    Ok, thanks Craig. If that is the case, what does one do? Decrease the encoder line count setting to 512 or 256?
    Hi John,
    Read what I suggested above. Yes reduce the encoder count. But there are other issues as well, such as reducing the Acceleration for the axis in Mach 3/4.
    Cheers
    Peter.


    Sent from my iPhone using Tapatalk Pro
    -------------------------------------------------
    Homann Designs - http://www.homanndesigns.com/store

  8. #8

    Re: Advice on using a servo as a spindle

    Quote Originally Posted by phomann View Post
    Hi John,
    Read what I suggested above. Yes reduce the encoder count. But there are other issues as well, such as reducing the Acceleration for the axis in Mach 3/4.
    Cheers
    Peter.


    Sent from my iPhone using Tapatalk Pro
    Thanks Peter. I figured out part of the problem; I was splitting the signals from the encoder to send them back to inputs on the C11G to use the signals to drive a tachometer/DRO in Mach 4. That must have introduced issues b/c when I rewired the output from the encoder to not send the signals to the C11G, the motor seems to respond correctly to M04 commands now and runs counter clockwise.

    I need to find the handheld tachometer I have somewhere to check to actual RPM versus commanded, then do some iterating in the counts per unit setting in Mach 4 before I can know whether I'm really hitting the RPM I think I'm hitting.

    After that, I'll try your suggestions if I run into issues hitting the targeted RPM, either with no load or under load.

    In a related question, does anyone happen to know of a quadrature encoder or TTL signal splitter which they recommend? Here is one I've found: https://mesaus.com/product/ency/. Does anyone have experience with this one or any other quadrature encoder signal splitter?

    Regards,
    John

    Regards,
    John

  9. #9
    Join Date
    Aug 2005
    Posts
    1110

    Re: Advice on using a servo as a spindle

    Quote Originally Posted by johnobrien12321 View Post
    Thanks Peter. I figured out part of the problem; I was splitting the signals from the encoder to send them back to inputs on the C11G to use the signals to drive a tachometer/DRO in Mach 4. That must have introduced issues b/c when I rewired the output from the encoder to not send the signals to the C11G, the motor seems to respond correctly to M04 commands now and runs counter clockwise.

    I need to find the handheld tachometer I have somewhere to check to actual RPM versus commanded, then do some iterating in the counts per unit setting in Mach 4 before I can know whether I'm really hitting the RPM I think I'm hitting.

    After that, I'll try your suggestions if I run into issues hitting the targeted RPM, either with no load or under load.

    In a related question, does anyone happen to know of a quadrature encoder or TTL signal splitter which they recommend? Here is one I've found: https://mesaus.com/product/ency/. Does anyone have experience with this one or any other quadrature encoder signal splitter?

    Regards,
    John

    Regards,
    John
    Hi John,
    I don’t have experience with the encoder splitter you’ve referenced. That said Mesa produces very good and robust products.

    Cheers
    Peter


    Sent from my iPhone using Tapatalk Pro
    -------------------------------------------------
    Homann Designs - http://www.homanndesigns.com/store

  10. #10
    Join Date
    Nov 2013
    Posts
    4666

    Re: Advice on using a servo as a spindle

    Hi,
    as I said before the signalling rate is quite high, about the limit of single ended signalling. Any extra wiring or loads will cause a degradation of signalling which you cannot afford.

    You would be advised to wire the encoder direct to the G320, with nothing extraneous in between. If you can get the servo to run properly and properly tuned you can be assured
    that it will stay within the zero error window....so what matter then about feedback to Mach4?. You have instructed the servo to do a certain thing, and it will do so. If it does not
    it will alarm out. Why bother with feedback to Mach4?

    Craig

  11. #11

    Re: Advice on using a servo as a spindle

    Quote Originally Posted by joeavaerage View Post
    Hi,
    as I said before the signalling rate is quite high, about the limit of single ended signalling. Any extra wiring or loads will cause a degradation of signalling which you cannot afford.

    You would be advised to wire the encoder direct to the G320, with nothing extraneous in between. If you can get the servo to run properly and properly tuned you can be assured
    that it will stay within the zero error window....so what matter then about feedback to Mach4?. You have instructed the servo to do a certain thing, and it will do so. If it does not
    it will alarm out. Why bother with feedback to Mach4?

    Craig
    Hi Craig,

    The hope was to do rigid tapping and threading. I thought one needed a and b encoder feedback to Mach 4 for rigid tapping to works. Is that not the case?

    Regards,
    John

  12. #12
    Join Date
    Nov 2013
    Posts
    4666

    Re: Advice on using a servo as a spindle

    Hi,
    Mach4 does not natively support rigid tapping. Mach4 is NOT a feedback controller.

    Conventional rigid tapping requires that the controller measure/monitor the angular position of the spindle (ie encoder) and process information so that the pulses necessary for the Z axis to move in exact synchronicity with the spindle.
    Mach4 cannot do this, and while the ESS might have the capacity to do so it has never been implemented.

    But you have an angular position capable spindle....do you not? That's the whole point about having a Step/direction capable spindle.

    Imagine this gcode:
    g1 c3600 z-10 f36000
    g1 c0 z0

    This would cause the C axis (your spindle) to rotate 3600 degrees or ten revolutions in synchronicity with the Z axis which lowers by 10mm. The feed rate is 36000 ie 100 revs/min, so the ten turns would take six seconds.
    The machine has 'spiralled' down 10mm in ten turns. The second line of code causes the machine to 'unwind' out of the hole back to 0 degrees (where it started) and the Z axis raising (again synchronously) 10mm.

    Is this not rigid tapping? It relies on Mach, in fact any halfway decent Gcode machine, to synchronize the movement between two axes. We are familiar with say the X and Y axes be synchronized but why not a rotary axis and a linear
    axis? No reason why not.

    This is how I induced Mach4 to do rigid tapping for me. I've been using Mach4 and an ESS for nine years. I have an servo driven spindle that I use for high torque/low speed ops including rigid tapping.
    I went to quite a bit of trouble trying to work it out....but guess what.....I hardly ever use rigid tapping. If your spindle lacks the torque authority the rigid tapping will fail MISERABLY. Likewise if the tap slips and rotates
    at all in the collet....you have a big F****up!

    Certainly rigid tapping by means of Gcode synchronisation is possible, and you will learn a lot about Gcode and your machine, I have found that rigid tapping is not particularly useful. Thread milling is a better solution
    when you have only a few holes to do. If you have a swag of holes then rigid tapping comes into play....but beware....you need to experiment and thoroughly prove the concept before you do a job.
    In particular you must pay very strict attention to percentage thread engagement or you will have big trouble.

    Craig

  13. #13

    Re: Advice on using a servo as a spindle

    Quote Originally Posted by joeavaerage View Post
    Hi,
    Mach4 does not natively support rigid tapping. Mach4 is NOT a feedback controller.

    Conventional rigid tapping requires that the controller measure/monitor the angular position of the spindle (ie encoder) and process information so that the pulses necessary for the Z axis to move in exact synchronicity with the spindle.
    Mach4 cannot do this, and while the ESS might have the capacity to do so it has never been implemented.

    But you have an angular position capable spindle....do you not? That's the whole point about having a Step/direction capable spindle.

    Imagine this gcode:
    g1 c3600 z-10 f36000
    g1 c0 z0

    This would cause the C axis (your spindle) to rotate 3600 degrees or ten revolutions in synchronicity with the Z axis which lowers by 10mm. The feed rate is 36000 ie 100 revs/min, so the ten turns would take six seconds.
    The machine has 'spiralled' down 10mm in ten turns. The second line of code causes the machine to 'unwind' out of the hole back to 0 degrees (where it started) and the Z axis raising (again synchronously) 10mm.

    Is this not rigid tapping? It relies on Mach, in fact any halfway decent Gcode machine, to synchronize the movement between two axes. We are familiar with say the X and Y axes be synchronized but why not a rotary axis and a linear
    axis? No reason why not.

    This is how I induced Mach4 to do rigid tapping for me. I've been using Mach4 and an ESS for nine years. I have an servo driven spindle that I use for high torque/low speed ops including rigid tapping.
    I went to quite a bit of trouble trying to work it out....but guess what.....I hardly ever use rigid tapping. If your spindle lacks the torque authority the rigid tapping will fail MISERABLY. Likewise if the tap slips and rotates
    at all in the collet....you have a big F****up!

    Certainly rigid tapping by means of Gcode synchronisation is possible, and you will learn a lot about Gcode and your machine, I have found that rigid tapping is not particularly useful. Thread milling is a better solution
    when you have only a few holes to do. If you have a swag of holes then rigid tapping comes into play....but beware....you need to experiment and thoroughly prove the concept before you do a job.
    In particular you must pay very strict attention to percentage thread engagement or you will have big trouble.

    Craig
    Thank you for your feedback. Another reason though is to see the measured RPM to compare it to the RPM I've sent, just to make sure everything is correct. I believe the ESS does support this (based off this webpage: https://documentation.warp9td.com/Ha...__Encoders.htm), but perhaps I am mistaken.

    Regards,
    John

  14. #14
    Join Date
    Nov 2013
    Posts
    4666

    Re: Advice on using a servo as a spindle

    Hi,
    why?

    Craig

  15. #15
    Join Date
    Nov 2013
    Posts
    4666

    Re: Advice on using a servo as a spindle

    Hi,,
    with any number of manual machines, be it a drill press, a lathe or a mill, you used whatever speed is closest to your desired speed. Is the job wrecked because you can't get the exact speed you want?
    Secondly, say you dial up 420 rpm on your lathe, how do you know its actually doing 420rpm? You don't. You are expected to know if the lathe is struggling, and you are expected to back off the cut a bit if it is.
    The point being that for many decades we have been using manual machines with perfect success without precise speed control.

    Years ago, when I built my first mini-mill I spent a lot of time and effort getting the spindle to run in both directions and at very close to commanded speed. I soon realized, once I actually started making
    parts, that it was a complete waste of time. Do I have any left-handed drills or endmills? No. I do not. If I commanded 12000 rpm but the spindle only did 11500rpm....does that matter? No, it does not.
    The bottom line is that the vast majority of ops perform perfectly well at anywhere within 10% and 20% of commanded speed.

    Last thing is that you already have a much, much better solution already! . Your spindle (servo) is position controlled is it not? So, if you command Mach to a certain speed the servo will faithfully keep
    not just to that speed but within a certain angle of that command. If your following error window you programmed into your drive is let's say 1/4 turn (1024 counts of a 4096-count encoder) then you can be
    assured that the spindle is with 1/4 turn of where it's supposed to be, otherwise it will alarm out. This is speed control and speed maintenance on a new and higher level.

    To recap; yes, Mach4 can use either an index (Z) signal or quadrature (A and/or B) signals to measure spindle speed. It would require at least one spare input, or as many as three, depending on how you want to wire it.
    You could instead devote one spare input to the spindle alarm, or bundle the alarm with the other Estop alarm (limits etc)

    My suggestion is don't get too hung up on spindle speed. There are lots of things to improve your CNC, precise spindle speed is not high on the list.

    Craig

  16. #16

    Re: Advice on using a servo as a spindle

    Quote Originally Posted by joeavaerage View Post
    Hi,,
    with any number of manual machines, be it a drill press, a lathe or a mill, you used whatever speed is closest to your desired speed. Is the job wrecked because you can't get the exact speed you want?
    Secondly, say you dial up 420 rpm on your lathe, how do you know its actually doing 420rpm? You don't. You are expected to know if the lathe is struggling, and you are expected to back off the cut a bit if it is.
    The point being that for many decades we have been using manual machines with perfect success without precise speed control.

    Years ago, when I built my first mini-mill I spent a lot of time and effort getting the spindle to run in both directions and at very close to commanded speed. I soon realized, once I actually started making
    parts, that it was a complete waste of time. Do I have any left-handed drills or endmills? No. I do not. If I commanded 12000 rpm but the spindle only did 11500rpm....does that matter? No, it does not.
    The bottom line is that the vast majority of ops perform perfectly well at anywhere within 10% and 20% of commanded speed.

    Last thing is that you already have a much, much better solution already! . Your spindle (servo) is position controlled is it not? So, if you command Mach to a certain speed the servo will faithfully keep
    not just to that speed but within a certain angle of that command. If your following error window you programmed into your drive is let's say 1/4 turn (1024 counts of a 4096-count encoder) then you can be
    assured that the spindle is with 1/4 turn of where it's supposed to be, otherwise it will alarm out. This is speed control and speed maintenance on a new and higher level.

    To recap; yes, Mach4 can use either an index (Z) signal or quadrature (A and/or B) signals to measure spindle speed. It would require at least one spare input, or as many as three, depending on how you want to wire it.
    You could instead devote one spare input to the spindle alarm, or bundle the alarm with the other Estop alarm (limits etc)

    My suggestion is don't get too hung up on spindle speed. There are lots of things to improve your CNC, precise spindle speed is not high on the list.

    Craig
    I mean, you are factually correct in everything you say. I think I should give you more context on the project though so I can explain my motivations better.

    I co-own and operate a makerspace in Waltham, MA (revolutionmakerspace.com). In it we have a Bridgeport clone, which to your point, only approximately hits a given RPM using a VFD. But it is close enough, it's fine. There aren't any problems.

    We also have a CNC mini mill I converted using servos. I couldn't figure out how to tune them properly using an oscilloscope when I built it a few years ago, so I tuned it by ear. It works fine.

    Now I have this crazy idea to build a milling machine that can also be used as a "vertical" lathe by having the spindle move on the y-axis instead of the bed moving on the y-axis. So, I am dusting off some old parts I have from that old project and trying to figure out some of the things I never understood how to do from before.

    On that project, I never got a tachometer working properly, never got the servos tuned properly using an oscilloscope, etc. So, on this new project, I am indulging in my "2nd system" compulsion and trying to make everything work just as good as it can. I want to figure out Servo tuning using an oscilloscope, even it doesn't really matter. I want to figure out how to use the whole RPM range of the servo if possible, even though when connected to the driven pully that RPM will likely be an RPM I will never need. I want to be able to execute rigid tapping with Gcode that comes straight out of a CAM program, even if I never use it. Maybe one of the makerspace members will want to some day, who knows. I want it to use linear rails, even if it would be cheaper and easier to convert a lathe/mill combo machine, etc.

    So, while you are right, I want to do it anyway, you know? Both because maybe I can apply what I learn to improving the CNC mill at the makerspace, but also because I am curious and I like the challenge of figuring it out. Does that make sense?

  17. #17
    Join Date
    Nov 2013
    Posts
    4666

    Re: Advice on using a servo as a spindle

    Hi,
    but also because I am curious and I like the challenge of figuring it out. Does that make sense?
    Yes, it does make sense. Remember I've done both of these things, namely attempted to get perfect spindle speed, and have also 'perfected' rigid tapping with a C axis spindle....so yes I understand the challenge....
    its just that there are more important things you could do with that effort and resource.

    ATC, flood cooling and filtration, chip conveyor, through-spindle coolant, shrink fit tooling, four and five axis tool center point control....and the list goes on.

    want to figure out Servo tuning using an oscilloscope,
    Why? You should be using AC servos. I use 750W Delta B2 servos and they have free tuning and set-up software. Included in that software is a 'software oscilloscope' especially tailored
    for tuning the servo. It can display things like 'following error', servo current, commanded input and much more besides. Then you can tweak the tuning parameters (PID) and watch
    the response live and realtime!! right on your PC. Not that you really need it, these servos have a software Auto-tune feature which make manually tuning servos nearly pointless.

    I use Delta, a Taiwanese brand made in China, but also DMM, a Canadian brand made in China, are both good quality, support, documentation and most importantly set-up software at fair
    prices. There are a whole swath of cheap Chinese servos, and to be fair to them they do work and are attractively priced, but the documentation is poor to shocking and often no set-up and tuning
    software. Many people buy them on the basis of price without ever considering how they will set up and tune them. That is a mistake. Pay a bit extra and get Delta or DMM.
    There are of course better servos again, like Yaskawa, Fanuc and Siemens....but if you have the money for those...then why build your own machine?

    These old school DC servos (that require you manually twiddle P,I,D knobs) are for the birds. Get up to date.

    Craig

Similar Threads

  1. Replies: 3
    Last Post: 01-09-2022, 08:32 PM
  2. Servo advice
    By dfox1787 in forum Servo Motors / Drives
    Replies: 2
    Last Post: 06-28-2020, 10:33 PM
  3. Advice needed for spindle Servo on lathe
    By DMBGO in forum Servo Motors / Drives
    Replies: 5
    Last Post: 09-12-2017, 07:44 AM
  4. Looking for advice on choosing a Servo spindle
    By zarthcode in forum Servo Motors / Drives
    Replies: 2
    Last Post: 08-27-2012, 02:05 PM
  5. servo advice
    By eloid in forum Servo Motors / Drives
    Replies: 0
    Last Post: 11-19-2007, 02:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •