1 // =============================================================================
2 // PROJECT CHRONO - http://projectchrono.org
3 //
4 // Copyright (c) 2014 projectchrono.org
5 // All rights reserved.
6 //
7 // Use of this source code is governed by a BSD-style license that can be found
8 // in the LICENSE file at the top level of the distribution and at
9 // http://projectchrono.org/license-chrono.txt.
10 //
11 // =============================================================================
12 // Authors: Radu Serban
13 // =============================================================================
14 //
15 // Simple powertrain model for the UAZBUS vehicle.
16 // - based on torque-speed engine maps
17 // - both power and torque limited
18 // - no torque converter
19 // - simple gear-shifting model (in automatic mode)
20 //
21 // =============================================================================
22 
23 #include "chrono_models/vehicle/uaz/UAZBUS_SimpleMapPowertrain.h"
24 
25 namespace chrono {
26 namespace vehicle {
27 namespace uaz {
28 
29 const double rpm2rads = CH_C_PI / 30;
30 
UAZBUS_SimpleMapPowertrain(const std::string & name)31 UAZBUS_SimpleMapPowertrain::UAZBUS_SimpleMapPowertrain(const std::string& name) : ChSimpleMapPowertrain(name) {}
32 
GetMaxEngineSpeed()33 double UAZBUS_SimpleMapPowertrain::GetMaxEngineSpeed() {
34     return 4000 * rpm2rads;
35 }
36 
SetEngineTorqueMaps(ChFunction_Recorder & map0,ChFunction_Recorder & mapF)37 void UAZBUS_SimpleMapPowertrain::SetEngineTorqueMaps(ChFunction_Recorder& map0, ChFunction_Recorder& mapF) {
38    map0.AddPoint(-10.0,	                          0.0);
39    map0.AddPoint(10.0,	                          0.0);
40    map0.AddPoint(rpm2rads*7.3654652540894313e+02,	   -10.0);
41    map0.AddPoint(rpm2rads*9.8766401357229211e+02,	   -10.0);
42    map0.AddPoint(rpm2rads*1.5002376354371584e+03,	   -15.0);
43    map0.AddPoint(rpm2rads*1.9805319424140143e+03,	   -15.0);
44    map0.AddPoint(rpm2rads*2.3483645267445136e+03,	   -15.0);
45    map0.AddPoint(rpm2rads*2.7370849651969356e+03,	   -20.0);
46    map0.AddPoint(rpm2rads*3.1899218510296519e+03,	   -20.0);
47    map0.AddPoint(rpm2rads*3.6847450081517964e+03,	   -30.0);
48    map0.AddPoint(rpm2rads*3.9080471179935125e+03,	   -100.0);
49 
50    mapF.AddPoint(-10.0,	                          0.6*1.7442687747035581e+02);
51    mapF.AddPoint(rpm2rads*7.3654652540894313e+02,	   1.7442687747035581e+02);
52    mapF.AddPoint(rpm2rads*9.8766401357229211e+02,	   1.8272727272727280e+02);
53    mapF.AddPoint(rpm2rads*1.2386762202128491e+03,	   1.8984189723320162e+02);
54    mapF.AddPoint(rpm2rads*1.5002376354371584e+03,	   1.9577075098814234e+02);
55    mapF.AddPoint(rpm2rads*1.7244030537657691e+03,	   2.0051383399209493e+02);
56    mapF.AddPoint(rpm2rads*1.9805319424140143e+03,	   2.0525691699604749e+02);
57    mapF.AddPoint(rpm2rads*2.1885050625372241e+03,	   2.0762845849802375e+02);
58    mapF.AddPoint(rpm2rads*2.3483645267445136e+03,	   2.0810276679841903e+02);
59    mapF.AddPoint(rpm2rads*2.4920316927464028e+03,	   2.0620553359683799e+02);
60    mapF.AddPoint(rpm2rads*2.7370849651969356e+03,	   2.0620553359683799e+02);
61    mapF.AddPoint(rpm2rads*2.9927927277540134e+03,	   2.0620553359683799e+02);
62    mapF.AddPoint(rpm2rads*3.1899218510296519e+03,	   2.0644268774703562e+02);
63    mapF.AddPoint(rpm2rads*3.4879527857490921e+03,	   2.0312252964426881e+02);
64    mapF.AddPoint(rpm2rads*3.6847450081517964e+03,	   1.9956521739130440e+02);
65    mapF.AddPoint(rpm2rads*3.9080471179935125e+03,	   1.9458498023715421e+02);
66    mapF.AddPoint(rpm2rads*4100.0,	                  -100.0);
67    mapF.AddPoint(rpm2rads*4200.0,	                  -200.0);
68 }
69 
SetGearRatios(std::vector<double> & fwd,double & rev)70 void UAZBUS_SimpleMapPowertrain::SetGearRatios(std::vector<double>& fwd, double& rev) {
71     rev = -1.0/5.224;
72 
73     fwd.push_back(1.0/4.124/1.94);
74     fwd.push_back(1.0/4.124);
75     fwd.push_back(1.0/2.641);
76     fwd.push_back(1.0/1.58);
77     fwd.push_back(1.0);
78 }
79 
SetShiftPoints(std::vector<std::pair<double,double>> & shift_bands)80 void UAZBUS_SimpleMapPowertrain::SetShiftPoints(std::vector<std::pair<double, double>>& shift_bands) {
81     shift_bands.push_back(std::pair<double, double>(1000 * rpm2rads, 3000 * rpm2rads));
82     shift_bands.push_back(std::pair<double, double>(1000 * rpm2rads, 3700 * rpm2rads));
83     shift_bands.push_back(std::pair<double, double>(1000 * rpm2rads, 3700 * rpm2rads));
84     shift_bands.push_back(std::pair<double, double>(1000 * rpm2rads, 3700 * rpm2rads));
85     shift_bands.push_back(std::pair<double, double>(1000 * rpm2rads, 3700 * rpm2rads));
86     // shift_bands.push_back(std::pair<double, double>(1000 * rpm2rads, 4000 * rpm2rads));
87 }
88 
89 }  // end namespace uaz
90 }  // end namespace vehicle
91 }  // end namespace chrono
92