test_effectorBranching_integrated
- test_effectorBranching_integrated.test_effectorBranchingIntegratedTest(show_plots, stateEffector, isParent, dynamicEffector, isChild)[source]
Validation Test Description
This integrated test sets up combinations of dynamic effector attached to a state effector.
Description of Variables Being Tested
In this file we are checking first for branching compatibility, as not every state effector is set up to host dependent effectors (isParent), and not every dynamic effector is set up to be attached to a state effector (isChild). The state effector compatibility is checked when the addDynamicEffector() method is called. The dynamic effector compatibility is checked at simulation initialization when linkInProperties() is called.
State effectors that are expected to be able to host dynamic effectors (isParent) include:
Dynamic effectors that are expected to be able to attach to state effectors (isChild) include:
Note that the constraint effector is tested in two configurations: once where one vehicle’s state effector is attached to the hub on another vehicle (
constraintEffectorOneHub), and once where both vehicles’ state effectors are attached to each other (constraintEffectorNoHubs). Additionally, a test with multiple dynamic effectors attached to a single state effector is included (multiEffector). Finally, at least one non-compatible state effector and one non-compatible dynamic effector are included to check that the error handling catches as expected.Note that the center of mass of the hub is adjusted to balance the shift in total vehicle COM due to the addition of the state effector’s mass. This adjustment is calculated such that at simulation initialization the total center of mass of the vehicle is coincident with the hub’s body frame B (r_BN_N = r_CN_N). This greatly simplifies the setup of the constraint effector branching scenarios. This calculation is performed by calculating the parameter mr_PcB_B in each state effector’s setup method which for the state effector’s series of \(i\) bodies is:
\[\sum_i m_{P_i} {}^{\mathcal{B}}\mathbf{r}_{Pc_i/B}\]Where P is the state effector’s designation as “parent”, with each of its \(i\) segments having segment body fixed frame \(\mathcal{P}_i\), origin \(P_i\), and segment center of mass \(Pc_i\). Then used to compute the hub center of mass offset scObject.hub.r_BcB_B as:
\[{}^{\mathcal{B}}\mathbf{r}_{Bc/B} = \frac{- \sum_i m_{P_i} {}^{\mathcal{B}}\mathbf{r}_{Pc_i/B}} {\sum_i m_{Bc}}\]In the case of a permissible combination, we then check that properties are being handed correctly from the state effector to dynamic effector.
These variables include:
inertialPositionPropertyinertialVelocityPropertyinertialAttitudePropertyinertialAngVelocityProperty
Finally, we simultaneously check that a) the applied force and torque are being handed correctly from the dynamic effector to state effector, and b) that these forces and torques are implemented correctly in the state effector’s equations of motion. We do this by isolating each case where a state effector has the Module: extForceTorque effector attached to it. Using the explicitly defined
forceExternal_BandtorqueExternalPntB_Band the logged inertial position and attitude properties of the state effector, we manually compute the total external force on the vehicle about the combined center of mass and the accumulated delta V of the vehicle’s combined center of mass. The torque is then integrated using a trapezoid rule and compared against the spacecraft’s internally computed angular momentum.\[\begin{split}{}^{\mathcal{N}}\!\Delta\mathbf{H}_{C} & = \int_{t_0}^{t} {}^{\mathcal{N}}\!\boldsymbol{\tau}_{\text{ext},C}(t)\,dt \\ & = \int_{t_0}^{t} \text{Pure Torque + Force Relative to COM} \\ & = \int_{t_0}^{t} [\mathcal{NP}_j] {}^{\mathcal{P}_j}\!\boldsymbol{\tau}_{\text{ext},P_j} + \left( {}^{\mathcal{N}}\mathbf{r}_{Pc_j/N} - [\mathcal{NP}_j] {}^{\mathcal{P}_j}\mathbf{r}_{Pc_j/P_j} - {}^{\mathcal{N}}\mathbf{r}_{C/N} \right) \times \left( [\mathcal{NP}_j] {}^{\mathcal{P}_j}\mathbf{F}_{P_j} \right)\end{split}\]Where \(j\) is the segment that the dynamic effector is attached to. The sim ‘truth’ \({}^{\mathcal{N}}\!\Delta\mathbf{H}_{C}\) (scObject.totOrbAngMomPntN_N) and \({}^{\mathcal{N}}\mathbf{r}_{C/N}\) are logged from the spacecraft module. Exerted \({}^{\mathcal{P}_j}\!\boldsymbol{\tau}_{\text{ext},P_j}\) and \({}^{\mathcal{P}_j}\mathbf{F}_{P_j}\) are from the extForceTorque effector module. \({}^{\mathcal{N}}\mathbf{r}_{Pc_j/N}\), \([\mathcal{NP}_j]\), and \({}^{\mathcal{P}_j}\mathbf{r}_{Pc_j/P_j}\) come from the state effector module.
The accumulated delta V is compared against the internally computed delta V of the spacecraft center of mass.
\[{}^{\mathcal{N}}\!\Delta v_{accum,C} = \int_{t_0}^{t} \frac{[\mathcal{NP}_j] {}^{\mathcal{P}_j}\mathbf{F}_{P_j}} {m_{Bc} + \sum_i m_{P_i}} dt\]where again \(j\) is the segment that the dynamic effector is attached to among all \(i\) segments. The sim ‘truth’ \({}^{\mathcal{N}}\!\Delta v_{accum,C}\) is logged from the spacecraft module.