Labs

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Lab 03: Time Domain Analysis of First Order Systems step by step:

Objective

• To obtain and analyze the step, impulse, and ramp responses of a given first-order system.

• To determine the system parameters (time constant τ\tauτ and DC gain KKK) using the step
response.

Step 1: Understanding the Transfer Function

A first-order system is given by:

G(s)=Kτs+1G(s) = \frac{K}{\tau s + 1}G(s)=τs+1K

Where:

• KKK: DC gain (ratio of steady-state output to steady-state input),

• τ\tauτ: Time constant (time taken to reach 63% of the final value),

• sss: Laplace transform variable.

Step 2: Experiment Details

For the given system, perform the following procedures in the lab:

Step Response

1. Setup:

o Connect the system to the power supply and apply a 10 Hz square wave as the input.

o Gradually increase the frequency until you observe a damped response.

2. Measurement:

o Observe the system output and note the steady-state value of the response.

o Determine τ\tauτ: the time it takes for the system to reach 63%63\%63% of its final
value.

o Compute KKK: the steady-state value of the output divided by the input amplitude.

3. Plotting:

o Record the output response and plot it against time.

o The plot should resemble an exponentially rising curve approaching the steady-state
value.
4. Simulation:

o Use MATLAB to simulate the step response of the derived transfer function:
G(s)=Kτs+1G(s) = \frac{K}{\tau s + 1}G(s)=τs+1K

o Compare the simulation with the practical response.

Impulse Response

1. Setup:

o Adjust the duty cycle of the square wave such that the "on" time becomes very small,
approximating an impulse input.

o Apply this to the system.

2. Observation:

o The output should exhibit a sharp peak followed by an exponential decay.

3. Plotting:

o Plot the impulse response.

Ramp Response

1. Setup:

o Apply a 10 Hz triangular wave to the input terminal.

o Gradually increase the frequency to observe a proper ramp-like response.

2. Measurement:

o Measure the deviation of the system’s output from the ramp input.

o Identify the response shape and determine if it matches a ramp response.

3. Plotting:

o Record and plot the ramp response.

Step 3: System Parameter Identification

Using the step response:

1. Determine KKK:

o The steady-state output value divided by the input amplitude gives KKK.
2. Determine τ\tauτ:

o Measure the time it takes for the output to reach 63%63\%63% of its final value.

Step 5: Calculations

1. Step Response Example:

2. Impulse Response Example:

o Initial peak response and exponential decay recorded and plotted.

3. Ramp Response Example:

o Deviation and response linearity observed and plotted.

Final Report

Summarize all plots, calculations, and MATLAB simulation comparisons in your lab report. Ensure you
comment on discrepancies between theoretical and practical results and suggest possible reasons (e.g.,
system noise, delays, hardware limitations).
• To analyze the step, impulse, and ramp responses of a second-order system.

• To identify system parameters using the step response.

Prerequisites:

• Circuit analysis theory.

• Familiarity with basic lab instruments.

Theory:

Second-Order Systems:

A system is termed second-order if the highest power of sss in the denominator of its transfer function
is 2.

The standard form of a second-order transfer function is:

G(s)=ωn2s2+2ζωns+ωn2G(s) = \frac{\omega_n^2}{s^2 + 2\zeta\omega_n s +


\omega_n^2}G(s)=s2+2ζωns+ωn2ωn2

Where:

• ωn\omega_nωn: Natural frequency.

• ζ\zetaζ: Damping ratio.

System classification based on ζ\zetaζ:

1. 0<ζ<10 < \zeta < 10<ζ<1: Under-damped.

2. ζ=1\zeta = 1ζ=1: Critically damped.

3. ζ>1\zeta > 1ζ>1: Over-damped.

4. ζ=0\zeta = 0ζ=0: Undamped.

Step Response:

A step signal transitions instantaneously from one value to another. The system’s step response
reveals key characteristics like rise time, overshoot, and settling time.

Procedure:

1. Connect the plant (system under test) to a power supply.

2. Apply a 10 Hz square wave to the input terminal of the system.

3. Gradually increase the frequency until a clear damped response is observed.


4. Plot the response on the provided graph.

Impulse Response:

