Import LinuxCNC source tree

This commit is contained in:
Wang Dequan
2026-08-20 06:17:39 +08:00
commit 2c814634c3
9429 changed files with 10556013 additions and 0 deletions

140
tests/limit3/checkresult Executable file
View File

@@ -0,0 +1,140 @@
#!/usr/bin/env python3
import sys, os, re, math
def near(a, b):
fudge_factor = 0.001
error = abs(a-b)
allowance = abs(a * fudge_factor)
if error <= allowance:
return True
return False
def must_decel_to_avoid_pos_violation(sample, out, vel):
"""Returns True if maximum deceleration is needed NOW to avoid
violating position constraints."""
# Keep going one cycle without any acceleration.
next_out = out + (vel * 0.001) # Assume a 1 ms period.
# v = v0 + at
# 0 = v0 + at
# t = v0/a
seconds_to_stop = abs(vel) / params['maxa']
# figure out which direction we need to accelerate in
if vel > 0:
accel_sign = -1
else:
accel_sign = 1
# r = r0 + v0t + 1/2 at^2
pos_at_stop = next_out + (vel * seconds_to_stop) + (accel_sign * 0.5 * params['maxa'] * math.pow(seconds_to_stop, 2))
print("sample=%d, next_out=%.6f, vel=%.6f, seconds_to_stop=%.6f, pos_at_stop=%.6f, min=%.6f, max=%.6f" % \
(sample, next_out, vel, seconds_to_stop, pos_at_stop, params['min'], params['max']))
if pos_at_stop > (params['max'] * 1.01) or pos_at_stop < (params['min'] * 1.01):
return True
return False
halfile = os.path.join(os.path.dirname(__file__),"test.hal")
param_re = re.compile(r'^setp\s+limit3.0.([^\s]+)\s+([-0-9]+)$')
params = {}
params['min'] = -1e20
params['max'] = 1e20
params['maxv'] = 1e20
params['maxa'] = 1e20
with open(halfile, 'r') as f:
for line in f:
m = param_re.match(line)
if m is None: continue
params[m.group(1)] = float(m.group(2))
result_filename = sys.argv[1]
result_file = open(result_filename, 'r')
retval = 0
for line in result_file.readlines():
(sample, in_val, out, vel, acc) = line.split()[:5]
sample = int(sample)
in_val = float(in_val)
out = float(out)
vel = float(vel)
acc = float(acc)
#
# See if we've violated any constraints.
#
if float(out) > params['max']:
print("max=%.3f, in=%.3f, out=%.3f, max violation on sample %s" % \
(params['max'], float(in_val), out, sample))
retval = 1
if float(out) < params['min']:
print("min=%.3f, in=%.3f, out=%.3f, min violation on sample %s" % \
(params['min'], float(in_val), out, sample))
retval = 1
if abs(vel) > params['maxv']:
print("maxv=%.3f, vel=%.3f, velocity violation on sample %s" % \
(params['maxv'], vel, sample))
retval = 1
if abs(acc) > params['maxa']:
print("maxa=%.3f, acc=%.3f, acceleration violation on sample %s" % \
(params['maxa'], acc, sample))
retval = 1
#
# See if we're accelerating too sluggishly.
#
if abs(acc) < params['maxa']:
# Why aren't we accelerating at the max rate?
if abs(vel) == params['maxv']:
# We've already maxed out vel.
pass
elif near(out, params['min']) or near(out, params['max']):
# We're at our position limit.
pass
elif near(out, in_val):
# We're already near our target.
pass
else:
# We have no good reason for not accelerating hard, so fail this test.
print("maxa=%.3f, acc=%.3f, sluggish acceleration on sample %s" % \
(params['maxa'], acc, sample))
retval = 1
#
# See if our velocity is too sluggish.
#
if abs(vel) < params['maxv']:
# Why aren't we moving at the max rate?
if abs(acc) == params['maxa']:
# We're still accelerating.
pass
elif near(out, params['min']) or near(out, params['max']):
# We're at our position limit.
pass
elif near(out, in_val):
# We've already reached our target.
pass
elif must_decel_to_avoid_pos_violation(sample, out, vel):
# We're slowing down to avoid violating position constraints.
pass
else:
# We have no good reason for not going fast, so fail this test.
print("maxv=%.3f, vel=%.3f, sluggish velocity on sample %s" % \
(params['maxv'], vel, sample))
retval = 1
sys.exit(retval)

View File

@@ -0,0 +1,6 @@
This test uses a mux to switch the limit3 input signal among a bunch
of options, and verifies that it never violates any of its constraints
(position, velocity, and acceleration).
The input signals are all the ones available from siggen (sine, cosine,
square, triangle, and sawtooth), plus a loopback of limit3's output.

View File

@@ -0,0 +1 @@
../checkresult

View File

@@ -0,0 +1,127 @@
setexact_for_test_suite_only
#
# This siggen produces test patterns for limit3 to try to follow.
#
loadrt siggen
setp siggen.0.frequency 2
setp siggen.0.amplitude 100
setp siggen.0.offset 0
net sine <= siggen.0.sine
net cosine <= siggen.0.cosine
net square <= siggen.0.square
net sawtooth <= siggen.0.sawtooth
net triangle <= siggen.0.triangle
#
# This mux selects one of the available input patterns. Later in this
# file, after loading the limit3 component, we'll add the output of
# limit3 as another option in this mux.
#
loadrt mux_generic config=ff8
net sine => mux-gen.00.in-float-00
net cosine => mux-gen.00.in-float-01
net square => mux-gen.00.in-float-02
net sawtooth => mux-gen.00.in-float-03
net triangle => mux-gen.00.in-float-04
net input <= mux-gen.00.out-float
#
# Here's the limit3, the component under test.
#
# These pos/vel/accel limits are just a hair above the limits of the
# input sine wave.
#
loadrt limit3
setp limit3.0.min -101
setp limit3.0.max 101
setp limit3.0.maxv 1500
setp limit3.0.maxa 15800
net input => limit3.0.in
net output <= limit3.0.out
net output => mux-gen.00.in-float-05
#
# Compute the velocity and acceleration of the limit3 output.
#
loadrt ddt names=ddt.out-accel,ddt.out-vel
net output => ddt.out-vel.in
net out-vel <= ddt.out-vel.out
net out-vel => ddt.out-accel.in
net out-accel <= ddt.out-accel.out
#
# This part cycles through the muxed signals. It uses a charge pump to
# generate a high-frequency square wave, and an encoder in counter-mode,
# with a large scale, to produce a slowly growing number (the encoder
# position). The encoder position is converted from a float to a u32,
# and fed to the mux select pin.
#
loadrt charge_pump
# The heartbeat toggles every other time the thread runs (so at 500 Hz).
net heartbeat <= charge-pump.out
# The scale of the encoder makes the .position output move forward by
# about 1.0 per second.
loadrt encoder num_chan=1
encoder.0.counter-mode = 1
encoder.0.position-scale = 500
net heartbeat => encoder.0.phase-A
net encoder-position <= encoder.0.position
loadrt conv_float_u32
net encoder-position => conv-float-u32.0.in
net mux-select <= conv-float-u32.0.out
net mux-select => mux-gen.00.sel-int
#
# This sampler reports everything we care about out to disk, so we can
# validate it after the realtime part of the test completes.
#
loadrt sampler depth=1500 cfg=ffffu
net input => sampler.0.pin.0
net output => sampler.0.pin.1
net out-vel => sampler.0.pin.2
net out-accel => sampler.0.pin.3
net mux-select => sampler.0.pin.4
loadrt threads name1=t period1=1000000
addf charge-pump t
addf encoder.update-counters t
addf encoder.capture-position t
addf conv-float-u32.0 t
addf siggen.0.update t
addf mux-gen.00 t
addf limit3.0 t
addf ddt.out-vel t
addf ddt.out-accel t
addf sampler.0 t
start
loadusr -w halsampler -t -n 5100

