|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| None | _add_engine_sim_to_path (Path project_root) |
| _load_engine_only (Path engine_config_path) | |
| _load_engine_and_controller (Path engine_config_path, Path|None controller_config_path, Path|None engine_lut_path=None, Path|None project_root=None) | |
| Tuple[List[str], List[np.ndarray]] | _build_axes (ControllerLUTConfig config) |
| Tuple[int, int] | _find_required_pressure_axes (List[str] axis_names) |
| float | _get_axis_value (List[str] axis_names, List[float] coords, str name, float default) |
| float | _map_engine_output (Any est, str out_name) |
| Tuple[float, float] | _duty_from_thrust_and_mr (np.ndarray u_safe, List[str] axis_names, List[float] coords, Any eng_est, Any get_axis) |
| float | _duty_from_thrust (np.ndarray u_safe, List[str] axis_names, List[float] coords, Any eng_est, int idx, Any get_axis) |
| None | _init_engine_worker (str engine_config_path, str project_root, List[str] axis_names, List[np.ndarray] grids, Tuple[int,...] axis_sizes, List[str] output_names) |
| Tuple[Tuple[int,...], Dict[str, float]] | _compute_engine_point_sequential (int flat_idx, List[str] axis_names, List[np.ndarray] grids, Tuple[int,...] axis_sizes, List[str] output_names, Any engine_wrapper) |
| Tuple[Tuple[int,...], Dict[str, float]] | _compute_engine_point (int flat_idx) |
| None | _init_ddp_worker (str engine_config_path, str controller_config_path, str engine_lut_path, str project_root, List[str] axis_names, List[np.ndarray] grids, Tuple[int,...] axis_sizes, List[str] output_names) |
| Tuple[Tuple[int,...], Dict[str, float]] | _compute_ddp_point_sequential (int flat_idx, List[str] axis_names, List[np.ndarray] grids, Tuple[int,...] axis_sizes, List[str] output_names, Any controller, Any engine_wrapper, Any Measurement, Any NavState, Any Command, Any CommandType) |
| Tuple[Tuple[int,...], Dict[str, float]] | _compute_ddp_point (int flat_idx) |
| None | generate_lut (Path lut_config_path, Path output_path, Path project_root, int jobs=1) |
| None | main (list[str]|None argv=None) |
Variables | |
| _worker_controller = None | |
| _worker_engine_wrapper = None | |
| _worker_axis_names = None | |
| _worker_grids = None | |
| _worker_axis_sizes = None | |
| _worker_output_names = None | |
| _worker_Measurement = None | |
| _worker_NavState = None | |
| _worker_Command = None | |
| _worker_CommandType = None | |
| float | G0 = 9.80665 |
|
protected |
Ensure the engine_sim submodule is importable as a Python package. We do not modify any files inside engine_sim; we only import and use its public APIs.
Definition at line 28 of file generate_controller_lut.py.
Referenced by _init_ddp_worker(), _init_engine_worker(), and generate_lut().
|
protected |
Definition at line 103 of file generate_controller_lut.py.
Referenced by generate_lut().
|
protected |
Compute a single DDP grid point. Uses worker globals.
Definition at line 500 of file generate_controller_lut.py.
References _duty_from_thrust(), _get_axis_value(), _worker_Command, _worker_Measurement, and _worker_NavState.
|
protected |
Compute a single DDP grid point (main process, no worker).
Definition at line 352 of file generate_controller_lut.py.
References _duty_from_thrust(), and _get_axis_value().
Referenced by generate_lut().
|
protected |
Compute a single engine-only grid point. Uses worker globals.
Definition at line 300 of file generate_controller_lut.py.
References _map_engine_output().
|
protected |
Compute a single engine-only grid point (main process, no worker).
Definition at line 280 of file generate_controller_lut.py.
References _map_engine_output().
Referenced by generate_lut().
|
protected |
Legacy: return duty_F or duty_O from MR-aware computation.
Definition at line 245 of file generate_controller_lut.py.
References _duty_from_thrust_and_mr().
Referenced by _compute_ddp_point(), and _compute_ddp_point_sequential().
|
protected |
Compute duty_F and duty_O from (F_ref, MR_ref, F_engine) for MR-aware control. Uses mass-flow scaling: duty_i = throttle * min(1, mdot_i_des / mdot_i_engine). - F_ref=0: duty_F=duty_O=0 - F_ref < F_engine*0.80: throttle=0 (or 0.06 baseline if F_ref>500) - F_ref in [F_engine*0.80, F_engine]: throttle 0.10..0.30 (maintenance) - F_ref > F_engine: throttle 0.30 + 0.65*(deficit/7000), cap 0.95
Definition at line 182 of file generate_controller_lut.py.
Referenced by _duty_from_thrust().
|
protected |
Locate indices of P_u_fuel and P_u_ox axes. These are required because EngineWrapper.estimate_from_pressures expects tank/ullage pressures for fuel and oxidizer.
Definition at line 119 of file generate_controller_lut.py.
Referenced by generate_lut().
|
protected |
Helper to read a coordinate for a named axis with a default.
Definition at line 137 of file generate_controller_lut.py.
Referenced by _compute_ddp_point(), and _compute_ddp_point_sequential().
|
protected |
Initialize worker for DDP LUT generation.
Definition at line 315 of file generate_controller_lut.py.
References _add_engine_sim_to_path(), and _load_engine_and_controller().
|
protected |
Initialize worker for engine-only LUT generation.
Definition at line 260 of file generate_controller_lut.py.
References _add_engine_sim_to_path(), and _load_engine_only().
|
protected |
Load engine + controller configs and construct a RobustDDPController. When engine_lut_path is set, controller uses EngineLUTWrapper for fast lookups.
Definition at line 57 of file generate_controller_lut.py.
Referenced by _init_ddp_worker(), and generate_lut().
|
protected |
Import engine_sim components and load the engine configuration for pure engine-performance LUTs (no DDP). Returns ------- (engine_config, EngineWrapper)
Definition at line 40 of file generate_controller_lut.py.
Referenced by _init_engine_worker(), and generate_lut().
|
protected |
Map EngineEstimate to a single output value.
Definition at line 147 of file generate_controller_lut.py.
Referenced by _compute_engine_point(), and _compute_engine_point_sequential().
| None controller_lut.generate_controller_lut.generate_lut | ( | Path | lut_config_path, |
| Path | output_path, | ||
| Path | project_root, | ||
| int | jobs = 1 ) |
Generate a high-dimensional LUT. Modes: - Engine-only mode (no controller_config_path): map tank pressures to engine performance (F, MR, Pc, mdots, stability, etc.) using EngineWrapper. - DDP mode (controller_config_path set): run RobustDDPController for each grid point and record both engine predictions and optimal control quantities (duty cycles, relaxed controls, etc.).
Definition at line 647 of file generate_controller_lut.py.
References _add_engine_sim_to_path(), _build_axes(), _compute_ddp_point_sequential(), _compute_engine_point_sequential(), _find_required_pressure_axes(), _load_engine_and_controller(), _load_engine_only(), and max.
Referenced by main().
| None controller_lut.generate_controller_lut.main | ( | list[str] | None | argv = None | ) |
Definition at line 849 of file generate_controller_lut.py.
References generate_lut(), and main().
|
protected |
Definition at line 18 of file generate_controller_lut.py.
|
protected |
Definition at line 20 of file generate_controller_lut.py.
|
protected |
Definition at line 24 of file generate_controller_lut.py.
Referenced by _compute_ddp_point().
|
protected |
Definition at line 25 of file generate_controller_lut.py.
|
protected |
Definition at line 16 of file generate_controller_lut.py.
|
protected |
Definition at line 17 of file generate_controller_lut.py.
|
protected |
Definition at line 19 of file generate_controller_lut.py.
|
protected |
Definition at line 22 of file generate_controller_lut.py.
Referenced by _compute_ddp_point().
|
protected |
Definition at line 23 of file generate_controller_lut.py.
Referenced by _compute_ddp_point().
|
protected |
Definition at line 21 of file generate_controller_lut.py.
| float controller_lut.generate_controller_lut.G0 = 9.80665 |
Definition at line 179 of file generate_controller_lut.py.