%========================================================================
% Análise de cames com seguidor de translação com rolo.
% Criado em: 02/04/2014
%========================================================================

clear all
close all
clc

P=23;
Rc=18;
Rf=6;
E=0;
NP=361;

for i=1:NP
    A(i)=2*pi*(i-1)/(NP-1);
    Ap(i)=asin((Rc*sin(A(i))-E)/(Rf+P));
    H(i)=(Rf+P)*cos(Ap(i))-Rc*cos(A(i));
    fL(i)=Rc*(sin(A(i))-cos(A(i))*tan(Ap(i)));
    fLL(i)=Rc*(cos(A(i))+sin(A(i))*tan(Ap(i))-(Rc*cos(A(i))^2)/((Rf+P)*cos(Ap(i))^3));
end

figure('name','Translação de rolo')
subplot(4,1,1)
plot(A*180/pi,H)
xlim([0 360])
xlabel('A (grau)')
ylabel('H (mm)')
grid on
subplot(4,1,2)
plot(A*180/pi,fL)
xlim([0 360])
xlabel('A (grau)')
ylabel('fL ')
grid on
subplot(4,1,3)
plot(A*180/pi,fLL)
xlim([0 360])
xlabel('A (grau)')
ylabel('fLL ')
grid on
subplot(4,1,4)
plot(A*180/pi,Ap*180/pi)
xlim([0 360])
xlabel('A (grau)')
ylabel('Ap ')
grid on
