State Observers | Understanding Kalman Filters, Part 2

Поделиться
HTML-код
  • Опубликовано: 13 фев 2017
  • Download our Kalman Filter Virtual Lab to practice linear and extended Kalman filter design of a pendulum system with interactive exercises and animations in MATLAB and Simulink: bit.ly/3g5AwyS
    Learn the working principles of state observers, and discover the math behind them. State observers are used to estimate the internal states of a system when you can’t directly measure them.
    You will learn how a state observer uses the input and output measurements to estimate system states. The example will walk you through the mathematical derivation of a state observer.
    You will discover how the state observer utilizes feedback control to drive the estimated states to the true states. Kalman filtering provides an optimal way of choosing the gain of this feedback controller.
    Check out additional resources:
    - Download examples and code - Design and Simulate Kalman Filter Algorithms: bit.ly/2Iq8Hks
    - Kalman Filter Design Example: bit.ly/3a0nLWs
    - Design and use Kalman filters in MATLAB and Simulink: bit.ly/3i4VKwG
    --------------------------------------------------------------------------------------------------------
    Get a free product trial: goo.gl/ZHFb5u
    Learn more about MATLAB: goo.gl/8QV7ZZ
    Learn more about Simulink: goo.gl/nqnbLe
    See what's new in MATLAB and Simulink: goo.gl/pgGtod
    © 2022 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc.
    See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.
  • НаукаНаука