An impulse signal has an instantaneous value change from zero to infinity. The impulse response
characterizes the system completely if it is linear and time-invariant (LTI).

Procedure:

1. Decrease the duty cycle of the square wave from the step response to approximate an impulse
input.

2. Apply the signal to the input terminal and observe the system's response.

3. Plot the response on the provided graph.

Ramp Response:

A ramp signal increases linearly with time. The system's ramp response deviates by a constant time lag
TTT.

Procedure:

1. Apply a 10 Hz triangular wave to the input terminal.

2. Increase the frequency until the response resembles the theoretical ramp response.

3. Plot the response on the provided graph.

System Identification Using Step Response:

System identification estimates system parameters based on input-output data. The step response
characteristics such as overshoot, rise time, and settling time are key to identifying parameters like:

• Damping ratio (ζ\zetaζ): Related to percent overshoot.

• Natural frequency (ωn\omega_nωn): Derived from oscillation frequency.

• DC Gain: Ratio of steady-state output to input.

Procedure:

1. Measure step response characteristics (overshoot, rise time, steady-state value, etc.).

2. Compute the damping ratio (ζ\zetaζ) and natural frequency (ωn\omega_nωn).

3. Derive the transfer function.

4. Simulate the step response in MATLAB and compare it with the experimental response.
Lab Task #1: Sensor Calibration

Objective: Calibrate the PT100 temperature sensor to establish a relationship between temperature and
output voltage (1V per 10°C).

Key Steps:

1. Use a multimeter to measure and set resistance at two reference points (0°C and 100°C).

2. Adjust trimmers for offset and gain to ensure proper calibration.

3. Verify the output voltage corresponds to the calibrated temperature values (0V for 0°C and 10V
for 100°C).

Expected Result:

• Accurate sensor calibration ensures precise temperature readings for subsequent control tasks.

Lab Task #2: Design an On/Off Controller

Objective: Implement a basic On/Off controller to maintain the water temperature at a set point.

Key Steps:

1. Establish connections for the water pump, heater driver, and temperature sensor.

2. Set the desired temperature (Set Point) to 40°C (4V).

3. Monitor the temperature's rise and fall cycles using the voltmeter and note the corresponding
up and down times in Table 20.1.

4. Observe the behavior of the On/Off controller as the heater activates/deactivates around the set
point.

Expected Result:

• Oscillations in temperature within the hysteresis band due to the controller toggling the heater.

Lab Task #3: Design Two-Position On/Off Controller

Objective: Modify the On/Off controller by incorporating a 25% hysteresis.

Key Steps:

1. Set the hysteresis percentage to 25%, ensuring a wider error band.

2. Repeat the observations from Task #2, now with a modified hysteresis band.

3. Record the up and down times, upper and lower temperature limits in the table.

Expected Result:

• Wider hysteresis reduces the frequency of switching but allows for greater temperature
oscillations around the set point.
Analysis & Observations

Hysteresis Diagram

• Fig. 20.3 and Fig. 20.4 will illustrate the characteristic behavior of the On/Off controller,
showcasing the upper and lower limits around the set point.

• The hysteresis band creates a dead zone where the controller does not switch, avoiding rapid
toggling and increasing system stability.

Performance Metrics

1. Up Limit (Set Point): Maximum temperature the system reaches before the heater switches off.

2. Lower Limit: Minimum temperature the system reaches before the heater switches on.

3. Temperature Rising/Falling Times: The time taken for the system to heat or cool within the
hysteresis band.

Expected Behavior

1. Without hysteresis (H=0% H = 0\%H=0%):

o Frequent switching of the heater, potentially causing wear and tear.

o Minimal temperature variation but at the cost of system stability.

2. With hysteresis (H=25% H = 25\%H=25%):

o Reduced switching frequency, leading to more stable operation.

o Increased temperature variation around the set point.

Diagrams

The hysteresis diagrams should clearly depict:

1. The set point (TspT_{sp}Tsp).

2. The upper limit (TupT_{up}Tup) and lower limit (TlowT_{low}Tlow).

3. Temperature oscillations within the hysteresis band.

Key Takeaways

