Hardware Oriented
Hardware Implementation and Analysis of a PID Controlled System
Aim
- To implement a second-order plant using op-amp circuits.
- To realize P, PI, PD, and PID controllers using analog hardware.
- To study the effect of Kp, Ki, and Kd on system response.
- To observe time-domain performance using an oscilloscope.
Apparatus & Software
| Sl. No. | Apparatus / Software | Technical Specification | Quantities |
|---|---|---|---|
| 1 | Operational Amplifiers (Op-Amps) | Standard laboratory op-amp ICs (e.g., LM741 / TL071) | As required |
| 2 | Resistors and Capacitors | 10 kΩ, 5 kΩ, 100 kΩ resistors; 10 µF capacitors | As required |
| 3 | DC Power Supply | ±12 V dual supply | 1 |
| 4 | Oscilloscope | Digital / Analog, dual-channel | 1 |
| 5 | Function Generator | For step input signal generation | 1 |
| 6 | Breadboard and Connecting Wires | — | As required |
Theory
A mass-spring-damper system is a standard example of a second-order dynamic system. It consists of a mass, a spring, and a damper, and its motion is governed by the differential equation:
where m is the mass, b is the damping coefficient, k is the spring constant, and f(t) is the applied force. Taking the Laplace transform (assuming zero initial conditions), the transfer function is:
For practical hardware implementation, the transfer function is chosen as:
This represents a stable and overdamped second-order system. The mechanical system is implemented using analog op-amp circuits: two cascaded integrators realize the double integration of the state equation, while a summing amplifier combines the damping and stiffness feedback terms. Scaling factors are introduced to keep voltage levels within the ±12 V op-amp rail limits.
The output of a PID controller is given by:
where e(t) is the error signal, and Kp, Ki, and Kd are the proportional, integral, and derivative gains respectively. In analog hardware, the PID controller is realized using an inverting amplifier for proportional control, an integrator circuit for integral action, and a differentiator circuit for derivative action. Kp is adjusted using a proportional potentiometer, Ki is varied by changing the resistance in the integrator circuit, and Kd is controlled by adjusting the resistance in the differentiator circuit.
Pre-Lab / Circuit Diagram

Figure 1: Complete closed-loop PID control system implementation using operational amplifiers.

Figure 2: Op-amp based mass-spring-damper plant realization. The circuit uses two cascaded integrators (10 kΩ / 10 µF and 100 kΩ / 10 µF), a summing amplifier with 5 kΩ and 10 kΩ feedback resistors, powered by a ±12 V dual supply, to realize X(s)/F(s) = 10 / (s² + 10s + 20).
Procedure
- Assemble the op-amp based mass-spring-damper plant on the breadboard as per the circuit diagram using the specified resistor and capacitor values.
- Apply a step input (low-frequency square wave of appropriate amplitude) from the function generator to the plant input.
- Connect the oscilloscope to the plant output and verify the open-loop overdampedoverdampedA system response that returns to steady state slowly without oscillating. Occurs when damping exceeds the critical value (ζ > 1). step response.
- Realize the proportional (P) controller by connecting an inverting amplifier with adjustable gain Kp in the forward path. Observe and record the closed-loop step response.
- Extend the circuit to a PI controller by adding an integrator stage in parallel with the proportional path. Adjust Ki and observe the effect on steady-state error.
- Extend to a PD controller by adding a differentiator stage. Adjust Kd and observe the improvement in damping and reduction of overshoot.
- Combine all three actions to realize the full PID controllerpid controllerA generic control loop feedback mechanism (Proportional-Integral-Derivative) widely used in industrial control systems to continuously calculate an error value and apply a precise dynamic correction.. Tune Kp, Ki, and Kd to achieve the best overall response.
- For each controller configuration, record the oscilloscope waveform and note the qualitative changes in rise timerise timeThe time required for a system's transient response to rise from 10% to 90% (typically for overdamped systems) or 0% to 100% (for underdamped systems) of its final steady-state value., overshoot, settling timesettling timeThe time required for a system's response curve to reach and permanently stay within a specified tolerance band (usually 2% or 5%) of the final steady-state value., and steady-state error.
- Tabulate and compare the observed effects of increasing each gain parameter on the system response.
Simulation / Execution (Not Applicable)
This section is not required for this experiment.
Observations
The effect of each controller gain on key time-domain performance parameters was recorded and is summarized below.
| Parameter | Increase Kp | Increase Ki | Increase Kd |
|---|---|---|---|
| Rise Time | Decreases | Slight decrease | Slight decrease |
| Overshoot | Increases | Increases | Decreases |
| Settling Time | Small change | Increases | Decreases |
| Steady-State Error | Decreases | Eliminates | Small change |
| Stability | Reduces | Reduces | Improves |
Oscilloscope waveforms were captured for three different controller configurations.

Figure 2: Observed oscilloscope response — Configuration 1.

Figure 3: Observed oscilloscope response — Configuration 2.

