Why is the MPC's response so early?

55 Views Asked by At

I have a little question, I have designed an MPC to follow the reference trajectory, but I don't know why my MPC reacts so early. my Sampling time is 0.1s, the prediction step and the control step are Np=Nc=40, in this case, the weighting factor for input is set to 0. Does anyone know why the curve looks like this? How could I do, if I want the trajectory begins from the reference trajectory?enter image description here

1

There are 1 best solutions below

3
On

You are using reference preview (i.e. you know the future changing reference) and here it is optimal to start moving before the reference changes (since the system reacts slowly), in order to achieve optimal performance in the long run. Roughly speaking you want to minimize the area between the yellow and red curve, and it is better to spread out that error on both sides, instead of lagging too much on one side (you probably have a quadratic measure, but the idea is the same)

Think of driving a car and approaching an uphill. You start accelerating before you enter the hill since you know the car will slow down soon.