Hi,

the servos and drivers you've got will work an absolute treat once you get them 100% sorted. Many a hobbyist CNCer would give their eye teeth for

that set up, me included.

To understand PID settings and stability in depth requires University level mathematics and many an Electrical Engineer will regale you with stories of

trying to understand pages of seeming incomprehensible mathematics for the purposes of passing exams.

In absence of that detailed understanding you have to rely on heuristic methods.

The essential feature of any servo loop is that the servos actual position is compared with its ideal programmed position. This is called the error term.

If for instance your servo is at 100.5 degrees when the programmed position is 102 degrees then the error will be -1.5 degrees, minus because its lagging

behind. The amplifier in the drive will increase its output voltage a little bit to encourage the servo to catch up. How much it increases its voltage

for a given amount of error is where PID comes in. The higher the gain of the amplifier will cause the voltage to increase markedly, the servo accelerate

and catch up. This is called the Proportional gain. In general you wish the proportional gain to be high so that the servo quickly responds to an error

and so minimise the error.

Imagine this servo is on the Z axis and the weight of the spindle causes the servo to want to drift clockwise as the Z axis slumps under gravity. The servo

drive would recognise this as an error and produce a voltage that causes the servo to drive counter clockwise. Ideally they would cancel out, but they don't,

not quite. Just to hold the axis against gravity requires a little voltage to try to spin counter clockwise even though it doesn't spin at all, its balanced.

This will mean there will be a small amount of error, say 1 degree. This is an example, contrived to be sure, but still an example of following error.

The solution to this error is to have an integrator in the error loop as well as the proportional term. The integrator will cause the amplifier to up its output

just enuf to cancel the following error. The aim here is to have enuf Integral gain to quickly and reliably reduce the following error to zero.

The downside is that excess integral term can cause oscillations.

The solution to the instability often introduced by the integral term is Differential. It is analogous to frictional damping, sometimes called viscous damping.

The aim is to add enuf differential term to cause the loop to be stable without adding so much as it becomes lethargic.

Your servo setup is very close to correct. A very small reduction in integral gain will reduce its tendency to oscillate quite a bit when the reduction

of performance in reducing following error will be hardly noticeable. You could increase the differential term to increase the damping but you'd probably

have to up it quite a bit to get the same result. If all else fails you may have to reduce the proportional gain, really the whole business with integral and

differential terms is just a means of increasing the proportional gain AND keep it stable. If you push the proportional gain too high then you have to do

pretty radical things to keep it stable and if circumstances or the load changes it could go back to oscillating.

Craig