meam2480

thermo 1 + dynamics lab

Lab 0: Sensor Calibrations

The first lab of the semester taught us an important lesson:
Don’t blindly trust all the data!
The main focus of the lab was to calibrate the telemetry devices Dr. Yim had made in-house, which had a 3-axis accelerometer and gyro, a thermistor, and a pressure sensor. We did this by putting the device in controlled states (i.e., taping it to a lathe turning at a fixed slow speed) and seeing what the appropriate reading (angular velocity along a particular axis) was. We then used a simple linear model for gain and offset to find actual values from what we sensed.

A calibration graph for angular velocity obtained by taping the sensor to a lathe in Penn's Precision Machining Laboratory. We aligned the sensor's x axis with the axis of rotation. The full report can be found here.

Lab 1: Heat Engine Optimization

Our second lab focused on maximizing power output on a heat engine by switching the air “tanks” between hot and cold baths. The expansion and contraction of gas would drive the engine. This would then lift a weight, which allowed us to measure the power output.

We used the fundamental relationships of the Ideal Gas Law to figure out how to optimize performance. For example, we recognized that filling the air tank while it was submerged in cold water would cause more air to enter the tank, which would result in a more powerful expansion stroke. Using a PV diagram and some simple calculations, we were also able to accurately estimate the power output of our system, which ended up being the highest in our lab section.

Derivation of formula for power output.

The full report can be found here.

Lab 2: Ball Launcher

The goal of this lab was to launch a plastic ball from ground level, through a window, and hit a target on the ground on the other side. This involved:

  • Making a MATLAB solver to generate potential trajectories
  • Designing and fabricating our launcher
  • Testing and revising our model (i.e., incorporating drag, introducing fudge factors…)

The trajectory generator was made using Matlab (using a rather brute-force method):

Xh = 1.5;
Yh = 0.5;
Xt = 4;
err_margin = 0.25;
valid_vs = [];
valid_thetas = [];
for V = 0:0.1:7
    for theta = 0:0.1:85
        targ_hit = false;
        hole_hit = false;
        % GENERATE TRAJ
        % the equations to solve are:
        %dVx/dt = -k/m (Vx^2 +Vy^2)^0.5 *Vx;
        %dVy/dt = -g-k/m(Vx^2 +Vy^2)^0.5 *Vy;
        % implement RK2;
        % define initial condition;
        X0 =0;
        Y0 =0;
        Vx0 = V*cosd(theta);
        Vy0 =V*sind(theta);
        % parameter values 
        k = 0.003459;
        m = 0.04;
        % define grid spacing 
        h=0.01;
        % define domain 
        T=5;
        t =0:h:T; t=t';
        % initialize solution 
        X = t*0; Y = t*0; Vx = t*0; Vy = t*0;
        X(1) = X0; Y(1) = Y0; Vx(1) = Vx0; Vy(1) = Vy0;
        for i = 1:length(t)-1
            %predictor values
            Xp = X(i) + 0.5*h*Vx(i);
            Yp = Y(i) + 0.5*h*Vy(i);
            Vxp = Vx(i) + 0.5*h*(-k/m)*(Vx(i)^2+Vy(i)^2)^0.5*Vx(i);
            Vyp = Vy(i) +0.5*h*(-k/m)*(Vx(i)^2+Vy(i)^2)^0.5*Vy(i)-0.5*h*9.81;
            %corrector values
            X(i+1) = X(i) + h*Vxp;
            Y(i+1) =Y(i) +h*Vyp;
            Vx(i+1)= Vx(i) + h*(-k/m)*(Vxp^2+Vyp^2)^0.5*Vxp; 
            Vy(i+1)= Vy(i) + h*(-k/m)*(Vxp^2+Vyp^2)^0.5*Vyp-h*9.81;
        end
        % END TRAJ GENERATION

        % DOES TRAJ INCLUDE TARGET?
        for ind=1:length(X)
            if Y(ind)>0 && Y(ind+1)<0
                if X(ind)>(Xt-err_margin) && X(ind)<(Xt+err_margin)
                    targ_hit = true;
                end
            end
            if targ_hit == true
                break
            end
        end

        % DOES TRAJ INCLUDE HOLE?
        for ind=1:length(X)
            if X(ind)>(Xh-err_margin) && X(ind)<(Xh+err_margin)
                if Y(ind)>(Yh-err_margin)&& Y(ind)<(Yh+err_margin)
                    hole_hit = true;
                end
            end
            if hole_hit == true
                break
            end
        end

        % RECORD VALID SOLUTION
        if hole_hit && targ_hit
            valid_vs(end+1) = V;
            valid_thetas(end+1) = theta;
        end
    end
end
Trajectories generated.

Our final launcher was made using laser-cut acrylic and a hefty amount of rubberbands. Below is the final demonstration (pending… lol). Our model wasn’t accurate enough to have it hit the correct targets, but it could pack a solid punch.

Final Project: Butane Bottle Rocket!