|
25 | 25 | </node>
|
26 | 26 | </n>
|
27 | 27 | <n id="37" component_id="340">
|
28 |
| - <node label="Slip" mode="1" description="Slip input from Bogie"> |
| 28 | + <node label="Slip" mode="1" description="Slip input from the wheels"> |
29 | 29 | <position x="2" z="1"/>
|
30 | 30 | </node>
|
31 | 31 | </n>
|
32 | 32 | <n id="41" component_id="293">
|
33 |
| - <node label="Current Speed (m/s)" mode="1" type="1" description="Current speed in (m/s, directional)"> |
| 33 | + <node label="Speed" mode="1" type="1" description="Current speed (m/s, directional)"> |
34 | 34 | <position x="4"/>
|
35 | 35 | </node>
|
36 | 36 | </n>
|
37 | 37 | <n id="42" component_id="299">
|
38 |
| - <node label="Wheel RPS" mode="1" type="1" description="RPS at the wheels"> |
| 38 | + <node label="Wheel RPS" mode="1" type="1" description="RPS at the wheels (from torque meter)"> |
39 | 39 | <position x="4" z="1"/>
|
40 | 40 | </node>
|
41 | 41 | </n>
|
|
258 | 258 | </object>
|
259 | 259 | </c>
|
260 | 260 | <c type="44">
|
261 |
| - <object id="268" l="ABS" on="ENABLED" off="DISABLED"> |
| 261 | + <object id="268" l="ABS" on="Enabled" off="Disabled"> |
262 | 262 | <pos x="2.25" y="-17.5"/>
|
263 | 263 | <in1 component_id="265"/>
|
264 | 264 | </object>
|
@@ -351,18 +351,24 @@ if on then
|
351 | 351 | end
|
352 | 352 |
|
353 | 353 | if slip then
|
354 |
| - --rst=true |
355 | 354 | b=clamp(b-0.05,0.05,1)
|
356 | 355 | else
|
357 |
| - --rst=false |
358 | 356 | b=clamp(b+0.001,0.05,1)
|
359 | 357 | end
|
360 | 358 |
|
361 |
| - thrTemp=piVal:run(target*b,current,-1,1,2.5*a,rst) |
| 359 | + if target < 0 then |
| 360 | + thrTemp=piVal:run(target*b,current,-1,0,2.5*a,rst) |
| 361 | + elseif target > 0 then |
| 362 | + thrTemp=piVal:run(target*b,current,0,1,2.5*a,rst) |
| 363 | + end |
| 364 | +
|
| 365 | + --thrTemp=piVal:run(target*b,current,-1,1,2.5*a,rst) |
362 | 366 | if abs(current) > abs(target)+3 then
|
363 | 367 | thr=0
|
| 368 | + rst=true |
364 | 369 | else
|
365 | 370 | thr=thrTemp
|
| 371 | + rst=false |
366 | 372 | end
|
367 | 373 | else
|
368 | 374 | thr=0
|
@@ -698,7 +704,7 @@ end'>
|
698 | 704 | <c30 id="265" n="ABS" on="On" off="Off" v="true">
|
699 | 705 | <pos x="2.25" y="-17"/>
|
700 | 706 | </c30>
|
701 |
| - <c31 id="268" l="ABS" on="ENABLED" off="DISABLED"> |
| 707 | + <c31 id="268" l="ABS" on="Enabled" off="Disabled"> |
702 | 708 | <pos x="2.25" y="-17.5"/>
|
703 | 709 | <in1 component_id="265"/>
|
704 | 710 | </c31>
|
@@ -777,18 +783,24 @@ if on then
|
777 | 783 | end
|
778 | 784 |
|
779 | 785 | if slip then
|
780 |
| - --rst=true |
781 | 786 | b=clamp(b-0.05,0.05,1)
|
782 | 787 | else
|
783 |
| - --rst=false |
784 | 788 | b=clamp(b+0.001,0.05,1)
|
785 | 789 | end
|
786 | 790 |
|
787 |
| - thrTemp=piVal:run(target*b,current,-1,1,2.5*a,rst) |
| 791 | + if target < 0 then |
| 792 | + thrTemp=piVal:run(target*b,current,-1,0,2.5*a,rst) |
| 793 | + elseif target > 0 then |
| 794 | + thrTemp=piVal:run(target*b,current,0,1,2.5*a,rst) |
| 795 | + end |
| 796 | +
|
| 797 | + --thrTemp=piVal:run(target*b,current,-1,1,2.5*a,rst) |
788 | 798 | if abs(current) > abs(target)+3 then
|
789 | 799 | thr=0
|
| 800 | + rst=true |
790 | 801 | else
|
791 | 802 | thr=thrTemp
|
| 803 | + rst=false |
792 | 804 | end
|
793 | 805 | else
|
794 | 806 | thr=0
|
|
0 commit comments