FCS Open Ended Lab MK
FCS Open Ended Lab MK
1|Page
OBJECTIVE:
To develop, simulate, and implement a reliable feedback control system for a Buck
converter, ensuring precise regulation of the output voltage, minimal steady-state error,
and a fast dynamic response under fluctuating input and load conditions. The project
focuses on optimizing the efficiency, stability, and performance of the system through
advanced modeling, controller design, and hardware implementation, bridging the gap
between simulation and practical validation.
COMPONENTS REQUIRED:
1. Arduino Uno
2. IRF540N N-Channel MOSFET
3. 0.5 mH Inductor
4. 4.7 μF Capacitor
5. Diode
6. Potentiometer
7. 1 kΩ, 10 W Resistor
8. 2 9V Battery
INTRODUCTION:
A buck converter, also known as a step-down converter, is a type of DC-to-DC
power converter designed to reduce voltage while increasing current from the input
(supply) to the output (load). Typically, this switched-mode power supply (SMPS)
utilizes at least two semiconductor components, such as a transistor and a diode.
Modern designs often replace the diode with a second transistor for synchronous
rectification. Energy storage components like inductors, capacitors, or both play a
critical role in the operation of the converter. Additionally, capacitor-based filters,
often used alongside inductors, are placed on the input (supply-side filter) and
output (load-side filter) to minimize voltage ripple.
2|Page
CIRCUIT DIAGRAM:
WORKING:
When the circuit is powered on, the MOSFET operates by switching on and off at a
frequency of 3.9 kHz. During the "on" phase, the inductor stores energy, and during
the "off" phase, this stored energy is delivered to the load. Due to the high-frequency
switching, the output voltage becomes a pulsed signal, which is averaged over
time. The output voltage depends on the position of the potentiometer's wiper
terminal relative to the 5V reference. As the voltage between the wiper terminal and
ground increases, the corresponding mapped PWM value on Arduino's pin 10 also
increases.
Since the MOSFET is a voltage-dependent device, the PWM signal directly controls
the voltage across the load. The Arduino generates clock pulses for the MOSFET's
gate at an approximate frequency of 65 kHz, enabling rapid switching. This results in
a stable average output voltage. The MOSFET primarily performs two key functions:
When the potentiometer's wiper terminal position is adjusted, the voltage between
it and ground changes, altering the analog value read by Arduino's pin A1. This
updated analog value is then mapped to a range of 0 to 255 and sent to Arduino's
3|Page
pin 5 to regulate the PWM signal.
PROCDEURE:
1. Inductor Connection
• Connect one terminal of the inductor to the positive terminal of the input power
supply.
• Attach the other terminal of the inductor to the cathode of the diode and one
end of the capacitor.
• Connect the positive terminal of the DC power supply (battery) to the cathode
of the diode and the inductor terminal connected to the source.
• Attach the negative terminal of the power supply to the source pin of the
MOSFET.
• Connect the anode (positive terminal) of the diode to the drain terminal of the
MOSFET.
• Use Arduino's PWM signal from pin 10 to control the gate of the MOSFET for
efficient switching.
4|Page
• Ensure the GND pin of the Arduino is connected to the negative terminal of the
power supply. This common ground is essential for proper circuit operation.
• Connect one end of the potentiometer to the Arduino’s 5V pin and the other
end to the GND pin.
• Attach the middle (wiper) terminal of the potentiometer to Arduino’s analog
pin A0 to control the input signal.
• Connect the output voltage (measured across the capacitor or the load
resistor) to Arduino’s analog pin A2 for real-time feedback and monitoring.
Problem Identification:
5|Page
3. Apply Data Filtering
• Approach: Use digital filters to remove noise and smooth the signal.
• Filters to Use:
o Low-pass filter: Removes high-frequency noise.
o High-pass filter: Eliminates low-frequency drifts.
o Band-pass filter: Focuses on a specific frequency range.
• Implementation: Use built-in Arduino libraries or process the data offline in
MATLAB.
Once the data is clean and stabilized, MATLAB can be used for in-depth analysis.
1. Data Preprocessing
• Remove Transients:
o Visualize the data and identify the transient region.
o Use MATLAB indexing to exclude these points from further analysis.
• Interpolate Missing Data:
o Use functions like interp1 to fill gaps.
o Example: data_interpolated = interp1(time, voltage, new_time, 'spline');
• Normalize Data:
o Scale the data to a common range for easier comparison.
o Example: normalized_data = (data - min(data)) / (max(data) -
min(data));
2. Data Visualization
• Time-Domain Plots:
o Plot voltage vs. time using plot(time, voltage);.
• Frequency-Domain Analysis:
o Use the fft function to examine frequency components.
o Example: Y = fft(data); plot(frequency, abs(Y));
• Statistical Analysis:
o Compute statistics like mean and standard deviation.
o Example: mean_value = mean(data); std_dev = std(data);
3. Model Fitting
• Fit Models to Data:
o Use MATLAB’s Curve Fitting Toolbox or functions like fit to model the
transient behavior (e.g., exponential decay).
o Example: [fit_result, gof] = fit(time, voltage, 'exp1');
6|Page
• Extract Parameters:
o Obtain parameters like time constants or frequency components
directly from the model.
4. Feature Extraction
• Identify Key Metrics:
o Extract features such as peak values, rise time, fall time, and dominant
frequencies.
• MATLAB Tools:
o Use findpeaks to detect peak values.
o Calculate rise and fall times using slope analysis or threshold methods.
7|Page
We have incorporated code-based simulations to extract time-domain response
characteristics, enabling a comprehensive time-domain analysis of the system.
Additionally, manual calculations were performed to determine the system's
transfer function, assuming an 80% duty cycle.
Manual Calculations:
𝑦𝑝𝑒𝑎𝑘−𝑦𝑠𝑠
𝑀𝑝 =
𝑦𝑠𝑠
𝑴𝒑 = 𝟎. 𝟎𝟐𝟔
𝑀
ln( 𝑝 )
𝜁=− 100
√𝜋2 + 𝑙𝑛2( 𝑀𝑝 )
100
𝜻 = 𝟎. 𝟕𝟓𝟓
𝜋
𝒕𝒑 = = 𝟎. 𝟎𝟏𝟏 𝒔𝒆𝒄
𝑤𝑑
𝜋 𝒓𝒂𝒅
𝒘𝒅 = = 𝟐𝟖𝟓. 𝟓𝟗
𝑡𝑝 𝒔𝒆𝒄
𝑤𝑑 = 𝑤𝑛√1 − 𝜁2
𝑤𝑑 𝒓𝒂𝒅
𝒘𝒏 = = 𝟒𝟑𝟓. 𝟓𝟒
√1 − 𝜁2 𝒔𝒆c
8|Page
𝐺 (𝑆) = 𝑤𝑛2
𝑆2 + 2𝜁𝑤 𝑆 + 𝑤 2
𝑛 𝑛
189701.6769
𝐺(𝑆) =
𝑆2 + 657.6654𝑆 + 189701.6769
𝟏
𝑮(𝑺) =
𝟓. 𝟐𝟕 ∗ 𝟏𝟎−𝟔𝑺𝟐 + 𝟑. 𝟒𝟔𝟔 ∗ 𝟏𝟎−𝟑 + 𝟏
𝑦𝑝𝑒𝑎𝑘−𝑦𝑠𝑠
𝑀𝑝 =
𝑦𝑠𝑠
𝑴𝒑 = 𝟎. 𝟒𝟒𝟑
𝑀
ln( 𝑝 )
𝜁=− 100
√𝜋2 + 𝑙𝑛2( 𝑀𝑝 )
100
9|Page
𝜻 = 𝟎. 𝟐𝟓𝟎𝟖
𝜋
𝒕𝒑 = = 𝟗. 𝟕𝟎𝟑 ∗ 𝟏𝟎−𝟒𝒔𝒆𝒄
𝑤𝑑
𝜋
𝒘𝒅 = = 𝟑𝟐𝟑𝟕. 𝟕𝟓 𝒓𝒂𝒅/𝒔𝒆𝒄
𝑡𝑝
𝑤𝑑 = 𝑤𝑛√1 − 𝜁2
𝑤𝑑
𝒘𝒏 = = 𝟑𝟑𝟒𝟒. 𝟔𝟒 𝒓𝒂𝒅/𝒔𝒆𝒄
√1 − 𝜁2
𝐺(𝑆) = 𝑤𝑛2
𝑆2 + 2𝜁𝑤 𝑆 + 𝑤 2
𝑛 𝑛
11186674.02
𝐺(𝑆) =
𝑆2 + 1677.67𝑆 + 11186674.02
𝟏
𝑮(𝑺) =
𝟖. 𝟗𝟑𝟗 ∗ 𝟏𝟎−𝟖𝑺𝟐 + 𝟏. 𝟒𝟗𝟗𝟕 ∗ 𝟏𝟎−𝟒𝑺 + 𝟏
𝑉𝑜(𝑆) 𝑉𝑠
𝑇(𝑆) = = 𝐿
𝑑(𝑆) 𝐿𝐶𝑆2 + ( 𝑅) 𝑆 + 1
Since,
𝑅 = 1Ω
𝐿 = 0.1𝑚𝐻
𝐶 = 1000µ𝐹
𝑑 = 0.5 − 0.8
𝑉𝑠 = 5𝑉
10 | P a g e
𝑇(𝑆) = 5
0.1𝑚
(0.1𝑚)(940µ)𝑆2 +( 1 )𝑆+1
𝟓
𝑻(𝑺) =
𝟗. 𝟒 ∗ 𝟏𝟎−𝟖𝑺𝟐 + 𝟎. 𝟏 ∗ 𝟏𝟎−𝟑𝑺 + 𝟏
11 | P a g e
Code:
void setup() {
Serial.begin(115200);
pinMode(10, OUTPUT); // PWM out
pinMode(A0, INPUT); // Analog in for set value (100k Pot)
pinMode(A1, INPUT); // Analog in for Vo
pinMode(A2, INPUT); // Analog in for reference
setpwmfreq(4); // 3921 Hz
adcsamplingrate(1); // 15 usec
analogWrite(10, 127); // 50% duty cycle, 100% = 255
}
void loop() {
int adcvalue = analogRead(A0);
float set_voltage = adcvalue * (5.0 / 1023.0); // Read set point from
Pot
if (sampletime == 4) {
ADCSRA |= PS_128;
} else if (sampletime == 3) {
ADCSRA |= PS_64;
} else if (sampletime == 2) {
ADCSRA |= PS_32;
} else if (sampletime == 1) {
ADCSRA |= PS_16;
} else {
12 | P a g e
ADCSRA |= PS_128;
}
}
CONCLUSION:
The project began with assembling the Buck converter circuit on a Vero board,
configured to operate at a 50% duty cycle. Experimental data obtained from
the Arduino-based setup was analyzed to determine the system's transfer
function. This transfer function was validated through MATLAB simulations.
A corresponding Simulink model of the Buck converter, also set to a 50% duty
cycle, was developed. The simulated response displayed an underdamped
behavior. Key parameters, such as peak overshoot and settling time, were
extracted from the Simulink model to derive the system's transfer function.
Discrepancies between the experimental and simulated transfer functions
were observed, primarily due to component tolerances and power losses
inherent in the physical setup. Despite these variations, both the experimental
implementation and simulation results were cross-verified mathematically,
ensuring reliability in the finding
13 | P a g e