Specifications
5 Designing and Testing Controllers in Simulink
5-20
The lower part contains the following key elements:
• A pulse generator that supplies the desired M1 position (the controller reference
signal). The output of the pulse generator is a square wave that varies between —5
and 5, with a frequency of 0.015 per second.
• Simulation of a contact sensor. When the two masses have the same position, the
Compare to Constant block evaluates to true and the Add1 block converts this to a 2.
Else, the output of Add1 is 1.
• The Multiple MPC Controllers block, which has four inputs. The measured output
(mo), reference (ref) and measured disturbance (md) inputs are as for the MPC
Controller block. The distinctive feature of the Multiple MPC Controllers block is the
switch input.
The figure below shows the Multiple MPC Controllers block mask for this example.