clear all, close all, clccomp=3;;global a1 a2 lc1 lc2 lc3 m1 m2 m3 I1 I2 I3 gc d1 d2 global KP KD comp gfinglobal qd1 qd2 qd3 ts taa1=1; a2=1; a3=1; lc1=0.4; lc2=0.4; lc3=0.4; m1=30; m2=20; m3=10; I1=3; I2=2; I3=1; gc=9.8; % d1=50; d2=50;
d1=0; d2=0;qd1=[pi/4; pi/4];qd2=[pi/3; pi/2];qd3=[pi/2; 0];q0=[-pi/4; pi/4]; qp0=[0; 0];dt=0.01;Tfin=15; ts=5; KP=400*eye(2); KD=50*eye(2); switch comp case 0 tipocontrollo='PD senza compensazione della gravità '; case 1 tipocontrollo='PD con compensazione esatta della gravità '; case 2 tipocontrollo='PD con compensazione nel punto finale'; case 3 tipocontrollo='Computed Torque'; endTsim=0:dt:Tfin;Nsim=max(size(Tsim));x0=[q0; qp0];[T,Xout]=ode45('robot3R',Tsim,x0);N=max(size(T));q1sim=Xout(:,1); q2sim=Xout(:,2); q3sim=Xout(:,3)qp1sim=Xout(:,4); qp2sim=Xout(:,5); qp3sim=Xout(:,6)if ts>=Tfin tt=Tfin;else tt=ts;end
Error in odearguments (line 90)f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);Error in robot3R_control_main (line 86)[T,Xout]=ode45('robot3R',Tsim,x0);
It keeps giving me this kind of errors but I can't understand where i have to work on, can anyone help me please?
P.S. The code can have several errors in its writing, i just started working on it.
Best Answer