sheim / vibly_LFS

Python implementation to compute viable sets in state-action space
MIT License
2 stars 3 forks source link

How is the damping implemented? #3

Closed sheim closed 5 years ago

sheim commented 5 years ago

I have some questions on the damping in stance_dynamics (see below). This started from the 6th plot in the demo "Work". Without perturbations, the actuator is doing negative work, which doesn't make sense to me. Since the damper is doing negative work, I expected the actuator to do positive work. I wanted to separate the active work from the actuator_open_loop_force and the passive work from the actuator_damping_force. During a nominal (limit-cycle) step, these should cancel out. If I just track them naively separately however this isn't the case (see branch split_work f95184a54ad90ab533ec3ac4c0cdf95067f01ff3, you can pull and run the same demo locally. The red line is the SLIP model with perturbation. )

From what I understand from the code:

From this I don't see a clear way to separate the passive (intrinsic damping) force and the open_loop active force...?

https://github.com/sheim/slippy/blob/0f6d9f6754318692798e2a882c9a4aea4cd65265/slippy/daslip.py#L178-L215

sheim commented 5 years ago

As per conversation with Matt:

The force-equilibrium between the damper-actuator (DA) and the spring is:
$f(x,t) - \beta \dot{l}_{da} = k (l_s-l_0)$

where $f$ is the actuator force output, $\beta$ is the damping coefficient, $l_{da}$ is the damper-actuator length, $k$ is the spring coefficient, $l_s$ is the leg-spring length and $l_0$ is the legspring resting length. We therefore only need to solve for $\dot{l}{da}$.

The negative force being output was just integration error and is ~6 orders of magnitude less than the energy, so nothing to worry about. I just didn't think through the scaling.