View File

@@ -0,0 +1,800 @@
0 0.001000
1 0.003000
2 0.006000
3 0.010000
4 0.015000
5 0.021000
6 0.028000
7 0.036000
8 0.045000
9 0.055000
10 0.066000
11 0.078000
12 0.091000
13 0.105000
14 0.120000
15 0.136000
16 0.153000
17 0.171000
18 0.190000
19 0.210000
20 0.231000
21 0.253000
22 0.276000
23 0.300000
24 0.325000
25 0.351000
26 0.378000
27 0.406000
28 0.435000
29 0.465000
30 0.496000
31 0.528000
32 0.561000
33 0.595000
34 0.630000
35 0.666000
36 0.703000
37 0.741000
38 0.780000
39 0.820000
40 0.861000
41 0.903000
42 0.946000
43 0.990000
44 1.035000
45 1.081000
46 1.128000
47 1.176000
48 1.225000
49 1.275000
50 1.326000
51 1.378000
52 1.431000
53 1.485000
54 1.540000
55 1.596000
56 1.653000
57 1.711000
58 1.770000
59 1.830000
60 1.891000
61 1.953000
62 2.016000
63 2.080000
64 2.145000
65 2.211000
66 2.278000
67 2.346000
68 2.415000
69 2.485000
70 2.556000
71 2.628000
72 2.701000
73 2.775000
74 2.850000
75 2.926000
76 3.003000
77 3.081000
78 3.160000
79 3.240000
80 3.321000
81 3.403000
82 3.486000
83 3.570000
84 3.655000
85 3.741000
86 3.828000
87 3.916000
88 4.005000
89 4.095000
90 4.186000
91 4.278000
92 4.371000
93 4.465000
94 4.560000
95 4.656000
96 4.753000
97 4.851000
98 4.950000
99 5.050000
100 5.151000
101 5.253000
102 5.356000
103 5.460000
104 5.565000
105 5.671000
106 5.778000
107 5.886000
108 5.995000
109 6.105000
110 6.216000
111 6.328000
112 6.441000
113 6.555000
114 6.670000
115 6.786000
116 6.903000
117 7.021000
118 7.140000
119 7.260000
120 7.381000
121 7.503000
122 7.626000
123 7.750000
124 7.875000
125 8.001000
126 8.128000
127 8.256000
128 8.385000
129 8.515000
130 8.646000
131 8.778000
132 8.911000
133 9.045000
134 9.180000
135 9.316000
136 9.453000
137 9.591000
138 9.730000
139 9.870000
140 10.011000
141 10.153000
142 10.296000
143 10.440000
144 10.585000
145 10.731000
146 10.878000
147 11.026000
148 11.175000
149 11.325000
150 11.476000
151 11.628000
152 11.781000
153 11.935000
154 12.090000
155 12.246000
156 12.403000
157 12.561000
158 12.720000
159 12.880000
160 13.041000
161 13.203000
162 13.366000
163 13.530000
164 13.695000
165 13.861000
166 14.028000
167 14.196000
168 14.365000
169 14.535000
170 14.706000
171 14.878000
172 15.051000
173 15.225000
174 15.400000
175 15.576000
176 15.753000
177 15.931000
178 16.110000
179 16.290000
180 16.471000
181 16.653000
182 16.836000
183 17.020000
184 17.205000
185 17.391000
186 17.578000
187 17.766000
188 17.955000
189 18.145000
190 18.336000
191 18.528000
192 18.721000
193 18.915000
194 19.110000
195 19.306000
196 19.503000
197 19.701000
198 19.900000
199 20.100000
200 20.301000
201 20.503000
202 20.706000
203 20.910000
204 21.115000
205 21.321000
206 21.528000
207 21.736000
208 21.945000
209 22.155000
210 22.366000
211 22.578000
212 22.791000
213 23.005000
214 23.220000
215 23.436000
216 23.653000
217 23.871000
218 24.090000
219 24.310000
220 24.531000
221 24.753000
222 24.976000
223 25.200000
224 25.425000
225 25.651000
226 25.878000
227 26.106000
228 26.335000
229 26.565000
230 26.796000
231 27.028000
232 27.261000
233 27.495000
234 27.730000
235 27.966000
236 28.203000
237 28.441000
238 28.680000
239 28.920000
240 29.161000
241 29.403000
242 29.646000
243 29.890000
244 30.135000
245 30.381000
246 30.628000
247 30.876000
248 31.125000
249 31.375000
250 31.626000
251 31.878000
252 32.131000
253 32.385000
254 32.640000
255 32.896000
256 33.153000
257 33.411000
258 33.670000
259 33.930000
260 34.191000
261 34.453000
262 34.716000
263 34.980000
264 35.245000
265 35.511000
266 35.778000
267 36.046000
268 36.315000
269 36.585000
270 36.856000
271 37.128000
272 37.401000
273 37.675000
274 37.950000
275 38.226000
276 38.503000
277 38.781000
278 39.060000
279 39.340000
280 39.621000
281 39.903000
282 40.186000
283 40.470000
284 40.755000
285 41.041000
286 41.328000
287 41.616000
288 41.905000
289 42.195000
290 42.486000
291 42.778000
292 43.071000
293 43.365000
294 43.660000
295 43.956000
296 44.253000
297 44.551000
298 44.850000
299 45.150000
300 45.451000
301 45.753000
302 46.056000
303 46.360000
304 46.665000
305 46.971000
306 47.278000
307 47.586000
308 47.895000
309 48.205000
310 48.516000
311 48.828000
312 49.141000
313 49.455000
314 49.770000
315 50.086000
316 50.403000
317 50.721000
318 51.040000
319 51.360000
320 51.681000
321 52.003000
322 52.326000
323 52.650000
324 52.975000
325 53.301000
326 53.628000
327 53.956000
328 54.285000
329 54.615000
330 54.946000
331 55.278000
332 55.611000
333 55.945000
334 56.280000
335 56.616000
336 56.953000
337 57.291000
338 57.630000
339 57.970000
340 58.311000
341 58.653000
342 58.996000
343 59.340000
344 59.685000
345 60.031000
346 60.378000
347 60.726000
348 61.075000
349 61.425000
350 61.776000
351 62.128000
352 62.481000
353 62.835000
354 63.190000
355 63.546000
356 63.903000
357 64.261000
358 64.620000
359 64.980000
360 65.341000
361 65.703000
362 66.066000
363 66.430000
364 66.795000
365 67.161000
366 67.528000
367 67.896000
368 68.265000
369 68.635000
370 69.006000
371 69.378000
372 69.751000
373 70.125000
374 70.500000
375 70.876000
376 71.253000
377 71.631000
378 72.010000
379 72.390000
380 72.771000
381 73.153000
382 73.536000
383 73.920000
384 74.305000
385 74.691000
386 75.078000
387 75.466000
388 75.855000
389 76.245000
390 76.636000
391 77.028000
392 77.421000
393 77.815000
394 78.210000
395 78.606000
396 79.003000
397 79.401000
398 79.800000
399 80.200000
400 80.599000
401 80.997000
402 81.394000
403 81.790000
404 82.185000
405 82.579000
406 82.972000
407 83.364000
408 83.755000
409 84.145000
410 84.534000
411 84.922000
412 85.309000
413 85.695000
414 86.080000
415 86.464000
416 86.847000
417 87.229000
418 87.610000
419 87.990000
420 88.369000
421 88.747000
422 89.124000
423 89.500000
424 89.875000
425 90.249000
426 90.622000
427 90.994000
428 91.365000
429 91.735000
430 92.104000
431 92.472000
432 92.839000
433 93.205000
434 93.570000
435 93.934000
436 94.297000
437 94.659000
438 95.020000
439 95.380000
440 95.739000
441 96.097000
442 96.454000
443 96.810000
444 97.165000
445 97.519000
446 97.872000
447 98.224000
448 98.575000
449 98.925000
450 99.274000
451 99.622000
452 99.969000
453 100.315000
454 100.660000
455 101.004000
456 101.347000
457 101.689000
458 102.030000
459 102.370000
460 102.709000
461 103.047000
462 103.384000
463 103.720000
464 104.055000
465 104.389000
466 104.722000
467 105.054000
468 105.385000
469 105.715000
470 106.044000
471 106.372000
472 106.699000
473 107.025000
474 107.350000
475 107.674000
476 107.997000
477 108.319000
478 108.640000
479 108.960000
480 109.279000
481 109.597000
482 109.914000
483 110.230000
484 110.545000
485 110.859000
486 111.172000
487 111.484000
488 111.795000
489 112.105000
490 112.414000
491 112.722000
492 113.029000
493 113.335000
494 113.640000
495 113.944000
496 114.247000
497 114.549000
498 114.850000
499 115.150000
500 115.449000
501 115.747000
502 116.044000
503 116.340000
504 116.635000
505 116.929000
506 117.222000
507 117.514000
508 117.805000
509 118.095000
510 118.384000
511 118.672000
512 118.959000
513 119.245000
514 119.530000
515 119.814000
516 120.097000
517 120.379000
518 120.660000
519 120.940000
520 121.219000
521 121.497000
522 121.774000
523 122.050000
524 122.325000
525 122.599000
526 122.872000
527 123.144000
528 123.415000
529 123.685000
530 123.954000
531 124.222000
532 124.489000
533 124.755000
534 125.020000
535 125.284000
536 125.547000
537 125.809000
538 126.070000
539 126.330000
540 126.589000
541 126.847000
542 127.104000
543 127.360000
544 127.615000
545 127.869000
546 128.122000
547 128.374000
548 128.625000
549 128.875000
550 129.124000
551 129.372000
552 129.619000
553 129.865000
554 130.110000
555 130.354000
556 130.597000
557 130.839000
558 131.080000
559 131.320000
560 131.559000
561 131.797000
562 132.034000
563 132.270000
564 132.505000
565 132.739000
566 132.972000
567 133.204000
568 133.435000
569 133.665000
570 133.894000
571 134.122000
572 134.349000
573 134.575000
574 134.800000
575 135.024000
576 135.247000
577 135.469000
578 135.690000
579 135.910000
580 136.129000
581 136.347000
582 136.564000
583 136.780000
584 136.995000
585 137.209000
586 137.422000
587 137.634000
588 137.845000
589 138.055000
590 138.264000
591 138.472000
592 138.679000
593 138.885000
594 139.090000
595 139.294000
596 139.497000
597 139.699000
598 139.900000
599 140.100000
600 140.299000
601 140.497000
602 140.694000
603 140.890000
604 141.085000
605 141.279000
606 141.472000
607 141.664000
608 141.855000
609 142.045000
610 142.234000
611 142.422000
612 142.609000
613 142.795000
614 142.980000
615 143.164000
616 143.347000
617 143.529000
618 143.710000
619 143.890000
620 144.069000
621 144.247000
622 144.424000
623 144.600000
624 144.775000
625 144.949000
626 145.122000
627 145.294000
628 145.465000
629 145.635000
630 145.804000
631 145.972000
632 146.139000
633 146.305000
634 146.470000
635 146.634000
636 146.797000
637 146.959000
638 147.120000
639 147.280000
640 147.439000
641 147.597000
642 147.754000
643 147.910000
644 148.065000
645 148.219000
646 148.372000
647 148.524000
648 148.675000
649 148.825000
650 148.974000
651 149.122000
652 149.269000
653 149.415000
654 149.560000
655 149.704000
656 149.847000
657 149.989000
658 150.130000
659 150.270000
660 150.409000
661 150.547000
662 150.684000
663 150.820000
664 150.955000
665 151.089000
666 151.222000
667 151.354000
668 151.485000
669 151.615000
670 151.744000
671 151.872000
672 151.999000
673 152.125000
674 152.250000
675 152.374000
676 152.497000
677 152.619000
678 152.740000
679 152.860000
680 152.979000
681 153.097000
682 153.214000
683 153.330000
684 153.445000
685 153.559000
686 153.672000
687 153.784000
688 153.895000
689 154.005000
690 154.114000
691 154.222000
692 154.329000
693 154.435000
694 154.540000
695 154.644000
696 154.747000
697 154.849000
698 154.950000
699 155.050000
700 155.149000
701 155.247000
702 155.344000
703 155.440000
704 155.535000
705 155.629000
706 155.722000
707 155.814000
708 155.905000
709 155.995000
710 156.084000
711 156.172000
712 156.259000
713 156.345000
714 156.430000
715 156.514000
716 156.597000
717 156.679000
718 156.760000
719 156.840000
720 156.919000
721 156.997000
722 157.074000
723 157.150000
724 157.225000
725 157.299000
726 157.372000
727 157.444000
728 157.515000
729 157.585000
730 157.654000
731 157.722000
732 157.789000
733 157.855000
734 157.920000
735 157.984000
736 158.047000
737 158.109000
738 158.170000
739 158.230000
740 158.289000
741 158.347000
742 158.404000
743 158.460000
744 158.515000
745 158.569000
746 158.622000
747 158.674000
748 158.725000
749 158.775000
750 158.824000
751 158.872000
752 158.919000
753 158.965000
754 159.010000
755 159.054000
756 159.097000
757 159.139000
758 159.180000
759 159.220000
760 159.259000
761 159.297000
762 159.334000
763 159.370000
764 159.405000
765 159.439000
766 159.472000
767 159.504000
768 159.535000
769 159.565000
770 159.594000
771 159.622000
772 159.649000
773 159.675000
774 159.700000
775 159.724000
776 159.747000
777 159.769000
778 159.790000
779 159.810000
780 159.829000
781 159.847000
782 159.864000
783 159.880000
784 159.895000
785 159.909000
786 159.922000
787 159.934000
788 159.945000
789 159.955000
790 159.964000
791 159.972000
792 159.979000
793 159.985000
794 159.990000
795 159.994000
796 159.997000
797 159.999000
798 160.000000
799 160.000000

View File

@@ -0,0 +1,19 @@
setexact_for_test_suite_only
loadrt sampler cfg=f depth=4096
loadrt limit3
#loadrt blocks limit3=1
loadrt threads name1=t period1=1000000
setp limit3.0.maxv 500.000000
setp limit3.0.maxa 1000
setp limit3.0.max 160
net n0 limit3.0.out sampler.0.pin.0
addf limit3.0 t
addf sampler.0 t
setp limit3.0.in 500
start
loadusr -w halsampler -t -n 800

View File

@@ -0,0 +1,800 @@
0 0.500000
1 1.000000
2 1.500000
3 2.000000
4 2.500000
5 3.000000
6 3.500000
7 4.000000
8 4.500000
9 5.000000
10 5.500000
11 6.000000
12 6.500000
13 7.000000
14 7.500000
15 8.000000
16 8.500000
17 9.000000
18 9.500000
19 10.000000
20 10.500000
21 11.000000
22 11.500000
23 12.000000
24 12.500000
25 13.000000
26 13.500000
27 14.000000
28 14.500000
29 15.000000
30 15.500000
31 16.000000
32 16.500000
33 17.000000
34 17.500000
35 18.000000
36 18.500000
37 19.000000
38 19.500000
39 20.000000
40 20.500000
41 21.000000
42 21.500000
43 22.000000
44 22.500000
45 23.000000
46 23.500000
47 24.000000
48 24.500000
49 25.000000
50 25.500000
51 26.000000
52 26.500000
53 27.000000
54 27.500000
55 28.000000
56 28.500000
57 29.000000
58 29.500000
59 30.000000
60 30.500000
61 31.000000
62 31.500000
63 32.000000
64 32.500000
65 33.000000
66 33.500000
67 34.000000
68 34.500000
69 35.000000
70 35.500000
71 36.000000
72 36.500000
73 37.000000
74 37.500000
75 38.000000
76 38.500000
77 39.000000
78 39.500000
79 40.000000
80 40.500000
81 41.000000
82 41.500000
83 42.000000
84 42.500000
85 43.000000
86 43.500000
87 44.000000
88 44.500000
89 45.000000
90 45.500000
91 46.000000
92 46.500000
93 47.000000
94 47.500000
95 48.000000
96 48.500000
97 49.000000
98 49.500000
99 50.000000
100 50.500000
101 51.000000
102 51.500000
103 52.000000
104 52.500000
105 53.000000
106 53.500000
107 54.000000
108 54.500000
109 55.000000
110 55.500000
111 56.000000
112 56.500000
113 57.000000
114 57.500000
115 58.000000
116 58.500000
117 59.000000
118 59.500000
119 60.000000
120 60.500000
121 61.000000
122 61.500000
123 62.000000
124 62.500000
125 63.000000
126 63.500000
127 64.000000
128 64.500000
129 65.000000
130 65.500000
131 66.000000
132 66.500000
133 67.000000
134 67.500000
135 68.000000
136 68.500000
137 69.000000
138 69.500000
139 70.000000
140 70.500000
141 71.000000
142 71.500000
143 72.000000
144 72.500000
145 73.000000
146 73.500000
147 74.000000
148 74.500000
149 75.000000
150 75.500000
151 76.000000
152 76.500000
153 77.000000
154 77.500000
155 78.000000
156 78.500000
157 79.000000
158 79.500000
159 80.000000
160 80.500000
161 81.000000
162 81.500000
163 82.000000
164 82.500000
165 83.000000
166 83.500000
167 84.000000
168 84.500000
169 85.000000
170 85.500000
171 86.000000
172 86.500000
173 87.000000
174 87.500000
175 88.000000
176 88.500000
177 89.000000
178 89.500000
179 90.000000
180 90.500000
181 91.000000
182 91.500000
183 92.000000
184 92.500000
185 93.000000
186 93.500000
187 94.000000
188 94.500000
189 95.000000
190 95.500000
191 96.000000
192 96.500000
193 97.000000
194 97.500000
195 98.000000
196 98.500000
197 99.000000
198 99.500000
199 100.000000
200 100.500000
201 101.000000
202 101.500000
203 102.000000
204 102.500000
205 103.000000
206 103.500000
207 104.000000
208 104.500000
209 105.000000
210 105.500000
211 106.000000
212 106.500000
213 107.000000
214 107.500000
215 108.000000
216 108.500000
217 109.000000
218 109.500000
219 110.000000
220 110.500000
221 111.000000
222 111.500000
223 112.000000
224 112.500000
225 113.000000
226 113.500000
227 114.000000
228 114.500000
229 115.000000
230 115.500000
231 116.000000
232 116.500000
233 117.000000
234 117.500000
235 118.000000
236 118.500000
237 119.000000
238 119.500000
239 120.000000
240 120.500000
241 121.000000
242 121.500000
243 122.000000
244 122.500000
245 123.000000
246 123.500000
247 124.000000
248 124.500000
249 125.000000
250 125.500000
251 126.000000
252 126.500000
253 127.000000
254 127.500000
255 128.000000
256 128.500000
257 129.000000
258 129.500000
259 130.000000
260 130.500000
261 131.000000
262 131.500000
263 132.000000
264 132.500000
265 133.000000
266 133.500000
267 134.000000
268 134.500000
269 135.000000
270 135.500000
271 136.000000
272 136.500000
273 137.000000
274 137.500000
275 138.000000
276 138.500000
277 139.000000
278 139.500000
279 140.000000
280 140.500000
281 141.000000
282 141.500000
283 142.000000
284 142.500000
285 143.000000
286 143.500000
287 144.000000
288 144.500000
289 145.000000
290 145.500000
291 146.000000
292 146.500000
293 147.000000
294 147.500000
295 148.000000
296 148.500000
297 149.000000
298 149.500000
299 150.000000
300 150.500000
301 151.000000
302 151.500000
303 152.000000
304 152.500000
305 153.000000
306 153.500000
307 154.000000
308 154.500000
309 155.000000
310 155.500000
311 156.000000
312 156.500000
313 157.000000
314 157.500000
315 158.000000
316 158.500000
317 159.000000
318 159.500000
319 160.000000
320 160.500000
321 161.000000
322 161.500000
323 162.000000
324 162.500000
325 163.000000
326 163.500000
327 164.000000
328 164.500000
329 165.000000
330 165.500000
331 166.000000
332 166.500000
333 167.000000
334 167.500000
335 168.000000
336 168.500000
337 169.000000
338 169.500000
339 170.000000
340 170.500000
341 171.000000
342 171.500000
343 172.000000
344 172.500000
345 173.000000
346 173.500000
347 174.000000
348 174.500000
349 175.000000
350 175.500000
351 176.000000
352 176.500000
353 177.000000
354 177.500000
355 178.000000
356 178.500000
357 179.000000
358 179.500000
359 180.000000
360 180.500000
361 181.000000
362 181.500000
363 182.000000
364 182.500000
365 183.000000
366 183.500000
367 184.000000
368 184.500000
369 185.000000
370 185.500000
371 186.000000
372 186.500000
373 187.000000
374 187.500000
375 188.000000
376 188.500000
377 189.000000
378 189.500000
379 190.000000
380 190.500000
381 191.000000
382 191.500000
383 192.000000
384 192.500000
385 193.000000
386 193.500000
387 194.000000
388 194.500000
389 195.000000
390 195.500000
391 196.000000
392 196.500000
393 197.000000
394 197.500000
395 198.000000
396 198.500000
397 199.000000
398 199.500000
399 200.000000
400 200.500000
401 201.000000
402 201.500000
403 202.000000
404 202.500000
405 203.000000
406 203.500000
407 204.000000
408 204.500000
409 205.000000
410 205.500000
411 206.000000
412 206.500000
413 207.000000
414 207.500000
415 208.000000
416 208.500000
417 209.000000
418 209.500000
419 210.000000
420 210.500000
421 211.000000
422 211.500000
423 212.000000
424 212.500000
425 213.000000
426 213.500000
427 214.000000
428 214.500000
429 215.000000
430 215.500000
431 216.000000
432 216.500000
433 217.000000
434 217.500000
435 218.000000
436 218.500000
437 219.000000
438 219.500000
439 220.000000
440 220.500000
441 221.000000
442 221.500000
443 222.000000
444 222.500000
445 223.000000
446 223.500000
447 224.000000
448 224.500000
449 225.000000
450 225.500000
451 226.000000
452 226.500000
453 227.000000
454 227.500000
455 228.000000
456 228.500000
457 229.000000
458 229.500000
459 230.000000
460 230.500000
461 231.000000
462 231.500000
463 232.000000
464 232.500000
465 233.000000
466 233.500000
467 234.000000
468 234.500000
469 235.000000
470 235.500000
471 236.000000
472 236.500000
473 237.000000
474 237.500000
475 238.000000
476 238.500000
477 239.000000
478 239.500000
479 240.000000
480 240.500000
481 241.000000
482 241.500000
483 242.000000
484 242.500000
485 243.000000
486 243.500000
487 244.000000
488 244.500000
489 245.000000
490 245.500000
491 246.000000
492 246.500000
493 247.000000
494 247.500000
495 248.000000
496 248.500000
497 249.000000
498 249.500000
499 250.000000
500 250.500000
501 251.000000
502 251.500000
503 252.000000
504 252.500000
505 253.000000
506 253.500000
507 254.000000
508 254.500000
509 255.000000
510 255.500000
511 256.000000
512 256.500000
513 257.000000
514 257.500000
515 258.000000
516 258.500000
517 259.000000
518 259.500000
519 260.000000
520 260.500000
521 261.000000
522 261.500000
523 262.000000
524 262.500000
525 263.000000
526 263.500000
527 264.000000
528 264.500000
529 265.000000
530 265.500000
531 266.000000
532 266.500000
533 267.000000
534 267.500000
535 268.000000
536 268.500000
537 269.000000
538 269.500000
539 270.000000
540 270.500000
541 271.000000
542 271.500000
543 272.000000
544 272.500000
545 273.000000
546 273.500000
547 274.000000
548 274.500000
549 275.000000
550 275.500000
551 276.000000
552 276.500000
553 277.000000
554 277.500000
555 278.000000
556 278.500000
557 279.000000
558 279.500000
559 280.000000
560 280.500000
561 281.000000
562 281.500000
563 282.000000
564 282.500000
565 283.000000
566 283.500000
567 284.000000
568 284.500000
569 285.000000
570 285.500000
571 286.000000
572 286.500000
573 287.000000
574 287.500000
575 288.000000
576 288.500000
577 289.000000
578 289.500000
579 290.000000
580 290.500000
581 291.000000
582 291.500000
583 292.000000
584 292.500000
585 293.000000
586 293.500000
587 294.000000
588 294.500000
589 295.000000
590 295.500000
591 296.000000
592 296.500000
593 297.000000
594 297.500000
595 298.000000
596 298.500000
597 299.000000
598 299.500000
599 300.000000
600 300.500000
601 301.000000
602 301.500000
603 302.000000
604 302.500000
605 303.000000
606 303.500000
607 304.000000
608 304.500000
609 305.000000
610 305.500000
611 306.000000
612 306.500000
613 307.000000
614 307.500000
615 308.000000
616 308.500000
617 309.000000
618 309.500000
619 310.000000
620 310.500000
621 311.000000
622 311.500000
623 312.000000
624 312.500000
625 313.000000
626 313.500000
627 314.000000
628 314.500000
629 315.000000
630 315.500000
631 316.000000
632 316.500000
633 317.000000
634 317.500000
635 318.000000
636 318.500000
637 319.000000
638 319.500000
639 320.000000
640 320.500000
641 321.000000
642 321.500000
643 322.000000
644 322.500000
645 323.000000
646 323.500000
647 324.000000
648 324.500000
649 325.000000
650 325.500000
651 326.000000
652 326.500000
653 327.000000
654 327.500000
655 328.000000
656 328.500000
657 329.000000
658 329.500000
659 330.000000
660 330.500000
661 331.000000
662 331.500000
663 332.000000
664 332.500000
665 333.000000
666 333.500000
667 334.000000
668 334.500000
669 335.000000
670 335.500000
671 336.000000
672 336.500000
673 337.000000
674 337.500000
675 338.000000
676 338.500000
677 339.000000
678 339.500000
679 340.000000
680 340.500000
681 341.000000
682 341.500000
683 342.000000
684 342.500000
685 343.000000
686 343.500000
687 344.000000
688 344.500000
689 345.000000
690 345.500000
691 346.000000
692 346.500000
693 347.000000
694 347.500000
695 348.000000
696 348.500000
697 349.000000
698 349.500000
699 350.000000
700 350.500000
701 351.000000
702 351.500000
703 352.000000
704 352.500000
705 353.000000
706 353.500000
707 354.000000
708 354.500000
709 355.000000
710 355.500000
711 356.000000
712 356.500000
713 357.000000
714 357.500000
715 358.000000
716 358.500000
717 359.000000
718 359.500000
719 360.000000
720 360.500000
721 361.000000
722 361.500000
723 362.000000
724 362.500000
725 363.000000
726 363.500000
727 364.000000
728 364.500000
729 365.000000
730 365.500000
731 366.000000
732 366.500000
733 367.000000
734 367.500000
735 368.000000
736 368.500000
737 369.000000
738 369.500000
739 370.000000
740 370.500000
741 371.000000
742 371.500000
743 372.000000
744 372.500000
745 373.000000
746 373.500000
747 374.000000
748 374.500000
749 375.000000
750 375.500000
751 376.000000
752 376.500000
753 377.000000
754 377.500000
755 378.000000
756 378.500000
757 379.000000
758 379.500000
759 380.000000
760 380.500000
761 381.000000
762 381.500000
763 382.000000
764 382.500000
765 383.000000
766 383.500000
767 384.000000
768 384.500000
769 385.000000
770 385.500000
771 386.000000
772 386.500000
773 387.000000
774 387.500000
775 388.000000
776 388.500000
777 389.000000
778 389.500000
779 390.000000
780 390.500000
781 391.000000
782 391.500000
783 392.000000
784 392.500000
785 393.000000
786 393.500000
787 394.000000
788 394.500000
789 395.000000
790 395.500000
791 396.000000
792 396.500000
793 397.000000
794 397.500000
795 398.000000
796 398.500000
797 399.000000
798 399.500000
799 400.000000

