STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_robust_ddp_controller_integration.TestControllerIntegration Class Reference
Inheritance diagram for test_robust_ddp_controller_integration.TestControllerIntegration:
[legend]
Collaboration diagram for test_robust_ddp_controller_integration.TestControllerIntegration:
[legend]

Public Member Functions

 setUp (self)
 test_controller_integration (self)

Public Attributes

 cfg
PintleEngineConfig engine_config = self._create_minimal_engine_config()
 controller = RobustDDPController(self.cfg, self.engine_config)
 x0
float F_ref = 5000.0
 dynamics_params = DynamicsParams.from_config(self.cfg)

Protected Member Functions

PintleEngineConfig _create_minimal_engine_config (self)
np.ndarray _simulate_dynamics (self, np.ndarray x, np.ndarray u, EngineWrapper engine_wrapper)
Measurement _measurement_from_state (self, np.ndarray x)

Detailed Description

Integration test for robust DDP controller.

Definition at line 38 of file test_robust_ddp_controller_integration.py.

Member Function Documentation

◆ _create_minimal_engine_config()

PintleEngineConfig test_robust_ddp_controller_integration.TestControllerIntegration._create_minimal_engine_config ( self)
protected
Create minimal engine config for testing.

Definition at line 85 of file test_robust_ddp_controller_integration.py.

◆ _measurement_from_state()

Measurement test_robust_ddp_controller_integration.TestControllerIntegration._measurement_from_state ( self,
np.ndarray x )
protected
Create measurement from state.

Definition at line 199 of file test_robust_ddp_controller_integration.py.

Referenced by test_controller_integration().

◆ _simulate_dynamics()

np.ndarray test_robust_ddp_controller_integration.TestControllerIntegration._simulate_dynamics ( self,
np.ndarray x,
np.ndarray u,
EngineWrapper engine_wrapper )
protected
Simulate one step of dynamics.

Parameters:
-----------
x : np.ndarray
    Current state
u : np.ndarray
    Control action
engine_wrapper : EngineWrapper
    Engine wrapper for mass flow estimation

Returns:
--------
x_next : np.ndarray
    Next state

Definition at line 162 of file test_robust_ddp_controller_integration.py.

References engine.control.robust_ddp.controller.RobustDDPController.cfg, engine.control.robust_ddp.identify.ParameterIdentifier.cfg, payload.cold_gas_thruster.ColdGasThruster.cfg, test_robust_ddp_actuation.TestActuation.cfg, cfg, engine.control.robust_ddp.controller.RobustDDPController.dynamics_params, and dynamics_params.

Referenced by test_controller_integration().

◆ setUp()

test_robust_ddp_controller_integration.TestControllerIntegration.setUp ( self)
Set up test fixtures.

Definition at line 41 of file test_robust_ddp_controller_integration.py.

◆ test_controller_integration()

Member Data Documentation

◆ cfg

test_robust_ddp_controller_integration.TestControllerIntegration.cfg
Initial value:
= ControllerConfig(
N=10, # Short horizon for faster test
dt=0.01, # 10 ms
dwell_time=0.05,
duty_quantization=0.1, # 10% steps
qF=1.0,
qMR=10.0,
qGas=0.1,
qSwitch=0.01,
MR_min=1.5,
MR_max=3.0,
P_u_max=10e6,
P_copv_min=1e6,
max_iterations=3, # Few iterations for speed
convergence_tol=1e-3,
)

Definition at line 44 of file test_robust_ddp_controller_integration.py.

Referenced by _simulate_dynamics(), test_combustion_stability_audit.TestIntegration.test_acoustic_report_only_by_default(), test_robust_ddp_reference.TestReferenceGeneration.test_altitude_command(), test_robust_ddp_reference.TestReferenceGeneration.test_altitude_command_below_goal(), test_robust_ddp_reference.TestReferenceGeneration.test_build_reference_altitude_mode(), test_robust_ddp_reference.TestReferenceGeneration.test_build_reference_slew_rate(), test_robust_ddp_reference.TestReferenceGeneration.test_build_reference_thrust_mode(), test_combustion_stability_audit.TestIntegration.test_chug_gate_is_the_gain_margin_band_minimum(), test_robust_ddp_safety_filter.TestSafetyFilter.test_compute_action_cost(), test_controller_integration(), test_robust_ddp_reference.TestReferenceGeneration.test_estimate_thrust_bounds(), test_robust_ddp_safety_filter.TestSafetyFilter.test_filter_action_clamping(), test_robust_ddp_safety_filter.TestSafetyFilter.test_filter_action_safe(), test_robust_ddp_safety_filter.TestSafetyFilter.test_filter_action_unsafe_mr(), test_robust_ddp_safety_filter.TestSafetyFilter.test_filter_action_unsafe_ullage(), test_robust_ddp_safety_filter.TestSafetyFilter.test_find_best_safe_action(), test_robust_ddp_ddp_solver.TestDDPSolver.test_forward_rollout(), test_robust_ddp_safety_filter.TestSafetyFilter.test_generate_action_candidates(), test_robust_ddp_identify.TestParameterIdentification.test_get_params(), test_robust_ddp_identify.TestParameterIdentification.test_identify_alpha_F(), test_robust_ddp_identify.TestParameterIdentification.test_identify_alpha_O(), test_robust_ddp_identify.TestParameterIdentification.test_identify_copv_coefficients(), test_robust_ddp_identify.TestParameterIdentification.test_identify_tau_line_F(), test_robust_ddp_identify.TestParameterIdentification.test_identify_tau_line_O(), test_combustion_stability_audit.TestIntegration.test_missing_injector_drop_is_recorded_and_zero_is_zero(), test_combustion_stability_audit.TestIntegration.test_model_error_fails_closed(), test_robust_ddp_identify.TestParameterIdentification.test_parameter_bounds(), test_robust_ddp_reference.TestReferenceGeneration.test_project_thrust_bounds(), test_robust_ddp_reference.TestReferenceGeneration.test_project_thrust_slew_rate(), test_robust_ddp_ddp_solver.TestDDPSolver.test_running_cost(), test_robust_ddp_ddp_solver.TestDDPSolver.test_running_cost_with_errors(), test_robust_ddp_safety_filter.TestSafetyFilter.test_tube_violates_constraints_copv_min(), test_robust_ddp_safety_filter.TestSafetyFilter.test_tube_violates_constraints_mr(), test_robust_ddp_safety_filter.TestSafetyFilter.test_tube_violates_constraints_safe(), test_robust_ddp_safety_filter.TestSafetyFilter.test_tube_violates_constraints_ullage_max(), and test_robust_ddp_identify.TestParameterIdentification.test_update_config().

◆ controller

test_robust_ddp_controller_integration.TestControllerIntegration.controller = RobustDDPController(self.cfg, self.engine_config)

◆ dynamics_params

test_robust_ddp_controller_integration.TestControllerIntegration.dynamics_params = DynamicsParams.from_config(self.cfg)

Definition at line 83 of file test_robust_ddp_controller_integration.py.

Referenced by _simulate_dynamics().

◆ engine_config

PintleEngineConfig test_robust_ddp_controller_integration.TestControllerIntegration.engine_config = self._create_minimal_engine_config()

Definition at line 62 of file test_robust_ddp_controller_integration.py.

◆ F_ref

test_robust_ddp_controller_integration.TestControllerIntegration.F_ref = 5000.0

◆ x0


The documentation for this class was generated from the following file: