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.

TopDrive_MainSolver.f90 2.6 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. subroutine TopDrive_MainSolver
  2. !use CDataDisplayConsoleVariables
  3. !use CDrillingConsoleVariables
  4. ! use CSimulationVariables
  5. use TopDrive_VARIABLES
  6. use CDrillWatchVariables
  7. use CWarningsVariables
  8. use CSounds
  9. use CTopDrivePanelVariables
  10. IMPLICIT NONE
  11. !if ( (TopDriveTdsPowerState==-1) .and. (RpmKnob==0.) ) then !FWD
  12. if ( TopDrivePanel%TopDriveTdsPowerState==-1 ) then !.and. (IsStopped == .false.)
  13. TDS%SoundBlower = .true.
  14. !Call SetSoundBlowerRT(TDS%SoundBlower)
  15. TopDrivePanel%TopDriveTdsPowerLed = 1
  16. !IF ( RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ????
  17. TDS%N_new = (TopDrivePanel%RpmKnob/250.d0)*965.d0 ! 0<RpmKnob<250 , 0<TDS%N_ref(truction motor)<965
  18. !===> Top Drive Malfunction ----> Drive Motor Failure
  19. call TopDrive_Malfunction_MotorFailure
  20. if (((TDS%N_new-TDS%N_old)/TDS%time_step)>193.) then
  21. TDS%N_ref = (193.*TDS%time_step)+TDS%N_old
  22. else if (((TDS%N_old-TDS%N_new)/TDS%time_step)>193.) then
  23. TDS%N_ref = (-193.*TDS%time_step)+TDS%N_old
  24. else
  25. TDS%N_ref = TDS%N_new
  26. end if
  27. CALL TopDrive_INPUTS
  28. CALL TopDrive_Solver
  29. TDS%N_old = TDS%N_ref
  30. !else if ( (TopDriveTdsPowerState==1) .and. (RpmKnob==0.) ) then !REV
  31. else if ( (TopDrivePanel%TopDriveTdsPowerState==1) ) then !REV .and. (IsStopped == .false.)
  32. TDS%SoundBlower = .true.
  33. !Call SetSoundBlowerRT(TDS%SoundBlower)
  34. TopDrivePanel%TopDriveTdsPowerLed = 1
  35. TDS%N_new = (TopDrivePanel%RpmKnob/250.d0)*965.d0
  36. !===> Top Drive Malfunction ----> Drive Motor Failure
  37. call TopDrive_Malfunction_MotorFailure
  38. if (((TDS%N_new-TDS%N_old)/TDS%time_step)>193.) then
  39. TDS%N_ref = (193.*TDS%time_step)+TDS%N_old
  40. else if (((TDS%N_old-TDS%N_new)/TDS%time_step)>193.) then
  41. TDS%N_ref = (-193.*TDS%time_step)+TDS%N_old
  42. else
  43. TDS%N_ref = TDS%N_new
  44. end if
  45. CALL TopDrive_INPUTS
  46. CALL TopDrive_Solver
  47. TDS%N_old = TDS%N_ref
  48. else
  49. if( (TopDrivePanel%TopDriveTdsPowerState /= 0) ) then !.and. (IsStopped == .false.)
  50. TDS%SoundBlower = .true.
  51. !Call SetSoundBlowerRT(TDS%SoundBlower)
  52. TopDrivePanel%TopDriveTdsPowerLed = 1
  53. else
  54. TDS%SoundBlower = .false.
  55. !Call SetSoundBlowerRT(TDS%SoundBlower)
  56. TopDrivePanel%TopDriveTdsPowerLed = 0
  57. end if
  58. Call TopDrive_OffMode
  59. end if
  60. end subroutine TopDrive_MainSolver