PID - Not this week, JUST Feed Forwards instead.

Join Date
Apr 2002
Location
No income tax, no capital gains tax. Freedom!
Posts
8,351
Position System control with Feed Forward Only

WHY Feed Forwards?

If you have follow the previous threads you have seen where minimizing the ITAE or ISE can cause the system to be very 'twitchy' if carried to extremes. This is because PID requires error to work and gains can't be increased indefinitely. There is NO WAY you can tune as system perfectly with just a PID. Many people waste too much time trying.

Feed forwards can are used to provide a good estimate of the required control output. If this estimate is within 1% of the actual control output, the PID only needs to provide %1 of the control output. Little error required for the PID to generate that last %1 of control signal. If fact only about %1 of the error that would have been required without the feed forwards. Does that thinking seem a little backwards? Is it error that causes the output or is the error required to generate the necessary output. Think about it. I will comment later.

The above link is a modified spread sheet that has had the PID DISABLED and two feed forwards gains added. The feed forward gains are Kv ( velocity feed forward ) and Ka ( acceleration feed forward ).

The equation calculating the control output from feed forwards is easy:

output = Kv * target_velocity + Ka * target_acceleration

One can see the feed forward terms is independent of the actual position, speed etc. This means that adjusting these gains will not make the system oscillate. One can make the system overshoot though as you will see when you play with the spread sheet.
The goal is two fold. First to tune Kv and Ka only to minimize the ISE. The second is to modify the system Gain and Time Constant a little and notice how Kv and Ka change. There is a simple relationship between the system gains ( G, TC ) and the feed forwards gains ( Kv and Ka ). I will comment on this later after there has been time to experiment.

Don’t be afraid to ask questions. The concept of feed forwards is very import. A few have already mentioned that tuning the spread sheets is much more difficult without the feed forwards.
 
Last edited:
Peter,

Kv = .5
Ka = .13
ISE = .17

The outpue doesn't look bad to me. I didn't adjust the gains or TC yet. I am taking a quick break from my tile project. I will adjust the gains and TC later. Thanks Peter.

Bob O.

Question...

At the risk of sounding stupid, why doesn’t the output follow the actual? In my mind I could understand a sharp increase at the start, kind of like over coming static friction to get an object moving but then I would have thought that the output would have followed the actual closer until it reached its target. How/why is the actual increasing while the output remains constant until the target is reached?

Thanks Again,
Bob O.
 
Last edited:
This is a good question.

Bob O said:
Peter,
Question...

At the risk of sounding stupid, why doesn’t the output follow the actual?

But the actual does follow the target which is the goal :)

Some would not even notice that the position is not proportional to the output and not think to ask why? Bob O, you did everyone a favor by asking a question that others were afraid to ask.

This is a position system ( type 1 ), not a velocity system ( type 0 ). Yeah, that dirty dog Peter switched back to a position system in this weeks spread sheet. The VELOCITY is proportional to the control output. That proportionality factor is G, the system gain. The system gain is in inches per second per volt. The position moves at a rate proportional to the velocity. The faster the velocity the steeper the slope of the position line on the graph.

For Rytko, system model for this type 1 single pole position system is:

Code:
    G
---------
s*(tau*s+1)

Notice the first s in the denominator. That integrates the velocity to become position. A give away is the name of the spread sheet T1P1 ????.xls. The T1 is for type 1 and the P1 is for 1 pole. I need to have a consistant way of naming my work sheets and spread sheets.


A simple velocity or temperature system model is:

Code:
    G
---------
(tau*s+1)

Notice the first s in the denominator is missing. The transfer function has no integrator, that is why it is a type 0 system. In these systems the PV or actual velocity is proportional to the control output as Bob O expected.
 
You all have good results so far.

