Why does joint PID tracking in a Simscape Multibody leg model degrade when Spatial Contact Force is enabled, while it works well without ground contact (XZ plane)?
I am simulating a simplified lower-limb / prosthetic leg in Simscape Multibody with 3 revolute joints (hip, knee, ankle). The motion is intended to be planar in the sagittal plane (XZ).What I am doing
I provide reference joint trajectories for hip/knee/ankle from a gait dataset (10 concatenated gait cycles) using three timeseries signals:
hip_ts, knee_ts, ankle_ts
Each joint is controlled by a joint-level PID/PD block that outputs a torque
The measured joint angles q are taken from the joint sensors and fed back to the controller (scopes show reference vs simulated for each joint).
What works (no contact)
If I disable ground contact, the joint tracking is reasonably good for all joints (hip/knee/ankle). The simulated angles follow the reference signals with small error.
The problem (with contact enabled)
When I enable foot–ground contact using Spatial Contact Force (foot geometry vs ground plane), the tracking becomes much worse:
large tracking errors / oscillations appear
the behavior looks unstable or heavily disturbed during stance/contact phases
the same PID gains that work without contact no longer work
What I suspect / questions
I am trying to understand what is causing this degradation when contact is enabled:
Is this mainly due to the contact model parameters (stiffness, damping, friction) creating stiff dynamics that destabilize the joint PID?
Could the issue be caused by unintended extra DOFs at the hip/base (e.g., the hip not fully constrained in the plane), so contact forces introduce out-of-plane motion or additional dynamics?
Is it conceptually wrong to expect simple joint PID tracking to work well when contact forces are present, and should I instead use:
impedance control at the joints,
inverse dynamics / computed torque,
or a constraint-based approach for stance?
What I can provide
Screenshot of the Simulink/Simscape model (joint controllers + Spatial Contact Force block)
Scope screenshots showing reference vs actual joint angles for hip/knee/ankle
Contact block settings (stiffness/damping/friction) and solver settings if needed
Question: What are the most common reasons why enabling Spatial Contact Force makes joint-level PID tracking degrade dramatically in Simscape Multibody, and what specific checks/changes would you recommend (contact parameters, solver, constraints/DOFs at hip/base, control structure)?I am simulating a simplified lower-limb / prosthetic leg in Simscape Multibody with 3 revolute joints (hip, knee, ankle). The motion is intended to be planar in the sagittal plane (XZ).What I am doing
I provide reference joint trajectories for hip/knee/ankle from a gait dataset (10 concatenated gait cycles) using three timeseries signals:
hip_ts, knee_ts, ankle_ts
Each joint is controlled by a joint-level PID/PD block that outputs a torque
The measured joint angles q are taken from the joint sensors and fed back to the controller (scopes show reference vs simulated for each joint).
What works (no contact)
If I disable ground contact, the joint tracking is reasonably good for all joints (hip/knee/ankle). The simulated angles follow the reference signals with small error.
The problem (with contact enabled)
When I enable foot–ground contact using Spatial Contact Force (foot geometry vs ground plane), the tracking becomes much worse:
large tracking errors / oscillations appear
the behavior looks unstable or heavily disturbed during stance/contact phases
the same PID gains that work without contact no longer work
What I suspect / questions
I am trying to understand what is causing this degradation when contact is enabled:
Is this mainly due to the contact model parameters (stiffness, damping, friction) creating stiff dynamics that destabilize the joint PID?
Could the issue be caused by unintended extra DOFs at the hip/base (e.g., the hip not fully constrained in the plane), so contact forces introduce out-of-plane motion or additional dynamics?
Is it conceptually wrong to expect simple joint PID tracking to work well when contact forces are present, and should I instead use:
impedance control at the joints,
inverse dynamics / computed torque,
or a constraint-based approach for stance?
What I can provide
Screenshot of the Simulink/Simscape model (joint controllers + Spatial Contact Force block)
Scope screenshots showing reference vs actual joint angles for hip/knee/ankle
Contact block settings (stiffness/damping/friction) and solver settings if needed
Question: What are the most common reasons why enabling Spatial Contact Force makes joint-level PID tracking degrade dramatically in Simscape Multibody, and what specific checks/changes would you recommend (contact parameters, solver, constraints/DOFs at hip/base, control structure)? I am simulating a simplified lower-limb / prosthetic leg in Simscape Multibody with 3 revolute joints (hip, knee, ankle). The motion is intended to be planar in the sagittal plane (XZ).What I am doing
I provide reference joint trajectories for hip/knee/ankle from a gait dataset (10 concatenated gait cycles) using three timeseries signals:
hip_ts, knee_ts, ankle_ts
Each joint is controlled by a joint-level PID/PD block that outputs a torque
The measured joint angles q are taken from the joint sensors and fed back to the controller (scopes show reference vs simulated for each joint).
What works (no contact)
If I disable ground contact, the joint tracking is reasonably good for all joints (hip/knee/ankle). The simulated angles follow the reference signals with small error.
The problem (with contact enabled)
When I enable foot–ground contact using Spatial Contact Force (foot geometry vs ground plane), the tracking becomes much worse:
large tracking errors / oscillations appear
the behavior looks unstable or heavily disturbed during stance/contact phases
the same PID gains that work without contact no longer work
What I suspect / questions
I am trying to understand what is causing this degradation when contact is enabled:
Is this mainly due to the contact model parameters (stiffness, damping, friction) creating stiff dynamics that destabilize the joint PID?
Could the issue be caused by unintended extra DOFs at the hip/base (e.g., the hip not fully constrained in the plane), so contact forces introduce out-of-plane motion or additional dynamics?
Is it conceptually wrong to expect simple joint PID tracking to work well when contact forces are present, and should I instead use:
impedance control at the joints,
inverse dynamics / computed torque,
or a constraint-based approach for stance?
What I can provide
Screenshot of the Simulink/Simscape model (joint controllers + Spatial Contact Force block)
Scope screenshots showing reference vs actual joint angles for hip/knee/ankle
Contact block settings (stiffness/damping/friction) and solver settings if needed
Question: What are the most common reasons why enabling Spatial Contact Force makes joint-level PID tracking degrade dramatically in Simscape Multibody, and what specific checks/changes would you recommend (contact parameters, solver, constraints/DOFs at hip/base, control structure)? simulink, simscape, control MATLAB Answers — New Questions