1. An On/Off controller with hysteresis is simple and cost-effective but may not be suitable for
processes requiring tight control.
2. Calibration is critical to ensure accurate sensor readings, forming the foundation for effective
control.

3. Observing the system's performance with and without hysteresis highlights the trade-offs
between stability and precision.
Lab Task #01: Close-loop Transfer Function

1. Circuit Connection: Assemble the circuit as described.

2. Adjust Proportional Gain:

o Set Kp=1K_p = 1Kp=1.

3. Set Set-point:

o Set the water level set-point to 10 cm10 \, \text{cm}10cm (corresponds to 5 on the


system scale).

4. Measurement and Data Collection:

o Connect the voltmeter to the level sensor's output and ground.

o Start the chronometer simultaneously with the power supply.

o Wait for the system to stabilize at the desired water level.

o Record the sensor's output value and the time taken to reach the final value.

5. Calculate Time Constant:

o τ=Settling Time5\tau = \frac{\text{Settling Time}}{5}τ=5Settling Time.

Transfer Function Derivation

For a first-order system with proportional control: G(s)=Kτs+1G(s) = \frac{K}{\tau s + 1}G(s)=τs+1K Where:

• KKK is the system gain (recorded from the sensor output).

• τ\tauτ is the time constant (calculated from the settling time).

Lab Task #02: Overcoming Disturbance

1. System with Disturbance Block:

o Insert a disturbance block into the closed-loop system.

o Simulate how the system reacts to disturbances with Kp=1K_p = 1Kp=1.

2. Design Adjustments:

o Increase KpK_pKp to improve disturbance rejection. Be cautious of system damping and


potential instability.

o Recalculate the closed-loop transfer function for the new KpK_pKp.

Lab Task #03: Implementation on Instrumentation Trainer

1. Setup on Trainer:

o Replicate the designed proportional control system on the trainer.


o Open the drain valve to introduce dynamic changes in water level.

2. Observe System Behavior:

o Measure the water level and response time.

o Adjust KpK_pKp on the trainer to achieve desired performance.

3. Record Observations:

o Compare practical performance with simulation results.

General Notes for Calculation Section

1. Use your recorded values for:

o System gain KKK,

o Settling time TsT_sTs,

o Time constant τ\tauτ,

o Proportional gain KpK_pKp.

2. Provide detailed steps for each calculation in the report.


Lab 09: Applying Ziegler-Nichols PID Tuning Rule to Control the Position of Ball on the Beam

Objective

To familiarize attendees with the Ziegler-Nichols PID tuning rule and apply it to control the position of
the ball on a beam.

Theory

PID Controller

A PID controller uses three components:

• Proportional (P): Provides output proportional to the error.

• Integral (I): Addresses accumulated past errors.

• Derivative (D): Predicts future errors based on the current rate of change.

The general transfer function of a PID controller is:

Gc(s)=Kp+Kis+KdsG_c(s) = K_p + \frac{K_i}{s} + K_d sGc(s)=Kp+sKi+Kds

Ziegler-Nichols Tuning Rule

Steps:

1. Set the PID controller as a P-controller (Ti=∞,Td=0T_i = \infty, T_d = 0Ti=∞,Td=0).

2. Gradually increase KpK_pKp until sustained oscillations occur. This value is KmK_mKm, the
marginal gain.

3. Measure the oscillation period TmT_mTm.

4. Use KmK_mKm and TmT_mTm in Ziegler-Nichols formulas to calculate KpK_pKp, TiT_iTi, and
TdT_dTd.

Lab Task

Given Setup

• System becomes marginally stable at Kp=30K_p = 30Kp=30, giving Km=30K_m = 30Km=30.

• Oscillation period is Tm=2.8 sT_m = 2.8 \, \text{s}Tm=2.8s.

Tuning for PID Controller

Using the Ziegler-Nichols formula for PID:

• Kp=0.6 Km=0.6×30=18K_p = 0.6 \, K_m = 0.6 \times 30 = 18Kp=0.6Km=0.6×30=18


• Ti=0.5 Tm=0.5×2.8=1.4 sT_i = 0.5 \, T_m = 0.5 \times 2.8 = 1.4 \, \text{s}Ti=0.5Tm=0.5×2.8=1.4s

