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/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7794e568-5abe-2c2d-70f2-0b2401e39639 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D670:264316:E5F8C7:131BC81:697C0657 |
| html-safe-nonce | b3432bb327365d0b8838cd7926d9a970f6492ce3168989ceaaa6e29b3e446ffe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjcwOjI2NDMxNjpFNUY4Qzc6MTMxQkM4MTo2OTdDMDY1NyIsInZpc2l0b3JfaWQiOiI2Mzk2MDU2NTE1NzY0ODE1NDQ3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2bec7564afe50b823f0406c2dbb65039bf8ffb0f6f2a724e1c79e074b65eb5eb |
| hovercard-subject-tag | pull_request:1179867979 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/files |
| 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 |
| diff-view | unified |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2d0972e08a3f8dfff1c4bf1f3d026a7d3a209c26 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width