#!/bin/sh

echo 'Making FEP chuck'

stty 9600 raw -echo crtscts </dev/ttyS0
echo 'VS3;!VZ3;' > /dev/ttyS0

echo 'Insert 7/64" end mill, lower to surface, and press ENTER'
echo 'Milling outline 4.675 mm or 187 units down in 2 steps of 93 and 94 units each'
read

echo '!PZ-93,100;!MC1;PR;' > /dev/ttyS0
echo 'PD655,0;PD0,399;PD-655,0;PD0,-399;' > /dev/ttyS0
echo '!PZ-187,100;!MC1;PR;' > /dev/ttyS0
echo 'PD655,0;PD0,399;PD-655,0;PD0,-399;!MC0;' > /dev/ttyS0
echo 'PU136,136;' > /dev/ttyS0


echo 'Insert #70 bit, lower to surface, and press ENTER'
echo 'Milling holes 3.675mm or 187 units down'
read


echo '!PZ-187,100;!MC1;PR;' > /dev/ttyS0
echo 'PD;PU128,0;PD;PU128,0;PD;PU128,0;' > /dev/ttyS0
echo 'PD;PU0,128;' > /dev/ttyS0
echo 'PD;PU-128,0;PD;PU-128,0;PD;PU-128,0;PD;' > /dev/ttyS0
echo '!MC0;' > /dev/ttyS0