• Td=0.125 Tm=0.125×2.8=0.35 sT_d = 0.125 \, T_m = 0.125 \times 2.8 = 0.35 \, \text{s}Td
=0.125Tm=0.125×2.8=0.35s

Further Refinement

• Overshoot: Reduce by increasing TiT_iTi and TdT_dTd.

• Settling Time: Reduce by increasing KpK_pKp.

Refined values:

• Kp=39K_p = 39Kp=39, Ti=3.07 sT_i = 3.07 \, \text{s}Ti=3.07s, Td=0.75 sT_d = 0.75 \, \text{s}Td
=0.75s.

Lab Task #1 Solution

Simulink Design Steps

1. Open MATLAB and create a Simulink model.

2. Add the components:

o Transfer Function block to represent the plant (Ball and Beam system).

o PID Controller block.

o Step input.

o Scope for output visualization.

3. Set the PID controller parameters:

o Kp=18K_p = 18Kp=18, Ti=1.4T_i = 1.4Ti=1.4, Td=0.35T_d = 0.35Td=0.35 (initial Ziegler-


Nichols values).

4. Simulate and analyze the response.

5. Fine-tune the parameters to minimize overshoot and settling time, using refined values
Kp=39K_p = 39Kp=39, Ti=3.07T_i = 3.07Ti=3.07, Td=0.75T_d = 0.75Td=0.75.

Calculations for Ziegler-Nichols Parameters

1. Identify Km=30K_m = 30Km=30 and Tm=2.8 sT_m = 2.8 \, \text{s}Tm=2.8s.

2. Compute initial parameters:

o Kp=0.6 Km=18K_p = 0.6 \, K_m = 18Kp=0.6Km=18

o Ti=0.5 Tm=1.4 sT_i = 0.5 \, T_m = 1.4 \, \text{s}Ti=0.5Tm=1.4s


o Td=0.125 Tm=0.35 sT_d = 0.125 \, T_m = 0.35 \, \text{s}Td=0.125Tm=0.35s

3. Refine parameters for stability and desired response.

Deliverables

• Simulink model showing PID controller for Ball on Beam.

• Results:

o System response curves (initial Ziegler-Nichols and refined).

o Observations on overshoot, settling time, and steady-state error.

• Calculation steps for KpK_pKp, TiT_iTi, TdT_dTd.

• Comparison of responses with initial and refined parameters.


Lead Compensator Design for an Inverted Pendulum system.

Objective Recap

The lab involves designing a lead compensator to stabilize and control the position of an inverted
pendulum. The compensator aims to meet specific transient response criteria.

Theory Refresher

Lead Compensator:

• Adds positive phase to the system to improve the phase margin.

• It bends the root locus, placing poles closer to desired locations in the s-plane.

• Acts as a high-pass filter to improve the system's transient response.

Design Parameters:

• Settling Time (TsT_sTs): Ts=4/(ζωn)T_s = 4 / (\zeta \omega_n)Ts=4/(ζωn)

• Percent Overshoot (MpM_pMp): Related to ζ\zetaζ via Mp=e−πζ/1−ζ2M_p = e^{-\pi\zeta /


\sqrt{1-\zeta^2}}Mp=e−πζ/1−ζ2.

Lab Tasks Breakdown

Lab Task #01: Interface Inverted Pendulum in MATLAB

1. Set Up MATLAB/Simulink:

o Import the transfer function G(s)=2.69(s+5)(s−5)G(s) = \frac{2.69}{(s + 5)(s -


5)}G(s)=(s+5)(s−5)2.69.

o Use the Motor Encoder block to read the motor's angular position and velocity.

o Use the Stepper Motor block for driving the motor with calculated control input.

2. Control Loop Block Diagram:

o Include the inverted pendulum system, the lead compensator, and the feedback loop.

o Implement signal acquisition using encoder readings and generate corresponding


control signals to the motor.

3. Submission:

o Save and share the Simulink block diagram as part of the submission.
Lab Task #02: Design and Validate Lead Compensator

1. Given Transfer Function:

G(s)=2.69(s+5)(s−5)G(s) = \frac{2.69}{(s + 5)(s - 5)}G(s)=(s+5)(s−5)2.69

