10 Inverse Simulation

10.3 Tracking controller structure and settings

10.3.1 Controller structure

Figure 10.12: Expanded navigation panel view of the tracking controller (named "tcon") and all its subcomponents, for the example InverseMuscleArm.

The tracking controller is a composite component, which contains the exciter list and the various cost and constraint terms as subcomponents. Some of these components are added as needed. They include the following, as described by their names:

exciters

A list of references to the exciters which have been added to the controller. Note that this is a list of references; the exciters themselves exist elsewhere in the model. Always present.

motionTerm

The MotionTargetTerm detailed in Section 10.2.2.1. Implements the motion cost term \phi_{m}(\Delta{\bf a}) defined in (10.11), and the motion tracker of Figure 10.1. Allocates and maintains target components for motion sources, storing the targets in the subcomponent lists targetPoints and targetFrames, and references to the sources in the reference lists sourcePoints and sourceFrames. Always present.

forceEffectorTerm

The ForceEffectorTerm detailed in Section 10.2.6.1. Implements the force effector cost term \phi_{e}(\Delta{\bf a}) defined in (10.14). Allocates and maintains target components for force effector sources, storing then in the subcomponent list forceTargets. Added on demand.

boundsTerm

Implements the actuator bounds {\bf a}_{\text{min}}\leq{\bf a}\leq{\bf a}_{\text{max}}, where {\bf a}_{\text{min}} and {\bf a}_{\text{max}} are nominally \bf 0 and \bf 1. Always present.

L2RegularizationTerm

Implements the cost term for L2 regularization (Section 10.2.3.1). Added on demand.

dampingTerm

Implements the cost term for excitation damping (Section 10.2.3.2). Added on demand.

10.3.2 Controller properties

The controller and its cost terms have a number of properties that can be used to adjust the controller’s behavior. They can be set interactively, either through the inverse controller panel created by the InverseManager (Section 10.4.3), or by selecting the relevant component in the navigation panel and choosing "Edit properties ..." from the context menu. The properties can also be set in code, using the accessor methods supplied by their host component. These methods will usually be named getXxx() and setXxx() for property xxx. Properties of the tracking controller itself include:

active

Controls whether or not the controller is active. Setting this to false turns the controller off. Default value is true.

normalizeCostTerms

If true, normalizes the cost terms so that their weights (e.g., w_{m}, w_{e}, and w_{a} in (10.15)) more accurately control the tradeoffs between terms. Each term’s quadratic matrix {\bf Q} is scaled to have unit trace before its weight is applied, so that the effect of the weights is approximately independent of the simulation step size h, as well as of the physical units and the masses of the model. However, since terms with low-rank {\bf Q} matrices (such as motion terms with fewer target coordinates than exciters) concentrate this trace into fewer directions, the effective ratio between weights still depends on the numbers of targets and exciters. Also, when normalization is enabled, the motion and force term weights w_{m} and w_{e} effectively enter the cost squared. If false, no normalization is performed and all weights enter the cost linearly, as in (10.15), but their effect depends on the step size, physical units, and model masses, and so typically needs to be retuned for each model (see also useTimestepScaling). Default value is true.

computeIncrementally

Controls whether excitation values should be computed incrementally or non-incrementally, as described in Sections 10.1.3 and 10.1.5. Default value is true.

refactorForIncremental

For incremental computation, controls whether the system solve matrix is refactored when computing each column of the excitation response matrices {\bf H}_{m}, {\bf H}_{e}, etc. Refactoring accounts for the effect of the excitations on the force derivatives used by the integrator, but has a computational cost that is proportional to the number of exciters, and does not usually improve tracking accuracy significantly. Default value is false.

excitationBounds

Specifies the default excitation bounds for exciter components. Default value is [0,1].

targetsVisible

Controls the visibility of the motion target terms contained within the controller, as described in Section 10.2.2.2. Default value is true.

configExcitationColoring

If enabled, automatically configures exciters which support excitation coloring to vary from white to red as their excitation increases (Section 10.2.1.1). Default value is true.

probeDuration

Default duration of probes managed by the InverseManager class (Section 10.4). Default value is 1.0.

probeUpdateInterval

Default update interval of output probes managed by the InverseManager class (Section 10.4). Default value is -1, which means that the interval will default to the simulation step size.

useKKTFactorization

Uses a more computationally expensive but possibly more accurate method to compute the excitation response matrices such as {\bf H}_{m} and {\bf H}_{e} (Section 10.1.3). Default value is false.

maxExcitationJump

Experimental property that limits the change in excitation during any time step. Default value is false.

useTimestepScaling

If true, and normalizeCostTerms is false, then the quantities {\bf H}_{m} and \bar{\bf v} of the motion term (10.11), and the corresponding quantities of the constraint force term, are scaled by 1/h, where h is the simulation step size. Since {\bf H}_{m} (the velocity change per unit excitation over one step) is approximately proportional to h, this converts these terms from velocity errors into acceleration errors, so that their size relative to the regularization terms is approximately independent of h. Without this, the motion term’s quadratic matrix scales with h^{2}, so that the effect of the regularization weight w_{a} increases as h decreases. The weights remain dependent on the model’s units and masses, and so may need to be tuned for each model. This property has no effect when normalizeCostTerms is true, since normalization already removes the dependence on h (and additional scaling would simply weaken the regularization terms by a factor of h^{2}). Default value is false.

debug

Enables debugging messages. Default value is false.

10.3.3 Motion term properties

The motion target term (Section 10.2.2.1) exports a number of properties that control motion tracking:

enabled

Controls whether or not this term is enabled. Default value is true.

weight

Specifies the weight w_{m} of this term relative to the other cost terms. Default value is 1.0.

chaseTime

Specifies the chase time T used for chase control (Section 10.1.2.1). If the value is less than the current step size h, then T is set to h instead. Therefore, a value of 0 (the default) ensures that T=h.

estimateTargetVelocity

If true, the velocity {\bf v}_{t} of each target whose velocity property has not been set since the previous step is estimated from the change in the target’s position over the step (Section 10.2.2). If false, unset target velocities are assumed to be 0. Default value is true.

usePDControl

Controls whether or not PD control is used (Section 10.1.2.2). Default value is false.

Kp

Specifies the proportional gain K_{p} for PD control (Section 10.1.2.2). Default value is 2500.

Kd

Specifies the derivative gain K_{d} for PD control (Section 10.1.2.2). Default value is 100.

pdTimeConstant

PD control time constant T=1/\sqrt{K_{p}} (Section 10.1.2.2). Setting this property sets Kp and Kd to 1/T^{2} and 2\zeta/T, where \zeta is the current damping ratio. This property is derived from Kp and is not saved. Default value is 0.02.

pdDampingRatio

PD control damping ratio \zeta=K_{d}/(2\sqrt{K_{p}}) (Section 10.1.2.2). Setting this property sets Kd to 2\zeta\sqrt{K_{p}}, leaving Kp unchanged. This property is derived from Kp and Kd and is not saved. Default value is 1.

legacyControl

Controls whether or not legacy control is used. Default value is false.

10.3.4 Properties for other cost terms

All other cost terms, including the L2 regularization (Section 10.2.3.1), export the following properties:

enabled

Controls whether or not the term is enabled. Default value is true.

weight

Specifies the weight of this term relative to the other cost terms. Default value is 1.0.