MPC trajectory tracking controller for a bicycle model #841
Unanswered
josyulakrishna
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I don't think you can do this in the current version of the python-control toolbox. The problem is that the current setup does not allow a time-varying integral cost. So there is no way to implement the $\eta_{k,t} - \eta_{\text{ref}{k,t}}$ expression, at least that I can think of. The $\Delta u{k,t}$ term is also problematic, since the integral cost as written can only depend on the current state and input (though there might be a way to fudge this but using costs that are negative?). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have so far followed the examples in the documentation, and I am trying to implement a simple state-space MPC-based trajectory tracking controller based on the kinematic bicycle model shown in figure.1
Fig.1 Model
I have a reference trajectory for the states (x_ref(t),y_ref(t), v_ref(t), psi_ref(t)) obtained from a cubic polynomial and would want to optimize a similar objective given in Fig.2
where
I have understood that I can encode the bicycle model as
NonlinearIOSystem
asI now have to code the cost function which essentially computes
sum_T_steps((x(t)-x_ref(t))^2 +(y(t)-y_ref(t))^2 +(v(t)-v_ref(t))^2+((psi(t)-psi_ref(t))^2)
I'm really not understanding how to proceed from here how do I pass the reference trajectory toopt.quadratic_cost
function? or do I have to pass a cost function handle, if so, how do I handle the computation ofx(t)
using thevehicle_update
function in the cost function?Thank you.
Beta Was this translation helpful? Give feedback.
All reactions