Starting from:

$34.99

CMPSCI403 Homework 8- Discrete Impact Based Contact Simulation Solution



Figure 1: Double pendulum model.
In this problem, you will extend your previous simulation to include constraints. In this homework, we will add the slippery surface, which makes a friction force depending on the friction coefficient and the normal force. Please include your simulate_pend_HW8.m code in your submission.
1. Given a ground height yc = −1.1 m, complete skeleton the code for the function discrete_impact_contact in simulate_pend_HW8.m. This function should:
• Compute the height of the foot relative to the ground Cy = y − yc.
• Compute the C˙y = y˙.
• If the constraints are not violated (i.e. Cy > 0 or C˙y > 0), then your function should not update q˙.
• If the constraints are violated (i.e. Cy < 0 and C˙y < 0), compute the vertical impulse force,
Fˆc,y = Λc,y(−γC˙y − Jc,yq˙), where Λc,y is the vertical directional operational space mass, γ is the coefficient of restitution, and Jc,y is the vertical directional Jacobian at the contact point.
• Update q˙ using the equation, .
• Using the same procedure, update q˙ by applying tragential impulse force to satisfy a friction cone constraint. Compute the tangential impulse force, Fˆc,x = Λc,x(0 − Jc,xq˙).
• Truncate Fˆc,x if it is outside of friction cone, > µFˆc,y.
• Update q˙ using the equation, q˙ = q˙ + M−1Jc,x> Fˆc,x.
2. Find a proper place to put the update function in the simulation. Does it need to be in dynamics function? Or in the middle of numeric integration?
3. Use the coefficient of resitution γ = 0 and a friction coefficient µ = 0.3 to simulate trajectory tracking for the circle task with ω = 3 rad/s. Provide position and velocity plots of x and y over the interval t = [0s, 10s].
4. Increase µ to 3 and perform another simulation. Describe what changes in this simulation.
1
5. (Optional) Note that this method for enforcing constraints is general to cases beyond contact with the ground. For instance, in reality, this mechanism has a kinematic joint limit that constrains q1. In your code, implement a joint limit constraint to enforce q1 > −0.1 rad.
2

More products