Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in FGBrushlessDCMotor #570

Merged
merged 29 commits into from
Jan 20, 2022
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ad4550d
first release FRBLdc.cpp and test scripts
pbecchi Dec 19, 2021
bafa85a
Programmable braking torque
pbecchi Dec 28, 2021
db1afa1
Delete Cobra2217.xml
pbecchi Dec 28, 2021
3708f40
added F450 test case
pbecchi Dec 28, 2021
541753a
Update FGBldc.h
pbecchi Dec 28, 2021
49df919
FGpropulsion.cpp modified
pbecchi Dec 29, 2021
0ec7d4d
local modifications
pbecchi Dec 29, 2021
8ea4b13
Merge branch 'DLBGengine' of https://github.com/pbecchi/jsbsim into D…
pbecchi Dec 29, 2021
43e2f64
Cmakelists_propulsion
pbecchi Jan 1, 2022
701190c
cleaned_examples
pbecchi Jan 8, 2022
be747db
Merge branch 'DLBGengine' of https://github.com/pbecchi/jsbsim into D…
pbecchi Jan 8, 2022
f566702
FGBLdc.cpp_reformatted
pbecchi Jan 8, 2022
841d32f
formatCorrections
pbecchi Jan 8, 2022
031a001
Correction_Reformat_requested
pbecchi Jan 8, 2022
313b169
updatedMakefile&addedElectricalUnits
pbecchi Jan 8, 2022
9c2b187
corrections
pbecchi Jan 10, 2022
e76c643
AdditionalCorrections
pbecchi Jan 10, 2022
927d82b
Update src/models/propulsion/FGBrushLessDCMotor.cpp
pbecchi Jan 10, 2022
7b27fc6
Update src/input_output/FGXMLElement.cpp
pbecchi Jan 10, 2022
5948851
Update src/models/propulsion/FGBrushLessDCMotor.h
pbecchi Jan 10, 2022
2ce9a4e
Update src/models/propulsion/FGBrushLessDCMotor.cpp
pbecchi Jan 10, 2022
3da9f59
Update src/models/propulsion/FGBrushLessDCMotor.cpp
pbecchi Jan 10, 2022
7273ed7
Update src/models/propulsion/FGBrushLessDCMotor.cpp
pbecchi Jan 10, 2022
4d5b655
Update src/models/propulsion/FGBrushLessDCMotor.cpp
pbecchi Jan 10, 2022
d19358f
Update src/models/propulsion/FGBrushLessDCMotor.cpp
pbecchi Jan 10, 2022
073615f
Remaining_comments
pbecchi Jan 11, 2022
58a7d77
Merge branch 'DLBGengine' of https://github.com/pbecchi/jsbsim into D…
pbecchi Jan 11, 2022
2a98044
ERROR in PR corrected
pbecchi Jan 18, 2022
f144652
Merge branch 'master' into DLBGengine
bcoconni Jan 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/models/propulsion/FGBrushLessDCMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Kv speed motor constant [RPM/Volt]
Rm internal coil resistance [Ohms]
I0 no load current [Amperes]

REFERENCE:
http://web.mit.edu/drela/Public/web/qprop/motor1_theory.pdf

HISTORY
--------------------------------------------------------------------------------
1/01/2022 Created
Expand Down Expand Up @@ -149,7 +152,7 @@ void FGBrushLessDCMotor::Calculate(void)
V = MaxVolts * in.ThrottlePos[EngineNumber];

// Delta RPM = (input voltage - currentRequired * coil resistance) * velocity costant
DeltaRPM = round((V - CurrentRequired * CoilResistance) * VelocityConstant);
DeltaRPM = (V - CurrentRequired * CoilResistance) * VelocityConstant-RPM;

// Torque is MaxTorque (stall torque) at 0 RPM and linearly go to 0 at max RPM (MaxVolts*VelocityCostant)
// MaxTorque = MaxCurrent*torqueconstant/velocityconstant*(1-RPM/maxRPM)
Expand All @@ -169,7 +172,7 @@ void FGBrushLessDCMotor::Calculate(void)
TargetTorque = TorqueRequired - min(abs(InertiaTorque)/(max(DecelerationFactor,0.01)*30),RPM*TorqueConstant/VelocityConstant/VelocityConstant/CoilResistance);
}

EnginePower = ((2 * M_PI) * max(RPM, 0.0001) * TargetTorque) / 60; //units [#*ft/s]
EnginePower = ((2 * M_PI) * RPM * TargetTorque) / 60; //units [#*ft/s]
HP = EnginePower /hptowatts*NMtoftpound; // units[HP]
LoadThrusterInputs();
Thruster->Calculate(EnginePower);
Expand Down