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.
 
 
 
 
 
 

83 lines
2.4 KiB

  1. subroutine TopDrive_MainSolver
  2. Use TopDrive_VARIABLES
  3. IMPLICIT NONE
  4. CALL TopDrive_Inputs
  5. if ( (TDS%PowerState==-1) ) then !FWD
  6. TDS%SoundBlower = .true.
  7. TDS%PowerLed = 1
  8. TDS%N_new = (TDS%RpmKnob/250.d0)*965.d0 ! 0<TDS%RpmKnob<250 , 0<TDS%N_ref(truction motor)<965
  9. !===> Top Drive Malfunction ----> Drive Motor Failure
  10. if ( TDS%MotorFaileMalf==1 ) then
  11. TDS%N_new = 0.d0
  12. end if
  13. !========================== Top Drive Rate limit ==========================
  14. if (((TDS%N_new-TDS%N_old)/TDS%time_step)>TDS%RateChange) then
  15. TDS%N_ref = (TDS%RateChange*TDS%time_step)+TDS%N_old
  16. else if (((TDS%N_old-TDS%N_new)/TDS%time_step)>TDS%RateChange) then
  17. TDS%N_ref = (-TDS%RateChange*TDS%time_step)+TDS%N_old
  18. else
  19. TDS%N_ref = TDS%N_new
  20. end if
  21. !==========================================================================
  22. CALL TopDrive_Solver
  23. else if ( (TDS%PowerState==1) ) then !REV
  24. TDS%SoundBlower = .true.
  25. TDS%PowerLed = 1
  26. TDS%N_new = (TDS%RpmKnob/250.d0)*965.d0
  27. !===> Top Drive Malfunction ----> Drive Motor Failure
  28. if ( TDS%MotorFaileMalf==1 ) then
  29. TDS%N_new = 0.d0
  30. end if
  31. !========================== Top Drive Rate limit ==========================
  32. if (((TDS%N_new-TDS%N_old)/TDS%time_step)>TDS%RateChange) then
  33. TDS%N_ref =(TDS%RateChange*TDS%time_step)+TDS%N_old
  34. else if (((TDS%N_old-TDS%N_new)/TDS%time_step)>TDS%RateChange) then
  35. TDS%N_ref = (-TDS%RateChange*TDS%time_step)+TDS%N_old
  36. else
  37. TDS%N_ref = TDS%N_new
  38. end if
  39. !==========================================================================
  40. CALL TopDrive_Solver
  41. else
  42. if( (TDS%PowerState /= 0) ) then
  43. TDS%SoundBlower = .true.
  44. TDS%PowerLed = 1
  45. else
  46. TDS%SoundBlower = .false.
  47. TDS%PowerLed = 0
  48. end if
  49. Call TopDrive_OffMode
  50. end if
  51. Call TopDrive_Outputs
  52. TDS%N_old = TDS%N_ref
  53. end subroutine TopDrive_MainSolver