Fixes to various optimization-based control functions by murrayrm · Pull Request #709 · python-control/python-control
Navigation Menu
- Notifications You must be signed in to change notification settings
- Fork 453
Conversation
I recently finished teaching an optimization-based controls course and found a but of small things in the code that needing fixing/improving:
- Parameters were not being passed properly to differentially flat systems.
- Basis functions derived from
BasisFamilywere not callingBasisFamily.__init__. - Changed
constraintskeyword inoptimal.solve_ocpandflatsys.point_to_pointtotrajectory_constraintsfor more consistency (legacy keyword still works). - Initial conditions for simulation of discrete time systems was being passed as a list instead of an ndarray, which caused some odd behavior and wasn't consistent with continuous time system usage.
- Added check for constraint types in optimal control problem setup (rather than when solving the optimal control problem).
- Fixed small inconsistency in the way discrete time was handled in setting up an I/O system for model predictive control (should be inherited from system, not passed separately).
- Unused keywords in
OptimalControlProblemnow generate an error (mentioned here). - To be consistent with the normal problem formulation, the discrete time optimal cost calculation no longer includes the endpoint (use
terminal_costinstead). create_mpc_iosystemnow re-computes the optimal controller when returning the output, which eliminates an unintended one-step delay in the MPC dynamics.- Added unit tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters