Skip to content

anp-exe/WindEnergyProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WindEnergyProject

Overview

This is a project based on one of my Bath University project week studies:

The objective of this project week is to build a simple wind turbine and convert some of the wind energy into electrical energy. You will have to test different mini wind turbine designs to assess which one is the best to harvest energy in different wind conditions. It is a competition; the best wind turbine—the one harvesting the most energy for a specific wind condition that we will reveal near the end of the week—will win.

In short, our task was to build the most efficient wind turbine. We then ran tests in a controlled environment and calculated the results based on the data collected. I took this project to the next level and automated a lot of the calculations using MATLAB.

How did we assemble the parts?

We were handed many parts to build a mini wind turbine. Mainly, we were given:

  • 3 fans of different sizes: Each fan had a different blade diameter, allowing us to explore how rotor size influences the amount of air intercepted and, consequently, the electrical power generated. Larger blades captured more wind energy but required greater torque to spin efficiently, while smaller ones spun faster but generated less power.
  • 3 different generators: A brushed DC motor consists of a rotating armature wound with coils, stationary magnets, and a commutator with brushes. When powered, the stationary magnets create a magnetic field, which interacts with the magnetic field generated by the current flowing through the armature. This interaction generates a torque that causes the armature to rotate.
  • 3 different capacitors: A capacitor stores energy and releases it to smooth out the fluctuations in the voltage.
  • A 47kΩ resistor: It will be used to help limit the current.
  • Gears and Shaft Assembly: The shaft is used to secure the blade and transmit the motion to the gears, which, in turn, increase the speed at which the motor is being rotated.

From there, we followed the assembly instructions below for the motor and housing:

Assembling the motor and motor housing

and for the turbine blades:

Assembling the turbine blades

How did we collect data to test each setup we created?

We relied on a wind tunnel to run our project in a controlled environment to collect accurate data:

The wind tunnel is a vital tool that simulates various wind conditions under controlled settings, enabling a thorough evaluation of how different wind speeds affect the energy harvesting capability of your turbines.

The wind tunnel

The testing setup includes the following:

  • Wind Tunnel which is controlled through the measurement software to simulate wind at a range of speeds.
  • Mast base which is used to hold the wind turbine.
  • Wind sensor which measures the wind speed inside the wind tunnel.
  • Oscilloscope that can be used to view and save the waveform of the electrical signal generated.
  • Measurement software that uses the readings from your circuit (on the breadboard) and input from the wind sensor to output a CSV file that includes tabulated values of voltage at a range of wind speeds.

It's important to note that the test setup produces the following CSV format (no header):

  • Column 1 → wind speed, m/s
  • Column 2 → voltage across the load, V
  • Each row corresponds to a fixed sampling period (default 4 s).

Data Processing & Plotting

The data automation can be found in the MATLAB project directory. It processes voltage–speed logs from the wind-turbine rig to estimate energy harvested under different design setups and wind speeds, and then plots the results so you can pick the most suitable setup for a target speed.

The workflow:

  1. Calculate energy per speed bin for each CSV (one CSV ≈ one setup/test run).
  2. Aggregate results into summary_data.xlsx (Sheet1).
  3. Summarize winners and totals in summary_data.xlsx (Sheet2).
  4. Plot total energy harvested vs. wind speed for all setups.

Project layout:

.
├── data/                               # put your CSV logs here
│   ├── T4_RED_L22_C68.csv
│   ├── T5_RED_L22_C100.csv
│   ├── T6_RED_L22_C47.csv
│   ├── T7_BLUE_L22_C68.csv
│   └── ... (other CSV files)
├── MATLAB_AUTOMATE.m                   # batch runner
├── MATLAB_CALCULATOR.m                 # computes and updates sheets
├── MATLAB_PLOTTER.m                    # plots multi-line graph
├── summary_data.xlsx                   # spreadsheet with results
├── graph.png                           # plot (generated)
└── WindEnergyProject.prj

Usage

1) Put your data in ./data

Place one CSV per setup/test run. Filenames can be any valid name; the file base name becomes the column title in the spreadsheet.

2) (Optional) Set parameters

Open MATLAB_AUTOMATE.m to override defaults if needed:

R_load_ohm   = 47e3;   % load resistance (ohms)
dt_per_row_s = 4.0;    % sampling period per row (s)
binWidth_mps = 0.20;   % total speed-bin width (m/s)  -> ±0.10 around each bin centre

The bin centres are read from column 1 of summary_data.xlsx (Sheet1). If the file does not exist yet, the calculator initializes a typical range (e.g., 2–6 m/s). You can edit these later and re-run.

3) Run everything

In MATLAB, set the current folder to the project root and run:

run('MATLAB_AUTOMATE.m')

What it does:

  • Deletes any existing summary_data.xlsx (clean start).
  • Iterates over data/*.csv, running MATLAB_CALCULATOR.m on each file.
  • Rebuilds Sheet2 (winners & totals) from Sheet1.
  • Calls MATLAB_PLOTTER.m to create graph.png.
  • Prints the final Sheet1 to the console.

Outputs you get:

  • summary_data.xlsx
    • Sheet1: per-speed energies (J) for each setup (one column per CSV).
    • Sheet2:
      • BySetup: total/mean energy, number of speeds with data, max and speed-at-max, ranked by total.
      • PerSpeed winners: best setup and energy for each speed.
      • Parameters: R, dt, bin width used (for auditability).
  • graph.png: multi-line plot of energy vs. speed.

How the calculations work (key decisions)

Why binning by wind speed?

Wind speed is not perfectly constant during a run. To compare designs fairly, we group measurements into speed bins (e.g., “the 3 m/s bin covers 2.9–3.1 m/s”). This:

  • keeps “3 m/s” data together even with small measurement jitter;
  • prevents a setup that happened to see more high-speed moments from looking unfairly better;
  • lets you choose the best setup for a specific test speed once it’s announced.

Bin centres come from the first column in Sheet1 (labelled Speed), and we use a window of ±(binWidth/2) around each centre (default ±0.10 m/s).

How is energy computed?

From each voltage sample, we estimate power using the load resistor:

$$ P_i = \frac{V_i^2}{R_{\text{load}}}\quad [\text{W}] $$

To get energy within a bin, we add up power over time using the trapezoid rule on consecutive samples that both lie inside the bin:

$$ E(s) = \sum_{\text{pairs in bin}} \frac{P_i + P_{i+1}}{2},\Delta t \quad [\text{J}] $$

where $\Delta t$ is the sampling period per row (default 4 s).

Important: we do not draw trapezoids across gaps where the speed jumps out of the bin (no “bridging”). This counts only energy truly produced while the wind was around that bin’s speed.

Why compute winners and overall efficiency the way we do?

  • Per-speed winner: for each speed bin, the setup with the largest $E(s)$ is the best choice if your test is run at that speed.
  • Overall “most efficient”: we rank setups by total energy across all speeds available:

$$ \mathrm{Sum}_J = \sum_{s} E(s) $$

This answers: “Which setup tends to harvest the most energy across the tested range?”
We also store the mean across speeds (Mean_J) and the max and its speed (Max_J, Speed_at_Max) to give more context.

Missing vs. zero values in the plot

We leave missing speeds as NaN and only plot the points that exist. We do not replace missing data with zeros—otherwise, a gap could be misread as a “measured zero”.


About

Build a simple wind turbine and convert some of the wind energy into electrical energy.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages