Video length is 6:03

Estimating Bouncing Ball Contact Parameters

From the series: Modeling, Simulation, and Control

This video shows a workflow to find the optimal contact parameters that can simulate a realistic behavior of a bouncing or a colliding ball. Initially, Veer tracks the real trajectory of a bouncing ball from a video file. Then, he replicates the bouncing ball model using Simscape Multibody. Further, he uses Parameter Estimation to find the contact parameters of the Spatial Contact Force blocks. Finally, he shows how you can create a customized realistic scenario by feeding the obtained contact parameter values in the Spatial Contact Force blocks.

You can find the example models used in this video on MATLAB Central File Exchange.

For more information, you can access the following resources:

Published: 2 Jun 2020

Hello everyone. Welcome to MATLAB and Simulink Robotics Arena. In this video, we'll be talking about how to find contact parameters using optimization techniques. We'll start by defining the problem statement, then move ahead to the approach for the defined problem, where we'll be talking about measured real data, creating a simulation environment, and optimizing contact parameters.

Moving ahead, let me ask you a question. This is a simulation environment that consists of a board, a floor, and a base office. When you simulate it, we can have multiple solutions-- something like this, or maybe like this one. As we can see, when the ball collides with the wall, we get two different trajectories.

These trajectories, after collision with the ball or the floor, is governed by certain parameters. So depending upon how we select these parameters, the trajectory of the ball will be defined. To better understand this, let's check out the model of the simulation environment. Please note that we'll be talking about the modeling in detail in the later section of the video.

So this is the block diagram of the model. And to model the contact between the surfaces and the ball, we have used a special contact block, where these are the contact parameters. Also, we are assuming a situation where all the blocks have the same contact parameters. So if we break down the model into contact between a ball and the surface, and can find the contact parameters-- then we can leverage these values to build different scenarios.

So this is how we do it. First, we conduct an experiment to get the real trajectory of the ball. Then we try to duplicate the same scenario in a simulation environment. Further, we use a optimization technique to measure simulation trajectory to the measured trajectory to obtain the contact parameters.

Having seen the approach, step by step, let's check out the models used to fulfill our requirements. This is the first model of the ball trajectory tracking, where we have used computer vision techniques to acquire the trajectory of the ball. This is the input of the model, which is a multimedia file of the recorded video.

Then we perform the thresholding, using the color thresholding app, and generate the MATLAB function. Further, the blob analysis block outputs the centroid of the track ball. And finally, we convert the pixels into real world coordinates. Please note that we are assuming a negligible change in the x direction because a smaller magnitude compared to the y direction trajectory.

So when we run the simulation, we see that the ball can travel the trajectory, but at the same time, it is missing some of the frames. For instance, whenever it is colliding with the ground surface. However, to perform the next steps, we need more realistic data points. So for that we are prepared a MATLAB script where the data captured from the camera was scale to realistic data by comparing it with the projectile motion equation.

So now we can see that we have much better data to compare to perform the optimization. In this case, we used a normal webcam to capture the data, which resulted in missing frames. But with better sensors, you can get better data points, and operation like scaling the data can be avoided. Now once we have the data ready, it's time to replicate the scenario in a simulation environment.

So that is the model, built using Simscape Multibody, where we can see a special contact plot between the plane and the sphere. And we aim to find these contact parameters. Additionally, we have also included a subsystem to calculate the track. When you simulate by feeding some random stiffness and damping values, we see that the simulated trajectory doesn't match with experimental trajectory.

So for that, we use parameter optimization, which estimates parameters and states of the Simulink model using measured data. In this model, we have added a callback to take you to the safe session of the parameter estimation. This is the window the parameter estimation, where these are the parameters which we want to estimate. To know more about how to use this tool, check out the links in the description.

Now let us run the estimation. As we estimate the parameters during estimation, Simulink design optimization will automatically run the simulation, compare the results of the simulation with the measured data, detect the sensitivity of the parameters to changes, and then rerun the simulation with each test for bringing it closer to the measured trajectory. Simultaneously, we can also see the changes in the estimated parameters.

Finally, we can see the decrease in the cost function. And after certain attrition, the optimization converges. Finally, these are the obtained values that we will use to create different realistic simulation environments. Now we are all set to answer our question-- that, which of these simulations is more realistic? So it is a scenario where the contact between ball and base office-- ball and wall-- has the same contact properties.

So we have used the same values obtained from the optimization model. And here's the final trajectory. So now we can see that this is the correct solution. Now the question is how to extend this approach. One scenario could be this, where the ball is bouncing on stairs where a few of the steps are made of different materials, such that the contact parameters between the ball and different types of surfaces are different.

Under such situations, you will need to perform a separate set of experiments for different surfaces, and find the contact parameters using the same methodology. And then these values can be further used to solve this scenario. Having seen the models and how to extend the approach, let's check out the key takeaways.

We can say that correct selection of contact parameters provide more realistic results. Now, if we have accurate sensor data results, that will be much better for estimation. Then for-- parameter estimation estimates parameters and states of Simulink models using measured data. And the proposed approach provides a solution to simulate more complex problems.

Moving ahead to the resources, we have also added an analytical answer to estimate contact parameters in MATLAB central. You can find a link for this in the description. And now these are the resources to reach out to us if you have any queries. And you can also join our Facebook Group and also check out the tutorial videos. Thank you.