Development of self balancing biped with inverse Dynamics

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Development of self balancing biped with inverse Dynamics

Postby Julio Jerez » Wed Jan 01, 2020 5:13 pm

Ok Joe, Dave and whoever is interested.
I added the interface for designating a contact point as a soft contact.
Code: Select all
void NewtonMaterialSetAsSoftContact (const NewtonMaterial* const material, dFloat relaxation, dFloat springCoef, dFloat damperCoef);

soft contact meaning a contact point that uses penetration to calculate a recovering acceleration that is proportional to the penetration.
this acceleration only control a fraction of the total reaction force at the contact point, the rest is calculated by the rigid body solver.

the final implementation is not ready yet, only the relaxation is applied at this time, the spring and damper are ignored at the moment therefore the contact will sink slowly until it reaches the equilibrium.
This is the exact setup you saw in the video, which was hard coded.
Now I can complete the rest.
Julio Jerez
Moderator
Moderator
 
Posts: 11147
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Development of self balancing biped with inverse Dynamic

Postby Dave Gravel » Wed Jan 01, 2020 6:29 pm

Cool thanks, I can try to test it more very soon.
Currently I can see it from your demo and it look to work very good.

Edited:
Thanks JoeJ for the Congrats :mrgreen: :lol:
Last edited by Dave Gravel on Wed Jan 01, 2020 8:57 pm, edited 3 times in total.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://www.facebook.com/dave.gravel1
http://orionx3d.googlepages.com/
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 725
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Development of self balancing biped with inverse Dynamic

Postby JoeJ » Wed Jan 01, 2020 6:46 pm

Yeah great, i have many usecases for this :mrgreen:

Offspring? Congrats, Dave! 8)
User avatar
JoeJ
 
Posts: 1160
Joined: Tue Dec 21, 2010 6:18 pm

Re: Development of self balancing biped with inverse Dynamic

Postby misho » Mon Jan 06, 2020 4:20 pm

Julio Jerez wrote:Ok Joe, Dave and whoever is interested.
I added the interface for designating a contact point as a soft contact.
Code: Select all
void NewtonMaterialSetAsSoftContact (const NewtonMaterial* const material, dFloat relaxation, dFloat springCoef, dFloat damperCoef);

soft contact meaning a contact point that uses penetration to calculate a recovering acceleration that is proportional to the penetration.
this acceleration only control a fraction of the total reaction force at the contact point, the rest is calculated by the rigid body solver.

the final implementation is not ready yet, only the relaxation is applied at this time, the spring and damper are ignored at the moment therefore the contact will sink slowly until it reaches the equilibrium.
This is the exact setup you saw in the video, which was hard coded.
Now I can complete the rest.


This is amazing... I can't wait to see a demo.

I will be using this, but in a much simpler form - I need an articulated robot "arm", much like the one on the space station... (and I think that is already fully functional in Newton)
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 568
Joined: Tue May 04, 2010 10:13 am

Re: Development of self balancing biped with inverse Dynamic

Postby Julio Jerez » Mon Jan 06, 2020 4:52 pm

My guess what you want is similar to the sixaxis manipulator demo.

Check it out, is not difficult to assembly.
Julio Jerez
Moderator
Moderator
 
Posts: 11147
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Development of self balancing biped with inverse Dynamic

Postby misho » Mon Jan 06, 2020 5:25 pm

Julio Jerez wrote:My guess what you want is similar to the sixaxis manipulator demo.

Check it out, is not difficult to assembly.


That's exactly what I need, probably even simpler!! :mrgreen:
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 568
Joined: Tue May 04, 2010 10:13 am

Re: Development of self balancing biped with inverse Dynamic

Postby Julio Jerez » Mon Jan 06, 2020 7:14 pm

this functionality has been for few years in the engine, but is was until 3.14 that I made a formal feature and made few demos. all the new demos use this feature now.
No one other than Dave, has really use it, of you do you will be probably the first person.

if you do you can get some far better than this.
https://www.youtube.com/watch?v=g7l-yBjjdEY
Julio Jerez
Moderator
Moderator
 
Posts: 11147
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Development of self balancing biped with inverse Dynamic

Postby misho » Tue Jan 07, 2020 2:38 am

Julio Jerez wrote:this functionality has been for few years in the engine, but is was until 3.14 that I made a formal feature and made few demos. all the new demos use this feature now.
No one other than Dave, has really use it, of you do you will be probably the first person.

if you do you can get some far better than this.
https://www.youtube.com/watch?v=g7l-yBjjdEY


Ah! THAT is a Kerbal Space Program (KSP) - my sim is similar to it, except I am hoping it will look and behave much more realistic. (KSP has a smaller universe, it is not Earth, everything is sized down, although there are mods that size it up to realistic sizes).
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 568
Joined: Tue May 04, 2010 10:13 am

Re: Development of self balancing biped with inverse Dynamic

Postby Julio Jerez » Tue Feb 11, 2020 4:42 pm

Hey Joe, I now added an improvement to the solver that made it possible to filter spiky reaction when a impulse force is calculated.
with this I try the biped without the soft penetration and is far, far more resilient to fall.

now remember that the biped is very naive, the fetes are passive, the do not try to align to the ground.

what I am doing next is to add a feet controller the make the foot active. this is they try to align to the floor contacts so that wen the body move the body the foot counter act the motion to present the pose. for the it need a mini solver the look ahead the support contacts and calculate the target rotation if is is when the joint limits.
but I am happy that even with such naive system the system can keep the balance naturally.

