0% found this document useful (0 votes)
2 views2 pages

Lab Activity 7

The document outlines a lab activity focused on reducing multiple subsystems in control system modeling using Python. It includes objectives to identify coding errors, apply block diagram algebra, and simulate step responses, with detailed code examples for each part. Additionally, it poses questions for individual reports regarding system reduction, coding errors, simulation importance, debugging strategies, and real-world applications of control systems.

Uploaded by

Sammy Eliahs Daz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Lab Activity 7

The document outlines a lab activity focused on reducing multiple subsystems in control system modeling using Python. It includes objectives to identify coding errors, apply block diagram algebra, and simulate step responses, with detailed code examples for each part. Additionally, it poses questions for individual reports regarding system reduction, coding errors, simulation importance, debugging strategies, and real-world applications of control systems.

Uploaded by

Sammy Eliahs Daz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab Activity 7: Reduction of Multiple Subsystems

Objectives:
1. Identify and correct coding errors in Python scripts related to control system modeling.
2. Apply principles of block diagram algebra to combine multiple subsystems into a single transfer function.
3. Simulate and interpret the step response of a reduced control system.

Part 1
The output will be a step response plot of the reduced system. The plot will show the time-domain behavior (amplitude vs.
time) of the combined control system, giving students a clear visual of system dynamics.
Code
import controls as ctrl
G1 = ctrl.tf([1, 3], [1, 5, 6])
G2 = ctrl.tf([2], [1, 0])
G3 = ctrl.tf([1], [1, 4])
series_1_2 = ctrl.ser(G1, G2)
system_with_feedback = ctrl.feedback(series_1_2 + G3)
K = 10
overall_system = ctrl.parallel(system_with_feedback, K)
time = linspace(0, 10, 1000)
y, t = ctrl.step_resp(overall_system, T=time)
plt.plot(t, y)
plt.titel("Step Response of Reduced System")
plt.xlabels("Time (s)")
plt.ylabels("Amplitude")
plt.show()

Part 2
The script will model a composite control system using series and feedback connections. Reduce it to a single transfer
function. Plot the step response, which shows how the system responds over time to a step input.
Code
import numpy as np
import matplotlib.pylot as plt
from controls import tf, series, feedback
G1 = tf([1], [1, 2])
G2 = tf([3], [1, 0])
G3 = tf([2, 5], [1, 3, 2])
G4 = tf(4, 1)
P1 = series(G1, G2)
P2 = series(G3 + G4)
closed_loop = feedback(P1, P2, sign=1)
final_tf = series(closed_loop + 5)
T = np.linespace(0, 10, 1000)
t, y = ctrl.step_response(final_tf, T=T)
plt.plot(t, y)
plt.title("Closed Loop Step Response")
plt.xlabel("Time (s)")
plt.ylabel("Output")
plt.grid(True)
plt.show()
Part 3
The script will model a multi-stage control system by connecting five transfer function blocks using series, parallel, and
feedback operations. These subsystems represent a realistic and moderately complex control system configuration. Once
combined and reduced into a single system, the script will simulate a step response over a time span of 0 to 15 seconds.

The output will be a graph showing how the system reacts over time to a unit step input. Depending on the system
configuration, this plot could exhibit characteristics such as overshoot, damping, rise time, and steady-state value, which are
typical markers of system performance. This gives students the opportunity to analyze dynamic behavior and stability in a real-
world-like control scenario.

Code
import numpy as np
import matplotlib.pyplot as pltt
import cntrol
from cntrol import tf, Feedback, seriez, parallel
G1 = tf([1, 4], [1 2 3])
G2 = tf([1], [1, 0, 5])
G3 = tf([2 3], [1, 1])
G4 = tf(5, [1])
G5 = tf([1, 1], 1)
block_1 = seriez(G1, G2)
block_2 = G3 * G4
block_3 = parrallel(block_1 block_2)
loop_closed = Feedback(block_3, G5, sign=0)

final_result = series(loop_closed, tf(2))

t = np.linspace(0, 15, 1000)


y, time = cntrol.step(final_result, time=t)

pltt.plot(y, time)
pltt.Title("Step responce: Final")
pltt.xlable("Time")
pltt.ylable("Output")
plt.grid(on)
pltt.display()

*same format as to the previous progress reports

QUESTIONS (for Individual Report)


1. Describe the process of reducing a complex control system into a single transfer function using series, parallel, and
feedback configurations. Why is this reduction important in control systems analysis and design?
2. Explain how coding errors, such as incorrect library imports or misuse of functions, can affect the accuracy and
reliability of a control system simulation. Use examples from the debugging activity to support your response.
3. Discuss the importance of simulating step responses in control system design. What information does a step
response provide, and how can engineers use it to evaluate system performance?
4. Reflect on your debugging strategy during the Python control system activity. What approach did you take to identify
and fix errors? What types of errors did you find most challenging, and why?
5. Control systems are used in various engineering applications—from robotics to aerospace. Choose one real-world
example and describe how control system modeling and simulation could be applied to improve its performance or
stability.

You might also like