When my mill is stopped, my servos "buzz" bzzz.......bzzzzzz....bzz
I have a feeling is that I need to "tune it". I believe that the story
is that the motors move due to imperfect TEST/OFFSET setting) and then
EMC "whips the mill back" to original position.
I somewhat addressed it by reducing gain on the amplifiers, to the
level when this buzz is no longer annoying, barely noticeable. I
postponed this until I would get the table all hooked up, homed and
safe with limit switches. Now is the time to address it, so here's my
question: what are the tuning parameters to address to get rid of
Ho ho ho ho ha ha ha ha he he he he.
It's probably too much differential gain, although it could be your
differential cutoff frequency, some other gain, noise in the system
(although that's not usually a buzz), friction-induced hysteresis, some
other hysteresis, or just plain bad juju.
This is an overall tutorial aimed at software engineers, but the tuning
section may help:
http://dpm1480.pbworks.com/f/PID%20without%20a%20PhD.pdf (note that
there's a link on my website that's BROKEN thanks to Embedded Systems
Programming!!!). Note that there are different ways to embed the
various gains into a system -- mine is the very best way, but other
folks operate under the delusion that theirs is the very best way, so
you may find things like derivative and integral time constants +
overall gain, or others.
Does it buzz with the computer disconnected? If so, then the tuning
problem is in your motor drive. If you have to have the EMC software
running to get a buzz then you're more of a nerd than I thought -- I
mean, the problem is in the EMC software or the tuning thereof.
If it's just a bit of noise, if the motors aren't overheating and parts
are coming out good and the neighbors aren't complaining and your power
meter isn't spinning like it's going to fly off into the stratosphere,
then you're probably good to go. Detune the thing enough to get rid of
the buzz and you'll have to accept lower performance, which means lower
I'm lucky, there is a software package called Galil WSDK (windows servo
design kit) that analysis my servo response and does automatic tuning. Ask
some guru did the same for EMC.
Otherwise, reduce P and D by 10% and try, repeat. At some point reduce I
To me tuning is black art, if its not working try something else.
In the link that Karl sent you the guy refers to an inner velocity loop
-- that is the loop that your motor drives close, and that is the loop
that must be made right first, before you tune the outer loop. Getting
the inner loop tuned too tightly will leave it susceptible to
oscillation (or make it oscillate outright) and demand that you tune the
outer loop more loosely than you might like; getting the inner loop
tuned too loosely will force the outer loop to work harder with both
insufficient information and insufficient sample rate.
Next you'll ask "what do these pots do, and how do I twiddle them?". I
will respond "every manufacturer has their own way of doing things, and
the ones that do it exactly my way are actually doing it correctly."
Then I'll say "send a link to your drives' manual, and maybe I'll figure
Just from the sound of it the error gain sets a drive's overall loop
gain, while the reference gain turns the whole inner loop's response to
a command up or down -- but that's a guess. If that's so then you want
to twiddle the error gain pot until the shape of the drive's response is
as best as you can get it, then you want to twiddle the reference gain
pot until the maximum velocity command out of the EMC2 software matches
the maximum velocity out of the drive, without either the drive or the
software maxing out before the other.
Does the EMC software provide you with any sort of measuring and
diagnostic tools? If it gives you the opportunity to inject test
signals into the loop and look at the results then you'll find your job
much easier. If it builds a transfer function analyzer into the thing
then you're either really lucky or in for some mind-bending frustration
And of course, if it auto-tunes, then you're at the mercy of the
competence of whoever made the auto tuning software.
Iggy has AMC amps. They have pages of how to on tuning their amps for each
mode. I haven't bookmarked that section but its not hard to find. Or, their
tech help is top notch. they will direct you to the right info.
Their tech support is awesome.
I saw some resources on current loop tuning, but I have a velocity
I will call them today to see what they got.
My attempts to tune the positioning loop ended up with a general
Ugh, it would be best to tune the servo amp all by itself, by pumping
small-amplitude square waves into the ppmc DAC outputs and observing the
velocity out from the PPMC encoder counter. This can be done with
Halscope and some HAL commands to set up a square wave generator.
Once the servo amps are giving a good, well-damped but still snappy
response, then you can add in the EMC positioning loop.
You have to set up a particular signal to trigger the scope. I use
velocity (ppmc.0.encoder.00.delta) as the trigger, it works well.
You have to pump up the gain to something like 1m (.001 or 1 milli) on
signals such as the following error to see useful information.
I think there is a halscope section in one of the manuals on the wiki.
You need to start using these manuals as the first place to look. When
it is not there, then you can ask for answers elsewhere. But, mostly,
it works like a digital scope.
The motor drives close an inner loop around the velocity signal from the
tachometers. If they're the source of the oscillation then you can
screw around with the outer loop until hell freezes over without fixing
From the history of the posts I don't think the problem crops up until
Iggy connects the EMC2 -- but it's a good due-diligence check that can
potentially save you a lot of trouble.
It is expected and inevitable that the drives should drift without being
inside a position loop -- electronics have an inevitable amount of bias,
and the expense to eliminate it is roughly inversely proportional to the
amount of bias you have left when you're done. Since these drives are
designed to go inside of a PID position loop, it wouldn't make sense to
really pound the bias down.
The problem is more intrinsic than the EMC2 correcting drift, and it may
not lie with the EMC2 itself. You are somewhat correct with the "rude
manner" (I like that turn of phrase; I'll have to use it). More often
than not -- at least at the stage of tuning you're in -- oscillations
like this are from excessive gain somewhere. It's probably because the
EMC2 is tuned too aggressively, but there's a really good chance that
either the drive loop is tuned too aggressively, with a peak in it's
response that the EMC2 is exciting, or that the drive loop is tuned too
limp and in tuning the EMC2 up tight enough to compensate you're causing
Do you have some means of stimulating the system, and looking at the
response? Ideally this would be built into the EMC2, but even just
having an oscilloscope and a signal generator would be exceedingly handy.
You should get the drive/motor/tachometer tuned correctly by itself
which can probably best be done by disconnecting one from the mill*,
putting a square wave into the command input of the drive, and looking
at the tach feedback with a scope. Once you get that so that it matches
the "critically damped" response in that paper that Karl sent you, then
you can put things back into the mill and start tuning the EMC2.
* I assume the servo motor is geared down plenty (10:1?) before it
drives the lead screw of the mill. If so, then the lead screw moment of
inertia probably doesn't matter in the tuning of the system. If the
gear ratio _isn't_ that high, then you either need to figure out how to
keep the axis roughly centered while you're tuning, or you need to slap
a load equal to the lead screw moment of inertia onto the gearbox output
shaft to do your tuning.
I think that it actually would, but what can I do.
I have two ways of exciting the system. One is just to apply some
force to the servo motor pulleys, and another is to make the axis go
back and forth a bit using keyboard. The last one usually makes it
Servo motor is belted down 2:1
sounds complicated. I am not sure where to start. I removing hum and
vibrations by turning gain down on the amps. Attempts to change gain
(P, I, D) in EMC configs did not bring on any sensible
results. Changing P does affect vibrations, but changing I does not,
and it should.
I spent about 1.5 hours yesterday on this and the result was not
satisfactory. In the end, I turned down gain on servo drives, and
restored original defaults for Pi, I, D.
Are you sure there isn't some facilities in the software to read back
what the software is seeing? Ideally it should be able to throw up a
graph of the command and the response vs. time. Then you can jog the
thing from the keyboard and look at how well it follows. If you can do
this it can make your job a _lot_ easier.
If that's the only gearing (and if the servo motors aren't internally
geared) then the lead screw moment of inertia matters, and you need to
do the tuning with the lead screw in place. Since you probably have
ball screws, you probably need to do it with the whole assembly in
place, oh joy.
("Oh joy" because that means you have to worry about crashing an axis
while tuning, which complicates things. Oh joy.)
One of the nice things about PID tuning schemes that separate the P, I
and D gains is that these gains act more or less independently. So it's
not surprising that turning down the integrator gain would not affect
anything, where turning down the proportional gain would.
Where to start:
At the innermost loop. That's the motor drive, and where you're working
You don't have a scope and a signal generator?
Yes, it is called HalScope, and is basically a digital storage scope in
software, that has available any signal routed through HAL, EMC2's
Hardware Abstraction Layer.
There are also signal generators and all manner of hal "components" that
perform logical and arithmetic functions.
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.