View File

@@ -0,0 +1,17 @@
setexact_for_test_suite_only
loadrt sampler cfg=f depth=4096
#loadrt limit3
loadrt limit3
loadrt threads name1=t period1=1000000
setp limit3.0.maxv 500.000000
net n0 limit3.0.out sampler.0.pin.0
addf limit3.0 t
addf sampler.0 t
setp limit3.0.in 500
start
loadusr -w halsampler -t -n 800

View File

@@ -0,0 +1,4 @@
This test runs a triangle waveform clipped by max/min limits.
This is an idealized case that will show weaknesses in locking onto
the input and limits.

View File

@@ -0,0 +1 @@
../checkresult

View File

@@ -0,0 +1,38 @@
setexact_for_test_suite_only
#loadrt sampler cfg=fffffffu depth=1700
loadrt sampler cfg=ffff depth=3200
loadrt limit3
setp limit3.0.min -50
setp limit3.0.max 50
setp limit3.0.maxv 4000
setp limit3.0.maxa 10000
loadrt siggen
setp siggen.0.amplitude 100
net in => limit3.0.in
net in => sampler.0.pin.0
net in <= siggen.0.triangle
net out <= limit3.0.out
net out => sampler.0.pin.1
loadrt ddt names=vel,acc
net out => vel.in
net vel <= vel.out => sampler.0.pin.2 => acc.in
net acc <= acc.out => sampler.0.pin.3
loadrt threads name1=t period1=1000000
addf sampler.0 t
addf siggen.0.update t
addf limit3.0 t
addf vel t
addf acc t
start
loadusr -w halsampler -t -n 800
#loadusr -w halscope

View File

@@ -0,0 +1,4 @@
This test reproduces the everyday overshoot/undershoot described in
github issue #240:
https://github.com/LinuxCNC/linuxcnc/issues/240

View File

@@ -0,0 +1 @@
../checkresult

View File

@@ -0,0 +1,36 @@
setexact_for_test_suite_only
loadrt sampler cfg=ffff depth=3200
loadrt limit3
setp limit3.0.min -50
setp limit3.0.max 50
setp limit3.0.maxv 4000
setp limit3.0.maxa 10000
loadrt siggen
setp siggen.0.amplitude 100
net in <= siggen.0.sine
net in => limit3.0.in
net in => sampler.0.pin.0
net out <= limit3.0.out
net out => sampler.0.pin.1
loadrt ddt names=vel,acc
net out => vel.in
net vel <= vel.out => sampler.0.pin.2 => acc.in
net acc <= acc.out => sampler.0.pin.3
loadrt threads name1=t period1=1000000
addf siggen.0.update t
addf limit3.0 t
addf vel t
addf acc t
addf sampler.0 t
start
loadusr -w halsampler -t -n 800

View File

@@ -0,0 +1,6 @@
This test reproduces the runaway problem described in github issue #240:
https://github.com/LinuxCNC/linuxcnc/issues/240
The input is a sine wave (sampled from siggen), amplitude 100, that is
abruptly cut off a -42, on the way down on the first cycle.

