Simbody
3.4 (development)
|
Model a compliant stop element that acts to keep a mobilizer coordinate q within specified bounds. More...
#include <Force_MobilityLinearStop.h>
Public Member Functions | |
MobilityLinearStop (GeneralForceSubsystem &forces, const MobilizedBody &mobod, MobilizerQIndex whichQ, Real defaultStiffness, Real defaultDissipation, Real defaultQLow=-Infinity, Real defaultQHigh=Infinity) | |
Create a MobilityLinearStop force element on a particular generalized coordinate. | |
MobilityLinearStop () | |
Default constructor creates an empty handle that can be assigned to refer to any MobilityLinearStop object. | |
MobilityLinearStop & | setDefaultBounds (Real defaultQLow, Real defaultQHigh) |
Provide new values for the default lower and upper bounds of this stop. | |
MobilityLinearStop & | setDefaultMaterialProperties (Real defaultStiffness, Real defaultDissipation) |
Provide new values for the default material properties of this stop, which are assumed to be the same for the upper and lower stops. | |
Real | getDefaultLowerBound () const |
Return the default value for the stop's lower bound (a generalized coordinate value). | |
Real | getDefaultUpperBound () const |
Return the default value for the stop's upper bound (a generalized coordinate value). | |
Real | getDefaultStiffness () const |
Return the default value for the stop material's stiffness k. | |
Real | getDefaultDissipation () const |
Return the default value for the stop's material's dissipation coefficient d. | |
void | setBounds (State &state, Real qLow, Real qHigh) const |
Change the values of the lower and upper bounds in the given state; these may differ from the default values supplied at construction. | |
void | setMaterialProperties (State &state, Real stiffness, Real dissipation) const |
Change the values of this stop's material properties in the given state; these may differ from the default values supplied at construction. | |
Real | getLowerBound (const State &state) const |
Return the value for the lower bound that is stored in the given state. | |
Real | getUpperBound (const State &state) const |
Return the value for the upper bound that is stored in the given state. | |
Real | getStiffness (const State &state) const |
Return the value for the stop material's stiffness k that is stored in the given state. | |
Real | getDissipation (const State &state) const |
Return the value for the stop material's dissipation coefficient d that is stored in the given state. |
Model a compliant stop element that acts to keep a mobilizer coordinate q within specified bounds.
This force element generates no force when the coordinate is in bounds, but when either the lower or upper bound is exceeded it generates a generalized force opposing further violation of the bound. The generated force is composed of a stiffness force (or torque, or generalized force) that is linear in the violation of the bound, and dissipation that is linear in the rate qdot.
Given a mobilizer coordinate q and limits q_low and q_high, the generalized force generated here is:
{ 0, q_low <= q <= q_high f = { min(0, -k*x*(1+d*qdot)), q > q_high, x=q-q_high (x>0, f<=0) { max(0, -k*x*(1-d*qdot)), q < q_low, x=q-q_low (x<0, f>=0)
where k is a stiffness parameter, and d is a dissipation coefficient.
Note that dissipation occurs both during compression and expansion, but we will never generate a "sticking" force. This is a Hunt and Crossley-like dissipation model. It has the nice property that the damping force is zero when you first touch the stop.
SimTK::Force::MobilityLinearStop::MobilityLinearStop | ( | GeneralForceSubsystem & | forces, |
const MobilizedBody & | mobod, | ||
MobilizerQIndex | whichQ, | ||
Real | defaultStiffness, | ||
Real | defaultDissipation, | ||
Real | defaultQLow = -Infinity , |
||
Real | defaultQHigh = Infinity |
||
) |
Create a MobilityLinearStop force element on a particular generalized coordinate.
forces | subsystem to which this force element should be added |
mobod | mobilizer to which the force should be applied |
whichQ | to which of the mobilizer's generalized coordinates q should this force be applied (first is 0)? |
defaultStiffness | default stop stiffness (>= 0) |
defaultDissipation | default stop dissipation coefficient (>= 0) |
defaultQLow | default lower bound (-Infinity) |
defaultQHigh | default upper bound (+Infinity) |
Note that if you have an integer value for the generalized coordinate (q) index, you have to cast it to a MobilizerQIndex here. The generalized coordinates are numbered starting with 0 for each mobilizer. Here is an example:
GeneralForceSubsystem forces; MobilizedBody::Pin pinJoint(...); MobilityLinearStop myStop(forces, pinJoint, MobilizerQIndex(0), k, d, -Pi/4, Pi/4);
SimTK::Force::MobilityLinearStop::MobilityLinearStop | ( | ) | [inline] |
Default constructor creates an empty handle that can be assigned to refer to any MobilityLinearStop object.
MobilityLinearStop& SimTK::Force::MobilityLinearStop::setDefaultBounds | ( | Real | defaultQLow, |
Real | defaultQHigh | ||
) |
Provide new values for the default lower and upper bounds of this stop.
This is a topological change because it affects the value that the containing System's default state will have when realizeTopology() is called. This is for use during construction, not for during a simulation where you should be using setBounds() to set the bounds in a State rather than in the System.
defaultQLow | Default lower bound (generalized coordinate value); <= defaultQHigh. Set to -Infinity to disable the lower bound by default. |
defaultQHigh | Default upper bound (generalized coordinate value); >= defaultQLow. Set to Infinity to disable the upper bound by default. |
MobilityLinearStop& SimTK::Force::MobilityLinearStop::setDefaultMaterialProperties | ( | Real | defaultStiffness, |
Real | defaultDissipation | ||
) |
Provide new values for the default material properties of this stop, which are assumed to be the same for the upper and lower stops.
This is a topological change because it affects the value that the containing System's default state will have when realizeTopology() is called. This is for use during construction, not for during a simulation where you should be using setMaterialProperties() to set the material properties in a State rather than in the System.
defaultStiffness | default stop stiffness (>= 0) |
defaultDissipation | default stop dissipation coefficient (>= 0) |
Real SimTK::Force::MobilityLinearStop::getDefaultLowerBound | ( | ) | const |
Return the default value for the stop's lower bound (a generalized coordinate value).
This is normally set at construction.
Real SimTK::Force::MobilityLinearStop::getDefaultUpperBound | ( | ) | const |
Return the default value for the stop's upper bound (a generalized coordinate value).
This is normally set at construction.
Real SimTK::Force::MobilityLinearStop::getDefaultStiffness | ( | ) | const |
Return the default value for the stop material's stiffness k.
This is normally set at construction.
Real SimTK::Force::MobilityLinearStop::getDefaultDissipation | ( | ) | const |
Return the default value for the stop's material's dissipation coefficient d.
This is normally set at construction.
void SimTK::Force::MobilityLinearStop::setBounds | ( | State & | state, |
Real | qLow, | ||
Real | qHigh | ||
) | const |
Change the values of the lower and upper bounds in the given state; these may differ from the default values supplied at construction.
state | The State in which the bounds are changed. |
qLow | Lower bound (generalized coordinate value); <= qHigh. Set to -Infinity to disable the lower bound. |
qHigh | Upper bound (generalized coordinate value); >= qLow. Set to Infinity to disable the upper bound. |
Changing these bounds invalidates Stage::Dynamics and above in the state since it can affect force generation.
void SimTK::Force::MobilityLinearStop::setMaterialProperties | ( | State & | state, |
Real | stiffness, | ||
Real | dissipation | ||
) | const |
Change the values of this stop's material properties in the given state; these may differ from the default values supplied at construction.
state | The State in which the material properties are changed. |
stiffness | The stop material stiffness k (>= 0). |
dissipation | The stop material dissipation coefficient d (>= 0). |
Changing these properties invalidates Stage::Dynamics and above in the state since it can affect force generation.
Real SimTK::Force::MobilityLinearStop::getLowerBound | ( | const State & | state | ) | const |
Return the value for the lower bound that is stored in the given state.
Note that this is not the same thing as the default lower bound that was supplied on construction.
Real SimTK::Force::MobilityLinearStop::getUpperBound | ( | const State & | state | ) | const |
Return the value for the upper bound that is stored in the given state.
Note that this is not the same thing as the default upper bound that was supplied on construction.
Real SimTK::Force::MobilityLinearStop::getStiffness | ( | const State & | state | ) | const |
Return the value for the stop material's stiffness k that is stored in the given state.
Note that this is not the same thing as the default stiffness that was supplied on construction.
Real SimTK::Force::MobilityLinearStop::getDissipation | ( | const State & | state | ) | const |
Return the value for the stop material's dissipation coefficient d that is stored in the given state.
Note that this is not the same thing as the default dissipation coefficient that was supplied on construction.