MicroLogix PID Control

niteRider

Member
Join Date
Aug 2006
Location
OKC, OK
Posts
14
I'm using an AB Micro1500 with an Analog module to control a water system on a piece of heavy mobile machinery (a Reclaimer-Stabilizer used in highway preparation). We use a Sparling flowmeter to measure flow and the Micro also measures ground speed via a pulse pickup from the wheels.

The Micro is reading both flowrate and ground speed and controlling the pump via analog output. The analog output is tied to a HighCountryTek Valve driver which converts the voltage into a PWM signal.

Flowrate*GroundSpeed= Liquid Volume / Unit Distance (This is the control variable)

Right now, I am only using proportional control (set at about 350-400). Anyone have any advice on tuning the other (integrative and derivative)filter parameters?

Thx!
nR
 
I am confused.

niteRider said:
Flowrate*GroundSpeed= Liquid Volume / Unit Distance (This is the control variable)

1. The units analysis doesn't match. Look at the equations in terms of length and seconds. Volume is L^3, flow is L^3/sec. I think the equation should be:

Flowrate = (Liquid_Volume/Unit_Distance)*Ground Speed

This way the faster you go, the higher the flow rate must be.

2. Where is the feed back? A PID needs feedback. I don't think you are using closed loop control.

3. The control alogorith appears to be a feed foward control scheme, not a closed loop proporitonal control. Feed forward control is an excellent way to do this application. If your formula is actually like what I wrote then I agree with geniusintraining and think you shouldn't mess with what you are doing unless you have a very good reason.
 
Peter Nachtwey said:
1. The units analysis doesn't match. Look at the equations in terms of length and seconds. Volume is L^3, flow is L^3/sec. I think the equation should be:

Flowrate = (Liquid_Volume/Unit_Distance)*Ground Speed

This way the faster you go, the higher the flow rate must be.

2. Where is the feed back? A PID needs feedback. I don't think you are using closed loop control.

3. The control alogorith appears to be a feed foward control scheme, not a closed loop proporitonal control. Feed forward control is an excellent way to do this application. If your formula is actually like what I wrote then I agree with geniusintraining and think you shouldn't mess with what you are doing unless you have a very good reason.

Peter, my guess is niterider meant to say that his/her equation is his/her process variable. ( But I guess niterider can speak for him/her self).

niterider, if process variable is what you meant then the term control variable is what the output of a PID controller is called.
Usually expressed as a percentages (0-100% )or counts (0-16383).
 
Last edited:
Mickey said:
Peter, my guess is niterider meant to say that his/her equation is his/her process variable. ( But I guess niterider can speak for him/her self).
That doesn't make sense.

I reread the statement above. The flow meter must provide be the feedback or process variable. The set point would be the calculated flow_rate. The error would be the difference between the two. Unless there is some non-linearity or error caused by the valve I don't see the need for the feedback.

If the system is linear then
Code:
ControlOutput = (100%/MaxFlowRate)*(Liquid_Volume/Unit_Distance)*GroundSpeed
Is enough. We will have to wait for niterider to tell us his intentions. What I know is that the unit analysis is not right and one should be able to predict the flow required by the GroundSpeed so ideally no closed loop control is required.
 
Originally posted by Peter Nachtwey:

...and one should be able to predict the flow required by the GroundSpeed so ideally no closed loop control is required.

That can be said of a great many physical systems. It's just that far too few people take this direction or are convinced they require closed loop control without adequate data to back that assertion up.

I would agree with Peter's point that the baseline equation as posted by niteRider can't be correct. It doesn't seem to make sense, neither logically nor from a units standpoint. I suspect that the operator 'setpoint' is volume / distance. The controller develops a control setpoint based on the operator setpoint and the machine speed.

I also agree that we need to find out what niteRider's ultimate goal is. Is his current level of control unacceptable or is he just looking to expand his horizons. First of all the setpoint flowrate being determined in the plc should become a feed forward command and be sent to the valve with appropriate scaling. If this was done the need for a closed loop controller would be greatly reduced, if not completely eliminated. If a controller is still require it won't need to develop the majority of the command.

Keith
 
I'm not saying niteRiders equation is right or wrong. I have no idea.
What I am saying is I think niterider misused the term "control variable". I think niteRider is using (Flowrate*GroundSpeed)right or wrong as the process variable in the PID and the set point as stated is 350-400 ( what ever that is). But I could be wrong( most likely)
I wouldn't begin to debate the rest of the sfuff Peter and Kamenges are talking about as its all over my head.
 
Thanks for the input... good information!


