Guest User

Untitled

a guest
Feb 5th, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. loadrt hostmot2
  2. loadrt hm2_eth board_ip=10.10.10.10
  3. loadrt threads name1=slow period1=1000000
  4.  
  5. loadrt abs
  6. loadrt lincurve count=2 personality=19,16
  7. loadrt limit2
  8. loadrt lowpass
  9. loadrt scale
  10. loadrt or2
  11. loadrt mux2 count=2
  12. loadrt wcomp
  13. loadrt and2
  14. loadrt not
  15. loadrt pid
  16.  
  17. addf hm2_7i97.0.read slow
  18. addf lincurve.0 slow
  19. addf lincurve.1 slow
  20. addf lowpass.0 slow
  21. addf scale.0 slow
  22. addf or2.0 slow
  23. addf abs.0 slow
  24. addf mux2.0 slow
  25. addf mux2.1 slow
  26. addf wcomp.0 slow
  27. addf and2.0 slow
  28. addf not.0 slow
  29. addf limit2.0 slow
  30. addf pid.0.do-pid-calcs slow
  31. addf hm2_7i97.0.write slow
  32.  
  33.  
  34. setp hm2_7i97.0.pwmgen.pdm_frequency 75000
  35. setp hm2_7i97.0.pwmgen.05.offset-mode TRUE
  36. setp hm2_7i97.0.pwmgen.05.output-type 1
  37. setp hm2_7i97.0.pwmgen.04.output-type 1
  38. setp hm2_7i97.0.pwmgen.04.offset-mode TRUE
  39.  
  40. #setp hm2_7i97.0.pwmgen.00.enable true
  41. #setp hm2_7i97.0.pwmgen.00.value .5
  42.  
  43.  
  44. setp hm2_7i97.0.encoder.00.scale 4096
  45.  
  46. setp lincurve.0.x-val-00 0
  47. setp lincurve.0.x-val-01 75
  48. setp lincurve.0.x-val-02 216
  49. setp lincurve.0.x-val-03 365
  50. setp lincurve.0.x-val-04 514
  51. setp lincurve.0.x-val-05 638
  52. setp lincurve.0.x-val-06 745
  53. setp lincurve.0.x-val-07 837
  54. setp lincurve.0.x-val-08 925
  55. setp lincurve.0.x-val-09 1000
  56. setp lincurve.0.x-val-10 1054
  57. setp lincurve.0.x-val-11 1005
  58. setp lincurve.0.x-val-12 1100
  59. setp lincurve.0.x-val-13 1200
  60. setp lincurve.0.x-val-14 1325
  61. setp lincurve.0.x-val-15 2500
  62.  
  63. setp lincurve.0.y-val-00 0
  64. setp lincurve.0.y-val-01 .1
  65. setp lincurve.0.y-val-02 .2
  66. setp lincurve.0.y-val-03 .3
  67. setp lincurve.0.y-val-04 .4
  68. setp lincurve.0.y-val-05 .5
  69. setp lincurve.0.y-val-06 .6
  70. setp lincurve.0.y-val-07 .7
  71. setp lincurve.0.y-val-08 .8
  72. setp lincurve.0.y-val-09 .9
  73. setp lincurve.0.y-val-10 1
  74. setp lincurve.0.y-val-11 1
  75. setp lincurve.0.y-val-12 1
  76. setp lincurve.0.y-val-13 1
  77. setp lincurve.0.y-val-14 1
  78. setp lincurve.0.y-val-15 1
  79.  
  80.  
  81. setp lincurve.1.x-val-00 0
  82. setp lincurve.1.x-val-01 75
  83. setp lincurve.1.x-val-02 216
  84. setp lincurve.1.x-val-03 365
  85. setp lincurve.1.x-val-04 514
  86. setp lincurve.1.x-val-05 638
  87. setp lincurve.1.x-val-06 745
  88. setp lincurve.1.x-val-07 1054
  89. setp lincurve.1.x-val-08 1122
  90. setp lincurve.1.x-val-09 1204
  91. setp lincurve.1.x-val-10 1312
  92. setp lincurve.1.x-val-11 1465
  93. setp lincurve.1.x-val-12 1696
  94. setp lincurve.1.x-val-13 2044
  95. setp lincurve.1.x-val-14 2668
  96. setp lincurve.1.x-val-15 2900
  97.  
  98. setp lincurve.1.y-val-00 1
  99. setp lincurve.1.y-val-01 1
  100. setp lincurve.1.y-val-02 1
  101. setp lincurve.1.y-val-03 1
  102. setp lincurve.1.y-val-04 1
  103. setp lincurve.1.y-val-05 1
  104. setp lincurve.1.y-val-06 1
  105. setp lincurve.1.y-val-07 .9
  106. setp lincurve.1.y-val-08 .8
  107. setp lincurve.1.y-val-09 .7
  108. setp lincurve.1.y-val-10 .6
  109. setp lincurve.1.y-val-11 .5
  110. setp lincurve.1.y-val-12 .4
  111. setp lincurve.1.y-val-13 .3
  112. setp lincurve.1.y-val-14 .2
  113. setp lincurve.1.y-val-15 .1
  114.  
  115.  
  116.  
  117.  
  118.  
  119. net armline lincurve.0.out scale.0.in
  120. net armlineout scale.0.out hm2_7i97.0.pwmgen.04.value
  121.  
  122. net fieldline lincurve.1.out hm2_7i97.0.pwmgen.05.value
  123. net rpmin lincurve.0.in lincurve.1.in
  124.  
  125. net lowpassin lowpass.0.in hm2_7i97.0.encoder.00.velocity-rpm
  126. setp lowpass.0.gain .01
  127.  
  128.  
  129. loadusr halmeter pin lowpass.0.out
  130. #net scaled scale.0.in lowpass.0.out
  131. #setp scale.0.gain .947
  132. loadusr halmeter pin scale.0.out
  133.  
  134. net enabledhighvolt hm2_7i97.0.pwmgen.04.enable or2.0.out
  135. net forward hm2_7i97.0.inmux.00.input-08 or2.0.in0
  136. net reverse hm2_7i97.0.inmux.00.input-09 or2.0.in1
  137.  
  138. setp mux2.0.in0 1
  139. setp mux2.0.in1 -1
  140. net rpm mux2.1.in1
  141. net enabledhighvolt mux2.1.sel
  142.  
  143.  
  144. net reverse mux2.0.sel
  145. net reverseval scale.0.gain mux2.0.out
  146.  
  147. net lowpassin abs.0.in
  148. net absout abs.0.out wcomp.0.in
  149. setp wcomp.0.min 10
  150. setp wcomp.0.max 5000
  151.  
  152. net enabledhighvolt not.0.in
  153. net brakeresistor1 not.0.out and2.0.in0
  154. net brakeresistor2 wcomp.0.out and2.0.in1
  155. net brakeresout and2.0.out hm2_7i97.0.ssr.00.out-01
  156.  
  157.  
  158.  
  159. setp hm2_7i97.0.pwmgen.05.enable true
  160.  
  161. net rpmin limit2.0.out
  162. #net brakeresout limit2.0.load
  163. setp limit2.0.maxv 600
  164. net rpmsel mux2.1.out limit2.0.in
  165.  
  166. start
Advertisement
Add Comment
Please, Sign In to add comment