2. Performance Criteria:

o Settling time (TsT_sTs) = 0.5 seconds (2% criterion).

o Maximum overshoot (MpM_pMp) ≤ 10%.

3. Steps for Design: i. Determine Damping Ratio (ζ\zetaζ):

Mp=e−πζ/1−ζ2,Mp=10%M_p = e^{-\pi\zeta / \sqrt{1-\zeta^2}}, \quad M_p = 10\%Mp=e−πζ/1−ζ2,Mp


=10%

Solve for ζ\zetaζ.

ii. Find Natural Frequency (ωn\omega_nωn):

Ts=4ζωn,Ts=0.5 sT_s = \frac{4}{\zeta \omega_n}, \quad T_s = 0.5 \text{ s}Ts=ζωn4,Ts=0.5 s

Solve for ωn\omega_nωn.

iii. Calculate Desired Pole Locations: Compute dominant poles (sss) using:

s=−ζωn±jωn1−ζ2s = -\zeta\omega_n \pm j\omega_n\sqrt{1-\zeta^2}s=−ζωn±jωn1−ζ2

iv. Compensator Design:

o Determine the angle deficiency at desired poles.

o Choose a zero (zzz) arbitrarily on the left-half plane (e.g., z=−10z = -10z=−10).

o Calculate the compensator pole (pcp_cpc) to satisfy angle contribution.

v. Gain Adjustment: Use magnitude condition to compute the gain KKK:

K⋅∣G(s)∣⋅∣Lead(s)∣=1K \cdot |G(s)| \cdot |Lead(s)| = 1K⋅∣G(s)∣⋅∣Lead(s)∣=1

4. Simulate in Simulink:

o Implement the compensator in Simulink.

o Analyze the closed-loop response and confirm the criteria (Ts=0.5T_s = 0.5Ts=0.5,
Mp≤10%M_p \leq 10\%Mp≤10%).

5. Experimental Validation:

o Using the designed compensator, control the inverted pendulum’s position.

o Compare experimental data to simulation results for performance validation.


Expected Deliverables

1. Task 01:

o Simulink block diagram for interfacing the inverted pendulum system.

2. Task 02:

o Detailed calculations for the lead compensator design.

o Simulink results showing the compensated system response.

o Experimental data demonstrating real-world performance.

o Comparison of simulation and experimental results.


Lag-Lead Compensator for an inverted pendulum system.

Objective Recap

Design a Lag-Lead Compensator to meet the following performance criteria:

• Response Time (TsT_sTs): 0.5 seconds (2% criterion).

• Maximum Overshoot (MpM_pMp): ≤ 10%.

• Steady-State Error (esse_{ss}ess): 0.01.

Theory Summary

Lag Compensator:

• Improves steady-state error without significantly affecting transient response.

• Adds a zero (zcz_czc) and a pole (pcp_cpc), where zc/pcz_c/p_czc/pc ratio determines
improvement in steady-state error.

• To minimize angular contributions, the pole-zero pair is placed close to the origin.

Lag-Lead Compensator:

• Combines the advantages of both compensators:

o Lead compensator improves transient response and stability.

o Lag compensator improves steady-state accuracy.

Lab Tasks Breakdown

Lab Task #01: Design a Lag-Lead Compensator

Given System:

G(s)=2.69(s+5)(s−5)G(s) = \frac{2.69}{(s + 5)(s - 5)}G(s)=(s+5)(s−5)2.69

Step 1: Design the Lead Compensator

1. Define Desired Performance:

o Settling time Ts=0.5T_s = 0.5Ts=0.5 seconds.

o Overshoot Mp≤10%M_p \leq 10\%Mp≤10%.

2. Determine Lead Compensator Parameters: i. Find ζ\zetaζ:


o Use Mp=e−πζ/1−ζ2M_p = e^{-\pi\zeta / \sqrt{1-\zeta^2}}Mp=e−πζ/1−ζ2 to calculate the
damping ratio ζ\zetaζ.

ii. Find ωn\omega_nωn:

o Use Ts=4ζωnT_s = \frac{4}{\zeta\omega_n}Ts=ζωn4 to calculate natural frequency


