misc docs stuff

matlab-v2
EmaMaker 2024-01-13 13:09:21 +01:00
parent 23e47d2a14
commit d292f7628d
18 changed files with 3175 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

BIN
matlab-sim/params.mat Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,50 @@
% Model of self balancing robot for PID controller
% See scheme anf formulas on notebook
clear all
clc
load('params.mat')
I_wheel = M_wheel*(r^2); %placeholder
I_body = M_body*(l^2)/3; %placeholder
nums1 = -(M_body + 2*(I_wheel/r^2) + 2*M_wheel + M_body*l/r);
nums0 = -2*b/r;
num = [nums1 nums0];
dens3 = I_body * M_body + 2*I_wheel*(I_body*M_body*l^2)/(r^2) + 2*I_body*M_wheel + 2*M_wheel*M_body*l^2;
dens2 = (2*b/r)*(I_body+M_body*g);
dens1 = -( ((M_body^2)*g*l) + 2*(I_wheel*M_body*g*l)/(r^2) + 2*M_body*M_wheel*g*l );
dens0 = -2*(b*M_body*g*l) / r;
den = [dens3 dens2 dens1 dens0];
w = tf(num, den)
sys = zpk(w);
sys.DisplayFormat='roots'
%sys.Z{1}
% sys.P{1}(1)
K = sys.K
p1 = sys.P{1}(1)
p2 = sys.P{1}(3)
p3 = sys.P{1}(2)
%display('Kd must be [' + num2str(p3/K) + ', 0]');
% Scelgo Kd così
kd = -0.001
kponkd = (p1+p2);
kionkd = (p1*p2);
kp = kponkd*kd
ki = kionkd*kd
% rlocus(sys, -sys)
%{
bode(w)
figure;
nyquist(w)
%}

BIN
torque_dx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
torque_sx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB