How many of you have used cascaded loops?

Here is something to study

On sci.engr.control
http://groups.google.com/group/sci.engr.control/browse_frm/thread/b8b9b29ad80d6171#
there was a recent thread from a student asking about why inner loop is faster than the outer loop. many gave their opinions but none would or could back them up. One person posted a link to this document.
http://www.google.com/url?sa=D&q=ht...10.pdf&usg=AFQjCNEgf6hoatvdpc3_ruaNIlyzVYJjXw
which is the same one Mordred posted previously. At the bottom of page 257 the pdf file challenges the notion that the inner loop must be much faster. I have worked through a few example to know that it depends a lot on the system. Even though I hinted that the document may be right I was ignored even though I asked for proof ( which I know they could supply as a general rule ). Then JCH challenged the forum to find a better solution than what he had for a transfer function. JCH is alway trying to put down simple PID control and in this case he thought his solution was better than cascaded PIDs. I finally got a little irritate with JCH for insisting he had a better solution and cascades loops aren't as good and I got irritated that those that claim to be engineers repeated myths they couldn't back up.

As it turns out I was working on cascaded loops at the time so I finally made a work sheet to solve JCH's example. I found out that JCH's transfer function is one where the outer loop can be faster than the inner loop. I was glad I put in the effort because now I have an example of the outer loop being faster than the inner loop.
You can see my solution is much faster than JCH's solutionYou need to look at JCH's website. JCH never shows his work and doesn't know how to tune PIDs so his examples always make PID control look bad.

Here is my solution
http://www.deltamotion.com/peter/Mathcad/Mathcad - t2p1 JCH cascade simple.pdf
All the calculations are shown. It is easy to see my response is faster. The response is critically damped and yet the ratio of the inner loop to the outer loop bandwidth is only 1.669 to 1. See the bottom of page 10/15.

If I change my outer loop controller to have a second derivative gain the outer loop bandwidth is extended and can be faster than the inner loop bandwidth.

Is this too deep for a magazine? I think so yet there is so much good information here. This would definitely take more than just one article.

I am sure Pandiani can figure this out but I wonder who else will wade through this. The engineers on sci.engr.control didn't seem to want to put any effort into this. I wonder if even they would wade through the math if it was presented to them. I solve these problems and teach the engineers here at Delta so they don't embarrass themselves like those other guys did .

A brief explanation for each page
1. Defines JCH's transfer function and computes the symbolic equations for the inner loop gains. Only using Kp and Kd
2. Computes the symbolic equations for the outer loop gains. Look closely at the formula for the outer loop gains.
3. Assigns number to the transfer function and computes numerical values for the inner and outer loop gains using the transfer function and the desired inner loop pole locations.
4. Computes the discrete arrays for simulation.
5. Define the Cascaded controller and JCH's step function.
6. The outer loop response to the step changes in position. The output of the outer loop is an inner loop target velocity
7. The inner loop response to the inner loop target velocity and the velocity feedback.
8 Outer loop response to a sine wave.
9 Inner loop response to a sine wave.
10. Calculate the inner and outer loop bandwidth and find the ratio of the inner loop to the outer loop.
11-12. The inner and outer loop Bode plots.
13. Calculations for the inner and outer pole and zero plot
14. The pole and zero plot.

Don't complain to me if your head hurts.
 
I'll definetely be wading through this, After seeing examples where the inner loop and outer loop were workable at the same speed I was wondering myself if having a faster response on the outer loop was viable. My head hurts every day listening to my wife so adding a challenging exercise is no biggie and provides a nice LOGICAL distraction.
 
Just understanding the first page is a real eye opener!!!

mordred said:
I'll definetely be wading through this, After seeing examples where the inner loop and outer loop were workable at the same speed I was wondering myself if having a faster response on the outer loop was viable.
Viable, yes. I don't know if it is most optimal solution. For instance the solution you see in the pdf is easy to calculate and is very robust as lambda from from 1/2 alpha to about 5/3 alpha but the ratio of the inner loop to the outer loop bandwidth is always 1.669.

If a second derivative gain is added then the outer loop poles can be moved independently of the inner loop poles. Then the outer loop can be made faster than the inner loop and still get a nice critically damped response over a range of values. The problem is that most people don't have access to a controller that can handle second derivative gains and don't like to use derivative gains let alone second derivative gains. They would never consider second derivative gains or even know such a thing exists.

Most people tune the system using trial and error. I was surprised at how narrow the options for good tuning are and one has to almost be lucky to find the right ratio between the inner loop and outer loop gains.
 
