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.
 
 
 
 
 
 

168 lines
10 KiB

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