I/O system enhancements by murrayrm · Pull Request #710 · python-control/python-control
This PR adds some new functionality for I/O systems that I used in a recent course on optimization-based control that I taught at Caltech:
-
Modify the
ss(),rss(), anddrss()functions to returnLinearIOSystemobjects (instead ofStateSpaceobjects). This makes it easier to create LTI state space systems that can be combined with other I/O systems without having to add a conversation step. SinceLinearIOSystemobjects are alsoStateSpaceobjects, no functionality is lost. (This change is implemented through the introduction of a internalNamedIOSystemclass, to avoid import cycles.) -
Added a new function
create_statefbk_iosystem()that creates an I/O system for implementing a linear state feedback controller of the form u = ud - Kp(x - xd). The function returns an I/O system that takes xd, ud, and x as inputs and generates u as an output. Theintegral_actionkeyword can be used to define a set of outputs y = C x for which integral feedback is also included: u = ud - Kp(x - xd) - Ki(C x - C xd). -
The
lqranddlqrcommands now accept anintegral_actionkeyword that allows outputs to be specified for implementing integral action. The resulting gain matrix has the form K = [Kp, Ki]. (This is useful for combining with theintegral_actionfunctionality increate_statefbk_iosystem()).