Overview
The pendulum experiment demonstrates simple harmonic motion, energy conservation, and damping. Using video tracking with sophisticated pivot detection, you can measure period, frequency, amplitude decay, and even calculate gravitational acceleration.Physics Theory
Simple Pendulum Motion
For small angles (θ < 15°), the period is: Therefore: Where:- is the period (seconds)
- is the pendulum length (meters)
- is gravitational acceleration (m/s²)
Damped Harmonic Motion
With air resistance, the angular displacement follows: Where:- is initial amplitude
- is damping coefficient
- is angular frequency
- is phase offset
- is equilibrium offset
Energy Analysis
At maximum displacement: At lowest point (maximum velocity):Measurement Method
PhysisLab uses camera-based tracking with dual color detection:- Bob (pendulum mass): Tracked for position and angle
- Pivot point: Tracked to compensate for camera movement
- Standard tracking:
~/workspace/source/Pendulo/analisis.py - With pivot tracking:
~/workspace/source/Pendulo/analisisTrackingpivote.py
Hardware Requirements
- Camera (webcam, USB camera, or phone)
- Pendulum setup (string + colored mass)
- Colored marker at pivot point
- Ruler or measuring tape
- Stable mounting for camera
Experimental Procedure
Setup Physical Pendulum
- Attach a colored bob (ball, weight) to a string
- Measure and record string length L (pivot to center of bob)
- Mark the pivot point with a different colored marker
- Mount camera with clear view of full swing range
Record Video
Record a video of the pendulum swinging:
- Ensure both bob and pivot are always visible
- Use consistent lighting
- Record at least 10-20 oscillations
- Keep camera as stable as possible
Configure Analysis
Follow the interactive prompts:Frame Selection:
- Navigate:
d(next),a(previous) - Mark start:
i - Mark end:
f - Confirm:
ENTER
- Select ROI around pendulum bob → automatic HSV detection
- Select ROI around pivot marker → automatic HSV detection
Spatial Calibration
- Enter pendulum length L in meters
- Click on bob center to measure L in pixels
- System calculates pixel-to-meter scale
Code Walkthrough
Color Calibration
Adaptive HSV range calculation (analisis.py:82-98):
Pivot Detection and Tracking
Dynamic pivot tracking with fallback (analisisTrackingpivote.py:222-244):
Angular Position Calculation
Coordinate transformation and angle measurement (analisis.py:228-237):
Sinusoidal Fitting
Damped harmonic oscillator fit (analisis.py:288-315):
Data Analysis
Output Files
Data File:datos_pendulo.txt
fig1_posicion_velocidad.png- Position and velocity vs timefig2_angulo.png- Angular displacement with sinusoidal fitfig3_trayectoria.png- Pendulum trajectory (x-y plane)
Example Results
Velocity and Acceleration
Velocities calculated via numerical differentiation (analisis.py:277-283):
Visualization
Position and Velocity Plots
The analysis generates comprehensive plots:Angular Displacement with Fit
Trajectory Visualization
Advanced Features
Camera Motion Compensation
The pivot tracking version compensates for camera shake:Energy Conservation Check
Calculate potential and kinetic energy:Tips for Best Results
Physical Setup
Physical Setup
- Use thin, inextensible string (fishing line works well)
- Ensure pivot is frictionless (ball bearing ideal)
- Use dense bob (metal sphere) to minimize air resistance
- Keep pendulum length between 0.5-1.5 meters
- Start with small angles (< 15°) for theoretical validity
Camera Setup
Camera Setup
- Mount camera securely (tripod essential)
- Position perpendicular to swing plane
- Ensure full swing visible in frame
- Use contrasting background
- Adequate lighting without glare
- Record at 30+ FPS for smooth tracking
Color Selection
Color Selection
- Bob and pivot should be different, bright colors
- Avoid colors present in background
- Solid, non-reflective surfaces work best
- Test color detection before recording
Measurement Accuracy
Measurement Accuracy
- Measure L from pivot to bob center of mass
- Use multiple measurements and average
- Account for bob radius if significant
- Ensure string is taut when measuring
Troubleshooting
| Issue | Solution |
|---|---|
| Pivot detection lost | Use brighter marker, improve lighting, check HSV range |
| Erratic tracking | Reduce bob motion blur, increase FPS, smooth data more |
| Poor sinusoidal fit | Use more oscillations, start with smaller amplitude |
| g value far from 9.8 | Check L measurement, ensure small angles, verify FPS |
| Tracking jumps | Background has similar colors, use more distinct markers |
Extensions and Variations
Physical Pendulum
Modify theory for extended objects with moment of inertia
Coupled Pendulums
Study energy transfer between two connected pendulums
Damping Study
Vary damping by adding air resistance (card attached to bob)
Nonlinear Effects
Use large angles to observe departure from SHM
Next Steps
Spring-Mass System
Study another form of harmonic motion
Data Analysis Guide
Learn advanced fitting techniques