View File

@@ -0,0 +1 @@
../checkresult

569
tests/limit3/runaway/input Normal file
View File

@@ -0,0 +1,569 @@
0.628314
1.256604
1.884844
2.513010
3.141076
3.769018
4.396812
5.024432
5.651854
6.279052
6.906003
7.532681
8.159061
8.785120
9.410831
10.036172
10.661116
11.285639
11.909716
12.533324
13.156436
13.779029
14.401078
15.022559
15.643447
16.263717
16.883345
17.502306
18.120577
18.738132
19.354947
19.970998
20.586261
21.200711
21.814324
22.427076
23.038943
23.649900
24.259923
24.868989
25.477073
26.084151
26.690199
27.295194
27.899111
28.501927
29.103617
29.704159
30.303527
30.901700
31.498652
32.094361
32.688803
33.281955
33.873793
34.464293
35.053433
35.641188
36.227537
36.812456
37.395921
37.977910
38.558400
39.137367
39.714790
40.290644
40.864908
41.437559
42.008573
42.577930
43.145605
43.711577
44.275824
44.838322
45.399051
45.957987
46.515108
47.070394
47.623821
48.175368
48.725013
49.272735
49.818511
50.362321
50.904142
51.443954
51.981735
52.517464
53.051119
53.582680
54.112126
54.639435
55.164588
55.687562
56.208339
56.726896
57.243213
57.757271
58.269049
58.778526
59.285683
59.790499
60.292955
60.793031
61.290706
61.785962
62.278779
62.769137
63.257017
63.742400
64.225266
64.705597
65.183373
65.658576
66.131187
66.601188
67.068558
67.533282
67.995339
68.454711
68.911382
69.365331
69.816543
70.264998
70.710679
71.153569
71.593649
72.030903
72.465314
72.896864
73.325535
73.751313
74.174178
74.594115
75.011108
75.425139
75.836192
76.244252
76.649302
77.051325
77.450307
77.846231
78.239082
78.628844
79.015502
79.399041
79.779445
80.156699
80.530789
80.901700
81.269417
81.633926
81.995212
82.353261
82.708058
83.059591
83.407844
83.752805
84.094459
84.432793
84.767794
85.099449
85.427744
85.752666
86.074203
86.392342
86.707071
87.018376
87.326246
87.630669
87.931632
88.229123
88.523132
88.813646
89.100653
89.384143
89.664104
89.940526
90.213397
90.482706
90.748443
91.010598
91.269159
91.524118
91.775463
92.023185
92.267275
92.507721
92.744516
92.977649
93.207112
93.432895
93.654989
93.873386
94.088078
94.299054
94.506308
94.709831
94.909615
95.105652
95.297935
95.486455
95.671206
95.852179
96.029369
96.202768
96.372368
96.538164
96.700149
96.858317
97.012660
97.163174
97.309852
97.452688
97.591677
97.726813
97.858091
97.985506
98.109052
98.228725
98.344521
98.456434
98.564460
98.668595
98.768834
98.865175
98.957612
99.046143
99.130763
99.211470
99.288261
99.361131
99.430079
99.495102
99.556197
99.613361
99.666593
99.715890
99.761251
99.802673
99.840155
99.873696
99.903294
99.928947
99.950656
99.968419
99.982235
99.992104
99.998026
100.000000
99.998026
99.992104
99.982235
99.968419
99.950656
99.928947
99.903293
99.873696
99.840155
99.802673
99.761250
99.715890
99.666593
99.613361
99.556196
99.495101
99.430079
99.361131
99.288260
99.211470
99.130763
99.046142
98.957611
98.865174
98.768834
98.668594
98.564459
98.456433
98.344520
98.228725
98.109051
97.985505
97.858090
97.726812
97.591676
97.452687
97.309850
97.163173
97.012659
96.858315
96.700148
96.538163
96.372367
96.202766
96.029368
95.852178
95.671204
95.486454
95.297933
95.105651
94.909614
94.709830
94.506307
94.299053
94.088076
93.873385
93.654988
93.432893
93.207110
92.977648
92.744514
92.507720
92.267273
92.023184
91.775461
91.524116
91.269158
91.010596
90.748441
90.482704
90.213395
89.940524
89.664102
89.384141
89.100651
88.813643
88.523130
88.229121
87.931630
87.630667
87.326244
87.018374
86.707069
86.392340
86.074201
85.752664
85.427742
85.099447
84.767792
84.432791
84.094457
83.752802
83.407842
83.059588
82.708056
82.353258
81.995209
81.633923
81.269415
80.901698
80.530787
80.156697
79.779442
79.399038
79.015499
78.628841
78.239079
77.846228
77.450304
77.051322
76.649299
76.244249
75.836189
75.425136
75.011105
74.594112
74.174175
73.751309
73.325532
72.896860
72.465311
72.030900
71.593646
71.153565
70.710676
70.264994
69.816539
69.365328
68.911378
68.454708
67.995335
67.533278
67.068555
66.601184
66.131184
65.658573
65.183370
64.705593
64.225263
63.742396
63.257013
62.769133
62.278775
61.785958
61.290702
60.793027
60.292951
59.790495
59.285679
58.778522
58.269045
57.757267
57.243209
56.726892
56.208335
55.687559
55.164584
54.639432
54.112122
53.582676
53.051115
52.517460
51.981731
51.443950
50.904138
50.362317
49.818507
49.272731
48.725009
48.175364
47.623817
47.070390
46.515104
45.957983
45.399046
44.838318
44.275820
43.711573
43.145601
42.577926
42.008569
41.437554
40.864904
40.290640
39.714785
39.137363
38.558395
37.977906
37.395917
36.812451
36.227533
35.641184
35.053428
34.464288
33.873788
33.281951
32.688799
32.094357
31.498648
30.901695
30.303523
29.704154
29.103613
28.501922
27.899107
27.295189
26.690195
26.084147
25.477068
24.868985
24.259919
23.649896
23.038938
22.427072
21.814320
21.200707
20.586257
19.970994
19.354943
18.738127
18.120572
17.502302
16.883340
16.263712
15.643442
15.022555
14.401074
13.779025
13.156432
12.533319
11.909712
11.285634
10.661111
10.036167
9.410827
8.785115
8.159057
7.532676
6.905998
6.279047
5.651849
5.024427
4.396807
3.769014
3.141071
2.513005
1.884839
1.256599
0.628310
-0.000005
-0.628319
-1.256609
-1.884849
-2.513014
-3.141081
-3.769023
-4.396817
-5.024437
-5.651858
-6.279057
-6.906007
-7.532685
-8.159066
-8.785124
-9.410836
-10.036176
-10.661120
-11.285643
-11.909721
-12.533328
-13.156441
-13.779034
-14.401083
-15.022564
-15.643451
-16.263721
-16.883349
-17.502311
-18.120581
-18.738136
-19.354952
-19.971003
-20.586266
-21.200716
-21.814329
-22.427081
-23.038948
-23.649905
-24.259928
-24.868994
-25.477077
-26.084155
-26.690204
-27.295198
-27.899115
-28.501931
-29.103622
-29.704163
-30.303532
-30.901704
-31.498657
-32.094366
-32.688808
-33.281959
-33.873797
-34.464297
-35.053437
-35.641193
-36.227542
-36.812460
-37.395925
-37.977914
-38.558404
-39.137372
-39.714794
-40.290648
-40.864912
-41.437563
-42.008578