ωn\omega_nωn.

iii. Calculate Desired Poles:

o Compute dominant poles: s=−ζωn±jωn1−ζ2s = -\zeta\omega_n \pm j\omega_n\sqrt{1-


\zeta^2}s=−ζωn±jωn1−ζ2.

3. Lead Compensator Design:

o Determine angle deficiency at the desired poles.

o Choose a zero location (zzz).

o Calculate the compensator pole (pcp_cpc) using angle condition.

o Adjust gain KKK to satisfy the magnitude condition.

4. Simulate Lead-Compensated System:

o Verify TsT_sTs and MpM_pMp criteria.

Step 2: Design the Lag Compensator

1. Given Requirements:

o Steady-state error: ess=0.01e_{ss} = 0.01ess=0.01.

o Compute desired steady-state constant: Kp=1−essess=91.59K_p = \frac{1 - e_{ss}}{e_{ss}}


= 91.59Kp=ess1−ess=91.59

2. Determine Improvement Factor:

o Calculate improvement ratio: Kp(compensated)Kp(lead)=91.59Kp(lead).\frac{K_p


(\text{compensated})}{K_p (\text{lead})} = \frac{91.59}{K_p (\text{lead})}.Kp(lead)Kp
(compensated)=Kp(lead)91.59.

3. Lag Compensator Parameters:

o Place zero (zcz_czc) and pole (pcp_cpc) near the origin.

o Ensure zc/pc=Improvement Ratioz_c/p_c = \text{Improvement Ratio}zc/pc


=Improvement Ratio.

4. Simulate Lag-Lead Compensated System:

o Verify TsT_sTs, MpM_pMp, and esse_{ss}ess.


5. Submit Simulink Results:

o Show step responses for uncompensated, lead-compensated, and lag-lead compensated


systems.

Lab Task #02: Experimental Validation

1. Control Inverted Pendulum Using Lag-Lead Compensator:

o Implement the designed compensator in MATLAB/Simulink.

o Interface with the inverted pendulum system using encoder and motor drivers.

2. Compare Results:

o Compare simulation step response to experimental data for system accuracy.

Deliverables

1. Task 01:

o Detailed calculations for designing lead and lag compensators.

o Simulink results for uncompensated, lead-compensated, and lag-lead compensated


systems.

o Verification of Ts=0.5T_s = 0.5Ts=0.5, Mp≤10%M_p \leq 10\%Mp≤10%, and


ess=0.01e_{ss} = 0.01ess=0.01.

2. Task 02:

o Experimental setup and results for controlling the inverted pendulum.

o Comparison of simulation and experimental responses.


Lab Task 01: Frequency Response and Bode Plot

Step 1: Bode Plot Construction

In this part, you'll measure the output amplitude and phase shift at different frequencies (1 Hz, 100 Hz, 1
kHz, and 10 kHz), then calculate the gain in dB and phase delay for each frequency.

Step 3: Repeat for Different Frequencies

You need to repeat the steps for 100 Hz, 1 kHz, and 10 kHz.

Step 4: Plot the Magnitude and Phase Response

Once you have the gain and phase delay for each frequency, you can plot the magnitude and phase
response on a Bode plot. The magnitude plot will show the gain in decibels, and the phase plot will show
the phase in degrees.

Lab Task 02: Estimating Transfer Function


You need to use the Bode plot from Task #1 to estimate the transfer function and simulate it in MATLAB.

Step 1: Retrieve the Order of the System

• Look at the phase plot to determine the order of the system.

• Since the phase plot will have a final slope of approximately -90° per pole, the system will have a
first-order phase behavior (indicating a first-order system).

Step 2: Identify the Number of Poles

• The number of poles is identified by the slope of the magnitude plot. If the slope is -20 dB/dec,
this corresponds to a single pole.

• The magnitude plot will help you identify if there are additional poles or zeros.

Step 3: Identify the Locations of Poles

• From the phase plot, we identify the break frequencies. The first pole appears at 0 rad/s, and the
second pole occurs at approximately 5 rad/s.

Step 4: Find the Gain

Simulating Transfer Function in MATLAB:

