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

  Рет қаралды 17,476

Mouad Boumediene - Hobby Coding

Mouad Boumediene - Hobby Coding

Күн бұрын

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 жыл бұрын
Get the code from:github.com/mouad-boumediene/self-balancing-robot-LQR-Matlab Get the robot model ( PID ) from: ko-fi.com/s/716bba8384
@nikitaermolenko3688
@nikitaermolenko3688 3 жыл бұрын
Thank you! control systems hands-on content is pretty rare. Keep going!
@hobby_coding
@hobby_coding 3 жыл бұрын
you are most welcome, Nikita ermolenko. I'll try posting more of these videos now and then
@ajaychidambaram2512
@ajaychidambaram2512 3 жыл бұрын
awesome work ....... one of the clear explanations that I ever see regarding the self balancing robot on youtube ......Eagerly waiting for your upcoming videos
@Aakash3101
@Aakash3101 3 жыл бұрын
Great job!!
@pentagon0073
@pentagon0073 3 жыл бұрын
Great job i am trying to implement the hardware part with pid.
@cgmuzic4119
@cgmuzic4119 2 жыл бұрын
I would greatly appreciate you showing us how to implement LQR control on hardware. Thank you.
@Lancasterlitchfield
@Lancasterlitchfield Жыл бұрын
Any luck?
@dcpowered
@dcpowered 3 жыл бұрын
Please post more about the self balancing robot! I love your videos!!
@hobby_coding
@hobby_coding 3 жыл бұрын
you got it, Shakeel.
@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?
@saidsaleh4882
@saidsaleh4882 2 жыл бұрын
can i build any system for push the chassis and test the respons
@hawiaboma4438
@hawiaboma4438 3 жыл бұрын
how i used mpc or model predictive control for this controller
@buseo5936
@buseo5936 6 күн бұрын
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 жыл бұрын
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
@hassansakeef5838
@hassansakeef5838 Ай бұрын
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 Ай бұрын
you can use another 3D robotics simulation environment like gazebo + ros.
@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 8 ай бұрын
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 - kzfaq.info/get/bejne/Z8WFosV6scyXk5c.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;
@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 жыл бұрын
i don't have much experience in fuzzy logic, unfortunately
@khiyanatdeori5957
@khiyanatdeori5957 3 жыл бұрын
What is the advantage of using lqr over pid?
@hobby_coding
@hobby_coding 3 жыл бұрын
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 жыл бұрын
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?
@khiyanatdeori5957
@khiyanatdeori5957 3 жыл бұрын
In the simulation why does the robot stops moving forward and starts going backwards?
@hobby_coding
@hobby_coding 3 жыл бұрын
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 жыл бұрын
@@khiyanatdeori5957 mainly because of overshooting
@asunasposibol
@asunasposibol Жыл бұрын
Thanks a lot for sharing your work. I am a hobbyist and I just finished a self balancing cube (kzfaq.info/get/bejne/p8yZrcKj1qe6j5c.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 2 жыл бұрын
i built one but i still haven't made a tutorial on it yet
@brianblasius
@brianblasius 2 жыл бұрын
@@hobby_coding should we expect a tutorial?
self balancing robot | Simulink basics series
18:15
Mouad Boumediene - Hobby Coding
Рет қаралды 60 М.
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 20 МЛН
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 25 МЛН
Now THIS is entertainment! 🤣
00:59
America's Got Talent
Рет қаралды 39 МЛН
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 79 МЛН
Enhanced Self Balancing Robot Simulation in Simulink [ PID ]
6:26
Mouad Boumediene - Hobby Coding
Рет қаралды 8 М.
How to Visually Tune PID Control Loops
33:39
upgrdman
Рет қаралды 95 М.
Self Balancing Robot Offroad Version
2:19
WickedLabElectronics
Рет қаралды 403 М.
LQR controller for tracking rather than just regulating! An example in Matlab
7:43
Arduino BLDC balancer robot - Tutorial
14:15
simplefoc
Рет қаралды 32 М.
Tracking My Car using A Tiny GPS  Module  | RYS8830 Test
3:21
Mouad Boumediene - Hobby Coding
Рет қаралды 7 М.
Cheapest gaming phone? 🤭 #miniphone #smartphone #iphone #fy
0:19
Pockify™
Рет қаралды 4,3 МЛН
Это Xiaomi Su7 Max 🤯 #xiaomi #su7max
1:01
Tynalieff Shorts
Рет қаралды 2 МЛН
Красиво, но телефон жаль
0:32
Бесполезные Новости
Рет қаралды 1,5 МЛН
Смартфон УЛУЧШАЕТ ЗРЕНИЕ!?
0:41
ÉЖИ АКСЁНОВ
Рет қаралды 1,2 МЛН
Как правильно выключать звук на телефоне?
0:17
Люди.Идеи, общественная организация
Рет қаралды 1,9 МЛН