VPOD 3DOF Vibratory Device
Nondimensional 3DOF Bouncing Ball Simulator
Introduction
The Nondimensional 3DOF Bouncing Ball Simulator is a simple Matlab program meant to mimic the behavior of a bouncing ball on a vibratory device capable of sinusoidal motion in three degrees, such as the VPOD. The simulator uses a numerical method in which the equations of motion describing the ball's flight are determined from the state variables of the previous impact. The program uses a binary search to locate the time at which the ball's position in the x,z plane is equal to that of the oscillating bar. In short, it calculates the intersection of a parabola with a sinusoid, uses a simple impact model to compute the new state variables, and repeats this computation as many times as desired. The equations of motion for the oscillating bar are as follows:
where A_x, A_z, A_theta represent the maximum x, z, and angular displacements of the bar's motion. The key input variables are the three position amplitudes, three frequencies, and three phase angles, as well as coefficients of restitution in the normal and tangential directions.
Quick Start
In order to run the simulator, first download the Matlab files by clicking on the link below:
Description of Functions
The zipped folder contains 6 m-files:
- bBallSim - This is the main m-file and likely the only one you will have to worry about. It contains a big for loop which takes the initial conditions for the ball's flight and calculates one bar impact, storing the data in the matrix 'P'. The post-impact conditions then become the new initial conditions. It loops as many times as indicated.
- binSrch - Uses a binary search method to locate the time where in ball intersects the bar, based off of the initial flight conditions and parameters. It returns the time of intersection (denoted 't2').
- checkLocking - Determines whether or not the ball is locking. Locking is a phenomenon in which the ball's velocity decays to zero, undergoing an infinite number of bounces in the absorbing region of the bar's motion. If the flight time is less than an arbitrarily small value, the ball is determined to be locking, and a value of 1 is returned.
- impact - This function takes the initial conditions and time of impact as inputs. It uses a simple impact model to calculate the post-impact positions and velocities of the ball.
- calculateLaunch - Determines whether or not the ball will be relaunched after locking. If the motion of the bar, and the position of the ball are such that the vertical acceleration of the bar will exceed gravity at some point during its periodic motion, then the ball will be relaunched. Otherwise, the ball will never be relaunched, and the simulation will terminate.
- plotTraj - This function is used only to plot the trajectories of the ball and the bar. This is only used as a visual aid and is helpful for debugging. It can easily be turned off to speed up the simulation.
Explanation of Important Inputs & Parameters
First, open the bBallSim m-file. The first few lines will look like this:
function [P, N] = bBallSim(A_x, A_z, A_th, p) % SYSTEM PARAMETERS num_impacts = 500; % Number of impacts simulator will calculate before terminating A = [A_x; A_z; A_th]; % Position amplitude of bar, nondimensional [A_x, A_z, A_th] phi = [pi/2; pi/2; p]; % Phase angle of bar [phi_x, phi_z, phi_th] f = [1; 2; 1]; % Frequencies of bar motions [f_x, f_z, f_th] w = 2*pi.*f; % [w_x, w_z, w_th]
There are four important inputs for this version of the program.
- A_x is the nondimensionalized position amplitude of the bar in the x (horizontal) direction.
- A_z is the nondimensionalized position amplitude of the bar in the z (vertical) direction.
- A_th is the amplitude in the theta direction (angular about the y). It is already dimensionless.
- p is the relative phase between the theta motion and the other motions.
Nondimensionalizations are as follows:
Position: where f(1) is equal to the first frequency in the vector f (or the horizontal frequency) and g is equal to the acceleration due to gravity
Velocity:
Acceleration:
Simple Test
For example, if one were to input the following:
[P, N] = bBallSim(0, 0.0052, 0, 0);
This is setting a motion with zero amplitude in the x and theta directions. 0.0052 is the nondimensional equivalent of 8m/s^2 in the z direction. If this simulation is run for 100 impacts with e = [0.8 0.8], the following plot will be created:
399 Write-up and Raw Data
The following is a 399 Write-up from a 2009-2010 independent study conducted by Undergraduate Eric Bell. The paper uses data from both physical experimentation as well as the simulator described above. EBell-399FinalWriteup
Some of the data used in the write-up are included below:
The following contains both the raw data from the real and virtual cameras as well as the calculated a workspace containing the calculated 3D coordinates. This data was used to create Figures 2.3 and 2.4: Figure2.3 Data
The following contains the Matlab workspaces used to create Figures 3.1-3.5. The period 1 and period 2 examples were captured using 2D imaging, whereas the period 3 example uses 3D. Figures3.1-3.5 Data
Finally, the following is experimental data used to create the bifurcation diagrams shown in Figure 3.8 and 3.10: Figure3.8 Data
This data was collected using 3 regions of interest (XZ- raw data from real camera, YZ- raw data from "virtual" camera, bar_tracking- raw data for bar's motion using real camera). This workspace also contains the calculated 3D coordinates of the ball (XYZ_BALL) as well as the adjusted coordinates of the bar (XZ_BAR). The Matlab function used to calculate these coordinates is pasted below.
function [XYZ_BALL, XZ_BAR, Maxima, Minima, Acc, Phase, fittedData] = calc3D(); % Specify names of desired data files. filename_xz = 'XZ.txt'; filename_yz = 'YZ.txt'; filename_bar = 'bar_tracking.txt'; % Should be most recent calibration calib = '7-9-09 New Zeros'; % Specify frequency of sweep f = 30; % Change working directory to location of data, load data w = cd; cd('C:\Documents and Settings\John Shih\My Documents\Visual Studio 2008\Projects\lims-hsv-system'); XZ = load (filename_xz, '.txt'); YZ = load (filename_yz, '.txt'); BAR = load (filename_bar, '.txt'); % Change directory to location of calibration constants, load constants cd('C:\Documents and Settings\John Shih\Desktop\VPOD- EBell\Calibration Constants\'); load(calib); % Change directory to regular working directory cd(w); % Calculate 3D location of ball, 2D location of bar figure(1); [XYZ_BALL, XZ_BAR] = calc_coords3ROI(XZ, YZ, BAR); % Calculate Maxima and Minima of the ball's flight figure(2); [fittedData, Maxima, Minima] = maxmin3D(XYZ_BALL, BALL0); % Calculate average phase angle and average amplitude of the bar for the % given data [Max, Min, Phase, avgamp] = calc_phase_maxmin(XZ_BAR, Minima); % Calculate max acceleration based off of the bar's amplitude Acc = avgamp/(1000)*(2*pi*f)^2;