%--------------------------------------------------------------------------
% Script:       SimParam.m
% Purpose:      Define simulation parameters: one-leg with 3dof-3D
%--------------------------------------------------------------------------
%-- Mechanical links ------------------------------------------------------
 l0=0.050; m0=0.444;    % Foot/ankle link's length and mass
 l1=0.139; m1=1*0.343;  % Ankle/knee link's length and mass 
 l2=0.143; m2=1*0.409;	% Knee/hip link's length & mass
 l21 = 0.063; l22 = 0.080;
 l3 = 0.119; m3 = 0.75;                        % distance between legs
 L=[l0 l1 l2 l21 l22 l3];                       % Vector of link lengths
 M=[m0 m1 m2 m3];                              % To be seen by the servos! 
 
 global go
 go=9.8;                                        % Gravity vector
%-- Joint vector: zero position ------------------------------------------- 
 global qi dqi M_01_i CTRL_mode Ts NUM_samples JointSpeed % Seen by the servos!!!
% Ts = 5e-3;  % Servo clock rate ------------------------------------------
%   qi_r = [0 0 0 0 0 0]';   qi_l = [0 0 0 0 0 0]'; 
  dqi_r = [0 0 0 0 0 0]';  dqi_l = [0 0 0 0 0 0]';   
 ddqi_r = [0 0 0 0 0 0]'; ddqi_l = [0 0 0 0 0 0]';
%-- Joint vector: zero position ------------------------------------------- 
 global ANG dANG ddANG COP COG GRF T tt
 tt = 0;
%-- Cartesian coordinates -------------------------------------------------  
 global save_P_r save_C_r save_F_r save_H_rl save_P_l save_C_l save_F_l SAVE_ans ZZ
 save_P_r = []; save_C_r = []; save_F_r = [];
 save_H_rl = [];
 save_P_l = []; save_C_l = []; save_F_l = [];
 SAVE_ans = 0; ZZ = 1;
 global save_COG_r save_COG_rl save_COG_l save_COG
 save_COG_r = []; save_COG_rl = []; save_COG_l = []; save_COG = [];
%-----------------------------------------------------------------endscript
%////////////////////////////////////////////////////////////end_SIMULATION
