-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Position-controlled actuators #63
Comments
We actually have a pdcontrol function which implements this. :) Time stepping models also have an option to take position commands as input (adds additional constraints). I agree that we should have a tool for abstracting an arbitrarily stiff pd controller with a first order approximation, but then it is probably not strictly an rbm anymore... So we have to do it carefully. |
madan-TRI
pushed a commit
to madan-TRI/drake
that referenced
this issue
Jul 5, 2023
* update hopper cost function * store vector of indices of unactuated DoFs * compute equality constraint violations * compute equality constraint jacobian * constraint jacobian unit test with hopper * draft dense KKT solve * add merit linesearch * add constraint violation to linesearch plots * try drafting least squares lagrangian formulation * fix bug in equality constraint jacobian * drive equality constraints near zero with SQP linesearch * isolate quadratic penalty bug * add equality constriant penalty parameter * isolate penalty function bug * fix gradient bug * quadratic underactuation penalty working * try L1 norm penalty * simple computation of constrained step in linesearch * modified dogleg working with acrobot * add equality constraint YAML parameter * print constraint violation in trust region * record and plot equality constraint violation * equality constraints help moderately with spinner * augmented cost decreases every iteration for acrobot * change merit used in trust ratio calculation * finger moves closer to spinner even without force at a distance * even simpler spinner example where actuated torques should be zero but aren't * isolate bug in equality constraint jacobian * isolate equality constraint jacobian bug in unit test * fix equality constraint jacobian bug for contact-less spinner * new unit tests for equality constraint jacobian * log and plot merit function * use a (slightly) better merit function by fixing lagrange multipliers * much stronger spinner example * equality constraints working with all examples up to hopper * set up caching for lagrange multipliers * allocate Hinv*J' in the workspace * fix gradient caching bug * update comparison script * add the merit function to the cache * cache the gradient of the merit function * print and log the gradient of the merit function instead of the gradient of the cost * choose better linesearch parameters * use trust region for spinner example * remove old plotting script * rough draft of combining scaling and equality constraints * example of scaling and equality constraints working well together * scaling + equality constraints: improves airhockey, same with spinner, makes hopper worse * revert to non-adaptive sqrt type scaling * correct descent direction sanity check * add initial and maximum trust region radius as yaml parameters * add scaling method yaml parameter * don't compute inverse dynamics partials for q0 * use scaled trust ratio with dense algebra * add unit test for combining scaling and equality constraints * fix bug in trust ratio computation * airhockey example works with all permutations of constraints and scaling * cleanup * don't assume particular scaling scheme in docs * further cleanup
madan-TRI
pushed a commit
to madan-TRI/drake
that referenced
this issue
Aug 9, 2023
* update hopper cost function * store vector of indices of unactuated DoFs * compute equality constraint violations * compute equality constraint jacobian * constraint jacobian unit test with hopper * draft dense KKT solve * add merit linesearch * add constraint violation to linesearch plots * try drafting least squares lagrangian formulation * fix bug in equality constraint jacobian * drive equality constraints near zero with SQP linesearch * isolate quadratic penalty bug * add equality constriant penalty parameter * isolate penalty function bug * fix gradient bug * quadratic underactuation penalty working * try L1 norm penalty * simple computation of constrained step in linesearch * modified dogleg working with acrobot * add equality constraint YAML parameter * print constraint violation in trust region * record and plot equality constraint violation * equality constraints help moderately with spinner * augmented cost decreases every iteration for acrobot * change merit used in trust ratio calculation * finger moves closer to spinner even without force at a distance * even simpler spinner example where actuated torques should be zero but aren't * isolate bug in equality constraint jacobian * isolate equality constraint jacobian bug in unit test * fix equality constraint jacobian bug for contact-less spinner * new unit tests for equality constraint jacobian * log and plot merit function * use a (slightly) better merit function by fixing lagrange multipliers * much stronger spinner example * equality constraints working with all examples up to hopper * set up caching for lagrange multipliers * allocate Hinv*J' in the workspace * fix gradient caching bug * update comparison script * add the merit function to the cache * cache the gradient of the merit function * print and log the gradient of the merit function instead of the gradient of the cost * choose better linesearch parameters * use trust region for spinner example * remove old plotting script * rough draft of combining scaling and equality constraints * example of scaling and equality constraints working well together * scaling + equality constraints: improves airhockey, same with spinner, makes hopper worse * revert to non-adaptive sqrt type scaling * correct descent direction sanity check * add initial and maximum trust region radius as yaml parameters * add scaling method yaml parameter * don't compute inverse dynamics partials for q0 * use scaled trust ratio with dense algebra * add unit test for combining scaling and equality constraints * fix bug in trust ratio computation * airhockey example works with all permutations of constraints and scaling * cleanup * don't assume particular scaling scheme in docs * further cleanup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Drake should have a way of modeling actuators that take position as input (like servos) directly from URDFs. This would of course be an abstraction for the controller inside the servo but most people assume those controllers to be "ideal" anyway.
A temporary workaround I found is to build a PD controller around a RigidBodyManipulator yourself.
The T is the mechanicalReduction in your URDF (which is technically inside RBM but is easier to see that way), RBM is your RigidBodyManipulator and LS is a LinearSystem (the PD controller). Here is an example:
Things to take into consideration when tuning your PD controller:
The text was updated successfully, but these errors were encountered: