PID Tuning Problems

scthor

Member
Join Date
May 2014
Location
Michigan
Posts
7
I am working on a drive system where I'm using a PID closed loop to control the speed of a drive (AB PF40). I developed my own PID block but am having trouble tuning it. I start by normalizing the target speed (in feet per minute) to a power (max speed = 100 power) and perform the PID calculations in terms of the power. When I start to try tuning the PID loop it always seems to be oscillating +-50 FPM which isn't good.

I was under the impression that the P term gets you roughly to where the setpoint is, the I term keeps you there, and the D term allows for faster adjustments. If this is true I would expect that as I lower the I term the current speed would start to tuck closer to the setpoint and a higher D term would cut down on the overshoot. Am I thinking about this wrong?

Does anyone have any suggestions that could help tune this loop? I have attached my PID code so you guys can take a look.

Thanks and and really appreciate any assistance you can give!
 
What is the inverter accel/decel set to? If the drive doesn't respond quickly to the PID demands it could set up the kind of oscillation you are seeing.

What are you trying to maintain? i.e. Flow, Level, Pressure
In most cases I would try to set it up using only P or I gain, depending on the answer. Then bring the other gains in if necessary.

I'm sure there will be a PID expert along soon though.................
 
Last edited:
Thanks everyone for your replies!

I had tried using the Rockwell PID block and didn’t have much success with it. I am actually getting results closer to what I need from my own block and it is taking a fair amount less resources from the controller.

The accel/decel are both set to 0.1 and I’m trying to maintain a motor speed.

I've also attached a trend of the output (TARGET_DRV_VEL) and the actual speed plotted. The target speed is 300FPM. The PID output is in terms of power and the output (TARGET_DRV_VEL) is the result after the normalization rung in the code I posted to convert it to a frequency and is in terms of FPM. DRV_CURR_VEL is the speed the VFD is reporting.

Capture.jpg
 
A quick check on Wikipedia (PID_controller) indicated setting the I and D to zero and increasing P until the output oscillates, then setting P to about half of that value.
Increase I "until any offset is corrected in sufficient time for the process" (too much I will make it unstable).
Finally, increase D, if required, "until the loop is acceptably quick to reach its reference after a load disturbance". Too much D will cause excessive response and overshoot.
 
Thanks everyone for your replies!

I had tried using the Rockwell PID block and didn’t have much success with it. I am actually getting results closer to what I need from my own block and it is taking a fair amount less resources from the controller.
Probably because you don't understand it. I understand, it is much easier to understand what you write.

The accel/decel are both set to 0.1 and I’m trying to maintain a motor speed.
This means nothing without units. Also, is this a limit on the actual or current acceleration in the drive or your target acceleration in your PID AOI. However, it looks like your target velocity is changing in steps and the current or actual velocity is trying to do the steps but is limited by the acceleration rate.

I've also attached a trend of the output (TARGET_DRV_VEL) and the actual speed plotted. The target speed is 300FPM. The PID output is in terms of power and the output (TARGET_DRV_VEL) is the result after the normalization rung in the code I posted to convert it to a frequency and is in terms of FPM. DRV_CURR_VEL is the speed the VFD is reporting.
I always try to plot the velocities on the same scale. Also, use a lighter blue if you can. The dark blue is almost invisible.

scthor, for wanting help you sure are making it difficult. Does the drive have a velocity loop? If the drive is limiting the acceleration and deceleration then how can it do that without knowing the velocity and having some sort of velocity control?

Do you know what feed forwards are?

@danatomega, that Wiki page needs help.
 
Originally Posted by scthor View Post
Thanks everyone for your replies!

I had tried using the Rockwell PID block and didn’t have much success with it. I am actually getting results closer to what I need from my own block and it is taking a fair amount less resources from the controller.
Probably because you don't understand it. I understand, it is much easier to understand what you write.

I agree it is easier to understand our own code and my implementing it myself I should understand the concepts better for next time.

The accel/decel are both set to 0.1 and I’m trying to maintain a motor speed.
This means nothing without units. Also, is this a limit on the actual or current acceleration in the drive or your target acceleration in your PID AOI.

I'm sorry I did forget the units, which are in seconds, and the drive operates on a frequency (and reports a frequency for it's reference to the PLC) The accel and decel parameters are limits on the current accel and decel in the drive. The actual is a function of these paramaters (respectively) and the maximum frequency.

Since the drive works on frequency rather than velocity it has a frequency loop and it uses the frequency it feeds back to the PLC in it's frequency control

However, it looks like your target velocity is changing in steps and the current or actual velocity is trying to do the steps but is limited by the acceleration rate.

The output from the PID AOI is a REAL in terms of power that's converted to a frequency when passed to the drive. The value passed to the drive has to be an INT that's scaled (i.e 350 = 35.0Hz). I believe it looks like the target velocity is changing in steps because the output is jumping 10-15 units because it's not tuned...Could that be possible?

Do you know what feed forwards are?

All I know of feed forwards are they measure a disturbance instead of an error and can be used in conjunction with PID controls. Do you think this is something I should try?
 
I am working on a system that requires me to control x number of motors using VFDs and be able to compensate for system speed when the load on the system changes and/or a some of the drives go offline (up to a certain percentage before stopping the system).
 
The change in load will be due to the items passing through the system having varied weights and/or a higher/lower volume of items going through the system.
 
I was able to get my PID to give a pretty good output (oscillating less than 1%) but it's not centered at the setpoint, its a lot lower. Does anyone have an idea why and how this can be corrected?
 

Similar Topics

Hello, I am attempting to tune a PID loop on a process. The process involves a valve with electronic actuator that has quite a high deadband...
Replies
10
Views
2,150
so i have 4 25gpm wells feeding a 1000gal tank (T-1), with an additional 15gpm from a decant tank for 3hrs every 12hrs. P1 and P2 both controlled...
Replies
154
Views
35,841
Hi everyone, yet another PID problem. I'm hoping I understand enough of the process I'm controlling that my request for help is reasonable. If a...
Replies
113
Views
27,838
A few months ago, I started to look into PID controllers and the tuning of first order processes. This has, partly thanks to you, resulted in a...
Replies
162
Views
61,976
I haven't had to tune a PID loop in a very long time. It's actually a PI loop for a pulse width modulation s.v. What was the name of that tuning...
Replies
16
Views
4,091
Back
Top Bottom