first commit

This commit is contained in:
afoucaultc 2026-06-05 13:11:08 +02:00
commit 205faf4224
5471 changed files with 973850 additions and 0 deletions

View file

@ -0,0 +1,224 @@
# Wind turbine gearbox simulator
![Static Badge](https://img.shields.io/badge/Octave-11.1.0-orange)
![Static Badge](https://img.shields.io/badge/Arch%20Linux-6.19.12-blue)
![Static Badge](https://img.shields.io/badge/Gnuplot-6.0%20patchlevel%204-yellow)
![Static Badge](https://img.shields.io/badge/Gitlab-repo-red?logo=Gitlab)
Wind turbine gearbox simulator is a matlab/octave simulator for a lumped parameters mechanical model of wind turbine gearbox. It implements varying wind profile, defects, varying gear mesh, and compute numerically the dynamical behaviour of the system using a Newmark's scheme.
**Related paper: [...]**
## Dependencies
**Development language:** Octave 11.1.0 (some package installed following first s)
**Compatibility:** Matlab v2026-a (delete all `graphics_toolkit("gnuplot")` mentions in the code)
**Plot engine:** Gnuplot 6.0 patchlevel 4
## Usage
```bash
$ git clone https://gitlab.com/afoucaultc/wind_turbine_gearbox
$ cd wind_turbine_gearbox
$ octave
$ octave:1> run main.m
$ # or run any standalone (starting by a "_")
$ octave:1> >>> run _[standalone].m
```
## File tree
```bash
: '
Main process takes the main parameters and compute the
whole process of calculations. It prints every figure
into .svg files, into folder print/run_print/. The
number of periods to calculate are asked as input when
the code is started.
"class_" are static functions used to calculate and plot
see in-code comments for more informations
'
## Main process
├── main.m
├── main_parameters.m
├── run_main.m
│ └── _convergence.m
├── run_display.m
│ └── class_display.m
└── run_print.m
: '
Standalone files are files that do a single specific task
that cannot be done by the main process. These starts by
a "_" and can be ran using ">>> run _file.m"
- _init_speed.m calculates the optimal initial speed to
avoid the transitionnal regime.
- _rms-analysis.m gives a .csv (in /data) containing the
RMS, STD and Kurtosis for different defects conditions
- _animation.m is showing a visual animation of the diff-
-erent shaft rotations and vibrations
- _gear-mesh-var.m plots the difference of mesh stiffness
between different center distance error values
- _convergence.m plots the convergence between a high
sample rate and other sample rates to determine which
one to choose for minimal numerical error and comput-
-ational
time
'
## Standalone functions
├── _init_speed.m
├── _rms-analysis.m
├── _animation.m
├── _gear-mesh-var.m
└── _convergence.m
: '
Rendering folders stores the .csv datasheet and .svg plots
'
## Rendering folders
├── data
│ └── rms.csv
└── print
├── _convergence
├── _gear-mesh-var
└── run_print
## Others
├── octave-workspace
└── README.md
```
## Maths and mechanical model
![Model](images/kinematicscheme.png)
As showed on the image, the model is based on 2 shaft with 4DDL each ($x$, $y$, input and output $\theta$), as a lumped parameters model. The parameters are listed as a $q$ vector :
$$
\{q\} = \{x_1, y_1,\theta _{11},\theta_{12},x_2,y_2,\theta_{22},\theta_{21}\}
$$
### Equations of movement
The equations of movement are given by the Lagrange formulation, using the kinetic and potential energies.
$$
\left[\frac{\partial E_p}{\partial q_i}\right]
+ \left[\frac{d}{dt}\left(\frac{\partial E_k}{\partial\dot{q}_i}\right)\right]
= \frac{\partial W}{\partial q_i}
\label{eq:reformlagrange}
\\
E_k = \frac{1}{2}
\left(
m_1{\dot{x}_1}^2+
m_1{\dot{y}_1}^2+
I_{11}{\dot{\theta}_{11}}^2+
I_{12}{\dot{\theta}_{12}}^2+
m_2{\dot{x}_2}^2+
m_2{\dot{y}_2}^2+
I_{22}{\dot{\theta}_{22}}^2+
I_{21}{\dot{\theta}_{21}}^2
\right)
\\
E_p = \frac{1}{2}
\left(
k_{x_1}{x_{1}}^2+
k_{y_1}{y_{1}}^2+
k_{\theta_1}(\theta_{11}-\theta_{12})^2+
k_{x_2}{x_{2}}^2+
k_{y_2}{y_{2}}^2+
k_{\theta_2}(\theta_{21}-\theta_{22})^2+
K_e(t){\delta}^2
\right)
$$
Where $I_{ij}$ inertias for shaft $i$ on its $j$ side; $K_e(t)$ the varying mesh stiffness (cf. *Mesh stiffness*); $\delta=(x_1-x_2)\sin(\alpha)+(y_1-y_2)\cos(\alpha)+r_{b_1}\theta_{12}+r_{b_2}\theta_{21}$ the tooth deflection.
The derivative of these equations is taken to directly get the movement, using:
$$
\frac{\partial E_p}{\partial q_i}+\frac{d}{dt}\left(\frac{\partial E_k}{\partial \dot{q}_i} \right) = F_i(t)
$$
The different terms ($k$ and $m$) are regrouped into matrices, to give the following system:
$$
\left[M\right]\{\ddot{q}\} + \left(\left[K_{mesh}\right](t)+\left[K_{cst}\right]\right) \{q\} = \left\{F(t)\right\}
$$
Where $K_{cst}$ represents the constant terms $k_{i_j}$ and $K_{mesh}$ the terms related to the gear mesh stiffness $K_e(t)$.
### Mesh stiffness
Mesh stiffness is calculated as a function of mesh period $T_{mesh}=60/(Z_1N_1)$, contact ratio $\varepsilon\approx c_{12}=\sum^2_{i=1}\frac{1+Z_i^{-1}}{0.5\sin(\alpha)+\sqrt{0.25\sin(\alpha)^2+(Z_i^{-2})+Z_i^{-1}}}$ and the one-tooth mesh stiffness $k_{mean}$. The one-tooth in contact is defined with a period of $T_{high} = T_{mesh}(\varepsilon -1)$ and stiffness $k_{max}=k_{mean}\left(1+\frac{2-\varepsilon}{2\varepsilon(\varepsilon-1)}\right)$; and the two-teeth period is defined by a period $T_{low} = T_{mesh}(2-\varepsilon)$ and stiffness $k_{min}=k_{mean}(1-\frac{1}{2\varepsilon})$.
![mesh stiffness](images/kvar.png)
### Forces
The forces vector depends on:
- wind input ($r_{blade}$ the blade radius, $v_{wind}$ the mean wind speed, $Cp$ the performance coefficient of the turbine, $\omega$ the average rotational speed, $T_{fluct}$ the fluctuation term and $f_{ext}$ its frequency).
$$
T_{in} = \rho_{air}\pi(r_{blade}^2)(v_{wind}^3)Cp/(2\omega) + T_{fluct}\cos(2\pi f_{ext}t)
$$
- output efficiency ($r$ the gearbox ratio)
$$
T_{out} = {eff}\times rT_{in}
$$
- a constant brake on 2nd shaft
Then, the force vector is:
$$
\begin{bmatrix}
T_{in} \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ T_{out}+T_{brake} \\ 0
\end{bmatrix}
$$
### Defects
Two types of defects are studied:
- profile error (which adds a force depending on a multiple cosine profile)
- center distance error (which makes $\alpha$ the contact angle vary slightly)
## Numerical scheme
Numerical computation is done using a Newmarks scheme with $K$ and $F$ updated for each time step. Mean acceleration parameters are used ($\gamma=1/2$ and $\beta=1/4$) for its unconditionally stable properties. Convergence is verified and the usual sample rate $fs_{div}$ (based on mesh period division) is chosen as equal to 11.
Speed is initialized at its permanent regime value, to avoid transient regime.
## Parameters
| **Gearbox** | | |
| -------------- | --------------------------- | ---------------- |
| $Z1$ | Tooth nbr 1 | 72 |
| $Z2$ | Tooth nbr 2 | 18 |
| $m0$ | Gear modulus | 0.016 m |
| $b$ | Gear width | 0.1 m |
| $N1$ | Shaft 1 speed | 17 RPM |
| $\alpha$ | Contact angle | 20° |
| $\rho_{steel}$ | Steel density | 7850 kg/m3 |
| $T_{brake}$ | Brake torque | 500 Nm |
| **Masses** | | |
| $m_{11}$ | Blades and input rotor mass | 2000 kg |
| $m_{22}$ | Output rotor mass | 500 kg |
| **Shafts** | | |
| $da1$ | Shaft 1 diameter | 0.5 m |
| $da2$ | Shaft 2 diameter | 0.2 m |
| $la1$ | Shaft 1 length | 2 m |
| $la2$ | Shaft 2 length | 1 m |
| $E_{steel}$ | Young modulus of steel | 2.1e11 MPa |
| $\nu_{steel}$ | Poisson ratio of steel | 0.3 |
| **Stiffness** | | |
| $k_x$ | $x$ translation stiffness | 1e8 N/m |
| $k_y$ | $y$ translation stiffness | 1e8 N/m |
| **Wind** | | |
| $r_{blade}$ | Blade radius | 6 m |
| $\rho _{air}$ | Air density | 1.225 kg/m3 |
| $v_{wind}$ | Wind mean speed | 12 m/s |
| $T_{fluct}$ | Wind fluctuating torque | 3000 Nm |
| $f_{fluct}$ | Fluctuation frequency | 6 Hz |
| $Cp$ | Performance coefficient | 16/27 |
| **Defects** | | |
| $e12_{amp}$ | Max profile error amplitude | Around 50$\mu m$ |
| $gap$ | Center distance error | around $\pm$1mm |
## Development machine specification
Hardware: Thinkpad E560, CPU Intel(R) Core(TM) i5-6200U(4)@2.8GHz, 3.70GiB RAM
OS: Arch Linux 6.19.12