Skip to content

Commit

Permalink
Настроил озвучку крана 395
Browse files Browse the repository at this point in the history
  • Loading branch information
ArepMM committed Jul 1, 2023
1 parent 999be58 commit 8a4ae55
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 48 deletions.
3 changes: 2 additions & 1 deletion addons/vl60/vl60k/src/vl60k-init-brakes-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ void VL60k::initBrakesControl(QString modules_dir)

// Тройник магистрали тормозных цилиндров
bc_splitter = new PneumoSplitter();
bc_splitter->read_config("pneumo-splitter");
bc_splitter->read_custom_config(
config_dir + QDir::separator() + "bc-splitter");

// Концевые краны магистрали тормозных цилиндров
anglecock_bc_fwd = new PneumoAngleCock();
Expand Down
14 changes: 10 additions & 4 deletions cfg/devices/krm395.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@
<!-- Коэффициент разрядки ТМ в VI положении -->
<K_VI>8.0e-2</K_VI>

<Kv_in>2e6</Kv_in>
<Kv_out>4e5</Kv_out>
<Kv_1>3e5</Kv_1>
<!-- Коэффициенты перехода от потока к громкости озвучки крана -->
<!-- К кубическому корню из потока наполнения ТМ -->
<Kv_in>3e2</Kv_in>
<!-- К кубическому корню из потока разрядки ТМ -->
<Kv_out>3e2</Kv_out>
<!-- К потоку зарядки уравнительного резервуара в I положении -->
<!-- <Kv_1>3e5</Kv_1> -->
<!-- К утечке из уравнительного резервуара через стабилизатор во II положении -->
<Kv_2>1e7</Kv_2>
<Kv_5>2e5</Kv_5>
<!-- К кубическому корню из потока разрядки уравнительного резервуара -->
<Kv_5>2e2</Kv_5>

</Device>
</Config>
2 changes: 1 addition & 1 deletion cfg/devices/motor-compressor-ac.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<K_pressure>0.0077</K_pressure>

<!-- Коэффициент потока в питательную магистраль -->
<K_flow>0.005</K_flow>
<K_flow>0.01</K_flow>

<SoundName>Motor_Compressor</SoundName>
<RegulateSoundByOnOff>0</RegulateSoundByOnOff>
Expand Down
2 changes: 1 addition & 1 deletion cfg/devices/motor-compressor-dc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<K_pressure>0.0061</K_pressure>

<!-- Коэффициент потока в питательную магистраль -->
<K_flow>0.005</K_flow>
<K_flow>0.01</K_flow>

<SoundName>Motor_Compressor</SoundName>
<RegulateSoundByOnOff>0</RegulateSoundByOnOff>
Expand Down
4 changes: 2 additions & 2 deletions cfg/vehicles/VL60k-1737/brakes-init.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<BrakesState>

<!-- Давление в главных резервуарах, МПа -->
<MainReservoirPressure>0.9</MainReservoirPressure>
<!-- <MainReservoirPressure>0.9</MainReservoirPressure> -->

<!-- Темп утечек из ГР -->
<MainReservoirFlow>1.1e-4</MainReservoirFlow>

<!-- Зарядное давление, МПа -->
<ChargingPressure>0.5</ChargingPressure>
<!-- <ChargingPressure>0.5</ChargingPressure> -->

<!-- Положение рукоятки крана машиниста -->
<TrainCranePos>2</TrainCranePos>
Expand Down
19 changes: 0 additions & 19 deletions cfg/vehicles/chs2t/motor-compressor.xml

This file was deleted.

2 changes: 1 addition & 1 deletion cfg/vehicles/tep70/motor-compressor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<K_pressure>0.01</K_pressure>

<!-- Коэффициент потока в питательную магистраль -->
<K_flow>0.005</K_flow>
<K_flow>0.01</K_flow>

<SoundName>Motor_Compressor</SoundName>
<RegulateSoundByOnOff>0</RegulateSoundByOnOff>
Expand Down
2 changes: 1 addition & 1 deletion cfg/vehicles/tep70bs/motor-compressor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<K_pressure>0.01</K_pressure>

<!-- Коэффициент потока в питательную магистраль -->
<K_flow>0.005</K_flow>
<K_flow>0.01</K_flow>

<SoundName>Motor_Compressor</SoundName>
<RegulateSoundByOnOff>0</RegulateSoundByOnOff>
Expand Down
18 changes: 18 additions & 0 deletions cfg/vehicles/vl60k-1737/bc-splitter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Config>
<Device>
<Order>1</Order>
<SubStepNum>1</SubStepNum>
<Solver>euler</Solver>