% Define the transfer function

K = 25; % Gain

num = [K 0]; % Numerator (25s)

den = [1 5]; % Denominator (s + 5)

% Create transfer function model

sys = tf(num, den);


% Plot Bode plot

bode(sys);

grid on;

This MATLAB script will create a Bode plot of the system with the transfer function G(s)=25ss+5G(s) =
\frac{25s}{s + 5}G(s)=s+525s, showing both the magnitude and phase response. The resulting Bode plot
can be compared with the experimental results you obtained in Task #1 to validate the system behavior.

Summary of the Transfer Function:

From the Bode plot, you estimated the transfer function as:

G(s)=25ss+5G(s) = \frac{25s}{s + 5}G(s)=s+525s

This transfer function reflects a system with a first-order behavior and a gain of 25, with a pole at -5.

LAB 13: PID Controller Design for Magnetic Levitation System

Objective

To familiarize the attendee with the magnetic levitation system and design a PID controller to stabilize a
metal sphere at a specific position by applying electromagnetic force to counteract gravity.

Theory

Magnetic Levitation:

Magnetic levitation involves suspending a metal sphere in the air using electromagnetic force. This force
is generated by an electromagnet and counteracts the force of gravity acting on the sphere. The
equilibrium of the sphere occurs when:

F=m⋅gF = m \cdot gF=m⋅g

Where:

• FFF: Electromagnetic force

• mmm: Mass of the sphere

• ggg: Acceleration due to gravity

To maintain this equilibrium, a closed-loop control system is required. The system continuously measures
the sphere's position and adjusts the current flowing through the electromagnet to stabilize the sphere.
A PID controller is often used to achieve this stabilization.
Laser Displacement Sensor:

The laser displacement sensor is a key component in the magnetic levitation system, providing non-
contact measurement of the sphere's position. Its working principle is based on laser pulse technology,
which determines the distance between the sensor and the sphere by calculating the time taken for the
laser to reflect back to the sensor.

Advantages of laser displacement sensors include:

• High precision

• Resistance to electrical interference

• Non-contact measurement

Lab Tasks

Task #1: Sensor Calibration

1. Zero Calibration of Laser Sensor:

o Open the provided MATLAB/Simulink program: Test_ADC.slx.

o Double-click the program to open the real control module.

o Set the "zero module" to zero.

2. Calibrate Sensor with Standard Ball:

o Place the GML2001 standard ball (diameter: 45 mm) at the bottom of the
electromagnet.

o Click "Build," "Connect to Target," and then "Run."

o Verify that the sphere adheres to the electromagnet at the bottom.

3. Adjust Output Voltage:

o Measure the average voltage UoutU_{\text{out}}Uout when the sphere is at the bottom.

o Input this value into the zero module and hold for at least 10 seconds.

o Confirm that the output voltage stabilizes close to zero.

Task #2: PID Controller Design

1. Objective:

o Design and tune a PID controller to stabilize the metal sphere near the electromagnet by
maintaining its position within the laser sensor's range.
2. Steps to Design the PID Controller:

o Analyze the system dynamics and determine the transfer function for the magnetic
levitation system.

o Implement a closed-loop control model in MATLAB/Simulink.

o Tune the PID parameters (Kp,Ki,KdK_p, K_i, K_dKp,Ki,Kd) to minimize the error and
stabilize the sphere:

▪ Proportional (P): Adjusts the output in proportion to the error.

▪ Integral (I): Addresses accumulated errors over time to eliminate steady-state


error.

▪ Derivative (D): Predicts and counteracts future errors based on the rate of
change.

3. Simulation and Testing:

o Run simulations to evaluate the controller's performance.

o Test the tuned PID controller on the physical magnetic levitation setup.

o Observe the sphere's response and make further adjustments to PID parameters as
necessary to achieve stability and fast response.

Deliverables:

1. Sensor calibration results, including the measured UoutU_{\text{out}}Uout.

2. MATLAB/Simulink model of the PID controller.

3. PID parameters (Kp,Ki,KdK_p, K_i, K_dKp,Ki,Kd) and their effect on system performance.

4. Observations of sphere levitation performance (stability, response time, etc.).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy