Це відео не доступне.
Перепрошуємо.

applying an LQR command on a self-balancing robot in Simulink |2021|

Поділитися
Вставка
  • Опубліковано 7 сер 2024
  • in this hands-on tutorial 🔥 you will learn how to implement an LQR regulator in Simulink to control a 3D-model of a self-balancing robot, this robot is used as an example, however, this is applicable for the majority of systems.
    in a previous video, we made a self-balancing robot in Simulink and controlled it using the PID controller, in this video we implement a Linear Quadratic Regulator in order to control the angle and the position of the robot.
    🔗links :
    1. the link for the script : github.com/mouad-boumediene/s...
    2. How to build this robot? : • self balancing robot |...
    3. or Get the robot model from: ko-fi.com/s/716bba8384
    💻 my services are available on :
    Fiverr: www.fiverr.com/mouad2021
    ⏱️Timestamps:
    0:00 intro
    0:31 what is LQR?
    1:10 what do we need?
    1:40 the mathematical model of the plant
    3:40 the weighting parameters ( Q and R )
    4:26 Simulink implementation
    6:27 test/outro
    🏷️Hashtags:
    #LQR #selfbalancingrobot #simulink

КОМЕНТАРІ • 34

  • @hobby_coding
    @hobby_coding  3 роки тому +5

    Get the code from:github.com/mouad-boumediene/self-balancing-robot-LQR-Matlab
    Get the robot model ( PID ) from: ko-fi.com/s/716bba8384

  • @ajaychidambaram2512
    @ajaychidambaram2512 3 роки тому +1

    awesome work ....... one of the clear explanations that I ever see regarding the self balancing robot on youtube ......Eagerly waiting for your upcoming videos

  • @nikitaermolenko3688
    @nikitaermolenko3688 3 роки тому +5

    Thank you! control systems hands-on content is pretty rare. Keep going!

    • @hobby_coding
      @hobby_coding  3 роки тому +1

      you are most welcome, Nikita ermolenko. I'll try posting more of these videos now and then

  • @Aakash3101
    @Aakash3101 3 роки тому +1

    Great job!!

  • @pentagon0073
    @pentagon0073 3 роки тому

    Great job i am trying to implement the hardware part with pid.

  • @cgmuzic4119
    @cgmuzic4119 2 роки тому +4

    I would greatly appreciate you showing us how to implement LQR control on hardware. Thank you.

  • @dcpowered
    @dcpowered 3 роки тому +1

    Please post more about the self balancing robot! I love your videos!!

  • @matheustomasetto3178
    @matheustomasetto3178 3 роки тому

    Great video!! I have a question on "GAIN", an error is occurring for me "Invalid setting in 'SBR_LQR/Gain' for parameter 'Gain'.
    Caused by: Error evaluating parameter 'Gain' in 'SBR_LQR/Gain'
    Unrecognized function or variable 'K'.
    Variable 'K' does not exist. Suggested Actions:
    Load a file into base workspace.
    Create a new variable.” Could you tell me how to solve this?

  • @buseo5936
    @buseo5936 19 днів тому

    Hello. I implemented a state feedback control using the state-space model with the provided A, B, C, and D matrices in Simulink, but I noticed that the state variables are diverging. When I checked the poles using the eig function, I found that there is a positive real number included.
    Why does the regulator work correctly in the Simscape model, but when I create a separate state feedback model, it produces diverging values? Also, when designing a state feedback model in Simulink, should the initial value of the integrator be set to the same value as the step input in Simscape?

  • @warriorforjesus2980
    @warriorforjesus2980 3 роки тому +1

    I'm final year mechanical engineer student this is my final year main project can you teach step by step procedure for two wheeled self balancing robot using Matlab code please upload as soon as possible
    And also explain theory part and also try to provide Matlab code PDF in discription

  • @hawiaboma4438
    @hawiaboma4438 3 роки тому

    how i used mpc or model predictive control for this controller

  • @saidsaleh4882
    @saidsaleh4882 2 роки тому

    can i build any system for push the chassis and test the respons

  • @kensito_espresso
    @kensito_espresso Рік тому

    hi, thanks for the educational video!! I have a question, I used your block diagram to simulate my own self balancing robot, but i also want to compare the state variable output from the physical system which is your diagram to my mathematical model so i attached scope in the state variables (position, velocity, tilt angle, and angular velocity). But i could never get the same plot from the mathematical model to physical model. Do you have any idea how to do it?

    • @dhalinesh8599
      @dhalinesh8599 9 місяців тому

      To answer your question
      1) You need to place the scope between the ps- simulink converter and mux (x4) (i.e. The very before the mux input). You can use the seperatye scope or 4 input scope. I used the second.
      2)You need to adjust the Q & R weights. Refer below, you could see that angular velocity is enormously increased , So in your system start the adjustment form angular velocity. Also please refer video from steve brunton - ua-cam.com/video/1_UobILf3cc/v-deo.html (Linear Quadratic Regulator (LQR) Control for the Inverted Pendulum on a Cart [Control Bootcamp]) . In that note a point at the time of 9:20. That's why i enormously increased the angular velocity.
      Hope works fine.
      This worked for me:
      M = 1; % mass of the chassis
      m = 0.07; % mass of the wheels and shaft
      b = 0.1; % estimate of viscous friction coefficient (N-m-s)
      I = 0.0057416;% moment of inertia of the pendulum
      g = 9.8; %acceleration due to gravity (m/s^2)
      l = 0.125; %length to pendulum center of mass
      Q = [0.001 0 0 0 %position - red
      0 0.01 0 0 %velocity - green
      0 0 0.1 0 %angle - yellow
      0 0 0 1e11] %angular velocity - blue

      R = 1;

  • @hassansakeef5838
    @hassansakeef5838 2 місяці тому +1

    Hello great video sir, i was wondering how do you suppose is it possible using the same model for the robot to make turns to reach a certain target rather than just move forward and backward? An idea or resource would be highly appreciated. Thank you.

    • @hobby_coding
      @hobby_coding  2 місяці тому

      you can use another 3D robotics simulation environment like gazebo + ros.

  • @eng.suelioalencar
    @eng.suelioalencar 3 роки тому

    I just tried it, changing the previous PID Model, like the video, but now my Robot Can't stay up. Any Idea?

  • @k1s1t7
    @k1s1t7 2 роки тому

    How about using fuzzy logic?

    • @hobby_coding
      @hobby_coding  2 роки тому +1

      i don't have much experience in fuzzy logic, unfortunately

  • @khiyanatdeori5957
    @khiyanatdeori5957 3 роки тому +2

    In the simulation why does the robot stops moving forward and starts going backwards?

    • @hobby_coding
      @hobby_coding  3 роки тому +1

      the forward motion is a result of the robot trying to balance itself after the initial push but since nothing is perfect the controller overshoots and the robot start falling backward this is why the controller has to move again to the opposite direction ( backwards ) in order to catch the robot and prevent it from falling

    • @khiyanatdeori5957
      @khiyanatdeori5957 3 роки тому

      But in case of PID controller why doesn't it happen the same it keeps going forward never backwards?

    • @hobby_coding
      @hobby_coding  3 роки тому +1

      @@khiyanatdeori5957 mainly because of overshooting

  • @khiyanatdeori5957
    @khiyanatdeori5957 3 роки тому +1

    What is the advantage of using lqr over pid?

    • @hobby_coding
      @hobby_coding  3 роки тому +2

      i recommend this paper that explains exactly that : citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.545.6096&rep=rep1&type=pdf#:~:text=For%20the%20last%20characteristic%2C%20both,response%20faster%20than%20PID%20controller.&text=It%20shows%20that%20LQR%20control,compared%20to%20PID%20control%20method.

    • @khiyanatdeori5957
      @khiyanatdeori5957 3 роки тому +1

      You are really very nice thanks a lot❤️ 👍

    • @HoangLe-qu8qo
      @HoangLe-qu8qo 2 місяці тому

      @@hobby_coding I can't access to this link. Can you reup it?

  • @asunasposibol
    @asunasposibol Рік тому

    Thanks a lot for sharing your work. I am a hobbyist and I just finished a self balancing cube (ua-cam.com/video/qfiz_rqAV_c/v-deo.html).
    i would love to model it with matlab. Could you please give me any hint on how would I need to modify your model in order for it to work with a balancing cube?

  • @brianblasius
    @brianblasius 3 роки тому

    Kindly build a real self balancing robot and test it in the real world. This would be a better way of learning..

    • @hobby_coding
      @hobby_coding  3 роки тому +2

      i built one but i still haven't made a tutorial on it yet

    • @brianblasius
      @brianblasius 3 роки тому

      @@hobby_coding should we expect a tutorial?