STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.control.robust_ddp.identify.ParameterIdentifier Class Reference

Public Member Functions

 __init__ (self, ControllerConfig cfg, float forgetting_factor=0.99)
None update_params (self, ControllerState state, Measurement meas, ControllerConfig cfg, np.ndarray x_current, np.ndarray u_current, float dt, Optional[float] mdot_F=None, Optional[float] mdot_O=None)
dict get_params (self)
None update_config (self, ControllerConfig cfg)

Public Attributes

 cfg = cfg
 lambda_rls = forgetting_factor
 alpha_F = cfg.alpha_F
 alpha_O = cfg.alpha_O
 tau_line_F = cfg.tau_line_F
 tau_line_O = cfg.tau_line_O
 copv_cF = cfg.copv_cF
 copv_cO = cfg.copv_cO
int P_alpha_F = 1e6
 theta_alpha_F = cfg.alpha_F
int P_alpha_O = 1e6
 theta_alpha_O = cfg.alpha_O
int P_tau_F = 1e6
float theta_tau_F = 1.0 / cfg.tau_line_F
int P_tau_O = 1e6
float theta_tau_O = 1.0 / cfg.tau_line_O
int P_copv = 1e6 * np.eye(2)
 theta_copv = np.array([cfg.copv_cF, cfg.copv_cO])
Optional[np.ndarray] x_prev = None
Optional[np.ndarray] u_prev = None
Optional[float] t_prev = None
 alpha_min
float alpha_max = 0.1, 100.0
 tau_min
float tau_max = 0.001, 1.0
 copv_c_min
int copv_c_max = 1e3, 1e7

Protected Member Functions

None _update_alpha_F (self, float dP_u_dt, np.ndarray x, np.ndarray u, float dt, Optional[float] mdot_F)
None _update_alpha_O (self, float dP_u_dt, np.ndarray x, np.ndarray u, float dt, Optional[float] mdot_O)
None _update_tau_line_F (self, float dP_d_dt, np.ndarray x, float dt)
None _update_tau_line_O (self, float dP_d_dt, np.ndarray x, float dt)
None _update_copv_coefficients (self, float dP_copv_dt, np.ndarray u, float dt)

Detailed Description

Online parameter identifier using RLS with forgetting factor.

Definition at line 29 of file identify.py.

Constructor & Destructor Documentation

◆ __init__()

engine.control.robust_ddp.identify.ParameterIdentifier.__init__ ( self,
ControllerConfig cfg,
float forgetting_factor = 0.99 )
Initialize parameter identifier.

Parameters:
-----------
cfg : ControllerConfig
    Controller configuration (contains initial parameter values)
forgetting_factor : float
    RLS forgetting factor (0 < lambda < 1, closer to 1 = slower forgetting)

Definition at line 32 of file identify.py.

Member Function Documentation

◆ _update_alpha_F()

None engine.control.robust_ddp.identify.ParameterIdentifier._update_alpha_F ( self,
float dP_u_dt,
np.ndarray x,
np.ndarray u,
float dt,
Optional[float] mdot_F )
protected

◆ _update_alpha_O()

None engine.control.robust_ddp.identify.ParameterIdentifier._update_alpha_O ( self,
float dP_u_dt,
np.ndarray x,
np.ndarray u,
float dt,
Optional[float] mdot_O )
protected

◆ _update_copv_coefficients()

◆ _update_tau_line_F()

None engine.control.robust_ddp.identify.ParameterIdentifier._update_tau_line_F ( self,
float dP_d_dt,
np.ndarray x,
float dt )
protected

◆ _update_tau_line_O()

None engine.control.robust_ddp.identify.ParameterIdentifier._update_tau_line_O ( self,
float dP_d_dt,
np.ndarray x,
float dt )
protected

◆ get_params()

◆ update_config()

◆ update_params()

None engine.control.robust_ddp.identify.ParameterIdentifier.update_params ( self,
ControllerState state,
Measurement meas,
ControllerConfig cfg,
np.ndarray x_current,
np.ndarray u_current,
float dt,
Optional[float] mdot_F = None,
Optional[float] mdot_O = None )
Update identified parameters from measurements.

Parameters:
-----------
state : ControllerState
    Controller state (not used, but kept for API consistency)
meas : Measurement
    Current measurements
cfg : ControllerConfig
    Controller configuration
x_current : np.ndarray
    Current state vector
u_current : np.ndarray
    Current control input
dt : float
    Time step [s]
mdot_F : float, optional
    Fuel mass flow [kg/s]
mdot_O : float, optional
    Oxidizer mass flow [kg/s]

Definition at line 84 of file identify.py.

References _update_alpha_F(), _update_alpha_O(), _update_copv_coefficients(), _update_tau_line_F(), _update_tau_line_O(), t_prev, engine.control.robust_ddp.data_models.ControllerState.u_prev, u_prev, engine.control.robust_ddp.controller.RobustDDPController.x_prev, and x_prev.

Member Data Documentation

◆ alpha_F

engine.control.robust_ddp.identify.ParameterIdentifier.alpha_F = cfg.alpha_F

Definition at line 47 of file identify.py.

Referenced by _update_alpha_F(), get_params(), and update_config().

◆ alpha_max

float engine.control.robust_ddp.identify.ParameterIdentifier.alpha_max = 0.1, 100.0

Definition at line 80 of file identify.py.

Referenced by _update_alpha_F(), and _update_alpha_O().

◆ alpha_min

engine.control.robust_ddp.identify.ParameterIdentifier.alpha_min

Definition at line 80 of file identify.py.

Referenced by _update_alpha_F(), and _update_alpha_O().

◆ alpha_O

