A few questions and comments #70
Replies: 1 comment
-
|
Hey @peterkrull , thanks for comments and suggestions! They are really helpful!
|
Beta Was this translation helpful? Give feedback.
-
|
Hey @peterkrull , thanks for comments and suggestions! They are really helpful!
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey TinyMPC team,
I am doing a project where I am expanding on my own tinympc-rs implementation, and have spent some more time looking into your derivations and implementation. So I have come up with some questions and comments.
I noticed there appear to be two distinct implementations: the main TinyMPC repository and the one used for the Crazyflie firmware. Could you elaborate on the relationship between these two? Would code generation for the Crazyflie not be the best demonstration of the main TinyMPC code base?
Is the memory usage described in the original paper from the code-gen implementation or the Crazyflie one? Since it bottoms out at ~380 kB of memory, which already exceeds the STM32F405, I would guess the former. Also is it static memory usage, or combined with dynamic stack usage? If there is a large different in memory consumption, what about compute between the two implementations?
Your termination check only includes the box-constraint slack variables, which presumably would result in premature termination when they are inactive, even when other constraints may be active and have large residuals. Could this have affected the results in your latest paper? In my implementation I have made an interface for constraints and their projection function, which allows for easily computing the residual for all constraints, but also give more flexibility to end users. Slack and dual variables are owned by each constraint, meaning their variables are not even allocated if not needed.
In your initial paper you mention using penalty scaling with multiple cached sets of matrices, but unless I am missing something, this was never published to the main branch? If you ever tested it out, how does it compare to the first-order approach from the latest paper? I have done some testing with the multiple-cache approach but find that the performance improvement for well-conditioned problems is not that great, and the result can be a bit jumpy. I have also considered doing a combined approach, where I use the value and derivative of the matrices for multiple values of rho, and then do cubic hermite spline interpolation between them.
I believe
update_linear_costshould be the first operation in the solver loop, otherwise a changed reference is not accounted for during the first iteration. It is also what sets the terminal condition in preparation for the Riccati backward pass. Having it last means the first forward pass is done using an outdated reference. It should just be considered part of the primal update, since it would be required in the unconstrained finite-horizon LQR case, and does not inherently have any connection to ADMM. Presumably, having it last might result in premature termination on a sub optimal solution. Is there a reason for this ordering that I might be missing?For my own implementation I have concluded that shifting the slack and dual variables (see discussion 10) is indeed preferable. Specifically when the related constraints are active, and especially when the cost matrices have a high conditioning number. See the recording below, made using rerun (which also has C++ bindings)
tinympc-shifted.mp4
Thank for your time and the work you are doing.
Regards, Peter
Beta Was this translation helpful? Give feedback.
All reactions