Комментарии • 118

  • @soorkie
    @soorkie 3 года назад +43

    Giving a cookie to Timmy disturbs the quantum state of Timmy's happiness. You cannot measure Timmy's happiness without altering the state.

  • @AniketSharmacodes
    @AniketSharmacodes 7 лет назад +14

    Great explanation! I love the way you have broken down Kalman filter in parts and explained in a layman's language with such intuitive examples! (y)

  • @omarel-ghezawi6466
    @omarel-ghezawi6466 4 года назад +10

    Oversimplification may lead to incorrect information. First : the eigenvalues of A-KC should have negative real parts , not that A-KC should be

  • @dalahmah
    @dalahmah 2 года назад +2

    I like the analogy with control systems. It cleared so many issues for me.

  • @godspeedyou
    @godspeedyou 4 года назад

    Awesome explanations! Easy to understand !!

  • @mustafaalshaqaq8238
    @mustafaalshaqaq8238 3 года назад

    Wonderful explanation! Thanks.

  • @salaheddinemokhlis123
    @salaheddinemokhlis123 7 лет назад

    thank you excellent explanation .. can't wait for the next part

  • @yingma6770
    @yingma6770 6 лет назад +6

    Hi, I also have the same confusion as totoxahc. To be specific, I think we should use \hat A, \hat B and \hac C in the mathematical model, which are different to the real measure model. Then in 6:09, the error function would be e(with a point on it)_obs=((\hat A-A)-K(\hat C-C))e_{obs}. We can not adjust A, C(which we don't have access to) and either\hat A and \hat C. So in order to make the error converge to zero, we must have a feedback loop, in this way, we can adjust K to make the error go to zero. I think this would make more sense. How do you think?

  • @mohannadtakrouri38
    @mohannadtakrouri38 7 лет назад +123

    Excellent explanation.
    Question:
    If you get to 6:03 , Shouldn't K(y-y^) be negative because it is subtracted from the first equation?

    • @meldaulusoy8389
      @meldaulusoy8389 7 лет назад +42

      Good catch! You're right, the equation should look like this: x_dot-x_dot_hat = Ax-Ax_hat+Bu-Bu-K(y-y_hat). In the video, the solution is correct but the sign in front of the K(y-y_hat) term should be -. Thanks for pointing this out!

    • @amraboughazala5986
      @amraboughazala5986 5 лет назад +4

      I was just going to say that but you were the first comment to my eyes.

    • @10uRization
      @10uRization 5 лет назад +1

      Melda Ulusoy kız Melda bundan ben bahsetmek istiyordum but seems like you’ve watched the video before me :( good job tho

    • @lazyvessel8632
      @lazyvessel8632 5 лет назад +1

      Good thing this is the first comment I read

    • @ucontrolchannel5967
      @ucontrolchannel5967 4 года назад +1

      I also noticed that.

  • @gimbopgimchi
    @gimbopgimchi 7 лет назад

    Wow. Well represented wonderful lecture! Thanks :)

  • @sashamuller9743
    @sashamuller9743 4 года назад

    amazing series!!!

  • @yuchendu8402
    @yuchendu8402 4 года назад +4

    It's a very clear explanation! I just have a question about 6:00. Why does the real system have the same equations as the model? In this video, it says model is simply an approximation of the real system, but at 6:00, the equations in both blocks are same. Also, if they are same, why do we need a state observer, why can't we can calculate x directly by using y=Cx?

  • @tmwu9940
    @tmwu9940 2 года назад +3

    6:12, why the solution to this equation is an exponential function?

  • @lukec5838
    @lukec5838 5 лет назад +1

    For T_in and T_ext can they be related but different? For example, can T_in be internal temperature and T_ext be the color of the superheated metal? Or something else that is related but different?

  • @Nikos30257
    @Nikos30257 4 года назад +2

    If we already know Texternal (from measurement) and we have the parameters A,B and C of the system then why do we need a state observer in the first place?

  • @coolcool1301
    @coolcool1301 5 лет назад +2

    This is so impressive. and This is the best of the best lecture.

  • @abhishekaaryan2328
    @abhishekaaryan2328 6 лет назад

    Nicely explained...

  • @madushaperera8115
    @madushaperera8115 6 лет назад

    Thanks for the videos. Very helpful. May I please know whether what would happen if the X- dot is having a relationship to x-square rather than x ? (what if it was not linear)

    • @madushaperera8115
      @madushaperera8115 6 лет назад

      Sorry it was already discussed in detail from part 5. Thanks!

  • @knk0112
    @knk0112 4 года назад

    Wonderful explanation.. one can easily grasp the purpose that Kalman filter serves and thats because of this very simple and intuitive video..

  • @cristian-bull
    @cristian-bull 6 лет назад +56

    Leave it to mathworks to explain a simple theory using a more complex one.

  • @guitarman513
    @guitarman513 4 года назад

    More Brian please!

  • @Inviaz
    @Inviaz 4 года назад

    After each time step x^ = x ? Then x_dot_^ is integrating and gives us y^ ? So the question is Does math model work indepedently of the real system? Or Does have input from real system in each time step?

  • @adampaech2469
    @adampaech2469 Год назад

    It's an awesome explanation!

    • @MATLAB
      @MATLAB  Год назад

      Glad it was helpful!

  • @aghaesthelyne8585
    @aghaesthelyne8585 3 года назад

    Thanks for this

  • @medchaouechi842
    @medchaouechi842 6 лет назад +4

    5:56 : Could you please explain how did you get x(hat) point

    • @akurmustafa
      @akurmustafa 6 лет назад +6

      Firstly, I am not sure about my answer, and I will write my own explanation to myself. At the second part the input to the system is no longer u but u-K*(y-y^). Hence when we apply equation A*x+ B*u, we will get A*x^+B*[u-K*(y-y^)]. When we expand this equation, what we will get is A*x^+B*u-B*K*(y-y^). Since B*K is just a constant changing with K, which is under our control. In equation, she just used K as constant. However I think that K is not the same K, at the feedback loop as I said.

  • @princessnice3716
    @princessnice3716 2 года назад

    wonderful...but please my problem now is how to use the measured variables to estimate the TIT of a gas turbine in my project. I want to understand where and how to bring in the real values, and which is A, B or C, etc from my parameters..

  • @burakergocmen5661
    @burakergocmen5661 6 лет назад

    really perfect

  • @droxid666
    @droxid666 7 лет назад

    Hello, I was wondering what happened to the part 3 (or it's deadline)? thank you very much!

    • @meldaulusoy8389
      @meldaulusoy8389 7 лет назад

      Hi Juan, thank you for your patience. Part-3 (Optimal State Estimator) video will be live tomorrow.

    • @hassanjb83
      @hassanjb83 7 лет назад

      Hi. When is the Part 4 going to be uploaded?

  • @TankNSSpank
    @TankNSSpank 7 лет назад +12

    What is the X_dot in this video. I don't understand. THanks

    • @meldaulusoy8389
      @meldaulusoy8389 7 лет назад +9

      Hi Will,
      The equations X_dot=Ax+Bu and y=Cx are the state space representation of the system that we discussed in the video. State space lets us represent systems with a first order differential equation. The equation x_dot=Ax+Bu is called the state equation where x is the state (internal temperature in our example) and x_dot is the first order derivative of the state (rate of change in the internal temperature).

    • @user-zo4lw6hx3z
      @user-zo4lw6hx3z 6 лет назад

      thanks a lot. I had a smae question. And your answer is perfect.

    • @madushaperera8115
      @madushaperera8115 6 лет назад

      Hi Melda, I saw your video list on 'Understanding control systems' and was very help full. Do you have a tutorial on state space representation as well since it's hard to understand. Thanks.

    • @nikolaichow4663
      @nikolaichow4663 3 года назад

      @@meldaulusoy8389 It helps a lot thanks!

  • @judithbrito4426
    @judithbrito4426 Год назад

    Can someone please tell me what Math do I need to study to understand how to get the equations at 06:20?

  • @totoxahc
    @totoxahc 7 лет назад +4

    At 6:20 why are you saying that A and B matrices of both models are the same? I always see this in observer explanations but we know it is not true. Edit: I forgot C matrix.

    • @meldaulusoy8389
      @meldaulusoy8389 7 лет назад

      Hi totoxahc, @ 6:20 I discuss how the feedback term and how it helps the error to vanish. Can you please expand your question?

    • @totoxahc
      @totoxahc 7 лет назад +1

      Hi,
      In the diagram, the upper system (the one without hat in the state and output) is supposed to be the "real" model right?
      The system below that is supposed to be a model of the upper system and one of the reasons to use a observer is because of the modeling errors, that is A, B, C and D matrices of both systems are not equal.
      I think one should use A, B and C for the for the upper system and \hat{A}, \hat{B} and \hat{C} for the other and then the equation for the dynamics of the error should be correct

    • @chriselgoog9744
      @chriselgoog9744 6 лет назад

      If you compare "dot_hat_x = hat_A hat_x + hat_B u" with the equation in the video you will get "hat_A = A - K hat_C" and "(hat_B -B) u = K y".
      What is quite strange. So there are maybe some assumptions/approximations in the controller model which are not explained in the video.

  • @MH_Yip
    @MH_Yip 3 года назад

    Hi Everyone,
    I do not understand this one. At 05:56, she used the equation y = cx. Since you have y and c, you can just directly calculate x. Why do we need state observer stuff?

  • @user-ph3ju4fv2v
    @user-ph3ju4fv2v 6 лет назад

    可以说是讲的很棒了。

  • @KARAB1NAS
    @KARAB1NAS 5 лет назад +3

    In my opinion you need to link better the qualitative description of the problem with the formulas and the "loops" used in electrical engineering... it is not a self contained presentation.

  • @richierich3135
    @richierich3135 6 лет назад

    u whoever have rocking exlaination .,,..

  • @xicai2290
    @xicai2290 7 лет назад

    Excellent explanation. Where can I find the Part 3? Thanks

    • @meldaulusoy8389
      @meldaulusoy8389 7 лет назад

      Hi Xi,
      The Part3 video has not been posted yet but will be live next week.

    • @xicai2290
      @xicai2290 7 лет назад

      Thanks Melda. Glad to know that.

    • @meldaulusoy8389
      @meldaulusoy8389 7 лет назад

      Hi Xi, Part3 - Optimal State Estimator is now live. Thank you for your patience.

  • @JayantKumarZ
    @JayantKumarZ 5 лет назад +3

    if you see something with a hat on it.. it is an estimated state. *cute timmy face shows up*
    Yay this is so jolly video i like it very much ^_^

  • @pokerboy72
    @pokerboy72 3 года назад +2

    This video started from cookies to sme real shit in 60 secs

  • @fifaham
    @fifaham Год назад

    @3:45 what guarantees that if [ T(ext) and (cap)T(ext) ] are equal then [T(in) and (capT(int) ] are also equal? Was that your assumption? If not then we need to find a spot where this assumption is near real, and that we are taking measurements based on the real "Dynamic Range" of linear correlation of those two measurements. If those measurements are beyond the real "Dynamic Range" operation then I assume that we can not make this assumption.

  • @parthi2929
    @parthi2929 6 лет назад

    At 4:48, why not improvise the mathematical model instead of external correction via K?

    • @parthi2929
      @parthi2929 6 лет назад

      ok, the answer is here 6:40 that it would take longer time?

  • @atle3780
    @atle3780 5 лет назад +7

    6:12 I dont understand why there is an expornential (A-KC)t come out of nowhere.

    • @kabascoolr
      @kabascoolr 5 лет назад +5

      It comes from differential equations. If I have a single-dimensional function for example (not matrices like above). x_dot(t) = a*x(t) is a differential equation. In differential equation our main goal is to usually find "x" such that the relationship above is true. If you pick x = e^at for example, remember that the derivative of an exponential is the same exponential times a constant, so (e^at)_dot = a*e^a(t) since x = e^at, it holds the form x_dot = a*x. The e(0) is our initial condition, it allows you to find a unique solution to your problem.

    • @atle3780
      @atle3780 5 лет назад

      @@kabascoolr OMG, I get it now. Thank you so much!!!!

    • @kabascoolr
      @kabascoolr 5 лет назад

      @@atle3780 No problem!

    • @atle3780
      @atle3780 5 лет назад +1

      ​@@kabascoolr I still got another one need to be explained, why it is x_dot = Ax + Bu instead of x = Ax_previous + Bu. How can the derivative of x is equal to Ax + Bu :(((. In the next chapter, the x equation turn to x = Ax_previous + Bu. Which one is correct ?

  • @yoyotvyoo
    @yoyotvyoo 2 года назад

    What does x with a dot on the top mean?

  • @atle3780
    @atle3780 4 года назад +4

    At 6:12, the e_obs(t) = e^ln(A-KC)t × e_obs(0) must be correct.

  • @CommanderUtka
    @CommanderUtka 4 года назад +2

    why the hell you use letter e as an error and as an exp in one expression?

  • @SuperNexus66
    @SuperNexus66 4 года назад +2

    Hi, what means (A-KC) < 0?

    • @Rahul-hp5ie
      @Rahul-hp5ie 3 года назад

      It's the condition for minimum error

    • @nndei
      @nndei 3 года назад

      A-KC is negative-definite, so all its eigenvalues have negative real part. It is the condition for the error to converge to 0.

  • @snowboyyuhui
    @snowboyyuhui 7 лет назад

    4:00 how do you know Tin and Tin^ will converge when Text and Text^ converge?

    • @meldaulusoy8389
      @meldaulusoy8389 7 лет назад

      Hi Yuhui,
      You have your real system and then the model of your system which you represent by a mathematical model. Now imagine a perfect scenario where you know the model exactly, meaning you would expect to see the same behavior at the output of your real system and your model since they match perfectly. If you now provide the same input to your real system and your model, you'll see that the outputs y and y_hat will be equal to each other as well as x and x_hat. In a system, we may have no access to system states x, but we measure y and we can calculate y_hat. And from the above discussion we know that if we can match y with y_hat, x_hat will converge to x. Hope this explanation is helpful.

    • @afshin3k3
      @afshin3k3 5 лет назад

      @@meldaulusoy8389 I am sorry but your answer doesn't explain the problem here, as we usually don't have the exact model of system. Imagine you have modeled an order 2 system with an order 1 model, so it doesn't matter how you try to match y and y_hat, the x and x_hat won't converge!

  • @anjishnu8643
    @anjishnu8643 6 лет назад

    2:20 don't we have to find the fuel flow from the external temp?

    • @meldaulusoy8389
      @meldaulusoy8389 6 лет назад

      In this system, ideally we would measure internal temperature and based on that control the fuel flow. However, this is not feasible because we cannot place the sensor inside the engine. So, what we do is measure the internal temperature indirectly. And this is why we measure external temperature.

    • @anjishnu8643
      @anjishnu8643 6 лет назад

      Did understand that portion. Nonetheless, thanks for the elaboration. What I don't get: 2:27 T(hat)(ext) has been considered as the output while fuel inflow as input (in the mathematical model), contrary to the practical model.

    • @meldaulusoy8389
      @meldaulusoy8389 6 лет назад

      What do you refer to when you say practical model? Both real system and mathematical model have the same input, fuel flow and the outputs are the external temperature and ext. temperature estimate, respectively.

  • @fffppp8762
    @fffppp8762 5 лет назад +1

    where is exponential from?

    • @kabascoolr
      @kabascoolr 5 лет назад +1

      It comes from differential equations. If I have a single-dimensional function for example (not matrices like above). x_dot(t) = a*x(t) is a differential equation. In differential equation our main goal is to usually find "x" such that the relationship above is true. If you pick x = e^at for example, remember that the derivative of an exponential is the same exponential times a constant, so (e^at)_dot = a*e^a(t) since x = e^at, it holds the form x_dot = a*x. The e(0) is our initial condition, it allows you to find a unique solution to your problem.

  • @poontingkwok1459
    @poontingkwok1459 4 года назад

    yes

  • @minhdaotran6907
    @minhdaotran6907 6 лет назад +1

    at 6:13, how can we have e_obs(t) = e^(A-KC)t * e_obs from previous formula ?

    • @chriselgoog9744
      @chriselgoog9744 6 лет назад +1

      That the solution of the "differential equation".

  • @jayaramjonnada5855
    @jayaramjonnada5855 8 месяцев назад

    But why are they measuring by taking T-ext(cap), when they already know what is T-ext. They W-fuel and T-ext, so they can find T-int. Why are they making it complex by estimating T-ext and making the error zero.

  • @TVAlphaGamer
    @TVAlphaGamer 6 лет назад +2

    what is "xdot"?

    • @meldaulusoy8389
      @meldaulusoy8389 6 лет назад +1

      Feel free to check out the following links to find information about state space representation: www.mathworks.com/discovery/state-space.html, en.wikipedia.org/wiki/State-space_representation

    • @TVAlphaGamer
      @TVAlphaGamer 6 лет назад

      thank you a lot

    • @sevketgunduz1100
      @sevketgunduz1100 5 лет назад

      @@TVAlphaGamertime derivative

  • @parthi2929
    @parthi2929 6 лет назад +1

    At 5:56 what does a x_hat_dot mean? What does Ax + Bu mean? If viewer is a beginner, he would be lost here

    • @meldaulusoy8389
      @meldaulusoy8389 6 лет назад +2

      Hi Parthiban, thanks for your comment. I'd recommend reading about state space representation. This topic is essential for learning control systems, and you can find numerous resources on the web. Feel free to check out the following resources www.mathworks.com/discovery/state-space.html, en.wikipedia.org/wiki/State-space_representation

    • @user-tj4ut8ox9r
      @user-tj4ut8ox9r 5 лет назад

      Totally right

    • @oldcowbb
      @oldcowbb 4 года назад

      this video (and the topic) obviously isn't for beginner

  • @recklessanil
    @recklessanil 3 года назад +1

    An LSD would be a better choice than the cookie as you go through a bad or good trip depending on your mood

  • @arnaudeportola1332
    @arnaudeportola1332 7 лет назад +1

    6:20 "Because even without the feedback loop that adds the KC term to the equation, we would have a decaying exponential function "...what?! When did you impose A negative definite? This is blatantly false unless you impose that condition

    • @meldaulusoy8389
      @meldaulusoy8389 7 лет назад

      Hi Arnau, in case you have missed it, @6:37 it's shown that in the absence of the KC term (which is crossed out) the observer error e_obs still converges to zero as t goes to infinity if A0 as t->inf. Here, we try to stress the importance of the feedback loop which helps increase the decay rate of the observer error function such that x_hat converges to x faster.

  • @gaoyuanliu525
    @gaoyuanliu525 4 года назад

    The hat metaphor is far fetched, man.

  • @prfontaine5387
    @prfontaine5387 11 месяцев назад

    Semble clair à la première écoute puis l'est moins quand on creuse. On part sur un modèle parfait puis on dit qu'en pratique il ne l'est jamais. Et pourtant il est affirmé qu'une convergence sur les températures externes (réelle vs modèle) assure une convergence sur les températures internes (réelle et modèle). Pourquoi? Quelle hypothèse permet d'affirmer cela?
    Et si le modèle n'est pas parfait, pourquoi on retrouve ses équations dans la boîte figurant le système réel ? On pourrait admettre à la rigueur que les équations du modèle et celles représentant le système aient la même forme, mais là ils ont la même forme et les mêmes paramètres A, B, C !
    Bref cette notion de modèle imparfait est assez confuse...

  • @chipflaming
    @chipflaming 4 года назад

    At 2:10, I think you mean "you can derive the equations" rather than "you can drive the equations".

  • @Jirayu.Kaewprateep
    @Jirayu.Kaewprateep Год назад

    📺💬 Could Jirayu explain ⁉️
    🥺💬 Sensors signals is vary but change can estimate relationship as K. ( Electrical )
    🥺💬 Now you are observe of sensory and expecting.

  • @tubanbodyslammer9125
    @tubanbodyslammer9125 5 лет назад +4

    This is way too fast

  • @jinshikami7525
    @jinshikami7525 4 года назад

    Can't afford conventional circuit simulators? Stumble Upon: androidcircuitsolver/app.html

  • @user-hy2oo2bt2t
    @user-hy2oo2bt2t 7 лет назад

    牛逼

  • @mickmickymick6927
    @mickmickymick6927 3 года назад

    5:43 What are A B and C? Am I even dumber than I thought or did she not explain that?

    • @perlechenchen9570
      @perlechenchen9570 3 года назад

      A B and C are just placeholders for parameters. The parameters need to be estimated and will be constants, but for this explanation it is not important what the exact figures are, hope it helps

  • @flydragoon88
    @flydragoon88 6 лет назад +14

    too many corrections.

  • @nickcui4567
    @nickcui4567 6 лет назад +6

    All went well until the math showed up ....... I could not even read the equations before they disappeared on the screen......

    • @mykolaiilin2266
      @mykolaiilin2266 6 лет назад +7

      that's why there is a pause button, so you can enjoy the content at your own pace instead of expecting the presenter to tune their pace to Nick's very specific personal needs :P

    • @gameon8177
      @gameon8177 5 лет назад

      @@davidblau1062 are u kidding

  • @mikgigs
    @mikgigs 3 года назад +1

    what means x with dot? Why suddenly A, B and C appears? Why suddenly an exponential function appears! BS guys! The worst Kalman filter presentation.

    • @jnestor481
      @jnestor481 3 года назад

      Yea not clear to me either. Wish someone would explain that. x dot is what exactly ?

  • @orsmplus
    @orsmplus 3 года назад +2

    Argh, get to the damn point. 12 year olds won't be watching this so why cater for them?