
gearRatio = 171.79; %
encoderResolution = 48; %48 clicks per rev of motor shaft 
speedNoLoad = 35*7.5/6; %no load speed of motor shaft in rpm
countsPersec = 35*48/60; %encounder counts per second at max speed
simFrequency = round(1/countsPersec,6); %capture encoder changes reliably
J = 9.76e-3; %motor + gearbox inertia, kg*m^2
Ra = 5; %resistance of motor, ohms

kt = (1/.013)*9.81/1000; %torque constant of motor + GB from datasheet values , N*m/A
kb = (6/35)*2*pi/60; %back emf constant of the motor + GB from datasheet values V*s/rad

b = (1/Ra)*(J*Ra/.21-kt*kb); % damping of motor + GB 

%Part C Constants 

theta_des = pi/2; %desired angular position in radians 
Kp = 250; %proportional gain kp
Ki = 250;

