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.

Drawworks_Direction.i90 9.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # 1 "/home/admin/SimulationCore2/Equipments/Drawworks/Drawworks_Direction.f90"
  2. subroutine Drawworks_Direction
  3. use CDrillingConsoleVariables
  4. use SimulationVariables
  5. use SimulationVariables
  6. use CDataDisplayConsole
  7. use SimulationVariables
  8. use SimulationVariables !@
  9. IMPLICIT NONE
  10. ! ! if (data%State%Drawworks%Switch==1) then !Up
  11. ! if (data%State%Drawworks%Throttle >= 0.d0) then !Up
  12. ! data%State%Drawworks%motion = +1
  13. ! data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ?
  14. ! data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s]
  15. ! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height+(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m]
  16. ! ! else if (data%State%Drawworks%Switch==-1) then !Down
  17. ! else if (data%State%Drawworks%Throttle < 0.d0) then !Down
  18. ! data%State%Drawworks%motion = -1
  19. ! data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ?
  20. ! data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s]
  21. ! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height-(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m]
  22. ! !else if (data%State%Drawworks%Switch==0) then !Off
  23. ! ! data%State%Drawworks%motion = 0
  24. ! ! data%State%Drawworks%w_old_drum = 0.d0
  25. ! ! data%State%Drawworks%w_drum = 0.d0
  26. ! ! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height
  27. ! end if
  28. if ((data%State%Drawworks%Throttle>0.d0) .or. (data%State%Drawworks%Throttle==0.d0 .and. data%State%Drawworks%Speed/=0.d0 .and. data%State%Drawworks%motion==+1)) then !Up
  29. data%State%Drawworks%motion = +1
  30. data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ?
  31. data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s]
  32. !data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height+(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m]
  33. data%State%Drawworks%HookLinearVelocity = (((data%State%Drawworks%Diameter/2.0)*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum))/data%State%Drawworks%NumberOfLine) ![m/s]
  34. else if ((data%State%Drawworks%Throttle<0.d0) .or. (data%State%Drawworks%Throttle==0.d0 .and. data%State%Drawworks%Speed/=0.d0 .and. data%State%Drawworks%motion==-1)) then !Down
  35. data%State%Drawworks%motion = -1
  36. data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ?
  37. data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s]
  38. !data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height-(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m]
  39. data%State%Drawworks%HookLinearVelocity = -(((data%State%Drawworks%Diameter/2.0)*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum))/data%State%Drawworks%NumberOfLine) ![m/s]
  40. else !fixed
  41. data%State%Drawworks%motion = 0
  42. data%State%Drawworks%w_old_drum = 0.d0
  43. data%State%Drawworks%w_drum = 0.d0
  44. data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height
  45. !data%State%Drawworks%HookLinearVelocity = 0.d0 ![m/s]
  46. end if
  47. !if (data%State%Drawworks%Conv_Ratio==1.d0) then
  48. !
  49. !
  50. ! IF (data%State%Drawworks%motion==+1) THEN
  51. ! Call Drawworks_Free_Traction_motor_Dir
  52. ! if (data%State%Drawworks%w_drum_Dir<=0.) then
  53. ! data%State%Drawworks%motion = 0
  54. ! else
  55. ! data%State%Drawworks%motion = +1
  56. ! Call Drawworks_Free_Traction_motor
  57. ! data%State%Drawworks%w = data%State%Drawworks%w_drum*data%State%Drawworks%Conv_Ratio
  58. ! data%State%Drawworks%w_old = data%State%Drawworks%w_old_drum*data%State%Drawworks%Conv_Ratio
  59. ! end if
  60. ! ELSE
  61. ! if (((data%State%Drawworks%F_fastline*(data%State%Drawworks%Diameter/2.0d0))-(((data%State%Drawworks%Diameter/2.0d0)*data%State%Drawworks%BreakLoad)*(data%State%Drawworks%ManualBreak/100.0d0)))<=0.) then
  62. ! data%State%Drawworks%motion = 0
  63. ! data%State%Drawworks%w_drum = 0.0d0
  64. ! data%State%Drawworks%w_old_drum = 0.0d0
  65. ! data%State%Drawworks%w = data%State%Drawworks%w_drum*data%State%Drawworks%Conv_Ratio
  66. ! data%State%Drawworks%w_old = data%State%Drawworks%w_old_drum*data%State%Drawworks%Conv_Ratio
  67. ! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height
  68. !
  69. ! data%State%Drawworks%ia = 0.
  70. ! data%State%Drawworks%ia_old = 0.
  71. ! data%State%Drawworks%x = 0.
  72. ! data%State%Drawworks%x_old = 0.
  73. ! data%State%Drawworks%y = 0.
  74. ! data%State%Drawworks%y_old = 0.
  75. ! else
  76. ! data%State%Drawworks%motion = -1
  77. ! Call Drawworks_Free_Traction_motor_dawn_motion
  78. ! data%State%Drawworks%w = data%State%Drawworks%w_drum*data%State%Drawworks%Conv_Ratio
  79. ! data%State%Drawworks%w_old = data%State%Drawworks%w_old_drum*data%State%Drawworks%Conv_Ratio
  80. ! end if
  81. !
  82. ! END IF
  83. !
  84. !
  85. !else
  86. !
  87. ! IF (data%State%Drawworks%motion==-1) THEN
  88. ! data%State%Drawworks%w = -data%State%Drawworks%w
  89. ! data%State%Drawworks%w_old = -data%State%Drawworks%w_old
  90. ! data%State%Drawworks%w_drum = -data%State%Drawworks%w_drum
  91. ! data%State%Drawworks%w_old_drum = -data%State%Drawworks%w_old_drum
  92. ! END IF
  93. ! Call Drawworks_Traction_motor_ClutchMode_Dir
  94. ! IF (data%State%Drawworks%w_Dir>0.d0) then
  95. !
  96. ! data%State%Drawworks%motion = +1
  97. ! Call Drawworks_Traction_motor_ClutchMode
  98. ! data%State%Drawworks%w_drum = data%State%Drawworks%w/data%State%Drawworks%Conv_Ratio
  99. ! data%State%Drawworks%w_old_drum = data%State%Drawworks%w_old/data%State%Drawworks%Conv_Ratio
  100. ! ELSE
  101. ! data%State%Drawworks%EddyTorque = (1.039d5*exp(4.343d-4*(30.0d0*(data%State%Drawworks%w/data%State%Drawworks%Conv_Ratio)/pi)))+(-1.036d5*exp(-.047920d0*(30.0d0*(data%State%Drawworks%w/data%State%Drawworks%Conv_Ratio)/pi))) !Lbf.ft
  102. ! if (data%State%Drawworks%EddyTorque>115000.) then
  103. ! data%State%Drawworks%EddyTorque = 115000.0d0
  104. ! end if
  105. ! data%State%Drawworks%EddyTorque = 1.355817948*data%State%Drawworks%EddyTorque ![N.m]
  106. ! if ((data%State%Drawworks%F_fastline*(data%State%Drawworks%Diameter/2.0d0))>((((data%State%Drawworks%Diameter/2.0d0)*data%State%Drawworks%BreakLoad)*(data%State%Drawworks%ManualBreak/100.0d0))+(data%State%Drawworks%EddyTorque*(data%State%Drawworks%EddyBreak/100.0d0)))) then
  107. ! data%State%Drawworks%motion = -1
  108. !
  109. ! IF (data%State%Drawworks%w_drum<0.) THEN
  110. ! data%State%Drawworks%w = -data%State%Drawworks%w
  111. ! data%State%Drawworks%w_old = -data%State%Drawworks%w_old
  112. ! !data%State%Drawworks%w = 0. !???????????????
  113. ! !data%State%Drawworks%w_old = 0. !???????????????
  114. ! data%State%Drawworks%w_drum = -data%State%Drawworks%w_drum
  115. ! data%State%Drawworks%w_old_drum = -data%State%Drawworks%w_old_drum
  116. ! END IF
  117. !
  118. ! data%State%Drawworks%Conv_Ratio = 1.
  119. ! Call Drawworks_Free_Traction_motor_dawn_motion
  120. ! data%State%Drawworks%w = data%State%Drawworks%w_drum*data%State%Drawworks%Conv_Ratio
  121. ! data%State%Drawworks%w_old = data%State%Drawworks%w_old_drum*data%State%Drawworks%Conv_Ratio
  122. ! !data%State%Drawworks%w_drum = data%State%Drawworks%w/data%State%Drawworks%Conv_Ratio
  123. ! !data%State%Drawworks%w_old_drum = data%State%Drawworks%w_old/data%State%Drawworks%Conv_Ratio
  124. ! else
  125. ! data%State%Drawworks%motion = 0
  126. ! data%State%Drawworks%w_drum = 0.0d0
  127. ! data%State%Drawworks%w_old_drum = 0.0d0
  128. ! data%State%Drawworks%w = data%State%Drawworks%w_drum*data%State%Drawworks%Conv_Ratio
  129. ! data%State%Drawworks%w_old = data%State%Drawworks%w_old_drum*data%State%Drawworks%Conv_Ratio
  130. ! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height
  131. !
  132. ! data%State%Drawworks%ia = 0.
  133. ! data%State%Drawworks%ia_old = 0.
  134. ! data%State%Drawworks%x = 0.
  135. ! data%State%Drawworks%x_old = 0.
  136. ! data%State%Drawworks%y = 0.
  137. ! data%State%Drawworks%y_old = 0.
  138. ! end if
  139. !
  140. ! END IF
  141. !
  142. !end if
  143. !Call DWBrakeSound
  144. end subroutine Drawworks_Direction