View File

@@ -0,0 +1,34 @@
setexact_for_test_suite_only
loadrt sampler cfg=ffff depth=3200
loadrt streamer cfg=f depth=4096
loadrt limit3
setp limit3.0.min -50
setp limit3.0.max 50
setp limit3.0.maxv 4000
setp limit3.0.maxa 10000
net in <= streamer.0.pin.0
net in => limit3.0.in
net in => sampler.0.pin.0
net out <= limit3.0.out
net out => sampler.0.pin.1
loadrt ddt names=vel,acc
net out => vel.in
net vel <= vel.out => sampler.0.pin.2 => acc.in
net acc <= acc.out => sampler.0.pin.3
loadrt threads name1=t period1=1000000
addf streamer.0 t
addf limit3.0 t
addf vel t
addf acc t
addf sampler.0 t
start
loadusr halstreamer input
loadusr -w halsampler -t -n 1500

View File

@@ -0,0 +1,4 @@
This test exposes limit3 to an input signal that it is capable of
following perfectly (but just barely), and verifies that the output
follows the input very closely, while not violating position, velocity,
and acceleration constraints.

View File

@@ -0,0 +1,57 @@
#!/usr/bin/env python3
import sys
import math
max_value = 0.0
min_value = -100.0
max_vel = 315
max_accel = 1975
result_filename = sys.argv[1]
result_file = open(result_filename, 'r')
retval = 0
for line in result_file.readlines():
(line, in_value, in_vel, in_accel, out_value, out_vel, out_accel) = line.split()
in_value = float(in_value)
in_vel = float(in_vel)
in_accel = float(in_accel)
out_value = float(out_value)
out_vel = float(out_vel)
out_accel = float(out_accel)
#
# constraints
#
if out_value > max_value:
print(("max=%.3f, out=%.3f, position violation on line %s" % (max_value, out_value, line)))
retval = 1
if out_value < min_value:
print(("min=%.3f, out=%.3f, position violation on line %s" % (min_value, out_value, line)))
retval = 1
if math.fabs(out_vel) > max_vel:
print(("max_vel=%.3f, out_vel=%.3f, velocity violation on line %s" % (max_vel, out_vel, line)))
retval = 1
if math.fabs(out_accel) > max_accel:
print(("max_accel=%.3f, out_accel=%.3f, acceleration violation on line %s" % (max_accel, out_accel, line)))
retval = 1
#
# input -> output following
#
error = math.fabs(in_value - out_value)
if error > 0.0:
print(("input=%.6f, output=%.6f, error=%.6f, threshold=%.6f, following failure on line %s" % (in_value, out_value, error, threshold, line)))
retval = 1
sys.exit(retval)

