Rust driver for controlling Zaber T-NM17A04 stepper motor for opening/closing heat switch
git clone https://github.com/MazinLab/heatswitch_driver
cd heatswitch_drivercargo build --releaseTo run the heatswitch command from anywhere, add the binary location to your bashrc:
echo 'export PATH="$HOME/heatswitch_driver/target/release:$PATH"' >> ~/.bashrc
source ~/.bashrcOr create an alias:
echo 'alias heatswitch="~/heatswitch_driver/target/release/heatswitch_driver"' >> ~/.bashrc
source ~/.bashrcheatswitch --helpNote that counterclockwise on the motor is actual a clockwise rotation on the heatswitch and vice versa. If you want to rotate the heatswitch closed (which is a clockwise rotation), you have to execute the motion counterclockwise. The commands for open and close already account for this discrepancy
# Current position
heatswitch pos
# Close heatswitch (counterclockwise 115200 steps)
heatswitch close
# Open heatswitch (clockwise 115200 steps)
heatswitch open
# Rotate clockwise 1000 steps
heatswitch cw 1000
# Rotate counterclockwise 1000 steps
heatswitch ccw 1000
# Move to absolute position
heatswitch move-abs 1000
# Get motor status
heatswitch status
# Stop motor
heatswitch stop
# Custom port/settings
heatswitch --port /dev/ttyUSB0 --baudrate 115200 posAPACHE