Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 lines
3.4 KiB

  1. subroutine RTable_OffMode
  2. use SimulationVariables !@
  3. IMPLICIT NONE
  4. REAL :: RT_OldSpeed, RT_OldRpmGauge
  5. RT_OldSpeed = data%State%RTable%Speed
  6. RT_OldRpmGauge = data%State%RTable%RpmGaugeOutput
  7. data%State%RTable%N_new = 0.d0
  8. !======================= Rotary Table Rate_limit =======================
  9. if (((data%State%RTable%N_new-data%State%RTable%N_old)/data%State%RTable%time_step)>data%State%RTable%RateChange) then
  10. data%State%RTable%N_ref = (data%State%RTable%RateChange*data%State%RTable%time_step)+data%State%RTable%N_old
  11. else if (((data%State%RTable%N_old-data%State%RTable%N_new)/data%State%RTable%time_step)>data%State%RTable%RateChange) then
  12. data%State%RTable%N_ref = (-data%State%RTable%RateChange*data%State%RTable%time_step)+data%State%RTable%N_old
  13. else
  14. data%State%RTable%N_ref = data%State%RTable%N_new
  15. end if
  16. !=======================================================================
  17. if ( any(data%State%RTable%RotaryMode==(/1,4/)) ) then !if rotary connected to string
  18. !==> RPM
  19. data%State%RTable%Speed = data%State%RTable%N_ref/data%State%RTable%Conv_Ratio
  20. data%State%RTable%Speed = min(data%State%RTable%Speed,data%State%RTable%MaxRPM) !Speed [RPM]
  21. data%State%RTable%RpmGaugeOutput = data%State%RTable%Speed
  22. !==> Sound
  23. data%State%RTable%SoundRPM = INT(data%State%RTable%Speed)
  24. !==> Torque
  25. 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]
  26. data%State%RTable%Torque = min(data%State%RTable%Torque,data%State%RTable%MaxTorque)
  27. data%State%RTable%TorqueGaugeOutput = data%State%RTable%Torque
  28. else if ( any(data%State%RTable%RotaryMode==(/2,5/)) ) then
  29. !==> RPM
  30. data%State%RTable%Speed = 0.d0
  31. data%State%RTable%RpmGaugeOutput = data%State%RTable%N_ref/data%State%RTable%Conv_Ratio
  32. data%State%RTable%RpmGaugeOutput = min(data%State%RTable%RpmGaugeOutput,data%State%RTable%MaxRPM)
  33. !==> Sound
  34. data%State%RTable%SoundRPM = INT(data%State%RTable%RpmGaugeOutput)
  35. !==> Torque
  36. data%State%RTable%Torque = 0.d0
  37. 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]
  38. data%State%RTable%TorqueGaugeOutput = min(data%State%RTable%TorqueGaugeOutput,data%State%RTable%MaxTorque)
  39. else if ( data%State%RTable%RotaryMode==3 ) then
  40. !==> RPM
  41. data%State%RTable%Speed = 0.d0
  42. data%State%RTable%RpmGaugeOutput = 0.d0
  43. !==> Sound
  44. data%State%RTable%SoundRPM = INT(data%State%RTable%RpmGaugeOutput)
  45. !==> Torque
  46. data%State%RTable%Torque = 0.d0
  47. data%State%RTable%TorqueGaugeOutput = 0.d0
  48. end if
  49. end subroutine RTable_OffMode