But what happens when G is changed to 1 or to 3? What happens if the TC ( system time constant is changed to .5 or .1 or .4 etc?

This exercise is very easy to tune. The relationship between the system gain G and Kv should be obvious. The relationship between the G and TC to Ka may not be.

Thomas, do the feed forwards work like this on a actual system?
 
Peter,

With the system tuned @ G = 2 and TC = .25 and then reducing TC too .1, I had to reduce the Ka to 10% of Kv. Then keeping TC = .1 and increasing G = 4 I had to reduce Kv by 50% and then Ka = 10% of Kv. The ISA was .18 in the above changes.
I have to get back to my honey do list. If I have time later, I will experiment more before going out of town on vacation.

Thanks,
Bob O.
 
Last edited:
ff

Yes they did it was all amazing, the controller showed up
along with the interface board for the nachi valve Thursday
evening at 6:00 PM. and 2:00 PM yesterday we cut the first
cant. I know thats no record, but me or the mill electrician
had any experience with motion control. Did you ever start a
project where you knew practically nothing about any of your parts?
I think we had the best teck support I`ve ever seen and a
blessing from Yahweh. i told Don D. this morning I`m still in
shock. The rmc is about the coolest thing I`ve seen sense they put
pockets on shirts. These loops we`ve been tuning take`s alot
of the fright out of it, you may not understand all the theory
behind it but you know what it`s suppose to look like. I read
the thread about begginers.We are all begginners at some thing or you`ve gotten lazy!
Sure would have been nice to go to the class and then do the job,
but the old controller went south last Monday about noon.
📚 :site:
Thanks
Tom an(hombre vieho)
 
ff

G=3
TC=1
Kv=.332
Ka=.339
= good move
If TC is increased you have increase Ka to make it respond
faster. If TC is higher guess you would want to respond faster to any changes in position, so if TC goes down Ka goes down because
you don`t need to accel as fast. TC is how your set is responding
to a set in the field higher number slower to respond lower
faster to go. Now if you go up on G you back off on Kv and if
you go up very much you have back off on Ka and so on. It`s
starting to make sense.
That is if the above is correct ?
I`m begining to see some light!sure hope it`s not a train!!!! :unsure:
 
You are getting it!

Originally posted by Thomas Sullens
G=3
TC=1
Kv=.332
Ka=.339
= good move
If TC is increased you have increase Ka to make it respond
faster. If TC is higher guess you would want to respond faster to any changes in position, so if TC goes down Ka goes down because
you don`t need to accel as fast.

Yes. In theory one should be able to control systems with very long time constants but the Ka would need to be increased so high that the +/- 10 volt limit would be exceed.

Try making the time constant longer and see.

Originally posted by Thomas Sullens
TC is how your set is responding
to a set in the field higher number slower to respond lower
faster to go.

For those of you that don't speak 'saw mill', a 'set' is a move to a position.

Yes, the longer the time constant the more sluggish the response.
It takes 5 time constants for the PV to with 1% of the SP on those systems that have only one pole. ( Lag or time constant )
Normally you design systems for have small time constants. Long time constants act like low pass filter we have seen so often on this forum.

Originally posted by Thomas Sullens
Now if you go up on G you back off on Kv and if
you go up very much you have back off on Ka and so on. It`s
starting to make sense.
That is if the above is correct ?

Yes. I will elaborate more after other have had some time to experiment.

Originally posted by Thomas Sullens
I`m begining to see some light!sure hope it`s not a train!!!! :unsure:

Once you see the light, however dimly, it is easier to go on.
 
The formulas for feed forward

The people that posted there results for the feed forward spread sheet did very well. The formulas to calculating the velocity and accelerat feed forward are:

Code:
      1
Kv = ---
      G

and
      TC
Ka = ---
      G

The equation for Ka is dependent on the model. Kv is always 1/G.

One can see that Ka can be increased to compensate for slow responding systems until the output reaches saturation limits at +/- 10 volts. In our training classes we have each student tune an analog simulator. When they get the system tuned we turn a pot that increases the time constant significantly. The PID alone can not possibly control the system. The Ka must be GREATLY increased to tune the system.

It should make sense that KV = 1/G because the goal is to have the overall gain of the controller and the plant to be 1. This way the Actual = Target or PV = SP

PV = SP * Controller openloop gains * plant gains. Since we want PV = SP, Controller openloop gains * plant gains should equal 1.

BTW, I too got the lowest ISE when Ka = 1.3 when the real answer should have been 1.25. Beleive me the answer is 1.25 but I wondered why. After rechecking my calculation it remembered the excel spreadsheet is a digital representation of a analog model and therefore not perfect. The model becomre more perfect as the same time is made smaller.

I was asked a couple of weeks ago about my first steps when tuning a system. I responded by saying I make a couple open loop moves. If I make a openloop move using a 1 volt output and the system reaches 3 inches per second then I know the system gain is 3 inchess per second per volt. Since Kv is 1/G, I know Kv is 1/3 volts per inche per second. I also look at how long the velocity takes to reach the stead state speed at 3 inches per second. If it takes 1 second for the velocity to reach 3 inches per second then I can calulate the time constant by dividing the 1 second by 5 since it takes 5 time constant to get within %1 of steady state. This means the time constant is .2 seconds. Now I can calculate Ka which is .2/3 or .01666 (TC/G). After I enter these values in for the feed fowards the actual position should be able to track the target position very closely. When tuning the PID now I do not need to be as aggressive as many of you were when tuning the PIDs. The feed forwards are doing most of the work. The PID just needs to correct for non-linearities and load changes.
 
I played with your spreadsheet and without looking I managed to come up with the exact solution as Mr. Sullens.

Could you try and relate the "time constant" and the real world. In a hydraulic system is the time constant akin to the time it takes for a valve to respond? Or is it more closely related to the mechanics of the system?

I've been trying to keep up with the math but it's difficult for a spark chaser such as myself. The last differential equation I solved involved a pizza. The faster I ate the pizza, the closer I approached full per unit time. The amount of beer drank didn't seem to affect the equation, just made computation more difficult.
 
Difficult questions for simple explanations.

Originally posted by allscott
I played with your spreadsheet and without looking I managed to come up with the exact solution as Mr. Sullens.

So did I, but that is because the perfect analog model is being converted to a digital one. The model and PID is only updated every 10 milliseconds which is very coarse. If I increased the update rate then the spread sheet would be much bigger and more accurate.
The real answer for ka is .125. From the equation above

Ka=TC/G or .25/2 = .125. That isn't too hard.

Originally posted by allscott
Could you try and relate the "time constant" and the real world. In a hydraulic system is the time constant akin to the time it takes for a valve to respond?

Yes, valves often have a specification for how quickly the spool will get to 95% of full open in response to a step input of 100%. A time constant is the time it takes to go the first 63%. See these links. They may explain better as they use simple electrical/electronic circuits.

RC Time Constant
L/R Time Constant
Filter Circuits

Originally posted by allscott
Or is it more closely related to the mechanics of the system?

Thermocouples have time constants. If you put one in the freezer it will take time to approach steady state. Most mechanical systems vibrate or oscillate which is a little more complex ( does any one get the joke? ) than a single pole system.

Originally posted by allscott
I've been trying to keep up with the math but it's difficult for a spark chaser such as myself. The last differential equation I solved involved a pizza. The faster I ate the pizza, the closer I approached full per unit time. The amount of beer drank didn't seem to affect the equation, just made computation more difficult.

The first differential equation I was exposed to involved interest on my savings account. Later I was exposed to paying of college and car loans.

I have been trying to keep the math simple so one can do it with a calculator. The real benefit comes from experimenting with the spread sheets and checking the 'what ifs'.
 
Last edited:
t/c

Hi allscott
The amount of beer drank didn't seem to affect the equation, just made computation more difficult. difficult = slower which effected
your TC how your system reacts to change. I could be wrong. Just a
thought.
Tom beerchug
 
Originally posted by Peter Nachtway:

Thermocouples have time constants. If you put one in the freezer it will take time to approach steady state. Most mechanical systems vibrate or oscillate which is a little more complex ( does any one get the joke? ) than a single pole system.

How very 'imaginative' of you Peter, in a 'j' sort of way.

You seem to infer from your response to this question that the time constant is more related to the sensor/actuator response that to the torque (or force) to inertia (or mass) ratio. I would think that would have a larger effect on the system time constant than the actuator or sensor time constant.

Keith
 

Similar Topics

I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
9
Views
259
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
851
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
386
I'm setting up a PID for a 50hp RO pump in a water treatment plant. When I go to manual mode on hmi I set the swm bit, I also ons the pid output%...
Replies
5
Views
524
I am setting up control for Hypochlorite dosing. The easy part is the dosing calculation for flow pacing but I would also like to setup trimming...
Replies
8
Views
896
Back
Top Bottom