<snip>

Do you understand PID loops?

P - Proportional I - Integral D - Derivative

Proportion is proportional to the error. If you set your cruise control for 60MPH and you are only going 55MPH then you have an error of 5MPH. There is a proportional gain Kp, this determines how much of the proportional error goes in the equation, if Kp is 2 then 10 goes into the equation to calculate the output.

Derivative is the rate of change, If your cruise control is set for 60MPH and you're going 55, you have 5MPH proportional error. But if you're 5MPH too slow but catching up fast, you may need to ease up on the throttle or you'll overshoot 60MPH. Likewise if your 5MPH too slow and slowing down (maybe a steep hill) you can stomp the throttle more. Derivative gain, Kd, determines how much effect the rate of change in error has to do with the output.

Integral is the error over time. If you have your PID cruise control set for 60MPH it will never get there without Integral because it takes some throttle (output) to get the car to 60MPH. Let's say you're driving 60MPH, hit the cruise control, Proportional error is zero, Derivative is zero, guess what, the output is zero! You'll slow down until there is enough error to hold the throttle at some speed below the setpoint. Integral integrates the error over time and causes the output required to achieve zero error, it is needed when an output is needed for zero error, such as the cruise control or often a temperature control, or even a motion control in a vertical application or under a load.

Though not the scientific method, I raise proportional gain until it becomes unstable, then back it off a bit. Then I do the same with Derivative, then re-do proportional, back an forth a couple times until I have P and D controlling but well into the stable region. Then I work on I gain. One way is to put a little torque on the shaft to see some error, turn up I gain until it gets rid of disturbances on the shaft as fast as possible without oscillation.

For my lathe with tach feedback, I have D gain set to 0, the amp does enough that any D gain in the control seems to make it oscillate.

Hope this helps!

RogerN

Do you understand PID loops?

P - Proportional I - Integral D - Derivative

Proportion is proportional to the error. If you set your cruise control for 60MPH and you are only going 55MPH then you have an error of 5MPH. There is a proportional gain Kp, this determines how much of the proportional error goes in the equation, if Kp is 2 then 10 goes into the equation to calculate the output.

Derivative is the rate of change, If your cruise control is set for 60MPH and you're going 55, you have 5MPH proportional error. But if you're 5MPH too slow but catching up fast, you may need to ease up on the throttle or you'll overshoot 60MPH. Likewise if your 5MPH too slow and slowing down (maybe a steep hill) you can stomp the throttle more. Derivative gain, Kd, determines how much effect the rate of change in error has to do with the output.

Integral is the error over time. If you have your PID cruise control set for 60MPH it will never get there without Integral because it takes some throttle (output) to get the car to 60MPH. Let's say you're driving 60MPH, hit the cruise control, Proportional error is zero, Derivative is zero, guess what, the output is zero! You'll slow down until there is enough error to hold the throttle at some speed below the setpoint. Integral integrates the error over time and causes the output required to achieve zero error, it is needed when an output is needed for zero error, such as the cruise control or often a temperature control, or even a motion control in a vertical application or under a load.

Though not the scientific method, I raise proportional gain until it becomes unstable, then back it off a bit. Then I do the same with Derivative, then re-do proportional, back an forth a couple times until I have P and D controlling but well into the stable region. Then I work on I gain. One way is to put a little torque on the shaft to see some error, turn up I gain until it gets rid of disturbances on the shaft as fast as possible without oscillation.

For my lathe with tach feedback, I have D gain set to 0, the amp does enough that any D gain in the control seems to make it oscillate.

Hope this helps!

RogerN