To implement this work into the real world is is necessary to have a hardware unit (Mobile robot). But as the initial step a antenna unit should be implement with following specifications in the real world.
As the first step a Matlab simulation was done for the antenna tip. It is decided to move the antenna in an elliptical path. The resultant 2D simulation is shown here.
But since the antenna is 3D unit in the real world, we can’t get much clear simulation result through the 2D simulation. So it is necessary to have a 3D simulation for the whole antenna unit. A polar coordinate system was used for the 3D model simulation. Matlab was used for both simulations. 3D model simulation is shown in the Figure 37. All the matlab codes for the 2D and 3D simulation were embed at the last.
Figure 36: Animated result for the 2D simulation.
Figure 36: Animated result for the 2D simulation - GIF
Figure 37: Animated result for the 3D simulation.
Figure 37: Animated result for the 3D simulation- GIF
Code for the 2D simulation (MATLAB 2017a)
clear all;
close all;
clc;
crc = @(r1,r2,p,a) [r1*cosd(a + p); r2*sind(a + p)];
t = linspace(0, 360, 361); % Time
init_pos = 0; % Initial Position (°)
r1 = 4;
r2 = 2;
locus = crc(r1,r2, init_pos, t)
figure(1)
for k1 = 2:length(t)
x= locus(1,k1)
y=locus(2,k1)
plot(x, y , 'r*')
axis([-5 5 -5 5])
grid
axis square
drawnow
end
Code for the 3D simulation (MATLAB 2017a)
clear all;
close all;
clc;
a=1
% while (2>1)
for i= pi/18:pi/180:14*pi/12
% Your two points
P1 = [0,0,0];
rho=400;
phi=cos(i)
theta=i+180
x=rho*sin(phi).*cos(theta);
y=rho*sin(phi).*sin(theta);
z=rho*cos(phi);
P2 = [x,y,z];
pts = [P1; P2];
line(pts(:,1), pts(:,2), pts(:,3));
f=plot3(pts(:,1), pts(:,2), pts(:,3));
drawnow
hold on;
grid on
box on
end