**Lab 4 - Coupled pendula** **[ENGR 12 Spring 2026](index.html)** (#) Objectives * Derive analytical solutions for mechanically coupled systems. * Model coupled systems using Simulink. * Compare the behavior of physical systems to simulations and analytical results. (##) Before you begin * Find your seat * [Section B](B4.pdf) - 3/18 * [Section C](C4.pdf) - 3/30 * [Section D](D4.pdf) - 4/1 * [Section A](A4.pdf) - 4/13 * Log into the desktop PC * Power up the oscilloscope. (##) Resources * Reference the [pre-lab slides](lab4.pdf) as needed. * Download the [E12 lab report template](E12_Lab_Report_Template.zip) and upload it to Overleaf. Share it with your lab partner. Equipment manual: * [MDO34 Oscilloscope](MDO34_Oscilloscope.pdf) Starter code: * [`load_tek_csv.m`](load_tek_csv.m) * [`fit_sinusoid.m`](fit_sinusoid.m) # Introduction Today in lab, you will be collecting data from, and modeling this system:  Here are the physical parameters describing the pendula: | Symbol | Description | Value | Unit | |:---|:---|--:|:--| |$k_w$ | Spring constant for spring connecting pendulum rods | 2.5 | N/m | |$k_u$ | Spring constant for springs connected to force sensors | 53.0 | N/m | |$m$ | Mass of each weight (plus plastic screw) | 0.201 | kg | |$\ell$ | Distance from pivot to center of weight | 0.360 | m | |$w$ | Distance from pivot to tension spring | 0.270 | m | |$u$| Distance from pivot to force sensor spring | 0.03 | m | For the purposes of this lab, you should assume that the bottom spring is at its rest length whenever $\theta_1 = \theta_2$ and that the top springs are at their rest lengths whenever $\theta_1 = 0$ and $\theta_2 = 0$. You should also assume that the springs work equally well in tension and compression. !!! Warning **Risk of possible equipment damage:** The force sensors have a maximum force capacity of 5N. Please make sure to limit the pendulum deflection to a maximum of 15° to avoid exceeding this threshold. !!! Tip **A note about the force sensor readings:** The [piezoelectric](https://en.wikipedia.org/wiki/Piezoelectricity) force sensors convert the force exerted on them by the spring to a voltage. The conversion rate is about 14 V/N. *While the pendula are moving*, as long as the angles are small (below about 15°), you can expect the spring force (and therefore voltage) to be proportional to angle. *However, when stationary, the force sensors do not correctly report an angle.* This is due to a high-pass frequency cutoff of 0.2 Hz for recording forces. **TL;DR - The force sensors are only proportional to angle *while the pendula are moving* and can't be used to measure angles while the pendula are stationary.** # Tasks during lab Since there are fewer available pendulum setups than there are groups, lab groups will have to take turns on these tasks. I will keep time and facilitate groups switching between the experiment and the analysis. ## Collect experimental data Ensure that the 12V power supply and force sensors are connected to the electronics board. Then use the coaxial cables to connect the electronics board to the oscilloscope. Check that the left pendulum (with angle $\theta_1$) is connected to Channel 1 and the right pendulum (with angle $\theta_2$) to Channel 2. I suggest you configure the vertical scale of Channel 1 and Channel 2 to have 200 mV per division. For the horizontal scale, I suggest 1 second per division, which should provide 10 seconds worth of data across the whole screen. For each case in the table below, ensure the scope is running and acquiring data. Then for some small angle $\epsilon$ (aim for about 10-15°), set the initial positions of the pendula to one of the cases in the table below. When the screen is full of data and the startup transient has disappeared, hit the run/stop button on the scope to pause acquisition so you can save the data from the scope. Repeat this for each experimental case below. |Case|$\theta_1(0)$|$\theta_2(0)$| |:---|--:|---:| |Alternating| $\epsilon$ | $0$ | |In phase| $\epsilon$ | $\epsilon$ | |Out of phase| $\epsilon$ | -$\epsilon$ | Save your recorded data to files named `pendulum1.csv`, `pendulum2.csv`, and `pendulum3.csv`. !!! Warning Due to the arrangement of the force sensors, Channel 1 will be proportional to $\theta_1$ directly but Channel 2 will be proportional to $-\theta_2$. So your "in phase" case will look out of phase on the scope and your "out of phase" case will look in phase on the scope. !!! **Checkpoint:** Show me or the wizard your first data recording before starting your second one! ## Analyze the dynamics of the coupled pendula You'll start by deriving the linearized differential equations using free-body diagrams. Then, you'll create a Simulink model to solve the coupled system. Finally, you'll use a change of variables to end up with a pair of decoupled equations that you can solve analytically. ### Draw a free-body diagram Draw a free-body diagram of the coupled pendula setup. Make sure to account for all of the following torques: * torques due to inertia (assume point masses at distance $\ell$) * torques due to the spring below the pivots * torques due to the springs above the pivots * torques due to gravity When computing your torques, ensure that they are linear in the angles and their second derivatives. That is, each torque should include a factor of $\theta_1$, $\theta_2$, $\ddot{\theta}_1$, or $\ddot{\theta}_2$ (or sums/differences of those quantities). Everything should be linearized around the setpoint $\theta_1 = \theta_2 = 0$. Remember the trigonometric linearizations for small angles: $\sin \theta \approx \theta$, and $\cos \theta \approx 1$. You will include your free-body diagram in your lab report, so make sure to use a drawing program to create the final version of it. !!! Tip It's often easier and clearer to draw an FBD with forces instead of torques (moments). Draw the FBD of the full rigid body (not just a point mass) and draw each force where it acts on the body. Draw the torque due to inertia $ml^2\ddot{\theta}$ as a curved arrow in the opposite direction that I defined as positive for $\theta$. Each pendulum has one degree of freedom to rotate about the pivot point, so after you have your FBD, sum the torques about the pivot point. !!! **Checkpoint:** Show me or the wizard your free-body diagram before you move on to the next step! ### Set up your linear differential equations All of the torques in the free-body diagram should sum to zero. Rearrange the resulting equations into the form below: $$ \begin{align} \ddot{\theta}_1 + a \, \theta_1 + b \, (\theta_1 - \theta_2) &= 0 \\ \ddot{\theta}_2 + a \, \theta_2 + b \, (\theta_2 - \theta_1) &= 0 \end{align} $$ You will need to express the constants $a$ and $b$ in terms of the physical parameters of the system described in [section 1](#toc1). ### Create a Simulink model The differential equations (1) and (2) are a coupled pair of second-order equations, which are difficult to solve analytically. However, you already know how to solve them numerically using Simulink. Consult the [Lab 2 pre-lab slides](lab2.pdf) for a refresher on my recommended process for building a Simulink model based on a differential equation. Then, build a Simulink model and run your simulation for the three sets of initial conditions above (alternating, in phase, and out of phase). Export your data to MATLAB to make nice plots of the simulated system response. !!! **Checkpoint:** Show me or the wizard your Simulink block diagram before moving on to the next step. ### Solve the system with a change of variables The differential equations (1) and (2) are a coupled pair of second-order equations, which are difficult to solve analytically. We can arrive at an easier set of equations to solve by introducing a change of variables $x = \theta_1 + \theta_2$ and $y = \theta_1 - \theta_2$. Create a new differential equation for $x$ by summing together equations (1) and (2) above. When whenever you see a $\theta_2$, replace it with $x - \theta_1$ (and don't forget that $\ddot{\theta}_2 = \ddot{x} - \ddot{\theta}_1$ also). Similarly you can create a differential equation for $y$ by subtracting equation (2) from equation (1) and replacing $\theta_2$ with $\theta_1 - y$ (don't forget second derivative too). When you're done, you should have a new set of equations $$ \begin{align} \ddot{x} + c\, x &= 0 \\ \ddot{y} + d\, y &= 0 \end{align} $$ where $c$ and $d$ depend on the constants $a$, $b$ above. Since $a$ and $b$ are expressed in terms of the physical parameters of the system, you can do the same for $c$ and $d$. !!! Tip Note that these equations are [simple harmonic oscillators](https://en.wikipedia.org/wiki/Simple_harmonic_motion) -- undamped second-order systems with natural frequencies determined by $c$ and $d$. Specifically for $x(t)$, $w_0^2 = c$ and for $y(t)$, $w_0^2 = d$. The analytical solution for each equation takes the form $A \cos(\omega_0 \, t + \phi)$ for some amplitude $A$ and phase offset $\phi$. Congratulations -- you now have an analytical solution of the linearized dynamics of the coupled pendula system! !!! **Checkpoint:** Check your solution with me or the wizard before moving on to the next step. # Analysis !!! Tip Don't forget to save your MATLAB code as you will need to submit it! For each recording, `pendulum1.csv`, `pendulum2.csv`, and `pendulum3.csv` corresponding to the in-phase, out-of-phase, and alternating cases, perform the following steps: 1. Import your data using [`load_tek_csv.m`](load_tek_csv.m) and generate an initial plot of $\theta_1(t)$ and $\theta_2(t)$. You do not need to include this plot in your report. **Don't forget that Channel 1 corresponds to $\theta_1$ and Channel 2 corresponds to $-\theta_2$.** 2. Apply the change of variables from [section 2.2.4](#toc2.2.4) to change your recordings of $\theta_1(t)$ and $\theta_2(t)$ into observations of $x(t)$ and $y(t)$. Generate an initial plot of $x(t)$ and $y(t)$ -- it should look like a pair of sinusoids at different frequencies. You do not need to include this plot in your report. 3. Use the provided [`fit_sinusoid.m`](fit_sinusoid.m) script to determine the amplitude $A$ and phase offset $\phi$ for each timeseries $x(t)$ and $y(t)$ using the natural frequencies you identified in [section 2.2.4](#toc2.2.4). Plot the experimental observations of $x(t)$ and $y(t)$ as well as your best-fit sinusoids of the predetermined frequencies. They should match reasonably well. You do not need to include this plot in your report. 4. Reverse the change of variables from [section 2.2.3](#toc2.2.3) to turn your theoretical models of $x(t)$ and $y(t)$ into models of $\theta_1(t)$ and $\theta_2(t)$. (This should involve a tiny bit of algebra.) Plot experiment vs theory. Here's an example of my plot from step 4:  Note the good agreement between experiment and theory. !!! **Checkpoint:** Show me your plots for steps 3 and 4 for the first case before you move onto the second and third cases. # Writing your lab report Write a lab report using $\LaTeX$ that adheres to the guidelines in the [E12 Lab Report Template](E12_Lab_Report_Template.zip). In addition to the guidelines in the template, below are guidelines specific to some sections of the report for this lab. (##) Introduction * Explain, in your own words, the purpose of today's lab. How does analyzing the coupled pendula system connect to the material from lecture and to the learning goals of E12? (##) Theory * Include your free-body diagram from [section 2.2.1](#toc2.2.1), including all of the linearized torques. * Include your coupled differential equations (1) and (2) for $\theta_1$ and $\theta_2$ from [section 2.2.2](#toc2.2.2). Make sure to indicate the values of $a$ and $b$ in terms of the physical parameters of the system listed in the table in [section 1](#toc1). * Include your uncoupled differential equations (3) and (4) for $x$ and $y$ from [section 2.2.3](#toc2.2.3). Make sure to indicate the values of $c$ and $d$ in terms of the physical parameters of the system. (##) Methods * Present your Simulink block diagram. To export your Simunlink model as a high-quality image, make sure the model you want to export is open and run the following line of code from the command line. Replace `MyModelName` with your model name. ~~~ MATLAB print -sMyModelName -dpng -r300 MyModelImage.png ~~~ (##) Results * Present your $\theta_1$/$\theta_2$ plots from [section 3](#toc3). There should be six in total: one from Simulink and another comparing theory vs. experiment for each of the three cases. (##) Discussion * Assuming the linearized dynamics are accurate, what do we expect to see in $x(t)$ and $y(t)$ when the motion of the coupled pendula is totally in-phase (that is, $\theta_1 = \theta_2$)? What about when the motion is totally out of phase (that is, $\theta_1 = -\theta_2$)? * Which decoupled variable ($x$ or $y$) oscillates at a higher frequency? Explain why from a physical perspective. Or to put it another way, would you expect in-phase motion to be faster or slower than out-of-phase motion, and why? * When deriving the dynamics, we assumed linearity (e.g. small angle assumption). What other assumptions did we make? List all you can think of. * When theory does not match experiment, there are a number of possible reasons including parameter errors (i.e. estimate of mass $m$ is incorrect), measurement errors (i.e. voltages recorded by scope are not proportional to angle, or have an offset/bias), and model errors (i.e. some assumption underlying the model was violated). Which type of error you think is most repsonsible for any mismatch between experiment and theory in your plots, and why? (##) Submission Two weeks from your lab meeting, please submit to Moodle: * Your lab report in PDF format. * All .csv data files you recorded from the oscilloscope. * Any code you wrote as .m files. You do not need to include any of my starter code.