|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- subroutine RTable_OffMode
-
- use SimulationVariables !@
-
- IMPLICIT NONE
-
- REAL :: RT_OldSpeed, RT_OldRpmGauge
-
-
-
- RT_OldSpeed = data%State%RTable%Speed
- RT_OldRpmGauge = data%State%RTable%RpmGaugeOutput
- data%State%RTable%N_new = 0.d0
-
- !======================= Rotary Table Rate_limit =======================
- if (((data%State%RTable%N_new-data%State%RTable%N_old)/data%State%RTable%time_step)>data%State%RTable%RateChange) then
- data%State%RTable%N_ref = (data%State%RTable%RateChange*data%State%RTable%time_step)+data%State%RTable%N_old
- else if (((data%State%RTable%N_old-data%State%RTable%N_new)/data%State%RTable%time_step)>data%State%RTable%RateChange) then
- data%State%RTable%N_ref = (-data%State%RTable%RateChange*data%State%RTable%time_step)+data%State%RTable%N_old
- else
- data%State%RTable%N_ref = data%State%RTable%N_new
- end if
- !=======================================================================
-
-
- if ( any(data%State%RTable%RotaryMode==(/1,4/)) ) then !if rotary connected to string
- !==> RPM
- data%State%RTable%Speed = data%State%RTable%N_ref/data%State%RTable%Conv_Ratio
- data%State%RTable%Speed = min(data%State%RTable%Speed,data%State%RTable%MaxRPM) !Speed [RPM]
- data%State%RTable%RpmGaugeOutput = data%State%RTable%Speed
- !==> Sound
- data%State%RTable%SoundRPM = INT(data%State%RTable%Speed)
- !==> Torque
- data%State%RTable%Torque = ( ((data%State%RTable%J_coef+data%State%RTable%String_JCoef)*((((pi*data%State%RTable%Speed)/30.d0)-((pi*RT_OldSpeed)/30.d0))/data%State%RTable%time_step))+(data%State%RTable%String_Torque) )*0.73756215d0 ![N.m]*0.73756215 = [ft.lbf] ![kg.m^2]*[radians/s^2]+[N.m]=[N.m]
- data%State%RTable%Torque = min(data%State%RTable%Torque,data%State%RTable%MaxTorque)
- data%State%RTable%TorqueGaugeOutput = data%State%RTable%Torque
- else if ( any(data%State%RTable%RotaryMode==(/2,5/)) ) then
- !==> RPM
- data%State%RTable%Speed = 0.d0
- data%State%RTable%RpmGaugeOutput = data%State%RTable%N_ref/data%State%RTable%Conv_Ratio
- data%State%RTable%RpmGaugeOutput = min(data%State%RTable%RpmGaugeOutput,data%State%RTable%MaxRPM)
- !==> Sound
- data%State%RTable%SoundRPM = INT(data%State%RTable%RpmGaugeOutput)
- !==> Torque
- data%State%RTable%Torque = 0.d0
- data%State%RTable%TorqueGaugeOutput = ( ((data%State%RTable%J_coef+data%State%RTable%String_JCoef)*((((pi*data%State%RTable%RpmGaugeOutput)/30.d0)-((pi*RT_OldRpmGauge)/30.d0))/data%State%RTable%time_step))+(data%State%RTable%String_Torque) )*0.73756215d0 ![N.m]*0.73756215 = [ft.lbf] ![kg.m^2]*[radians/s^2]+[N.m]=[N.m]
- data%State%RTable%TorqueGaugeOutput = min(data%State%RTable%TorqueGaugeOutput,data%State%RTable%MaxTorque)
- else if ( data%State%RTable%RotaryMode==3 ) then
- !==> RPM
- data%State%RTable%Speed = 0.d0
- data%State%RTable%RpmGaugeOutput = 0.d0
- !==> Sound
- data%State%RTable%SoundRPM = INT(data%State%RTable%RpmGaugeOutput)
- !==> Torque
- data%State%RTable%Torque = 0.d0
- data%State%RTable%TorqueGaugeOutput = 0.d0
- end if
-
-
-
-
- end subroutine RTable_OffMode
|