the soft contact is a cool feature by is cause the foot to move slightly on the ground and did not look good to me.
now the body can have quicker reaction and the feet does not bounce back as before. so I thin a foot control will do the rest of the trick.
I will work on that this weekend. see what we get.
Julio Jerez
Moderator
Moderator
 
Posts: 11147
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Development of self balancing biped with inverse Dynamic

Postby JoeJ » Tue Feb 11, 2020 5:02 pm

Julio Jerez wrote:Hey Joe, I now added an improvement to the solver that made it possible to filter spiky reaction when a impulse force is calculated.

Makes sense. Much better than soft contacts i guess :)

Julio Jerez wrote: this is they try to align to the floor contacts so that wen the body move the body the foot counter act the motion to present the pose. for the it need a mini solver the look ahead the support contacts and calculate the target rotation if is is when the joint limits.

You mean something like the casting placement tool you made for Bird, so adjusting while the foot is in air?
Or something that adjusts to resting ground contact?
User avatar
JoeJ
 
Posts: 1160
Joined: Tue Dec 21, 2010 6:18 pm

Re: Development of self balancing biped with inverse Dynamic

Postby Julio Jerez » Tue Feb 11, 2020 5:22 pm

JoeJ wrote:You mean something like the casting placement tool you made for Bird, so adjusting while the foot is in air?

yes something more of less. but hsi is more complex because the body is part of a rig of connected joints.

Basically each foot has some prescribed path based of the foot position but allows for some small adjustment with is some small contraction.
it seems a well define problem.

a foot has it pivot fix to the foot joint, with some velocity and angular velocity, the target position is threes points for the contact to the intersection with floor.

that giver a target orientations. so the problem is calculate the acceleration need so the the foot move to the orientations while keeping the limits. the use that at the target orientation of the effector.

is done correctly the biped should balance even on a moving platform. as along as the platform movement is within the reach of the joints limits.

imitatively in the demo this is what happens
the foot target foot orientation is 0, 0, 0

each time the controller moves the center of mass to the center of the support polygon.
the foot is support to remain aligned to that orientation.
the the integration steps happens and all the integration error cause the for to miss the alignment just a little bu enough to change the contact confirmation.

with the propose system the target is no longer the 0, 0, 0, instead is the predicted orientation base of the foot current velocity, so the new origination is 0, 0, 0 some delta angle.
now went the solver that the step the new orientation is again 0, 0, 0
Julio Jerez
Moderator
Moderator
 
Posts: 11147
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Development of self balancing biped with inverse Dynamic

Postby Julio Jerez » Tue Feb 11, 2020 5:41 pm

Actually it is much simpler than that.

It reduces to this.

The foot has some orientation.
In the prelistener we calculate the contacts.
And save them
If the contacts kept the foot aligned not action is needed.
If not, rum a small iterative alignment that rotate the foot toward the alignment with the support.
This will change both rotation and the pivot.

So yes it is almost identical to the bird function for object placement, only this has one extra constraint that the body can only rotate around an off pivot.
Julio Jerez
Moderator
Moderator
 
Posts: 11147
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Development of self balancing biped with inverse Dynamic

Postby Julio Jerez » Tue Feb 11, 2020 9:53 pm

ok I just try a small milestone.

I drop the model for 15 centimeters high and it recovers. it may not sound like much bu this is a huge step on the leaning to walk :D :shock:
tonight I see if I can work the foot alignment controller.
Julio Jerez
Moderator
Moderator
 
Posts: 11147
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Development of self balancing biped with inverse Dynamic

Postby JoeJ » Wed Feb 12, 2020 4:22 am

Julio Jerez wrote:
JoeJ wrote:is done correctly the biped should balance even on a moving platform. as along as the platform movement is within the reach of the joints limits.

... reminds me i consider joint limits in the IK solver, but then when working at things like balancing on platforms or walking i realized the limits never get violated during regular locomotion tasks. Nature evolved bodies so the limits are just right.
So you could eventually save some work by ignoring limits in control problems and planning.
User avatar
JoeJ
 
Posts: 1160
Joined: Tue Dec 21, 2010 6:18 pm

Re: Development of self balancing biped with inverse Dynamic

Postby Julio Jerez » Wed Feb 12, 2020 8:52 am

Yes I found out that by experimentation.
Limits are overrated.
Each time a motion touches a limit it loses some degree of freedom and the motion becomes unnatural.

I am also reconsidering the method of having the feet be part of the ik chain.
It makes the so rigid that any slight movement make them lose contacts.
I think that a better method is to let the be a free double huge with some dry friction.

The dry friction provide some torque the is only strong enoght cancel the torque that center of mass is off from the center of the soppprt point.

Imagine this say we have a inverted pendulum with a heavy weight on top and a very thin rod to support it.

If the stick is only a point, keep the balance is unstable because any small deviation from the projecting of the center of mass over the support point generate at turning torque that tend to flip it to the floor.

Now imagine that instead of a simple stick, if has a food the provid a sopport point and also some angular torque. Now there will be a radius around the support point in Wich the torque generated by the heel friction can cancel the torque generated be the offset from the center of mass to the support point.

This will let the feet adjust naturally by their own weight .

I say this because I do not believe that walk and balancing is * a complex action that requires such complex calculation. This is done by an automatic system on the brain, and only when disrupted the smart brain take controll.

Do yo understand what I mean?
Julio Jerez
Moderator
Moderator
 
Posts: 11147
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests