Specifications

5 Designing and Testing Controllers in Simulink
5-24
In the upper plot, the cyan curve is the desired position. It starts at -5. The M1
position (yellow) starts at 0. Under the control of MPC1, M1 moves rapidly towards the
desired position. M2 (magenta) starts at 10 and begins moving in the same direction.
At about t = 13 seconds, M2 collides with M1. The switching signal (lower plot)
changes at this instant from 1 to 2, so MPC2 takes over.
The completely inelastic collision moves M1 away from its desired position and M2
remains joined to M1. Controller MPC2 adjusts the applied force (middle plot) so M1
quickly returns to the desired position.
When the desired position changes step-wise to 5, the two masses separate briefly,
with the controller switching to MPC1 appropriately. But, for the most part, the two
masses move together and settle rapidly at the desired location. The transition back
to —5 is equally well behaved.
Suppose we force MPC2 to operate under all conditions.
The figure below shows the result.