mirror of
https://github.com/eddyem/pusirobot.git
synced 2026-03-20 08:41:00 +03:00
Add better reaction to -q keyword
This commit is contained in:
22
commandline/cfg/Oscill
Executable file
22
commandline/cfg/Oscill
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
Ampl=$1
|
||||
|
||||
./steppermove -s250
|
||||
./steppermove -I1 -m4000
|
||||
./steppermove -I2 -m4000
|
||||
|
||||
#if false; then
|
||||
./steppermove -I2 -qr-3000
|
||||
./steppermove -I1 -qr-3000
|
||||
./steppermove -I2 -qw -r500
|
||||
./steppermove -I1 -qr500
|
||||
./steppermove -I2 -qw
|
||||
#fi
|
||||
|
||||
while true; do
|
||||
./steppermove -I2 -qwr${Ampl}
|
||||
./steppermove -I1 -qr${Ampl}
|
||||
./steppermove -I2 -qwr-${Ampl}
|
||||
./steppermove -I1 -qr-${Ampl}
|
||||
done
|
||||
8
commandline/cfg/SetCurnt0.8.cfg
Normal file
8
commandline/cfg/SetCurnt0.8.cfg
Normal file
@@ -0,0 +1,8 @@
|
||||
# Transmit SDO to driver
|
||||
# Format: index, subindex, data
|
||||
|
||||
# Set max phase current to 800mA
|
||||
0x600B, 0, 800
|
||||
|
||||
# Save parameters
|
||||
0x2007, 0, 2
|
||||
8
commandline/cfg/SetCurnt1.0.cfg
Normal file
8
commandline/cfg/SetCurnt1.0.cfg
Normal file
@@ -0,0 +1,8 @@
|
||||
# Transmit SDO to driver
|
||||
# Format: index, subindex, data
|
||||
|
||||
# Set max phase current to 600mA
|
||||
0x600B, 0, 1000
|
||||
|
||||
# Save parameters
|
||||
0x2007, 0, 2
|
||||
8
commandline/cfg/SetCurnt1.5.cfg
Normal file
8
commandline/cfg/SetCurnt1.5.cfg
Normal file
@@ -0,0 +1,8 @@
|
||||
# Transmit SDO to driver
|
||||
# Format: index, subindex, data
|
||||
|
||||
# Set max phase current to 600mA
|
||||
0x600B, 0, 1500
|
||||
|
||||
# Save parameters
|
||||
0x2007, 0, 2
|
||||
8
commandline/cfg/SetCurnt2.0.cfg
Normal file
8
commandline/cfg/SetCurnt2.0.cfg
Normal file
@@ -0,0 +1,8 @@
|
||||
# Transmit SDO to driver
|
||||
# Format: index, subindex, data
|
||||
|
||||
# Set max phase current to 2A
|
||||
0x600B, 0, 2000
|
||||
|
||||
# Save parameters
|
||||
0x2007, 0, 2
|
||||
37
commandline/cfg/TurretMove
Executable file
37
commandline/cfg/TurretMove
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
function move(){
|
||||
./steppermove -I4 $*
|
||||
}
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 Nposition (enumeration from 0)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $1 -lt 0 -o $1 -gt 5 ]; then
|
||||
echo "Turet position should be from 0 to 5" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
LAST=-1
|
||||
[ -f lastpos ] && LAST=$(cat lastpos)
|
||||
|
||||
eval "$(move -s250 -m50)"
|
||||
|
||||
DIFF=$((CURENCODER - LAST))
|
||||
ABS=${DIFF#-} # absoulte value
|
||||
|
||||
if [ $ABS -gt 3 ]; then # goto zero if last position differs more then for 3 from current
|
||||
move -cE1 -r-1000
|
||||
move -wcA
|
||||
move -0
|
||||
fi
|
||||
|
||||
move -Fa $((683*$1))
|
||||
move -w
|
||||
|
||||
sleep 1 # wait for stopping
|
||||
eval "$(move)"
|
||||
echo $CURENCODER > lastpos
|
||||
echo "Current encoder position: $CURENCODER"
|
||||
Reference in New Issue
Block a user