Title: Add gain scheduling to create_statefbk_iosystem() by murrayrm · Pull Request #827 · python-control/python-control · GitHub
Open Graph Title: Add gain scheduling to create_statefbk_iosystem() by murrayrm · Pull Request #827 · python-control/python-control
X Title: Add gain scheduling to create_statefbk_iosystem() by murrayrm · Pull Request #827 · python-control/python-control
Description: This PR adds functionality to the create_statefbk_iosystem function, allowing it to be used to set up a simple gain scheduled controller. From the documentation: Gain scheduling on the desired state, desired input, or system state can be implemented by setting the gain to a 2-tuple consisting of a list of gains and a list of points at which the gains were computed, as well as a description of the scheduling variables ctrl, clsys = ct.create_statefbk_iosystem( sys, ([g1, ..., gN], [p1, ..., pN]), gainsched_indices=[s1, ..., sq]) The list of indices can either be integers indicating the offset into the controller input vector or a list of strings matching the names of the input signals. Example: # Create a simple nonlinear system to check (kinematic car) def unicycle_update(t, x, u, params): return np.array([np.cos(x[2]) * u[0], np.sin(x[2]) * u[0], u[1]]) def unicycle_output(t, x, u, params): return x unicycle = ct.NonlinearIOSystem( unicycle_update, unicycle_output, inputs = ['v', 'phi'], outputs = ['x', 'y', 'theta'], states = ['x_', 'y_', 'theta_']) # Speeds and angles at which to compute the gains speeds = [1, 5, 10] angles = np.linspace(0, pi/2, 4) points = list(itertools.product(speeds, angles)) # Gains for each speed (using LQR controller) Q = np.identity(unicycle.nstates) R = np.identity(unicycle.ninputs) gains = [np.array(ct.lqr(unicycle.linearize( [0, 0, angle], [speed, 0]), Q, R)[0]) for speed, angle in points] # # Schedule on desired speed and angle # # Create gain scheduled controller ctrl, clsys = ct.create_statefbk_iosystem( unicycle, (gains, points), gainsched_indices=['vd', 'theta']) Includes unit tests and documentation.
Open Graph Description: This PR adds functionality to the create_statefbk_iosystem function, allowing it to be used to set up a simple gain scheduled controller. From the documentation: Gain scheduling on the desired st...
X Description: This PR adds functionality to the create_statefbk_iosystem function, allowing it to be used to set up a simple gain scheduled controller. From the documentation: Gain scheduling on the desired st...
Opengraph URL: https://github.com/python-control/python-control/pull/827
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:56e8391e-74c5-b944-8007-8fd31a4cfaf1 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | CF70:2A5F76:94CB9:CDBBB:697C5069 |
| html-safe-nonce | 38bc234ebf7fd094956751ad5422153e4ec6bfe8edfae35cf2069ba2b916d218 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjcwOjJBNUY3Njo5NENCOTpDREJCQjo2OTdDNTA2OSIsInZpc2l0b3JfaWQiOiIxMTI2OTc5Mjk4MzE4MzcyOTY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8a230e5ed86bb15b232cd0f7fa6bd45cdddebd1555d8944a203037685f319177 |
| hovercard-subject-tag | pull_request:1179867979 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-control/python-control/pull/827/checks |
| twitter:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| og:image:alt | This PR adds functionality to the create_statefbk_iosystem function, allowing it to be used to set up a simple gain scheduled controller. From the documentation: Gain scheduling on the desired st... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | da4f0ee56809799586f8ee546b27f94fe9b5893edfbf87732e82be45be013b52 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-control/python-control git https://github.com/python-control/python-control.git |
| octolytics-dimension-user_id | 2285872 |
| octolytics-dimension-user_login | python-control |
| octolytics-dimension-repository_id | 22791752 |
| octolytics-dimension-repository_nwo | python-control/python-control |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22791752 |
| octolytics-dimension-repository_network_root_nwo | python-control/python-control |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 787d8d274e314f52ce6d846c7581f9476d8dc736 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width