Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to add a disturbance input block in Simulink.
Simulink
add_block('simulink/Sources/[1]', 'model/Disturbance')
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a 'Constant' block which does not simulate a disturbance change.
Using 'Sine Wave' which is periodic, not a step disturbance.
✗ Incorrect
The 'Step' block is commonly used to simulate a disturbance input in Simulink models.
2fill in blank
mediumComplete the code to connect the disturbance block to the plant input.
Simulink
add_line('model', 'Disturbance/1', '[1]/1')
Attempts:
3 left
💡 Hint
Common Mistakes
Connecting disturbance to the controller input instead of the plant.
Connecting disturbance to the sensor which measures output.
✗ Incorrect
The disturbance affects the plant input, so the line connects to the 'Plant' block.
3fill in blank
hardFix the error in the code to correctly set the disturbance amplitude parameter.
Simulink
set_param('model/Disturbance', '[1]', '5')
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Frequency' which does not exist for Step block.
Using 'SampleTime' which controls timing, not amplitude.
✗ Incorrect
The 'Amplitude' parameter sets the disturbance strength for the Step block.
4fill in blank
hardFill both blanks to create a feedback loop that rejects disturbance.
Simulink
add_line('model', '[1]/1', '[2]/1', 'autorouting', 'on')
Attempts:
3 left
💡 Hint
Common Mistakes
Connecting plant output directly to summation input.
Connecting output block instead of controller.
✗ Incorrect
The controller output connects to the summation block input to form feedback for disturbance rejection.
5fill in blank
hardFill all three blanks to define a disturbance rejection test scenario.
Simulink
set_param('model/Disturbance', '[1]', '10'); set_param('model/Controller', '[2]', '1'); add_line('model', '[3]/1', 'Plant/1')
Attempts:
3 left
💡 Hint
Common Mistakes
Using Frequency instead of Amplitude for disturbance.
Connecting wrong blocks in add_line function.
✗ Incorrect
Set disturbance amplitude to 10, controller gain to 1, and connect disturbance output to plant input.
