subroutine RTable_Solver use CDrillingConsoleVariables use CDataDisplayConsoleVariables ! use CSimulationVariables use CDrillWatchVariables use RTable_VARIABLES use CSounds use equipments_PowerLimit IMPLICIT NONE REAL :: const , RT_RpmGaugeOutput !RTable%TracTorque = RTable%String_Torque/RTable%Conv_Ratio/RTable%Mech_Efficiency RT_wOld = RTable%w_new/RTable%Conv_Ratio CALL RTable_Traction_Motor if (RTable%N_ref<=0.) then Call RTable_OffMode end if !IF (RTable%ia_new<=1150.) THEN RTable%fii = 6.3304d-3*1150. !ELSE IF (RTable%ia_new>1150.) THEN ! RTable%fii = 2.8571d-7*(RTable%ia_new-1150.)+7.28 !END IF RTable%Te = RTable%fii*RTable%ia_new const = RTable%J_coef+(RTable%String_JCoef/(RTable%Mech_Efficiency*RTable%Conv_Ratio)) RTable%dw = (RTable%Te-RTable%TL)/(const) if ( any(RT_RotaryMode==(/1,4/)) ) then !if rotary connected to string RT_RpmGaugeOutput = (30.d0*RTable%w_new/pi)/RTable%Conv_Ratio RTable%Speed = min(RT_RpmGaugeOutput,200.d0) !Speed [RPM] Call Set_RotaryRPMGauge(sngl(1-RTable%RpmGaugeMalf)*real(RTable%Speed,8)) RTable%SoundRPM = INT(RTable%Speed) Call SetSoundRT( RTable%SoundRPM ) !RotaryRPMGauge = RTable%Speed !RPM = RotaryRPMGauge DataDisplayConsole%RotaryTorqueGauge = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] RTable%Torque = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] Call Set_RotaryTorque(sngl(1-RTable%TorqueGaugeMalf)*real(RTable%Torque,8)) DrillingWatch%Torque = DataDisplayConsole%RotaryTorqueGauge !print*, 'RTable%Speed=', RTable%Speed !print*, 'RTable%String_JCoef=', RTable%String_JCoef !print*, 'RTable%String_Torque=', RTable%String_Torque else if ( any(RT_RotaryMode==(/2,5/)) ) then RTable%Speed = 0.0 RT_RpmGaugeOutput = (30.d0*RTable%w_new/pi)/RTable%Conv_Ratio RT_RpmGaugeOutput = min(RT_RpmGaugeOutput,200.d0) !print*, 'RT_RpmGaugeOutputif=', RT_RpmGaugeOutput Call Set_RotaryRPMGauge(sngl(1-RTable%RpmGaugeMalf)*real(RT_RpmGaugeOutput,8)) RTable%SoundRPM = INT((30.d0*RTable%w_new/pi)/RTable%Conv_Ratio) Call SetSoundRT( RTable%SoundRPM ) RTable%Torque = 0.0 Call Set_RotaryTorque(sngl(1-RTable%TorqueGaugeMalf)*real( (((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque))*0.73756215,8 )) !print*, 'RT_Rpmtorqueif=', RTable%Torque , sngl(1-RTable%TorqueGaugeMalf)*real( (((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque))*0.73756215,8 ) else if ( RT_RotaryMode==3 ) then RTable%Speed = 0.0 RT_RpmGaugeOutput = 0.d0 Call Set_RotaryRPMGauge(sngl(1-RTable%RpmGaugeMalf)*real(RT_RpmGaugeOutput,8)) RTable%SoundRPM = 0 Call SetSoundRT( RTable%SoundRPM ) RTable%Torque = 0.0 Call Set_RotaryTorque(sngl(1-RTable%TorqueGaugeMalf)*real( 0.d0,8 )) end if !if ( RTable%String_JCoef/=0.0 ) then !if rotary connected to string ! RT_RpmGaugeOutput = (30.d0*RTable%w_new/pi)/RTable%Conv_Ratio ! RTable%Speed = min(RT_RpmGaugeOutput,200.d0) !Speed [RPM] ! Call Set_RotaryRPMGauge(real(RTable%Speed,8)) ! RTable%SoundRPM = INT(RTable%Speed) ! Call SetSoundRT( RTable%SoundRPM ) ! !RotaryRPMGauge = RTable%Speed ! !RPM = RotaryRPMGauge ! RotaryTorqueGauge = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] ! RTable%Torque = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] ! Call Set_RotaryTorque(real(RTable%Torque,8)) ! Torque = RotaryTorqueGauge !else ! RTable%Speed = 0.0 ! RT_RpmGaugeOutput = (30.d0*RTable%w_new/pi)/RTable%Conv_Ratio ! RT_RpmGaugeOutput = min(RT_RpmGaugeOutput,200.d0) ! Call Set_RotaryRPMGauge(real(RT_RpmGaugeOutput,8)) ! RTable%SoundRPM = INT((30.d0*RTable%w_new/pi)/RTable%Conv_Ratio) ! Call SetSoundRT( RTable%SoundRPM ) ! RTable%Torque = 0.0 ! Call Set_RotaryTorque(real( (((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque))*0.73756215,8 )) !end if !****************************************************************** !!!!!RTable%Output_Current = (RTable%TracTorque*RTable%w_new)/RTable%Vt !???????????? !!print*, 'Power_sigma=', Power_sigma !!print*, 'power_num_of_Jenerators=', power_num_of_Jenerators !!print*, 'drilling_num_of_Jenerators=', drilling_num_of_Jenerators !!!print*, 'Jenerator_power=', Jenerator_power !print*, 'RT_RpmGaugeOutput=', RT_RpmGaugeOutput !!!print*, 'RTable%Vt=', RTable%Vt !print*, 'RTable%w=', RTable%w_new !print*, 'RTable%String_Torque=', RTable%String_Torque !print*, 'RTable%Speed=', RTable%Speed !!print*, 'RTable%Speed2=', ((30.*RTable%w_new/pi)/RTable%Conv_Ratio) !!!!!!!print*, 'RTable%Te=', RTable%Te !print*, 'RTable%TL=', RTable%TL !!print*, 'RTable%ia=', RTable%ia_new !!print*, 'RTable%ia_ref=', RTable%ia_ref !!print*, 'RTable%ia_ref_limit=', RTable%ia_ref_limit END subroutine RTable_Solver