some changes: bug fixes, working with PMC007

This commit is contained in:
2025-02-18 17:36:25 +03:00
parent 1453398f08
commit f3023b1cc0
20 changed files with 308 additions and 45 deletions

View File

@@ -0,0 +1 @@
scripts for 3-motor local corrector

View File

@@ -0,0 +1,19 @@
#!/bin/sh
# init 3-point local corrector
for I in 2 10 11; do
./steppermove -I$I -m8000 -r-10000
done
for I in 2 10 11; do
./steppermove -I$I -w
done
for I in 2 10 11; do
./steppermove -I$I -0
done
for I in 2 10 11; do
./steppermove -I$I -a 7200
done

View File

@@ -0,0 +1,24 @@
#!/bin/sh
# random move 3-point local corrector around middle point
function rmove(){ # $1 - current motor index, $2 - index of motor to correct into+, $3 - relative steps
arr=(2 10 11) # ID's of motors
ID=${arr[$1]}
#./steppermove -I$ID -w
if [[ $1 -ne $2 ]]; then # move to minus
./steppermove -I$ID -a $(( 7200 - S ))
else # move to plus
./steppermove -I$ID -a $(( 7200 + S ))
fi
}
trap "echo Exited!; exit;" SIGINT SIGTERM
while true; do
I=$(( RANDOM % 3 ))
S=$(( RANDOM % 1280 ))
for i in 0 1 2; do
rmove $i $I $S
done
done