‫Welcome back in this video, I would like to expand on the LPV concept, we ended up with this formulation
‫that allowed us to predict our four future states x one x two x three and X four in one go.
‫However, when it comes to LP V, then this is a simplified approach.
‫This is your global control schematics.
‫You have your plant, the planner feedback organization, and in this box you have LP and PC.
‫You already know that you have four inner loops through one outer loop, so the Feedback Loop unionization
‫controller gives you a new five R and Theta R every 0.4 seconds that you have to track.
‫And then NPC using the LP formulation tries to track fire and thetr together with CI R that comes out
‫of the planner and it tries to finish tracking it during four inner loops and each inner loop lasts
‫for 0.1 second.
‫So 0.4 seconds when outer loop 0.1 second one inner loop.
‫Therefore, you have four inner loops in one outer loop, so every 0.1 second, the LP v NPC controller
‫gives you a new U2, Q3 and Q4 control inputs that go into the plant together with you, one that comes
‫out of this feedback linear Asian box.
‫And then the plant gives you new states every 0.1 seconds, every in the Loop LP, the NPC gives you
‫new U2, Q3 and Q4 control inputs and every inner loop.
‫The plan gives you new states.
‫Of course, you one stays the same during all the four inner loops you want changes every outlook.
‫And now remember that our continuous a matrix in our LP formulation depends on the variables fi that
‫standard and also the omega.
‫And so because of that, the continuous a matrix changes every 0.1 second, every inner loop, not the
‫B matrix, though the B matrix remains unchanged because it does not have any changing variables there.
‫Only I double x, I double Y and I double Z.
‫These are your mass moments of inertia about the body from X, Y and z axis.
‫And because of the fact that they are measured with respect to your body frame, they stay constant.
‫But the matrix changes every 0.1 second, every inner loop.
‫But that also means that in the prediction formula, both of these gigantic matrices.
‫This one here and this one here, they would also change every 0.1 second because the matrix is inside
‫them would change every 0.1 second.
‫Now, if your horizon period is very short, like in our case, Horizon period equals four, then it's
‫OK.
‫You can use this formulation, which is what we will do in this course.
‫However, if the horizon period is longer, which was the case in the previous course in this control
‫system series called Applied Control Systems, two autonomous cars 360 tracking where the horizon appeared
‫equal 10, then you have to do it in a more advanced way.
‫You also have to update your A matrices in your predictions.
‫So I'm going to draw here, my LPV and BusyBox, my plants.
‫For now, let's still consider that our Horizon period equals four.
‫So let's say that your MPAC controller finds this vector of control inputs you global that looks like
‫this.
‫Note that this U0 it contains your first you to use three and you four control inputs.
‫Then you one.
‫It contains your second to Q3 and Q4 inputs and et cetera.
‫You two, it would contain your third.
‫You two use three and you four inputs and then you three.
‫It would continue to force you to Q3 and Q4 inputs.
‫And so you already know that NPC only takes the first sub vector and gives it to the plant and it discards
‫the rest.
‫These are your leftovers that you're not going to use for your plant.
‫Then your plant will compute a new state vector that's called X1, and then you're going to start with
‫the new loop.
‫So what I will do now, I'm going to put here a red line, and I'm going to say that everything that
‫crosses this red line, it means that for that variable, a new loop has started.
‫So for example, this is your new state vector X1.
‫But once it crosses this red line, then you are in your new loop already.
‫So this x1 the same vector here it will be X0.
‫So your present state, it's exactly the same vector is just because it has crossed this red line.
‫Now I consider this vector to be a present state vector because now I'm in my new loop and I'm concerned
‫with finding new control inputs in order to calculate a new state vector.
‫And by the way, this present state vector, it will also enter into your plant.
‫In other words, once you cross this red line, your new state becomes your present state because you're
‫in a new loop now.
‫And then if we look at these control input leftovers, you won you two and you three the ones that you
‫did not use for your plants, the ones that you discarded.
‫Well, at the beginning, they are you one, you two and three.
‫But then once you start with your new loop, once you cross this red line, they become you zero, you
‫one and you two.
‫So this one here is this one here.
‫But in the next loop, then this one here, it's this one here, but in the next loop.
‫And then this one here, that's this one here in the next loop.
‫And actually, the same thing happens with this you zero the sum vector that you did apply to your plant.
‫At the beginning, it was you zero.
‫But then once you go and enter a new loop, this you zero in the new loop, it will be you minus one.
‫Since you're in a new loop, everything shifts one step back.
‫And so as you go through your new loop, you enter into your PC box and inside your LPV, the NPC box,
‫you have to predict your Future State Vector X1 with this formula, A0 times your present state vector,
‫plus B times use zero.
‫So this X1, this is your predicted state vector one time step into the future.
‫Now, keep in mind that this use zero here.
‫That's not the one that you had applied to your plans.
‫One loop before.
‫Remember, you're in a new loop now.
‫So this you zero here four.
‫Which is better if I use green, it's this one here.
‫Or in other words, in the previous loop, it was your first leftover.
‫Is this one here?
‫You won?
‫But now, since you're in your new loop, this new one became you zero.
‫And since you're predicting your future state vectors in your new loop, this use zero here.
‫It's this one here or your first left over from the previous loop.
‫Then this vector X0.
‫And that's your present state vector.
‫In the previous loop, it was your new state vector.
‫But now in this loop, it's your present state vector, and it looks like this transposed because actually
‫it's your column vector.
‫And so from this present state vector, you take 5.0 and citadels zero and you put them inside your
‫A0 matrix.
‫You see, this was your continuous a matrix in the LPT format.
‫But remember that this is zero here.
‫This is your discrete A0.
‫So actually, it's like this this aid zero.
‫It's this one here, and it equals the identity matrix.
‫Plus the continuous a matrix times the sample time interval and this one here.
‫That's this one here.
‫And quite frankly, you don't need these notations here.
‫You can automatically see that this is a discrete a matrix.
‫Why?
‫Because if you look at this form, then it's X at K plus one equals eight times x at the K plus b times
‫use up K.
‫This is a discrete form.
‫A continuous form would be like this x dot equals eight times x plus b times you.
‫If you have x dot here, then that means that you're A and B matrices are continuous.
‫If you have X at Kate plus one here and exit K here and you add K here, then your A and B matrices
‫are discrete.
‫So I don't have to specify whether my A matrix is discrete or continuous.
‫You can see from this form this one, it's like your Capa's one.
‫And this zero, it's like your K and also the zero.
‫It's like your K here.
‫But if you look at this form here, then you can see that here you have your ex dot, you have your
‫five dot fi double down theater dot to double dot signed on side double dot.
‫So this is clearly in the continuous format.
‫Therefore, these matrices here, they're continuous.
‫And so obviously this B matrix here, it's also your discrete P matrix, which is your continuous B
‫matrix times t.
‫So that's the formula.
‫We covered the derivations in the first part in this control system series.
‫You see, that's how you obtain your disk with a matrix.
‫And this could be matrix and then you're discrete.
‫See, Matrix was equal to your continuous see matrix.
‫And now, once you have put your 5.0 and 10.0 inside your discrete A0 matrix, you take your latest
‫omega that you have calculated inside your plant.
‫It's right here.
‫First, you calculated your omega one omega to omega three and omega four, and then you calculated
‫your global omega.
‫It happened here inside the plant.
‫You see you had your you want you to use three and you four, and you used them to compute your global
‫or.
‫And so you take the global Omega that you had calculated in your plant in the previous loop.
‫And you also put it inside your A0 matrix here because as you can see that in the continuous LP, a
‫matrix, you also have omega here.
‫And that's why you also have to put it inside your discrete a matrix in the previous loop this omega
‫zero.
‫It was actually omega one because it was your new omega that you had calculated inside your plant.
‫But now, since you started with a new loop, it became your present omega.