Title: System Analysis 3
From: Joshua Weilbacher, Alina Yang, Will Grawe
To: Jolanta Janiszewska
Date: March 2nd, 2016
Introduction
This week’s lab consisted of further analysis testing to gain more insight as to what needed to be changed. To this end, a test code was constructed. The test code consisted of one uphill motion, a complete stop, a reverse, and a downhill motion leading to another stop. The AEVs energy consumption was again monitored to give valuable information that was used to calculate other aspects of the AEV such as velocity or the RPM.
Results
The performance of the AEV was observed as it ran on the incline of the track. Many trials were taken during the experiment to make sure the AEV functions as expected. The power for AEV to climb to the top of the incline was increased and power to slide down the incline was decreased in order to stop in time. Power, energy, velocity and the efficiency of the AEV were calculated to check its performance. The trail can be divided into six phases as shown in Figure 4 and Table 1. According to Figure 4, phase 2 was when the AEV climbed up the incline, because greater power was needed to perform the action. For a similar reason, phase 5 was when AEV ran down from the incline, less power was needed in order to stabilize the AEV and prepare to stop. Accelerating the motor to a greater speed than needed before performing the action would improve the performance of the AEV. In previous labs, where no acceleration was taken place, the AEV needed a few seconds to prepare the motor and then execute the code. During this lab the celerate command was used and as shown in Figure 1 and 4, there was almost no delay after the motorSpeed code ran. From the values measured from the code distance, velocity and kinetic energy were calculated. The physical representation of these values can be seen in Figure 2 and Figure 3.
Figure 1: Power vs. Time
Figure 2: Distance vs.Velocity
Figure 3: Distance vs. Kinetic Energy
Figure 4: Power vs. Time with phases
Phase / Arduino Code / Distance(meters) / Time(seconds) / Total Energy(Joules)1 / celerate(4,0,40,1); / 0 / 1.021 / 3.675
2 / motorSpeed(4,45); / 53.79 / 3.481 / 44.7
3 / motorSpeed(4,0);/goFor(1); / 53.96 / 1.2 / 0.52
4 / celerate(4,0,30,1); / 52.96 / 0.96 / 2.117
5 / motorSpeed(4,15); / 428.98 / 6.597 / 18.015
6 / motorSpeed(4,25); / 133.55 / 1.08 / 6.8089
Total Energy Used: / 75.836
Table 1: Time used and total energy of three phases.
Conclusion
Many observations were made based on the information collected during the lab. During the initial two seconds the arduino was set with a delay that still consumed energy in order to power the arduino even though no motors were being powered. In the final version of the code this section will be removed in order to prevent unnecessary energy consumption. During phase two the AEV was traversing the incline, which required more power than the AEV traveling on the decline track such as in phase 5. In the final version of the code the power will need to be carefully observed when traveling on inclines as it consumes the most energy. Between phase 5 and 6 the motor direction changes and jumps to 25% power in order to slow the AEV down. This was inefficient and a large spike in power was recorded at the beginning of phase 6, in order to prevent this a slow transition, such as in phase 4, will be used in the final version of the AEV code.
Acknowledgements
Gratitude goes out to Jolanta Janiszewska for all materials provided in this lab.
Arduino Code
int marks= -443; //-443 marks = 18ft
goFor(2);//delay before AEV starts moving
reverse(4);//reverses motors so they will go forward
celerate(4,0,40,1);//accelerates all motors from 0 to 40% in 1 second
motorSpeed(4,45);//sets all motors to 20% speed
goToRelativePosition(-2.2/0.0124); // travels until (-2 meters/0.0124 meters/marks)
motorSpeed(4,0);//stops all motors
goFor(1);//stops for 1 second
reverse(4);//switches motor direction
celerate(4,0,30,1);//accelerates all motors from 0 to 30% in 1 second
motorSpeed(4,15);//sets all motors to 15%
goToRelativePosition(3/0.0124); // travels until (2.6 meters/0.0124 meters/mark)
reverse(4);//switches motor direction
motorSpeed(4,25);//sets motors to 25%
goFor(1);//slows AEV for 1 second
brake(4);//cuts power to all motors
Matlab Code
clc;clear
a=xlsread('SomethingElseMeaningful2.xlsx');
vr=a(1,2);
a(1:6,:)=[];
Mass=284;
Time=a(:,1)/1000; %This calculates the time
Current=(a(:,2)/1024).*vr.*(1/0.185); %This calculates the current
Voltage=(15*a(:,3))/1024; %This calculates the voltage
Distance=0.0124*a(:,4); %This calculates the distance
pos=0.0124*a(:,5); %This calculates the position
Power=Voltage.*Current; %This calculates the power
n=length(Power);
for j=1:(n-1)
Energy(j)=(Power(j)+Power(j+1))/2*(Time(j+1)-Time(j)); % This calculates the energy
end
EnergyS=sum(Energy(n-1));
figure
plot(Time,Power)
xlabel('Time');
ylabel('Power');
title('Power vs Time');
xR = 2; % Right x-coordinate
xL = 0; % Left x-coordinate
iL = knnsearch(Time,xL); % Element index of left point
iR = knnsearch(Time,xR); % Element index of right point
E_phase_1 = Energy(iL:iR); %Reverse and Delay time
EnergyP1=sum(E_phase_1); %sum energy
fprintf('EnergyP1=%f\n',EnergyP1);
xR = 3; % Right x-coordinate
xL = 2; % Left x-coordinate
iL = knnsearch(Time,xL); % Element index of left point
iR = knnsearch(Time,xR); % Element index of right point
E_phase_2 = Energy(iL:iR); %Set speed
EnergyP2=sum(E_phase_2); %sum energy
fprintf('EnergyP2=%f\n',EnergyP2);
xR = 6.5; % Right x-coordinate
xL = 3; % Left x-coordinate
iL = knnsearch(Time,xL); % Element index of left point
iR = knnsearch(Time,xR); % Element index of right point
E_phase_3 = Energy(iL:iR);
EnergyP3=sum(E_phase_3);
xR = 8; % Right x-coordinate
xL = 6.5; % Left x-coordinate
iL = knnsearch(Time,xL); % Element index of left point
iR = knnsearch(Time,xR); % Element index of right point
E_phase_4 = Energy(iL:iR);
EnergyP4=sum(E_phase_4);
xR = 8; % Right x-coordinate
xL = 15.4; % Left x-coordinate
iL = knnsearch(Time,xL); % Element index of left point
iR = knnsearch(Time,xR); % Element index of right point
E_phase_5 = Energy(iL:iR);
EnergyP5=sum(E_phase_5);
xR = 16.4; % Right x-coordinate
xL = 15.4; % Left x-coordinate
iL = knnsearch(Time,xL); % Element index of left point
iR = knnsearch(Time,xR); % Element index of right point
E_phase_6 = Energy(iL:iR);
EnergyP6=sum(E_phase_6);
TotalEnergy=EnergyP2+EnergyP1+EnergyP3+EnergyP4+EnergyP5+EnergyP6; %sum energy for both phases
fprintf('TotalEnergy=%f\n',TotalEnergy);
Diameter=0.08128; % Constant for Diameter of blades
q=length(Time);
Velocity = zeros(q-1, 1); %This sets velocity as a blank matrix
for i=2:(q)
Velocity(i)=((pos(i)-(pos(i-1))/(Time(i)-(Time(i-1))))); % Calculation for Velocity
end
KEnergy=(1/2)*Mass*Velocity; % Calculation for Kinetic Energy
RPM=-64.59*Current.^2+1927.25*Current-84.58; %Calculation for RPM
J=(Velocity)./((RPM/60)*Diameter); %Preliminary calculation for propulsion
Propulsion=-454.37*J.^3+321.58*J.^2+22.603*J; %Calculation for Propulsion
figure
plot(Distance,Velocity)
xlabel('Distance');
ylabel('Velocity');
title('Distance vs Velocity');
figure
plot(Distance,KEnergy)
xlabel('Distance');
ylabel('Kinetic Energy');
title('Distance vs Kinetic Energy');
figure
plot(Distance,Propulsion)
xlabel('Distance');
ylabel('Propulsion');
title('Distance vs Propulsion');
Individual (Will Grawe)
Reference Voltage / 2.46Time (ms) / Current (counts) / Voltage (counts) / Marks
(Cumulative wheel counts) / Marks
(Position wheel counts)
14883 / 30 / 516 / 473 / -71
14943 / 32 / 516 / 479 / -65
Individual (Alina Yang)
Time (ms) / Current (counts) / Voltage (counts) / Marks (Cumulative wheel counts) / Marks (Position wheel counts)5343 / 130 / 501 / 94 / -94
5403 / 132 / 502 / 99 / -99
Individual (Joshua Weilbacher)
Reference Voltage / 2.46Time(ms) / Current (Counts) / Voltage (Counts) / Marks (Cumulative wheel counts) / Marks (Position wheel counts)
5103 / 129 / 501 / 77 / -77
5163 / 131 / 502 / 81 / -81