[SOLVED] slider between 2 parents and 1 child

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

[SOLVED] slider between 2 parents and 1 child

Postby blackbird_dream » Sat Nov 28, 2020 12:25 pm

I'd like to model one body attached to 2 other bodies (= 2 articulated arms) by means of springs (procedural forces in reality).
Obviously when the arms rotate the body doesn't move linearly :


Then I'd like to constrain the 3rd body along the axis given by the 2 insertion points.
I thought building one joint with 2 parents and 1 child like this:
https://ibb.co/pbWVVsn
Would it be some way more appropriate ?
Thks
Last edited by blackbird_dream on Tue Dec 01, 2020 5:20 pm, edited 1 time in total.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: slider between 2 parents and 1 child

Postby Julio Jerez » Sat Nov 28, 2020 2:57 pm

you can attach the control body to one arms using a sliding contacts.
thet the joint that is use to make fires without steering
then you are free to move the body with spring or what ever other force along the sliding dof.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: slider between 2 parents and 1 child

Postby blackbird_dream » Sun Nov 29, 2020 11:45 am

Thks for your reply.
I am sorry I did'nt understand. Is it a dCustomSlidingContact ? What is it ? A hinge+slider ?
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: slider between 2 parents and 1 child

Postby Julio Jerez » Sun Nov 29, 2020 12:51 pm

Yes. It is a hinge with a slider. There are two variants
One is named corkscrew. Which a hinge that slides along the hinge axis.
The other is the sliding contact which slides along an axis perpendicular to the hinge axis.

You know you can make your own joints, is not that difficulty.

I say this because the sliding contact assume the sliding frame is fixes on a parent frame, but in you case you need to modify the function so the the sliding direction is the direction vctor between the two attachment point in the two arms.

That vector changes direction as the arms rotate.
You can subclass from the sliding contact, them overload the submiticonstraint callback and there you can realign the frame matrix of the parent so the sign pin met the instant sling direction. The call the base function.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: slider between 2 parents and 1 child

Postby blackbird_dream » Sun Nov 29, 2020 12:58 pm

crystalclear.
What about a slider between one body and 2 other bodies (eachone supporting one end of the sliding axis) ?
Is it feasible as a joint (between 3 bodies in fact)?
I used to implement joints many many times ago with rows and I don't feel comfortale right now.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: slider between 2 parents and 1 child

Postby Julio Jerez » Sun Nov 29, 2020 1:03 pm

You can also refine the design.
You do not need two sliding contacts.

A better way is use a ball and socket in one pivot.
So the controll body does not slides, only rotates.
The the second pivot you use the sliding contact.

And that one you apply the spring force.
This is fart more robust, stable and simple design.

This avoid the problem of the two sliders sliding along two axis that is ideally parallel, but even using exact arithmetic are not, since each one will slide along a path tangent to the arch of the attachment, and that path drift with each step.

This numerical error translate to large penalty that try to keep the slider in the path.
You do not want that to happens.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: slider between 2 parents and 1 child

Postby blackbird_dream » Sun Nov 29, 2020 1:29 pm

ball and socket to one insertion point keeps the distance constant. It shall change as you can see on the video.
Both attachments change in distance:
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: slider between 2 parents and 1 child

Postby blackbird_dream » Sun Nov 29, 2020 1:34 pm

I was thinking of one unique joint like this betwwen 3 bodies:
https://ibb.co/LZR4SMD
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: slider between 2 parents and 1 child

Postby Julio Jerez » Sun Nov 29, 2020 1:36 pm

There are not joint between three bodies.

you disregard what I said about the overloading of the callback to recalculate the alignment, I forget the the hinge part doe that, it should be fine with just the sliding contact and the ball and socket.
you can experiment with diffrent building blocks, but at some point yo uwill need to chnage a joint.

is the movie using those sliding contacts configuration?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: slider between 2 parents and 1 child

Postby blackbird_dream » Sun Nov 29, 2020 1:41 pm

the movie comes from a mechanical software I use for validation.
If I use a ball&socket, the distance between the sphere and the pin stays constant, doesn't it ?
In my case it must be free, so the distance can change depending on the spring forces.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: slider between 2 parents and 1 child

Postby Julio Jerez » Sun Nov 29, 2020 1:42 pm

you can however make the hinge between the two are, had the spring damper and one extra row.

basically one spring dampend is calculate by the adding a linear row that calculate the linear spring force between the tow pivot on eth two arm.

this will probably be the most efficient and maybe more correct way because adding the a third body add a mass that is not part of teh system, yes tha mass of that body change the total initial of the system. while the linear row act as an ideal spring damper

again is goes back to sub classing the hinge, and overloading the calculateConstraints function for that
so teh you call the base class an dthe add teh extra linear row.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: slider between 2 parents and 1 child

Postby Julio Jerez » Sun Nov 29, 2020 1:47 pm

blackbird_dream wrote:In my case it must be free, so the distance can change depending on the spring forces.

the distance still changes, the control body will be fixed to one arm and move with it but the spring use teh distance for the center of the control body to the other attachment point wich still changes by the same amount.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: slider between 2 parents and 1 child

Postby blackbird_dream » Sun Nov 29, 2020 1:52 pm

What I mean is the 2 distances must change.
The distance between the control body and one arm and the distance between the control body and the other arm.
I don't understand how it is possible if the control body is connected to one arm through a B&S joint.
Last edited by blackbird_dream on Sun Nov 29, 2020 2:20 pm, edited 2 times in total.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: slider between 2 parents and 1 child

Postby Julio Jerez » Sun Nov 29, 2020 2:17 pm

because it is a distance, each time one arm moves, the distance is: dist = pivot1 - pivot0.

so if have two springs, is end up been two spring connected sequential but each displace half the distance.

so the effective k becomes k/2 but since each displacement dist/2 the effect is the same as one spring that displace the full distance.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: slider between 2 parents and 1 child

Postby blackbird_dream » Sun Nov 29, 2020 2:20 pm

I just read your last msghttp://newtondynamics.com/forum/posting.php?mode=quote&f=9&p=65961. I think thi is not possible that way because the control body is an internal dof indeed and it's non linear (non linear laws of both distances and relative velocities). I can not compute equivalent stifness for the 2 'springs' in series. So I need the knowledge of the control body relative position between the 2 insertions points.
so the effective k becomes k/2 but since each displacement dist/2 the effect is the same as one spring that displace the full distance.
This is not true in my case, because these are not pure springs but non linear forces depending on the position and speed of th eCbody.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 55 guests

cron