What type of joint should I use and with what configuration should it be?

I am working with a Ball & Plate, when using the 6 DOF joint, the ball moves in the Y axis infinitely. What type of joint should I use and with what configuration should it be? to make the ball roll over the plate as it moves and sense its movement.

 Risposta accettata

can you share the mechanics configuration ? It seems you may have the gravity on the Y axis, and the ball simply fall along the y axis because of gravity.
In order to have the ball rolling over the plate you may need to implement a contact force. For older release this is available with file exchange entry:
I would strongly recommend to use the latest release (2020a) where we implemented contact forces natively and take a look at following example. Use a 6 DoF between ball and world, but create a contact force relationship between plate and ball:

9 Commenti

Indeed, the displacement of the ball in the Y axis was deviated to the sense of gravity in it. Thanks to your help I have managed to orient gravity to the Z axis. However, I was unable to install / add the Contact_Forces_Library. I followed the steps in the "Read me" file but I still can't get it. Also the steps described here I really wish I could include the library in my project.
Will there be another way to load the library?
Thanks.

I have already managed to add the library. Analyzing the Ball on Table example included in the library, I have realized the required contact forces (sphere to plane force), but when enabling "Visual" the sphere is not centered. I have made sure that the sphere and the Table have the origin at the midpoint of the 3 axes (X, Y, Z). When simulated, the sphere rises uncontrollably.

 How can I correctly set the required contact force?
Hi
If you look at example Coll3D_01_Ball_Plane_Fixed.slx in the library you can see that the contact forces must go around the joint with no Trnasform in between, and at best using a Bushing Joint:
You have a transform sensor after the contact forces. If you want to se tup initial position of the ball, use the internal state targets for the appropriate prismatic primitive, ie:
The sphere is now where it should be and rolls on the platter according to the tilt. I'm testing with a repeating signal on the servos and the system works great.
Without your help it would have been impossible. Thank you, thank you, thank you.
One more question:
How can I predefine the trajectory of the ball cyclically?
Hi Egay, I'm happy you have a working system now!
As I said, in the future if you are upgrading to a release from 20a or newer you will find Contact Forces directly in Multibody. They are solved more elegatly and allow you great flexibility.
Regarding your question, if I understood correctly you would like to periodically reposition the ball over the plate and let it fall with a certain trajectory.
I don't see how you can do that in the same simulation. The only workaround I have is to specify ball position and velocity target so that the ball fall at a certain angle with a certain velocity. You can use parmeters for that. Than you run a simulation with one set of initial condition, simulation finish, you change parameters and start another simulation. wiat for it to finish, change parameters and so on and so on.
You can use a MATLAB script and the >>sim command in a for loop to launch multiple simulations always changing initial speed and position of the ball.
Hope this helps
Vasco
Actually I was referring to defining the trajectory of the ball when it is already on the plate.
Thanks again.
I'm still not sure I understand.
What you can do is apply force to the ball periodically: imagine your fingers hitting the ball every x seconds to see how the system reacts. But the trajectory is then going to be the results of physics and how your controller behave. It would not make sense to define a trajcetory: the controller would be useless
You can apply a periodic "hit" using such blocks. Play around with the force value to stimulate more or less:

Accedi per commentare.

Più risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by