|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- subroutine RTable_OnModeSolver
-
- Use RTable_VARIABLES
-
- IMPLICIT NONE
-
- REAL :: RT_OldSpeed, RT_OldRpmGauge
-
-
-
- RT_OldSpeed = RTable%Speed
- RT_OldRpmGauge = RTable%RpmGaugeOutput
-
-
-
- if ( any(RTable%RotaryMode==(/1,4/)) ) then !if rotary connected to string
- !==> RPM
- RTable%Speed = RTable%N_ref/RTable%Conv_Ratio
- RTable%Speed = min(RTable%Speed,RTable%MaxRPM) !Speed [RPM]
- RTable%RpmGaugeOutput = RTable%Speed
- !==> Sound
- RTable%SoundRPM = INT(RTable%Speed)
- !==> Torque
- RTable%Torque = ( ((RTable%J_coef+RTable%String_JCoef)*((((pi*RTable%Speed)/30.d0)-((pi*RT_OldSpeed)/30.d0))/RTable%time_step))+(RTable%String_Torque) )*0.73756215d0 ![N.m]*0.73756215 = [ft.lbf] ![kg.m^2]*[radians/s^2]+[N.m]=[N.m]
- RTable%Torque = min(RTable%Torque,RTable%MaxTorque)
- RTable%TorqueGaugeOutput = RTable%Torque
- else if ( any(RTable%RotaryMode==(/2,5/)) ) then
- !==> RPM
- RTable%Speed = 0.d0
- RTable%RpmGaugeOutput = RTable%N_ref/RTable%Conv_Ratio
- RTable%RpmGaugeOutput = min(RTable%RpmGaugeOutput,RTable%MaxRPM) !inja bayad bashe ya na???
- !==> Sound
- RTable%SoundRPM = INT(RTable%RpmGaugeOutput)
- !==> Torque
- RTable%Torque = 0.d0
- RTable%TorqueGaugeOutput = ( ((RTable%J_coef+RTable%String_JCoef)*((((pi*RTable%RpmGaugeOutput)/30.d0)-((pi*RT_OldRpmGauge)/30.d0))/RTable%time_step))+(RTable%String_Torque) )*0.73756215d0 ![N.m]*0.73756215 = [ft.lbf] ![kg.m^2]*[radians/s^2]+[N.m]=[N.m]
- RTable%TorqueGaugeOutput = min(RTable%TorqueGaugeOutput,RTable%MaxTorque)
- else if ( RTable%RotaryMode==3 ) then
- !==> RPM
- RTable%Speed = 0.d0
- RTable%RpmGaugeOutput = 0.d0
- !==> Sound
- RTable%SoundRPM = INT(RTable%RpmGaugeOutput)
- !==> Torque
- RTable%Torque = 0.d0
- RTable%TorqueGaugeOutput = 0.d0
- end if
-
-
-
- END subroutine RTable_OnModeSolver
|