Update the Rz reference: offset added after filter
This commit is contained in:
parent
b2ca19bf05
commit
cfc4cf28f5
@ -506,12 +506,11 @@ The Simscape model of the Spindle is composed of:
|
|||||||
:END:
|
:END:
|
||||||
#+begin_src matlab
|
#+begin_src matlab
|
||||||
arguments
|
arguments
|
||||||
args.rigid logical {mustBeNumericOrLogical} = false
|
args.x0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||||
args.x0 (1,1) double {mustBeNumeric} = 0 % [m]
|
args.y0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||||
args.y0 (1,1) double {mustBeNumeric} = 0 % [m]
|
args.z0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||||
args.z0 (1,1) double {mustBeNumeric} = 0 % [m]
|
args.rx0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [rad]
|
||||||
args.rx0 (1,1) double {mustBeNumeric} = 0 % [rad]
|
args.ry0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [rad]
|
||||||
args.ry0 (1,1) double {mustBeNumeric} = 0 % [rad]
|
|
||||||
end
|
end
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -1211,12 +1210,15 @@ The =sample= structure is saved.
|
|||||||
Rzd(:) = 0;
|
Rzd(:) = 0;
|
||||||
Rzdd(:) = 0;
|
Rzdd(:) = 0;
|
||||||
case 'rotating'
|
case 'rotating'
|
||||||
Rz(:) = args.Rz_amplitude+2*pi/args.Rz_period*t;
|
Rz(:) = 2*pi/args.Rz_period*t;
|
||||||
|
|
||||||
% The signal is filtered out
|
% The signal is filtered out
|
||||||
Rz = lsim(H_lpf, Rz, t);
|
Rz = lsim(H_lpf, Rz, t);
|
||||||
Rzd = lsim(H_lpf*s, Rz, t);
|
Rzd = lsim(H_lpf*s, Rz, t);
|
||||||
Rzdd = lsim(H_lpf*s^2, Rz, t);
|
Rzdd = lsim(H_lpf*s^2, Rz, t);
|
||||||
|
|
||||||
|
% We add the angle offset
|
||||||
|
Rz = Rz + args.Rz_amplitude;
|
||||||
otherwise
|
otherwise
|
||||||
warning('Rz_type is not set correctly');
|
warning('Rz_type is not set correctly');
|
||||||
end
|
end
|
||||||
|
Binary file not shown.
@ -122,12 +122,15 @@ switch args.Rz_type
|
|||||||
Rzd(:) = 0;
|
Rzd(:) = 0;
|
||||||
Rzdd(:) = 0;
|
Rzdd(:) = 0;
|
||||||
case 'rotating'
|
case 'rotating'
|
||||||
Rz(:) = args.Rz_amplitude+2*pi/args.Rz_period*t;
|
Rz(:) = 2*pi/args.Rz_period*t;
|
||||||
|
|
||||||
% The signal is filtered out
|
% The signal is filtered out
|
||||||
Rz = lsim(H_lpf, Rz, t);
|
Rz = lsim(H_lpf, Rz, t);
|
||||||
Rzd = lsim(H_lpf*s, Rz, t);
|
Rzd = lsim(H_lpf*s, Rz, t);
|
||||||
Rzdd = lsim(H_lpf*s^2, Rz, t);
|
Rzdd = lsim(H_lpf*s^2, Rz, t);
|
||||||
|
|
||||||
|
% We add the angle offset
|
||||||
|
Rz = Rz + args.Rz_amplitude;
|
||||||
otherwise
|
otherwise
|
||||||
warning('Rz_type is not set correctly');
|
warning('Rz_type is not set correctly');
|
||||||
end
|
end
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
function [rz] = initializeRz(args)
|
function [rz] = initializeRz(args)
|
||||||
|
|
||||||
arguments
|
arguments
|
||||||
args.rigid logical {mustBeNumericOrLogical} = false
|
args.x0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||||
args.x0 (1,1) double {mustBeNumeric} = 0 % [m]
|
args.y0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||||
args.y0 (1,1) double {mustBeNumeric} = 0 % [m]
|
args.z0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||||
args.z0 (1,1) double {mustBeNumeric} = 0 % [m]
|
args.rx0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [rad]
|
||||||
args.rx0 (1,1) double {mustBeNumeric} = 0 % [rad]
|
args.ry0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [rad]
|
||||||
args.ry0 (1,1) double {mustBeNumeric} = 0 % [rad]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
rz = struct();
|
rz = struct();
|
||||||
|
Loading…
Reference in New Issue
Block a user