%--------------------------------------------------------------------------
% Script:       SimParam.m
% Purpose:      Define simulation parameters: one-leg with 3dof-3D
%--------------------------------------------------------------------------
%-- Mechanical links ------------------------------------------------------
 l0=0.05;	 r0=0.032; m0=0.440;  % Foot/ankle link's length and mass
 l1=0.139;	 r1=0.089; m1=0.343; % Ankle/knee link's length and mass 
 l2=0.143;	 r2=0.101; m2=0.409;	% Knee/hip link's length & mass
 
 global L R M CM0x CM0y CM1y go
 L=[l0 l1 l2];   R=[r0,r1,r2];  M=[m0 m1 m2];   % To be seen by the servos! 
 CM0x = 0.0091; CM0y = 0;                       % Real value CM0y = 2.7 mm
 CM1y = -0.016;                                 % 
 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 = [0 pi/4 -pi/4]';
  dqi = [0 0 0]';
 ddqi = [0 0 0]';
%-- Joint vector: zero position ------------------------------------------- 
 global ANG dANG ddANG COP COG GRF T tt
 tt = 0;
%-----------------------------------------------------------------endscript
%//////////////////////////////////////////////////////////////////////////
% SIMULATION
%//////////////////////////////////////////////////////////////////////////
% Graphical represenftation of the single-leg at the initial configuration
%--------------------------------------------------------------------------
 P = DirKin3dof_sim(qi,L);
 C = JointCoordinates( qi,L );
 COG_i = RobCOG( qi,L,R,M );
 CreateWorldBodies( P,C,[P(10) P(11) P(12)]',COG_i,COG_i(1:2) )
%////////////////////////////////////////////////////////////end_SIMULATION
