Exciter.cpp 1.69 KB
Newer Older
Viviane Sapucaia's avatar
Viviane Sapucaia committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/** Exciter
*
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* DPsim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/

#include "Exciter.h"
#include "../IntegrationMethod.h"

using namespace DPsim;

Exciter::Exciter(Real Ta, Real Ka, Real Te, Real Ke, Real Tf, Real Kf, Real Tr, Real Lad, Real Rfd, Real Vf_init)
{

	mTa = Ta;
	mKa = Ka;
	mTe = Te;
	mKe = Ke;
	mTf = Tf;
	mKf = Kf;
	mTr = Tr;
	mLad = Lad;
	mRfd = Rfd;
40
	mVf = Vf_init*(mLad / mRfd);
41
	mVf = 0;
Viviane Sapucaia's avatar
Viviane Sapucaia committed
42
43
44
45

}


46
Real Exciter::step(Real mVd, Real mVq, Real Vref, Real dt) {
Viviane Sapucaia's avatar
Viviane Sapucaia committed
47
48
49
50


	mVh = sqrt(pow(mVd, 2.) + pow(mVq, 2.));
	// Voltage Transducer equation
51
	mVm = Euler(mVm, -1, 1, dt / mTr, mVh);
Viviane Sapucaia's avatar
Viviane Sapucaia committed
52
	// Stabilizing feedback equation
53
54
	mVfl = mVfl + dt*mVis / mTf;
	mVis = (mKf / mTf)*mVf - mVfl;
Viviane Sapucaia's avatar
Viviane Sapucaia committed
55
	// Amplifier equation
56
	mVr = Euler(mVr, -1, mKa, dt / mTa, Vref - mVm - mVis);
Viviane Sapucaia's avatar
Viviane Sapucaia committed
57
58
	// Exciter
	mVse = 0.0039*exp(mVf*1.555);
59
	mVf = Euler(mVf, -mKe, 1, dt / mTe, mVr - mVse);
Viviane Sapucaia's avatar
Viviane Sapucaia committed
60

61
	return (mRfd / mLad)*mVf;
Viviane Sapucaia's avatar
Viviane Sapucaia committed
62
63
64
65
66

}