View File

@@ -0,0 +1,63 @@
setexact_for_test_suite_only
loadrt limit3
# These pos/vel/accel limits are just a hair above the limits of the
# input sine wave.
setp limit3.0.min -150
setp limit3.0.max 50
setp limit3.0.maxv 630
setp limit3.0.maxa 4000
loadrt siggen
setp siggen.0.amplitude 50
setp siggen.0.offset -50
loadrt ddt names=ddt.in-accel,ddt.in-vel,ddt.out-accel,ddt.out-vel
loadrt sampler depth=2000 cfg=ffffff
# We use the cosine signal as the input so that the velocity and
# acceleration start out at 0, and we offset it by the negative of the
# amplitude so that position start out at 0 too.
net input <= siggen.0.cosine
net input => limit3.0.in
net input => ddt.in-vel.in
net input => sampler.0.pin.0
net in-vel <= ddt.in-vel.out
net in-vel => ddt.in-accel.in
net in-vel => sampler.0.pin.1
net in-accel <= ddt.in-accel.out
net in-accel => sampler.0.pin.2
net output <= limit3.0.out
net output => ddt.out-vel.in
net output => sampler.0.pin.3
net out-vel <= ddt.out-vel.out
net out-vel => ddt.out-accel.in
net out-vel => sampler.0.pin.4
net out-accel <= ddt.out-accel.out
net out-accel => sampler.0.pin.5
loadrt threads name1=t period1=1000000
addf siggen.0.update t
addf limit3.0 t
addf ddt.in-vel t
addf ddt.in-accel t
addf ddt.out-vel t
addf ddt.out-accel t
addf sampler.0 t
start
loadusr -w halsampler -t -n 4000