How to update vehicle's state variable in simulator?
1 view (last 30 days)
Show older comments
Hello, I'm a graduate student and my research field is Vehicle motion planning
I'm trying to make a MPC controller for path tracking with and the problem is how to update my state variable.
The controller need to update the vehicle's state, such as speed and position, at every step. I'm wondering whether this should be done by calculating x˙=Ax+Bu, or by calculating just the control input and then updating based on the current state of the vehicle obtained from the simulator at each step.
I am curious if it is valid to update the state based on the information received from the simulator and then calculate the control input. If it needs to be updated through calculation, I wonder how to handle parameters such as tire friction coefficient or parameters that change over time.
Any answer can be a great help for me
Thank you
0 Comments
Answers (1)
Adam Danz
on 2 Apr 2024
Edited: Adam Danz
on 2 Apr 2024
I think the choice between the two options depends on a few factors.
Relying on the state space equation (x'=Ax+Bu) involves calculating the vehicle's next state based on its current known state and control inputs using the system's dynamic model. If the model is reliable and there are no external unexpected forces (e.g. gusts of wind, slippage, changes to friction) then this should suffice. But in the real world, error will accumulate.
Updating based on simulator feedback may be more practical in situations where the model may not capture all of the complexities or unpredictable conditions. However, the reliability of the feedback depends on the fidelity of the simulator.
A third approach is to combine these options. The state space model prediction of the vehicle's state can be optimally combined with the simulator feedback using an estimator such as a Kalman filter. This benefits from the predictive power of the model while accounting for complexities such as unexpected forces identified in the feedback that the model would not capture.
This doc page shows a similar design: https://www.mathworks.com/help/mpc/gs/what-is-mpc.html
Disclaimer: I'm no expert but I have modeled similar predictive controllers in graduate school using monkeys trained to steer through a virtual environment. But for my work, much of the control system was latent, hidden in organic neural networks ;)
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!