Control Bootcamp: LQG Example in Matlab

Ғылым және технология

This video combines the LQR and Kalman filter in Matlab on the example of an inverted pendulum on a cart. We stabilize the full nonlinear system with a measurement of a single variable (the cart position). This example is demonstrated in simulink.
Code available at: faculty.washington.edu/sbrunton/control_bootcamp_code.zip
These lectures follow Chapters 1 & 3 from:
Machine learning control, by Duriez, Brunton, & Noack
www.amazon.com/Machine-Learni...
Chapters available at: faculty.washington.edu/sbrunto...
This video was produced at the University of Washington

Пікірлер: 29

  • @hariprasadhparthasarathy9287
    @hariprasadhparthasarathy92874 жыл бұрын

    Dear Prof, great lectures really well presented.

  • @FliBaleon
    @FliBaleon4 жыл бұрын

    If you got a positive gain in the LQR you just need to reverse the signs of the block with the step and the position estimation as input? Another question, does the proportional regulator gives some oscillation problem around the reference point, do we need a pole in zero?

  • @hakansezen2019
    @hakansezen20193 жыл бұрын

    Sir, Nonlinear dynamics S-Function Buldier, Can it be used as SS Steady state block

  • @ashikahmed2241
    @ashikahmed22414 жыл бұрын

    Is it not possible to simulate the nonlinear (actual) model of the system without S-function? Are the noise and disturbance taken care of within the S-function?

  • @ashikahmed2241
    @ashikahmed22414 жыл бұрын

    Dear Prof, does the system work well with Vd=0.001*eye(4) and Vn=0.001? For me it is not giving good result (although stable). As i checked your code (from the provided link), I find that the values of Vd and Vn are set to 0.0000001 and the system shows excellent result. Which one should we use?

  • @mehmedhezenci722
    @mehmedhezenci7224 жыл бұрын

    Sir, if we suppose x and theta don't have any relation with x_dot and theta_dot in system equetions, how can I linearize it at fixedpoints. İn that, I cannot place equlibrium x and theta after differentiate equetions because there aren't.(is it logical). I have a system like that. But ı have to linearize it. I hope I can explain my problem.

  • @murat9480
    @murat94804 жыл бұрын

    Sir you didn't add white noise to measurement and process. But there are disturbance and noise covariance.

  • @boxiao6830
    @boxiao68302 жыл бұрын

    What if I make C = [1 1 0 0], assume it is still observable, what will happen, is it going to affect x_hat?

  • @turkey343434
    @turkey3434344 жыл бұрын

    Sir why did you not subtract PI from "theta" at 7:27 minute mark in the video?

  • @Eigensteve

    @Eigensteve

    4 жыл бұрын

    Good question. You can actually download the code at databookuw.com under the CODE.zip link. Then you can play with the simulink model more. There are a couple of things that could be going on here: 1) I might have subtracted pi in the simulink code, or 2) I might be linearizing about the up position, in which case this would become the "origin". But I would check out the code to make sure.

  • @wizardOfRobots
    @wizardOfRobots4 жыл бұрын

    Prof. this might be a strange question, but does the controller move to the left a little before moving to 10. and if so, how does the controller know to do that?

  • @tushermyth

    @tushermyth

    3 жыл бұрын

    The same thing popped to me. Yes, I think it has to move a little bit back first to tilt the pendulum forwards (the yellow curve on the scope dips a bit). But I am not sure how it knows that.

  • @RugnirSvenstarr

    @RugnirSvenstarr

    2 жыл бұрын

    ​@@tushermyth The -K matrix given to us by the LQR encodes how to get the system to go to a state of [0,0,0,0] - that includes information about how to move while keeping the pendulum upright, which includes putting it slightly off balance to move the cart by going backwards first.

  • @navsquid32
    @navsquid323 жыл бұрын

    What is the x vector that is multiplied with the sysKF.A matrix? I'm doing this in Python, and therefore I don't have Simulink. Since we only know the x-position, what should go in to the other 3 entries in the x-vector? Is it the previous state from the Kalman filter?

  • @AchrajSarma

    @AchrajSarma

    Ай бұрын

    I think the inital x_hat vector is the same as the x_vector [0;0;pi;0] and then the sysKF dynamics takes it from there? Would also like a clarification on this. Inputs to the sysKF are u and y, how is x_hat being taken as an input as well?

  • @georgepb4703
    @georgepb4703 Жыл бұрын

    Dear Prof, thank you for the Control Bootcamp, I keep revisiting it year after year! This time I come with a question regarding our C = [1 0 0 0]; Matrix. Usually encoders for inverted pendulums are set to read the Theta angle. So our C should be C= [0 0 1 0] . I have tried using the Kalman filter to estimate the state of the system but got an error when trying to estimate the states. (Error using lqe (C,A) is undetectable). What does it mean? Does it mean that we cannot estimate the estate of the system with a sensor on the pendulum ? Kind regards,

  • @mauriciocarazzodec.209

    @mauriciocarazzodec.209

    Жыл бұрын

    george, he actually taught about that in a previous class. if you want to estimate full state you have to measure x (then the system is observable). If you measure any other quantity, you'll se that your system will be rank 3 and it's not observable. Of course that you have a shade on observability and not just OBSERVABLE/NOT OBSERVABLE.

  • @pablorabal926
    @pablorabal9264 жыл бұрын

    This is a great series. I'm actually learning a lot from it. I have a question, though, how come you don't get an error when you use the unstable matrix A (pendulum up) to build the gain matrix Kf as you did in one of the previous videos? In that video you built the estimator for the pendulum down system because of this error. Why is this not an issue in this case?

  • @davidpeter5639

    @davidpeter5639

    3 жыл бұрын

    he said that if the pendulum is in the up position, it will rapidly goes down so the linearized model will not vaild for it leaves the fixed linearized region , but if it combines with LQR full state feedback , the system will be stable, and the the linearized model will be vaild! maybe this will help you !

  • @pablorabal926

    @pablorabal926

    3 жыл бұрын

    @@davidpeter5639 I think I understand what you mean. Thanks a lot!

  • @huuthinho8406
    @huuthinho84063 жыл бұрын

    But is the system not observable with C=[1 0 0 0]? How can you still estimate the other states?

  • @muhammadqaisarali

    @muhammadqaisarali

    2 жыл бұрын

    Good observation. Even, thinking logically and practically, we conclude that it's impossible to stabilize pendulum in upright position, estimate thetha, just based on the knowledge of x, position. We can stabilize only if we know the angle theta, may be, for that C matrix must have nonzero value at 3rd index, then the system might be observable, but one thing should be noted, that minimum condition for observer is detectibility of system, means in that case we can build reduced order observer. A system might be unobservable, but still detectable. Detectable system means, that unobservable modes goes to zero and non zero can be observed.

  • @pilliozoltan6918
    @pilliozoltan69183 жыл бұрын

    One think confuse me: how can the kalman filter estimate the angle just from the cart position? I know, from a known initial state, the cart position is enough to propagate it in time. And I understand why kalman filter can work with a normal stable pendulum. But if the pendulum is not stable, an initial bias in state can aggregate in time.

  • @RugnirSvenstarr

    @RugnirSvenstarr

    2 жыл бұрын

    the kalman filter also knows the input, so it knows where the cart ought to end up. When it sees the kart move backwards relative to how it should with the input (notice how without any input when the pendulum falls the cart rolls backwards and forwards due to momentum) it can infer the pendulum's angular velocity. And when it has an idea of the angular velocity, it can tell whether the pendulum is up (angular acceleration is relatively small) or falling (angular acceleration is high) of course once the pendulum falls far enough it won't be able to figure out the position with much accuracy any more, but that part is outside of our linearization

  • @kallolchatterjee4373
    @kallolchatterjee43733 жыл бұрын

    Can anyone help me how to simulate the file please? That will be a great help for me. Thanks.

  • @Dave-bz4nr

    @Dave-bz4nr

    3 жыл бұрын

    sure, where is your problem

  • @kallolchatterjee4373

    @kallolchatterjee4373

    3 жыл бұрын

    @@Dave-bz4nr I am unable to simulate the file that I get from the course site. Can you give me the .slx file??

  • @muhammadqaisarali
    @muhammadqaisarali2 жыл бұрын

    Thinking logically and practically, we conclude that it's impossible to stabilize pendulum in upright position, just based on the knowledge of position,x. We can stabilize only if we know the angle theta. Because we can see that the measurement y is just position of cart. Then how it's possible to stabilize pendulum in upright position just based on position value?. Moreover C=[1 0 0 0], makes the system unobservable, I believe C matrix must have non zero value at 3rd index instead of first index, so would have angle measurement, which should be sufficient for stabilization and also rest of states estimation.

Келесі