Allow me to clarify (hopefully I won't mix my nomenclature...)


My process variable is derived from the instantaneous flow rate (either liters/meter or USgal/foot) and the instantaneous ground speed (either meters/min or ft/min). Dividing the inst. flow rate by the inst ground speed gives the liquid volume per unit distance (liters/meter or gal/foot). This is the feedback variable.

The control loop alters the flow rate (by generating a 0-10 VDC signal on the analog output) to achieve a set liter/meter or gal/foot (ie, the setpoint is the control variable).

As I mentioned Friday, I'm currently using only proportional action. What I am seeing is that the loop is tracking the setpoint, but when it gets close to the setpoint it has a hard time zeroing in... increasing the gain only causes it to overshoot and exhibit 'pulse-ish' behavior.

I expect to get some more test time this morning and am going to try adding integral action to the process in the hopes of eliminating some of inaccuracy. I wanted to see if you guys had any other tips.

thanks again!
nR
 
OK, let's break this down.

Originally posted by niteRider:

My process variable is derived from the instantaneous flow rate (either liters/meter or USgal/foot) and the instantaneous ground speed (either meters/min or ft/min).

I think this is just a typo, but your flowrate shouldn't be volume/distance, it should be volume/time. By dividing flowrate by speed you will get volume/distance. The thing that got Peter going was your original posts said:

Originally posted by niteRider:

Flowrate*GroundSpeed= Liquid Volume / Unit Distance (This is the control variable)

This doesn't agree with your last post and is, in fact, wrong.

While what you have may work, I would ultimately work in the units of your control device. Your output device is not directly controlling volume/distance. If it was you woudn't need to change the output with speed. You are controlling volume/time. Work in those units.

If you aren't already doing this, I would use a feed forward term based on what you know. You have more than enough information to make a REALLY good guess about the control output you need at any given speed and setpoint. Use that to your advantage. You will want to do this mostly because of my next point.

Based on what you have now you need an integral term. A Type 0 system will not be able to reach setpoint with proportional only control. However, integral terms add delay to the output. If you change ground speed or operator setpoint it will take time for the integrator to respond to this. You can largely replace what the integrator in a first order system does by using an accurate feed forward term. Don't let your PI loop generate a command you know you need anyway.

And finally, back to another of Peter's points. Are you sure you need to worry about this? Is the fact that you don't actually reach setpoint causing a problem or does it just look bad that the acual value doesn't match the setpoint?
 
It is clear niteRider is not using a feed foward but he should

My point it that one can compute the output to the valve directly using the GroundSpeed. See my equation above. From the GroundSpeed we can predict the flow. The predicted flow is multiply by 100%ControlOutput/100%Flow to yield the current output to the valve. As long as the feed forwards gain or 100%ControlOutput/100%Flow is accurate and reasonably linear there is no need to use a feedback. If could be that after awhile the 100%Flow changes because the tank levels are decreasing but we haven't got any information.

niteRIder WHY DO YOU NEED TO USE A PID? I want to hear some reason like the flow isn't constant at a given output or the valve is non-linear or the tank levels change or something like that. If you can't answer this then you don't understand your system.
 
You are absolutely right about the need for a feed-forward variable, but unfortunately time has become a limiting factor... the company I work for has a bit of a problem with only building systems when they have an order for one, so my first prototype ended up being the first production machine. I won't get into how maddening that is...


I was able to make the system work as described above by playing with the Proportional and Integral terms. Before lunch I was not having much luck... lots of overshooting and the output would never settle... by setting the RG bit in the PID instruction my performance improved dramatically... apparently I was off by a factor of 10 on my reset and gain.

Had I had the luxury of designing this system from the ground up (rather than taking the program from an old Slick500 and converting it to work on a Micrologix) I would have done it as you guys suggest. I also would have added a pressure sensor as well... when there is sufficient back pressure in the system it works really well... when there isn't, it jumps around quite a bit (makes sense).

It wasn't the best way to do it, but it worked...

thanks again for the feedback... I was really getting worried that they would ship the thing out from under me!

-nR
 
Peter Nachtwey said:
My point it that one can compute the output to the valve directly using the GroundSpeed. See my equation above. From the GroundSpeed we can predict the flow. The predicted flow is multiply by 100%ControlOutput/100%Flow to yield the current output to the valve. As long as the feed forwards gain or 100%ControlOutput/100%Flow is accurate and reasonably linear there is no need to use a feedback. If could be that after awhile the 100%Flow changes because the tank levels are decreasing but we haven't got any information.

niteRIder WHY DO YOU NEED TO USE A PID? I want to hear some reason like the flow isn't constant at a given output or the valve is non-linear or the tank levels change or something like that. If you can't answer this then you don't understand your system.


The reason I went with PID control was due to:

1- Ease of set up (basically one instruction)
2- There are 16-18 valve nozzles on the spray bar (2 per foot, 8 or 10 foot total) which are capable of being opened/closed in any combination, which causes the flow NOT to be the same at a given output, depending on how many valves are open.

-nR
 
OK, that helps but

Since the amount of water that is dispensed varies with the number of nozzles, that is effectively changing the system gain which means the PID gains need to change as the system gain changes. That is because the overall gain must be one if the error is going to be 0. For the best response I would have a table of max flow rates for each nozzle combination. If you have a PID then you should have this table anyway so you can change the proportional gain as a function of the nozzle combination. I still like the simple feed forward.

Code:
ControlOutput = (100%/MaxFlowRate[NozzleCombination])*(Liquid_Volume/Unit_Distance)*GroundSpeed

If you need to you can add a proportional gain to the feed forward. The feed forward with the proportional gain will work much better than the integrator with the proportional gain as long as you have the MaxFlowRate table. Integrators take time to respond so if the truck stops suddenly the integrator will take time to wind down and will be spilling fluid while it does. Then when you take off the integrator will take time to wind up and the flow rate will be too low. The feed forward scheme will respond instantly to changes in the GroundSpeed.

Here is the question. How do you add the proportional gain to the feed forward equation above?
 

Similar Topics

Hey guys, After spending most of a day Googling looking for the answer, I finally decided to make a thread and ask the experts. I'm trying to...
Replies
5
Views
3,566
Hi, I would like to ask about the allen bradley on how to use the pid block in the programming, the software i use is rslogix500 and model of plc...
Replies
4
Views
3,882
Hello guys. I'm from Brazil... So sorry there is an error. I'm begineer here and in CLP programation. I'm trying to control the temperature with...
Replies
2
Views
2,749
Hi Everyone. I have been reading through the forums, and I have learned a lot! I do have a specific question that I couldn't find. I have a...
Replies
8
Views
5,101
I have a Micrologix 1500. Need to control with PID for digital outputs open/close. There is no SRTP function (Split Range Time Proportional) in...
Replies
2
Views
3,268
Back
Top Bottom