Issue with Adaptive MPC in Simulink Using Online Pure Pursuit for Reference Path Generation
Hi there 🙂
I am facing an issue with my Simulink model, where an adaptive MPC controls the longitudinal and lateral dynamics of a vehicle with all-wheel steering and all-wheel drive. The MPC uses future reference values over the next 10 simulation steps within its prediction horizon. These reference paths are structured as [10×3] matrices, consisting of X, Y positions and orientation (Psi) in a 2D coordinate system.
Here’s my workflow:
I use a hybrid A* algorithm to generate a global path.
I use Pure Pursuit (PP) to create a local path from the current position to the LookAhead Point. PP runs in a loop 10 times to generate the structure of 10 future points for the MPC at each time step.
When using PP with an initial position that deviates from the global path, it successfully generates a meaningful local path leading to the global path and follows it accurately. If I pass this path offline to the MPC, the controller performs as expected, closely following the path.
Problem:
When I run the PP online in parallel with the MPC, feeding it the current positions from the plant system, I observe a discrepancy:
The PP outputs appear correct and provide reasonable reference suggestions.
However, the MPC seems not to implement these references properly.
Interestingly, the MPC produces different control signals when the reference path is generated online versus offline, even though the data and its structure ([10×3]) are identical in both cases.
Key Observations:
Offline paths work perfectly with the MPC.
Online paths generated by PP lead to unexpected MPC behavior, even though the output of PP looks correct.
Questions:
What could cause the adaptive MPC to behave differently when using online reference paths, despite their structure and data being identical to offline paths?
Are there specific considerations for feeding dynamically generated paths into an adaptive MPC during runtime?
Could this issue be related to timing, delays, or synchronization between the PP and MPC blocks in Simulink?
Any insights, suggestions, or debugging tips would be greatly appreciated!
Many thanks in advance and kind regards,
DanusHi there 🙂
I am facing an issue with my Simulink model, where an adaptive MPC controls the longitudinal and lateral dynamics of a vehicle with all-wheel steering and all-wheel drive. The MPC uses future reference values over the next 10 simulation steps within its prediction horizon. These reference paths are structured as [10×3] matrices, consisting of X, Y positions and orientation (Psi) in a 2D coordinate system.
Here’s my workflow:
I use a hybrid A* algorithm to generate a global path.
I use Pure Pursuit (PP) to create a local path from the current position to the LookAhead Point. PP runs in a loop 10 times to generate the structure of 10 future points for the MPC at each time step.
When using PP with an initial position that deviates from the global path, it successfully generates a meaningful local path leading to the global path and follows it accurately. If I pass this path offline to the MPC, the controller performs as expected, closely following the path.
Problem:
When I run the PP online in parallel with the MPC, feeding it the current positions from the plant system, I observe a discrepancy:
The PP outputs appear correct and provide reasonable reference suggestions.
However, the MPC seems not to implement these references properly.
Interestingly, the MPC produces different control signals when the reference path is generated online versus offline, even though the data and its structure ([10×3]) are identical in both cases.
Key Observations:
Offline paths work perfectly with the MPC.
Online paths generated by PP lead to unexpected MPC behavior, even though the output of PP looks correct.
Questions:
What could cause the adaptive MPC to behave differently when using online reference paths, despite their structure and data being identical to offline paths?
Are there specific considerations for feeding dynamically generated paths into an adaptive MPC during runtime?
Could this issue be related to timing, delays, or synchronization between the PP and MPC blocks in Simulink?
Any insights, suggestions, or debugging tips would be greatly appreciated!
Many thanks in advance and kind regards,
Danus Hi there 🙂
I am facing an issue with my Simulink model, where an adaptive MPC controls the longitudinal and lateral dynamics of a vehicle with all-wheel steering and all-wheel drive. The MPC uses future reference values over the next 10 simulation steps within its prediction horizon. These reference paths are structured as [10×3] matrices, consisting of X, Y positions and orientation (Psi) in a 2D coordinate system.
Here’s my workflow:
I use a hybrid A* algorithm to generate a global path.
I use Pure Pursuit (PP) to create a local path from the current position to the LookAhead Point. PP runs in a loop 10 times to generate the structure of 10 future points for the MPC at each time step.
When using PP with an initial position that deviates from the global path, it successfully generates a meaningful local path leading to the global path and follows it accurately. If I pass this path offline to the MPC, the controller performs as expected, closely following the path.
Problem:
When I run the PP online in parallel with the MPC, feeding it the current positions from the plant system, I observe a discrepancy:
The PP outputs appear correct and provide reasonable reference suggestions.
However, the MPC seems not to implement these references properly.
Interestingly, the MPC produces different control signals when the reference path is generated online versus offline, even though the data and its structure ([10×3]) are identical in both cases.
Key Observations:
Offline paths work perfectly with the MPC.
Online paths generated by PP lead to unexpected MPC behavior, even though the output of PP looks correct.
Questions:
What could cause the adaptive MPC to behave differently when using online reference paths, despite their structure and data being identical to offline paths?
Are there specific considerations for feeding dynamically generated paths into an adaptive MPC during runtime?
Could this issue be related to timing, delays, or synchronization between the PP and MPC blocks in Simulink?
Any insights, suggestions, or debugging tips would be greatly appreciated!
Many thanks in advance and kind regards,
Danus mpc MATLAB Answers — New Questions
​