Figure 4: Observed oscilloscope response — Configuration 3.
Calculations
The plant transfer function parameters are derived from the chosen component values. With m = 1, b = 10, k = 20:
Since ζ > 1, the open-loop plant is overdamped. The two real poles are located at:
Results & Analysis
The PID controller realized using operational amplifiers significantly improves the overall system performance compared to P, PI, and PD controllers.
- Proportional (P) control reduced rise time but introduced overshoot and left a residual steady-state error.
- Integral (I) action (PI controller) eliminated steady-state error but adversely affected stability and increased settling time.
- Derivative (D) action (PD controller) improved damping, reduced overshoot, and decreased settling time.
- The combined PID controller provided the best overall performance: fast rise, reduced overshoot, short settling time, and zero steady-state error.
- The observed oscilloscope waveforms confirmed the qualitative trends predicted by the gain-effect table.
Conclusion
In this experiment, a second-order system based on the mass-spring-damper model was successfully implemented using operational amplifier circuits. The theoretical model was translated into an equivalent electrical analog using integrators and summing amplifiers, allowing the dynamic behavior of the system to be observed in real time. The implemented system exhibited stable and overdamped characteristics, validating the chosen parameters and design approach.
Various controllers including P, PI, PD, and PID were realized using analog hardware components. Each controller was studied by observing its effect on system response using an oscilloscope. Proportional controlproportional controlA control strategy that produces an output proportional to the current error value (P-action). It helps decrease rise time but cannot eliminate steady-state error completely. reduced rise time but introduced overshoot; integral controlintegral controlA control strategy that produces an output proportional to the accumulated error over time (I-action). It uniquely eliminates steady-state error but may degrade stability and increase overshoot. eliminated steady-state error but affected stability; derivative controlderivative controlA control strategy producing an output proportional to the rate of change of the error (D-action). It anticipates future errors to dampen system oscillations, reducing overshoot and settling time. improved damping and reduced overshoot. The combined PID controller provided the best overall performance by balancing all these effects, making it highly suitable for practical control applications.
Post-Lab / Viva Voce
- Q: Why is the mass-spring-damper system used as the plant in this experiment, and how is it electrically analogous to a series RLC circuit?
A: The mass-spring-damper governing equation m·ẏ + b·ẁ + k·x = f(t) has the same mathematical form as the series RLC voltage equation L·ẏ + R·ẁ + (1/C)·q = v(t), where mass m corresponds to inductance L, damping coefficient b to resistance R, spring constant k to 1/C, applied force f(t) to voltage v(t), and displacement x(t) to charge q(t). This electrical analogy allows the mechanical system to be physically implemented using op-amp integrator and summing circuits, enabling real-time observation of mechanical dynamics using standard electrical instruments without requiring actual mechanical components. - Q: In the op-amp realization of the plant, why are two cascaded integrators used, and how do the summing amplifier feedback connections set the values of damping b and stiffness k?
A: The governing equation is rearranged as ẏ = [f(t) − b·ẁ − k·x]/m, expressing the highest derivative in terms of lower-order signals. The first integrator integrates ẏ to produce ẁ, and the second integrates ẁ to produce x. The summing amplifier reconstructs ẏ by combining f(t), the −b·ẁ damping feedback (scaled by b/m), and the −k·x stiffness feedback (scaled by k/m). For the transfer function 10/(s²+10s+20), the summing amplifier feedback resistors are chosen so that the damping term coefficient equals 10 and the stiffness term equals 20. - Q: Why does the proportional controller alone always leave a non-zero steady-state error for a step input, and how does the integral term eliminate it?
A: With a P controller, the control output is u(t) = Kp·e(t). At steady state, a non-zero error ess must persist so that Kp·ess provides the necessary control output to hold the plant at the correct output. The integral term Ki·∫e(t)dt accumulates even a very small error over time, building up a non-zero control output until the error is driven exactly to zero. At steady state, the integral term holds the required control output while e(t) = 0, thereby eliminating steady-state error entirely. - Q: What is integrator windup and what is its practical consequence in the hardware op-amp PID circuit?
A: Integrator windup occurs when the integrator output accumulates to a large value during a period when the controller output is saturated at the op-amp rail (±12 V in this experiment). When the error eventually reverses sign, the large accumulated integral takes a long time to unwind, causing excessive overshoot and delayed settling. In the hardware circuit, this manifests as the op-amp rail-saturating during the initial transient; the integrator capacitor charges to a large voltage, and the response exhibits significant overshoot even after the error reverses. Practical anti-windup schemes include clamping the integrator output or using back-calculation of the integrator state. - Q: Why is a pure differentiator problematic in the hardware PID circuit and what modification is typically made?
A: A pure differentiator has a transfer function Kd·s whose gain grows without bound with frequency (magnitude = Kd·ω). High-frequency noise in the error signal (from measurement, supply ripple, or quantization) is amplified by this unbounded gain, producing a large noisy derivative signal that can destabilize the system. The standard modification is a first-order filtered derivative: D(s) = Kd·s/(τf·s + 1), implemented by adding a small resistor in series with the feedback capacitor of the differentiator op-amp. The filter time constanttime constantA measure of how quickly a circuit responds to change. For RC circuits, τ = RC; for RL circuits, τ = L/R. After one time constant, the response reaches ~63% of its final value. τf attenuates high-frequency noise while still providing useful derivative action within the control bandwidth. - Q: Given the plant G(s) = 10/(s²+10s+20), derive the closed-loop transfer function with C(s) = Kp and find the Kp for critically dampedcritically dampedA system response that returns to steady state as fast as possible without oscillating. Occurs when the damping ratio exactly equals one (ζ = 1). closed-loop response.
A: The closed-loop transfer function with unity feedback is T(s) = 10Kp / (s² + 10s + 20 + 10Kp). The characteristic equationcharacteristic equationThe polynomial equation derived from a circuit's differential equation whose roots determine the natural (transient) response behavior of the system. is s² + 10s + (20 + 10Kp) = 0. Comparing with s² + 2ζωn·s + ωn² = 0: ωn = √(20 + 10Kp) and ζ = 5/√(20 + 10Kp). For critical damping ζ = 1: 5/√(20 + 10Kp) = 1 → 20 + 10Kp = 25 → Kp = 0.5. A proportional gain of Kp = 0.5 places the closed-loop system at critical damping with ωn = 5 rad/s and a double pole at s = −5.
References & Resources (Not Applicable)
This section is not required for this experiment.
Was this experiment helpful?
Your feedback helps us improve
Please Sign In to rate this experiment.