Issue with Adaptive MPC in Simulink Using Online Pure Pursuit for Reference Path Generation

4 views (last 30 days)
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 [10x3] matrices, consisting of X, Y positions and orientation (Psi) in a 2D coordinate system.
Here’s my workflow:
  1. I use a hybrid A* algorithm to generate a global path.
  1. 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 ([10x3]) 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:
  1. What could cause the adaptive MPC to behave differently when using online reference paths, despite their structure and data being identical to offline paths?
  1. Are there specific considerations for feeding dynamically generated paths into an adaptive MPC during runtime?
  1. 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

Accepted Answer

Kothuri
Kothuri on 22 Jan 2025
Hi Danus,
You can try the below steps to rectify the issue:
  • Ensure that the dynamically generated path is updated at the same sampling rate as the MPC. If the Pure Pursuit (PP) path generation is slower than the MPC sampling time, the MPC might operate on outdated reference paths.
  • Use buffers or zero-order hold (ZOH) blocks to ensure proper alignment of data.
  • Monitor the execution time of PP and ensure it completes within one MPC sampling period.
  • Ensure that the reference path points are expressed in the same coordinate system as the MPC's states. Misalignment in coordinate frames (global vs. local) can lead to incorrect predictions.
  • Plot both online and offline reference paths alongside the plant's trajectory to ensure they are identical at every time step.
  • Ensure that both PP and MPC blocks operate in real-time without overruns.
You can refer the below documentation links for more info:

More Answers (0)

Tags

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!