<!-- Объём рабочей камеры пневмосоединения -->
<V0>1e-2</V0>

<K1>1e-2</K1>

<K2>1e-2</K2>

<K3>1e-2</K3>

</Device>
</Config>
14 changes: 6 additions & 8 deletions simulator/krm395/include/krm395.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,19 @@ class BrakeCrane395 : public BrakeCrane

int max_pos;

// Громкость озвучки
int volume_in;

int volume_out;

double Kv_in;

double Kv_out;

// int volume_1;
int volume_2;
// int volume_5;
int volume_5;

// Коэффициенты к громкости озвучки
double Kv_in;
double Kv_out;
// double Kv_1;
double Kv_2;
// double Kv_5;
double Kv_5;

Timer *incTimer;
Timer *decTimer;
Expand Down
26 changes: 16 additions & 10 deletions simulator/krm395/src/krm395.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ BrakeCrane395::BrakeCrane395(QObject *parent) : BrakeCrane (parent)
, max_pos(POS_VI)
, volume_in(0)
, volume_out(0)
, Kv_in(1e9)
, Kv_out(1e7)
// , volume_1(0)
, volume_2(0)
, Kv_2(2e7)
, volume_5(0)
, Kv_in(3e2)
, Kv_out(3e2)
// , Kv_1(3e5)
, Kv_2(1e7)
, Kv_5(2e2)
{
std::fill(pos.begin(), pos.end(), 0.0);
pos[POS_II] = 1.0;
Expand Down Expand Up @@ -102,15 +106,17 @@ void BrakeCrane395::preStep(state_vector_t &Y, double t)

emit soundSetVolume("KRM395_vpusk", cut(volume_in, 0, 100));
emit soundSetVolume("KRM395_vipusk", cut(volume_out, 0, 100));
// emit soundSetVolume("KRM395_1", cut(volume_1, 0, 100));
emit soundSetVolume("KRM395_2", cut(volume_2, 0, 100));
emit soundSetVolume("KRM395_5", cut(volume_5, 0, 100));
/*
// DebugMsg = QString("out: %1 in: %2 1: %3 2: %4 5: %5")
DebugMsg = QString("out: %1 in: %2 2: %3")
DebugMsg = QString("out: %1 in: %2 2: %3 5: %4")
.arg(volume_out, 10)
.arg(volume_in, 10)
// .arg(volume_1, 10)
.arg(volume_2, 10);
// .arg(volume_5, 10);
.arg(volume_5, 10);
*/
}

Expand Down Expand Up @@ -168,11 +174,11 @@ void BrakeCrane395::ode_system(const state_vector_t &Y,
// Суммарный поток в уравнительный резервуар
setERflow(Q_leak_er + Q_charge_er + Q_train_er + Q_stab_er + Q_brake_er);

volume_in = static_cast<int>(Kv_in * pf(QBP)) * pos[POS_I];
volume_out = static_cast<int>(Kv_out * nf(QBP));
volume_in = static_cast<int>(Kv_in * cbrt(pf(QBP)));
volume_out = static_cast<int>(Kv_out * cbrt(nf(QBP)));
// volume_1 = static_cast<int>(Kv_1 * pf(Q_charge_er));
volume_2 = static_cast<int>(Kv_2 * nf(Q_stab_er));
// volume_5 = static_cast<int>(Kv_5 * nf(Q_brake_er));
volume_5 = static_cast<int>(Kv_5 * cbrt(nf(Q_brake_er)));

BrakeCrane::ode_system(Y, dYdt, t);
}
Expand All @@ -199,6 +205,7 @@ void BrakeCrane395::load_config(CfgReader &cfg)
cfg.getDouble(secName, "A", A);

cfg.getDouble(secName, "K_charge", K_charge);
cfg.getDouble(secName, "K_pulse_II", K_pulse_II);
cfg.getDouble(secName, "K_feed", K_feed);
cfg.getDouble(secName, "K_atm", K_atm);
cfg.getDouble(secName, "K_VI", K_VI);
Expand All @@ -207,8 +214,7 @@ void BrakeCrane395::load_config(CfgReader &cfg)
cfg.getDouble(secName, "Kv_out", Kv_out);
// cfg.getDouble(secName, "Kv_1", Kv_1);
cfg.getDouble(secName, "Kv_2", Kv_2);
cfg.getDouble(secName, "K_pulse_II", K_pulse_II);
// cfg.getDouble(secName, "Kv_5", Kv_5);
cfg.getDouble(secName, "Kv_5", Kv_5);
}

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 8a4ae55

Please sign in to comment.