MATLAB Simulation/Animation of an Inverted Pendulum with LQR (Linear Quadratic Regulator)

  Рет қаралды 241

Charley Yang

Charley Yang

Күн бұрын

Пікірлер: 2
@WonYYang
@WonYYang 4 ай бұрын
%inv_pendulum.m Mc=5; Mp=1; L=2; d=1; g=9.8; xr=[1; 0; 0; 0]; % Reference state A=[0 0 1 0; 0 0 0 1; 0 Mp*g/Mc -d/Mc 0; 0 (Mc+Mp)*g/Mc/L -d/Mc/L 0] B=[0; 0; 1/Mc; 1/Mc/L]; C=[1 0 0 0; 0 1 0 0]; Q=C'*C; %[1 0 0 0; 0 1 0 0; 0 0 0 0; 0 0 0 0]; Q=1000*Q; % Increase these values to make the system response faster % possibly at the cost of larger force R=10; % Increase this value to reduce the input force K=lqr(A,B,Q,R); u=@(x)-K*(x-xr); % Control input (force) function x0=[0; 0.7; 0; 0]; % Initial vector t0=0; tf=10; tspan=[t0 tf]; % Time span of 10 sec % To solve the ODE [tt,xx]=ode45(@(t,x)dxdt(t,x,Mc,Mp,L,d,g,u(x)),tspan,x0); Nt=numel(tt); animation=1; if animation
@alfonsoramirez6485
@alfonsoramirez6485 4 ай бұрын
Thank you.
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН
How To Use Open-Source AI IDE for Beginners (aide by codestory)
8:51
Control of Linearized Inverted Pendulum on the Cart
44:38
Engineering Educator Academy
Рет қаралды 2,4 М.
Deriving the Dirac Equation
16:34
Richard Behiel
Рет қаралды 118 М.
Application of Calculus in Backpropagation
14:45
Orblitz
Рет қаралды 23 М.
Inverted Pendulum - Arduino Balancing Robot
15:52
Ian Carey
Рет қаралды 9 М.
MATLAB Analysis and PSpice Simulation of an OP amp Circuit
17:02
This Speed Test Will Change How You Buy Ethernet Cables!
8:00
What does the second derivative actually do in math and physics?
15:19
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН