0
0
Simulinkdata~10 mins

Speed control with PID in Simulink - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the proportional gain of the PID controller.

Simulink
pid_controller.Kp = [1];
Drag options to blanks, or click blank then click option'
A5
B0.8
C1.5
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Using a very high Kp can cause the system to oscillate.
Setting Kp to zero means no proportional control.
2fill in blank
medium

Complete the code to set the integral gain of the PID controller.

Simulink
pid_controller.Ki = [1];
Drag options to blanks, or click blank then click option'
A0.1
B2
C0
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting Ki too high can cause overshoot and oscillations.
Setting Ki to zero disables integral action.
3fill in blank
hard

Fix the error in setting the derivative gain of the PID controller.

Simulink
pid_controller.Kd = [1];
Drag options to blanks, or click blank then click option'
A0.05
B-0.1
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using a negative derivative gain causes the system to become unstable.
Setting Kd too high amplifies noise.
4fill in blank
hard

Fill both blanks to create a dictionary of PID gains and check if the proportional gain is greater than 1.

Simulink
pid_gains = {'P': [1], 'I': [2]
if pid_gains['P'] [3] 1:
    print('High proportional gain')
Drag options to blanks, or click blank then click option'
A0.9
B>
C0.1
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong comparison operator like '<' instead of '>'.
Mixing up the gain values in the dictionary.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps each gain name to its value if the value is greater than zero.

Simulink
filtered_gains = {name: value for name, value in pid_gains.items() if value [1] 0 and name != [2] and name != [3]
Drag options to blanks, or click blank then click option'
A>
B'D'
C'I'
D'P'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong comparison operators like '<'.
Forgetting to exclude the correct gain names.