This commit is contained in:
2024-12-22 05:22:46 +03:00
commit 1992e632d3
232 changed files with 20394 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
all: compile test
DEV=ttyUSB0
test: M1.test M7.test
%.test:
MOTOR=$* ./seq_04.sh $(DEV)
MOTOR=$* ./seq_05.sh $(DEV)
MOTOR=$* ./seq_06.sh $(DEV)
MOTOR=$* ./seq_01a.sh $(DEV)
MOTOR=$* ./seq_01b.sh $(DEV)
MOTOR=$* ./seq_02.sh $(DEV)
MOTOR=$* ./seq_07a.sh $(DEV)
MOTOR=$* ./seq_07b.sh $(DEV)
MOTOR=$* ./seq_07c.sh $(DEV)
MOTOR=$* ./seq_03.sh $(DEV)
compile:
(cd ../../../pio_dirs/StepperDemo;rm -fR .pio; pio run -e esp32_V6_8_1 -t upload --upload-port /dev/$(DEV))
compile_idf4:
(cd ../../../pio_espidf/StepperDemo;rm -fR .pio; pio run -e esp32_idf_V5_3_0 -t upload --upload-port /dev/$(DEV))
compile_idf5:
(cd ../../../pio_espidf/StepperDemo;rm -fR .pio; pio run -e esp32_idf_V6_8_1 -t upload --upload-port /dev/$(DEV))
clean:
rm -f seq*.log

View File

@@ -0,0 +1,51 @@
BEGIN {
pass = 1
}
# This is for running motor
/^M[17]:/ {
api = substr($2,2)
pcnt = substr($3,2,length($3)-2)
if (pcnt < 0) {
if (api > 0) {
while (pcnt < 0) {
pcnt += 32767
}
}
}
api = api % 32767
delta = pcnt - api
if (api > pcnt) {
delta = api - pcnt
}
if ((delta > 66) && (delta < 32767-66)) {
print
print api, pcnt
pass = 0
print "FAIL HERE ^^^"
}
}
# This is for selected motor
/^>> M[17]:/ {
print
api = substr($3,2)
api = api % 32767
pcnt = substr($4,2,length($4)-2)
if (pcnt < 0) {
pcnt += 32767
}
if (api != pcnt) {
print api, pcnt
pass = 0
print "FAIL HERE ^^^"
}
}
END {
if (pass) {
print "PASS"
}
else {
print "FAIL"
}
}

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 H25000 A10000 f w1000 X w100 pc R100 w100 W R1000 w1000 W "
PASS=">> $MOTOR: @1100 \\[1100\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 10 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 H25000 A10000 f w1000 X W pc R100 w100 W R1000 w1000 W "
PASS=">> $MOTOR: @1100 \\[1100\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 10 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 H25000 A10000 f w10 X W pc w 20 R1 W "
PASS=">> $MOTOR: @1 \\[1\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 3
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 10 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
# grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,32 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 H30000 A100000 R30000 "
PASS=">> $MOTOR: @30000 \\[30000\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 3 -o $LOG
echo
if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
then
grabserial $DEV -c 'r ' -q StepperDemo -e 1
echo
echo FAIL $0 pulse counter mismatch
exit 1
fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,43 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
COMPLETE="test completed"
PASS="test passed"
MAX_RUN_S=300
# rmt has failed once 07, but repetitions are ok
for SEQ in 13 01 02 03 04 06 07 10 11
do
LOG="$0_$SEQ.log"
CMD="$MOTOR p7,-32767,32767 t $MOTOR $SEQ R "
echo "reset esp32"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
echo "send commands"
grabserial $DEV -c "$CMD" -q "$COMPLETE" -e $MAX_RUN_S -o $LOG
echo
if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
then
grabserial $DEV -c 'r ' -q StepperDemo -e 1
echo
echo FAIL $0 pulse counter mismatch
echo "test sequence $SEQ"
exit 1
fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' x r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
echo "test sequence $SEQ"
exit 1
fi
done

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 H25000 A10000 R1 W "
PASS=">> $MOTOR: @1 \\[1\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 3 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR H25000 A10000 R1000 w200 X W p7,-32767,32767 ? R10 w1000 "
PASS=">> $MOTOR: @10 \\[10\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 3 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 V40 A1000000 R54 W "
PASS=">> $MOTOR: @54 \\[54\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 3 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 V40 A1000 R54 W R-54 W"
PASS=">> $MOTOR: @0 \\[0\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 3 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 V40 A1000 R20 W R-19 W"
PASS=">> $MOTOR: @1 \\[1\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 3 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,34 @@
#!/bin/sh
TTY=${1:-ttyUSB0}
DEV="-d /dev/${TTY} -b 115200"
MOTOR=${MOTOR:-M1}
CMD="$MOTOR p7,-32767,32767 V40 A1000 R20 W "
PASS=">> $MOTOR: @20 \\[20\\]"
LOG="$0.log"
grabserial $DEV -c ' x reset ' -q "$MOTOR:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e 3 -o $LOG
echo
#if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
#then
# grabserial $DEV -c 'r ' -q StepperDemo -e 1
# echo
# echo FAIL $0 pulse counter mismatch
# exit 1
#fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c ' r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,33 @@
#!/bin/sh
DEV="-d /dev/ttyUSB0 -b 115200"
CMD="M1 p7,0,0 t M1 07 R "
PASS="Test passed"
MAX_RUN_S=10
LOG="$0.log"
grabserial $DEV -c 'reset ' -q "M1:" -e 10
sleep 2
grabserial $DEV -c "$CMD" -q "$PASS" -e $MAX_RUN_S -o $LOG
echo
if [ `gawk -f judge_pcnt_sync.awk $LOG | grep -c PASS` -ne 1 ]
then
grabserial $DEV -c 'r ' -q StepperDemo -e 1
echo
echo FAIL $0 pulse counter mismatch
exit 1
fi
if [ `grep -c "$PASS" $LOG` -eq 1 ]
then
echo PASS
else
grabserial $DEV -c 'r ' -q StepperDemo -e 1
echo
echo "FAIL $0 result pattern: $PASS"
exit 1
fi

View File

@@ -0,0 +1,13 @@
#!/bin/sh
# arduino idf4 based test
make compile
make M1.test M7.test
# idf4 based test
make compile_idf4
make M1.test M7.test
# idf5 only rmt-module supporting 8 steppers
make compile_idf5
make M1.test