1 of 26

Unit 2 - Motion�Lab 2A : Constant Acceleration

UCLA Physics Department

1

University of California, Los Angeles

Department of Physics and Astronomy

Physics 4AL

2 of 26

Outline of Lab 2A

  • Free fall experiment data taking:
    • Modify arduino code to capture data for longer intervals and to directly output distance values.
    • Collect 3 good data sets from free falling objects using ultrasonic sensor.
  • Data analysis 1:
    • Use np.polyfit (degree 2) to estimate the value of g from any one plot.
  • Introduction to Tracker

UCLA Physics Department

2

3 of 26

Constant Acceleration

UCLA Physics Department

3

4 of 26

Arduino extension board

Attach your Arduino extension board (already setup from Lab 1B) to the Arduino ensuring that corresponding pins match.

5 of 26

Wiring Diagram

Attach your ultrasound sensor to create the same setup from Lab 1B.

6 of 26

Code - Part 1

  • Built on the same program from Lab 1B
  • Introduce new variable “elapsedTime” to track the time elapsed since the program started.

7 of 26

Code - Part 2

  • “elapsedTime” will track the time since the experiment began in milliseconds. It will be set to 0 only when you start the program for the first time or you hit the reset button.

8 of 26

Code - Part 3

  • Serial Monitor will print two values : elapsedTime, duration.
  • No while loop as in Lab 1B to limit the number of data points.

  • What does the elapsedTime variable hold? What are its units?
  • What does the duration variable hold? What are its units?
  • Which value will be on the x axis and which one on the y axis?

9 of 26

Modify Code

  • Modify the code to directly output the distance in centimeters instead of outputting the time-of-flight delay. (Hint : Introduce new variable of the type “float” and set it to appropriate value using the speed of sound you obtained in Lab 1B or using speed of sound as 343 m/s, then print this new variable instead of “duration”)
  • When multiplying or dividing by constant integers in the code end the number with .0, for example instead of dividing by 2, divide by 2.0
  • Verify if output matches any of the reference lengths from 1B.

10 of 26

Free fall experiment

  • Mount Arduino setup so that the ultrasonic sensor is facing the ground.
  • Hold a book (or similar object) close to the sensor and then drop the book so that the sensor records the distance as the book experiences free fall.
  • Record 3 datasets. Try to vary the initial height and the object.

11 of 26

TA Checkpoint 1

  • Plot only the accelerating portion of one of your datasets.
  • Use np.polyfit to fit a quadratic curve to that plot and plot the best fit curve.
  • Find the value of g from this. (Hint : Use the kinematic equation x = x0 - 0.5gt2 and think about how it is related to the best fit curve)
  • Use Notebook: Unit2_Lab2A

12 of 26

Analyzing videos with Tracker

  • Analyze this vertical drop video. Download it on your local system.
  • Download and install Tracker.
  • Evaluate position, velocity and acceleration using Tracker

13 of 26

Analyzing videos with tracker - Clip Settings 1

  • Upload the video to Tracker software. Go to File->Open File and select the video to upload. You will be working on the vertical ball drop video from the pre-lab.

Pick the start frame and end frame required for analysis. Here, the start frame will be the frame where the ball is released. The end frame will be frame when the ball almost hits the floor for the first time. Here, 19 is a good Start frame and 30 is a good End Frame.

14 of 26

Analyzing videos with tracker - Clip Settings 2

The two buttons around the number can be used to move frame by frame to the left or the right with the number in between being the step size.

Current Frame number

Start Frame

End Frame

15 of 26

Analyzing videos with tracker - Calibration 1

We need to use an appropriate reference length in a video we want to analyze. Here, we use the ruler. In this case the two strings are separated by 10 cm. For best results, the motion should be almost in the same plane as the reference length.

Click here and pick New-> Calibration Stick. Use Shift+Click to mark the two ends.

16 of 26

Analyzing videos with tracker - Calibration 2

Click at the right locations to mark the ends of the Calibration Stick. These ends can be moved later.

Click on the box with the number to edit the value to the appropriate reference length. Here, it is 0.1 m.

17 of 26

Analyzing videos with tracker - Coordinate Axes

We need to pick the origin of coordinate axes for the motion that we analyze from the videos. After picking the calibration stick and coordinate axes, we can begin to track the ball in the video.

Click here to create coordinate axes for your video. The centre of the ball at the start frame is a good option of the origin.

18 of 26

Analyzing videos with tracker - Tracking 1

Create a point mass is one option to track the object. Use Shift+Click on the center of the ball. You will notice it moves to the next frame. Use Shift+Click on the center of the ball in the new frame. Keep repeating until you reach the end frame (11 clicks using Start Frame 19 and End Frame 30).

Click here to create a point mass to track. The use Shift+Click to hit the center of the ball.

19 of 26

Analyzing videos with tracker - Tracking 2

The red spots mark the position of the center of the ball in each frame.

One the right (top) you will be able to see the position vs time plot. By default, it picks the x(m) vs t(s) but it can be changed to y(m) vs t(s) by clicking the axes label and picking what you like.

One the right (bottom) you will be able to see the values of time, x position and y position.

20 of 26

Analyzing videos with tracker - Plots

By changing the axes labels, you can plot many quantities. On the left, we have velocity (top) in y direction and acceleration (bottom) in y direction. We will export position data to Python and analyze using np.polyfit.

21 of 26

Analyzing videos with tracker - Exporting data 1

Set variables of interest (in this case you only need y) on the table. You can also define new functions.

22 of 26

Analyzing videos with tracker - Exporting data 2

Go to File->Export->Data File. You will see the window on the left.

  • Pick the point mass you are tracking in the Data Table list box.
  • Pick “All Cells” in the list box under Cells.
  • Pick “As Formatted” in the list box under Number Format.
  • Pick “Comma” as the Delimiter.

23 of 26

TA Checkpoint 2

  • When saving the file, give it an appropriate name but end with .csv like “ball_drop.csv”.
  • Skip the first 2 rows before loading this file to Python. You can do this by using np.loadtxt(filename,delimiter=’,’,skiprows=2)
  • Use np.polyfit on the position data to find the value of g.
  • Use Notebook: Unit2_Lab2A

24 of 26

Post-lab Week 2�(due Sunday 11: 59 pm)

UCLA Physics Department

24

April 13 - 17, 2020

25 of 26

Free fall plot

  • Plot only the accelerating portion of one of your datasets.
  • Use np.polyfit to fit a quadratic curve to that plot and plot the best fit curve.
  • Find the value of g from this. (Hint : Use the kinematic equation x = x0 - 0.5gt2 and think about how it is related to the best fit curve)
  • Add all the requirements in the Post-Lab template here

26 of 26

Using Tracker

  • When saving the file, give it an appropriate name but end with .csv like “ball_drop.csv”.
  • Skip the first 2 rows before loading this file to Python. You can do this by using np.loadtxt(filename,delimiter=’,’,skiprows=2)
  • Use np.polyfit on the position data to find the value of g.
  • Add all the requirements in the Post-Lab template here