engine.control.robust_ddp.identify.ParameterIdentifier.alpha_O = cfg.alpha_O

Definition at line 48 of file identify.py.

Referenced by _update_alpha_O(), get_params(), and update_config().

◆ cfg

engine.control.robust_ddp.identify.ParameterIdentifier.cfg = cfg

Definition at line 43 of file identify.py.

Referenced by test_robust_ddp_controller_integration.TestControllerIntegration._simulate_dynamics(), _update_alpha_F(), _update_alpha_O(), _update_copv_coefficients(), payload.cold_gas_thruster.ColdGasThruster.compute(), payload.cold_gas_thruster.ColdGasThruster.generate_nozzle_contour(), 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_actuation.TestActuation.test_binary_actuation_sigma_delta(), test_robust_ddp_actuation.TestActuation.test_binary_actuation_threshold(), 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_robust_ddp_actuation.TestActuation.test_compute_actuation_binary(), test_robust_ddp_actuation.TestActuation.test_compute_actuation_clamping(), test_robust_ddp_actuation.TestActuation.test_compute_actuation_dwell_enforcement(), test_robust_ddp_actuation.TestActuation.test_compute_actuation_dwell_satisfied(), test_robust_ddp_actuation.TestActuation.test_compute_actuation_pwm(), test_robust_ddp_controller_integration.TestControllerIntegration.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().

◆ copv_c_max

int engine.control.robust_ddp.identify.ParameterIdentifier.copv_c_max = 1e3, 1e7

Definition at line 82 of file identify.py.

Referenced by _update_copv_coefficients().

◆ copv_c_min

engine.control.robust_ddp.identify.ParameterIdentifier.copv_c_min

Definition at line 82 of file identify.py.

Referenced by _update_copv_coefficients().

◆ copv_cF

engine.control.robust_ddp.identify.ParameterIdentifier.copv_cF = cfg.copv_cF

Definition at line 51 of file identify.py.

Referenced by _update_copv_coefficients(), get_params(), and update_config().

◆ copv_cO

engine.control.robust_ddp.identify.ParameterIdentifier.copv_cO = cfg.copv_cO

Definition at line 52 of file identify.py.

Referenced by _update_copv_coefficients(), get_params(), and update_config().

◆ lambda_rls

engine.control.robust_ddp.identify.ParameterIdentifier.lambda_rls = forgetting_factor

◆ P_alpha_F

int engine.control.robust_ddp.identify.ParameterIdentifier.P_alpha_F = 1e6

Definition at line 55 of file identify.py.

Referenced by _update_alpha_F().

◆ P_alpha_O

int engine.control.robust_ddp.identify.ParameterIdentifier.P_alpha_O = 1e6

Definition at line 59 of file identify.py.

Referenced by _update_alpha_O().

◆ P_copv

int engine.control.robust_ddp.identify.ParameterIdentifier.P_copv = 1e6 * np.eye(2)

Definition at line 71 of file identify.py.

Referenced by _update_copv_coefficients().

◆ P_tau_F

int engine.control.robust_ddp.identify.ParameterIdentifier.P_tau_F = 1e6

Definition at line 63 of file identify.py.

Referenced by _update_tau_line_F().

◆ P_tau_O

int engine.control.robust_ddp.identify.ParameterIdentifier.P_tau_O = 1e6

Definition at line 67 of file identify.py.

Referenced by _update_tau_line_O().

◆ t_prev

Optional[float] engine.control.robust_ddp.identify.ParameterIdentifier.t_prev = None

Definition at line 77 of file identify.py.

Referenced by update_params().

◆ tau_line_F

engine.control.robust_ddp.identify.ParameterIdentifier.tau_line_F = cfg.tau_line_F

Definition at line 49 of file identify.py.

Referenced by _update_tau_line_F(), get_params(), and update_config().

◆ tau_line_O

engine.control.robust_ddp.identify.ParameterIdentifier.tau_line_O = cfg.tau_line_O

Definition at line 50 of file identify.py.

Referenced by _update_tau_line_O(), get_params(), and update_config().

◆ tau_max

float engine.control.robust_ddp.identify.ParameterIdentifier.tau_max = 0.001, 1.0

Definition at line 81 of file identify.py.

Referenced by _update_tau_line_F(), and _update_tau_line_O().

◆ tau_min

engine.control.robust_ddp.identify.ParameterIdentifier.tau_min

Definition at line 81 of file identify.py.

Referenced by _update_tau_line_F(), and _update_tau_line_O().

◆ theta_alpha_F

engine.control.robust_ddp.identify.ParameterIdentifier.theta_alpha_F = cfg.alpha_F

Definition at line 56 of file identify.py.

Referenced by _update_alpha_F().

◆ theta_alpha_O

engine.control.robust_ddp.identify.ParameterIdentifier.theta_alpha_O = cfg.alpha_O

Definition at line 60 of file identify.py.

Referenced by _update_alpha_O().

◆ theta_copv

engine.control.robust_ddp.identify.ParameterIdentifier.theta_copv = np.array([cfg.copv_cF, cfg.copv_cO])

Definition at line 72 of file identify.py.

Referenced by _update_copv_coefficients().

◆ theta_tau_F

float engine.control.robust_ddp.identify.ParameterIdentifier.theta_tau_F = 1.0 / cfg.tau_line_F

Definition at line 64 of file identify.py.

Referenced by _update_tau_line_F().

◆ theta_tau_O

float engine.control.robust_ddp.identify.ParameterIdentifier.theta_tau_O = 1.0 / cfg.tau_line_O

Definition at line 68 of file identify.py.

Referenced by _update_tau_line_O().

◆ u_prev

◆ x_prev


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