One of the biggest problems I and many others like myself face in understanding materials written by Engineers is they always seem to forget that not everyone is familiar with all the symbology used. One example is the usage of the greek symbols Lambda and Alpha. If you go look them up They can often mean several things so you end up puzzling out which form they are using. Keep in mind that I'm writing this in regards to the idea of your article you wish to write.
It would make understanding articles of this nature a whole lot easier if a table of Symbology is included with the formulas to derive their values included where possible.

Most of us are capable of the mathematics in and of itself. After all we all did algebra and/or calculus however ppl tend to stop trying to puzzle it out when they have no way of knowing how the variable/constant is derived. Or how they go from this equation to that equation.

Side note I haven't worked with domain state arrays before I'm assuming mathematically they work the same as the matrix state arrays which I do know how to use and apply?
 
Last edited:
One of the biggest problems I and many others like myself face in understanding materials written by Engineers is they always seem to forget that not everyone is familiar with all the symbology used.
It is the context in which the symbols are used. α ( alpha ) in K*α/(s*(s+α)) is just the inverse of a time constant. In the denominator there are two poles. One is at s=0 and the other is at -α. The poles at s=0 is a pure integrator. It integrates the acceleration to velocity in this example. The pole where s=-α tells use the system acceleration will decay to 0 as time goes on a(t)=a0*e-α*t. Alpha is usually used in this context but any symbol will do. It is just a way of show symbolically there is a real pole.

λ is used to designate the location of the desired inner loop pole locations. λ2/(s+λ)2 is simply the desired response. A single pole has a response of λ/(s+λ) This is the same as the low pass filter we have seen so many times now on this forum.
Code:
Output(n+1)=e[sup]-λ*Δt[/sup]*Output(n)+(1-e[sup]-λ*Δt[/sup])Input(n+1)
Normally we see on this forum
Code:
k=1-e[sup]-λ*Δt[/sup]
Output(n+1)=Output(n)+k*(Input(n+1)-Output(n))
To get the response of λ2/(s+λ)2 on uses the filter twice
Code:
Output1(n+1)=Output1(n)+k*(Input1(n+1)-Output1(n))
Output1(n+1)=Output1(n)+k*(Output1(n+1)-Output2(n))

One example is the usage of the greek symbols Lambda and Alpha. If you go look them up They can often mean several things so you end up puzzling out which form they are using. Keep in mind that I'm writing this in regards to the idea of your article you wish to write.
It would make understanding articles of this nature a whole lot easier if a table of Symbology is included with the formulas to derive their values included where possible.
Noted but the symbols can be anything. I tried to use the most common ones found in books but you have hit on a key problem with the engineering books. There is a lack of consistency but it isn't the symbol. It is how it is used. In this case -α is the location of the pole in the open loop transfer function and -λ is desired location of the two inner loop poles that will provide a smooth response to steps without overshooting.

Most of us are capable of the mathematics in and of itself. After all we all did algebra and/or calculus however ppl tend to stop trying to puzzle it out when they have no way of knowing how the variable/constant is derived. Or how they go from this equation to that equation.
In this case α was provided by JCH. λ is a value I or we chose to get the desired response. It is just another way of changing k in the formula above. If λ is bigger the poles move to -λ and the response is faster.

Side note I haven't worked with domain state arrays before I'm assuming mathematically they work the same as the matrix state arrays which I do know how to use and apply?
Yes, they are normal arrays in the way they add, subtract, multiply and divide. The only tricky thing I have done is that it is necessary to compute e-A*Δt where A is the matrix. I used a 7 term Taylor series to approximate that. The math is shown. BTW, Δt is the scan time.

I think my deep dive article better be limited to snorkeling depth. It would be interesting to see what Pandiani or Rytko has to say about this.

This thread explains what I am doing on the first page.
http://www.plctalk.net/qanda/showthread.php?t=36407&highlight=Quiz
 
Thanks Peter this helps me understand this much easier. Now I'm starting to see how we got from point A to B the other thread helps out a lot as well. As you can tell I've been working on studying motion control so I definetely want to work through this and other exercises as I don't get the opportunity to play around with it much with my current job. I still value the skills and knowledge gained from it
 
I think my deep dive article better be limited to snorkeling depth. It would be interesting to see what Pandiani or Rytko has to say about this.


Better to wade, then snorkel, before you dive in that order lol
 
The system at my mill used to use a 2 stage cascaded loop. The first 2 loop ran every 2 seconds, the 2nd loop ran once a second and outputted to another system (drive) which communicated to the drive every half second. It worked but the loops were not properly tuned as too many other things were going wrong with the system and only the manufacturers engineers were allowed to tune the system.

I changed the system to a AB system and since the drive and DCS system are on the same PLC it is just the 2 loops set at the same speed (200ms). The 2nd loop controls the drive speed which has a 50ms interrupt.
I tuned each loop manually (the autotune just doesn't even come close to stable) starting at the drive loop, then the 2nd PID, then the 1st PID. I set the 2nd with higher gains for faster reactions than the 1st, which I presume is a lazy way of not putting them at different loop speeds.

My reasoning for the 'myth' for the gains or loop time, is so that the 2nd loop can react to the SP change before the SP is changed again. I suppose every system would be different but thats not a rule of thumb. At a guess I would use a 2-1 ratio to start with, but I'm just a noob.
 
What is meant by faster?

In cascaded loop terms faster means having a higher bandwidth. The bandwidth is the frequency where the amplitude drops by -3db or 0.707 of the signal at 0 Hz. The usable closed loop bandwidth is much less.

In pdf file the inner and outer loops are updated every millisecond. This is common in motion controllers. Process system may have completely different controllers for the inner and outer loops. This makes coordinating the tuning more difficult.

Tuning is easier when all the gains are in one controller. It is possible to do the math so that all the interactions between the loops are taken into consideration. You can see in my example that the outer loop gains and not dependent on the plant parameters at all. The outer loop proportional gain is only dependent on λ which is used to specify the desired response. Notice that the outer loop derivative gain is always 1/3 and doesn't depend on the system parameters or the desired response in this example.

I agree some time needs to be spent in the children's wading pool.
I have already talked to our marketing manager and we should barely go ankle deep.

Now Keith knows why the articles have more fluff than stuff and lean heavily on application articles.
 
Originally posted by Peter Nachtwey:

Now Keith knows why the articles have more fluff than stuff and lean heavily on application articles.

Touche'.

I finally had a chance to go through the cascaded loops PDF. Interestingly enough I get everything except the simulation matrices and the discrete time domain conversion. I guess I have a mission for this year.

I guess I'm waffling a bit on my technical depth of articles position. I would personally like them a little on the heavy side. But, while this forum is available to all, not everyone has a source of interactive knowledge like this forum provides. So if they get a little buried they may just toss it to the side and forget it.

On a loosely related note, why did Mathcad multiply all the equation coefficients by 33 when it expanded the outer loop closed loop transfer function on page 13? It didn't do that with the inner loop equation just above it.

Keith
 
On a loosely related note, why did Mathcad multiply all the equation coefficients by 33 when it expanded the outer loop closed loop transfer function on page 13? It didn't do that with the inner loop equation just above it.
I have no idea. Mathcad does some strange things sometimes. It doesn't a number of things I don't like.

What specifically don't you understand about the simulation matrices?
 
I'm very weak on matrix and vector algebra and state-space system representations. So I can't move between a transfer fuunction in algbraic notation and a matrix representation. I'm not sure what the matrix rows and columns represent nor how to multiply the matrices and vectors with any confidence.

And then there's the whole discrete time transform thing. Again, more reading.

I've got some studying to do. But I do have some material to go through.

Keith
 
I'm very weak on matrix and vector algebra and state-space system representations.
JCH's transfer function describes how a system will accelerate but in his example he was controlling position.

The 3x1 x array has the current state which contains the current position, velocity and acceleration. The initial position is 0.6. Don't you have SimApp? You should be able to simulate this too.

I will be on Skype from time to time this weekend.
I bet I can explain in 5 minutes what is happening on page 4/15.
 

Similar Topics

Good Morning , Looking into hiring , to replenish our retiring workforce . Have you had success using Indeed , and how much does it cost ...
Replies
4
Views
1,989
Good Evening , We have a number of Powerflex 525 Drives . I took notice for years elsewhere and our plant , that our Powerflex 525 drive...
Replies
0
Views
642
Good Afternoon, Just wondering , are many of you using SAP in your plants ? If so , is it difficult to learn ? Are there many training...
Replies
10
Views
1,423
It better to have too many instead of not enough right?
Replies
26
Views
2,899
Hi all- I have an application where: - I have a fixed system with a pre-determined, static, network (say, 192.168.2.0/24). - That system...
Replies
13
Views
4,242
Back
Top Bottom