Gcode-nachbearbeitung.sh: Unterschied zwischen den Versionen

Aus RF1000 Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
  #!/bin/bash
#!/bin/bash
 
  for i in bottom top drills board ; do
for i in bottom top drills board ; do
 
    FeedG0=500
  FeedG0=500
    FeedG1=30
  FeedG1=30
    if [ $i == drills ]; then
  if [ $i == drills ]; then
      FeedG0=500
    FeedG0=500
      FeedG1=200
    FeedG1=200
    fi
  fi
   
 
    echo "Eingabe-Datei: ${i}.ncd"
  echo "Eingabe-Datei: ${i}.ncd"
    echo "Ausgabe-Datei: ${i}.gcode"
  echo "Ausgabe-Datei: ${i}.gcode"
    echo "Feedrate fuer G0: ${FeedG0}"
  echo "Feedrate fuer G0: ${FeedG0}"
    echo "Feedrate fuer G1: ${FeedG1}"
  echo "Feedrate fuer G1: ${FeedG1}"
 
    sleep 1
  sleep 1
 
    cat - ${i}.ncd > ${i}.gcode <<EOF
  cat - ${i}.ncd > ${i}.gcode <<EOF
  %
%
  M3005 S6 ; enable debug output
M3005 S6 ; enable debug output
  M3060 ; print firmware version
M3060 ; print firmware version
  G90 ; absolute coordinates
G90 ; absolute coordinates
  M3153 ; output matrix
M3153 ; output matrix
  M3141 ; turn z compensation on
M3141 ; turn z compensation on
  EOF
EOF
 
 
    sed -i ${i}.gcode -e 's/^G00 Z00.*$/G00 Z0.5/' -e 's/^G01.*$/\0 F'${FeedG1}'/' -e 's/^G00.*$/\0 F'${FeedG0}'/'      \
  sed -i ${i}.gcode -e 's/^G00 Z00.*$/G00 Z0.5/' -e 's/^G01.*$/\0 F'${FeedG1}'/' -e 's/^G00.*$/\0 F'${FeedG0}'/'      \
                      -e 's/^M74$/% \0/' -e 's/^M71$/% \0/' -e 's/^M48$/% \0/' -e 's/^M999.*$/% \0/'                    \
                    -e 's/^M74$/% \0/' -e 's/^M71$/% \0/' -e 's/^M48$/% \0/' -e 's/^M999.*$/% \0/'                    \
                      -e 's/^M30 .*$/% \0/' -e 's/^G36 .*$/% \0/' -e 's/^T.*$/% \0/'
                    -e 's/^M30 .*$/% \0/' -e 's/^G36 .*$/% \0/' -e 's/^T.*$/% \0/'
 
  done
done

Version vom 7. Mai 2017, 15:52 Uhr

#!/bin/bash

for i in bottom top drills board ; do

  FeedG0=500
  FeedG1=30
  if [ $i == drills ]; then
    FeedG0=500
    FeedG1=200
  fi
  
  echo "Eingabe-Datei: ${i}.ncd"
  echo "Ausgabe-Datei: ${i}.gcode"
  echo "Feedrate fuer G0: ${FeedG0}"
  echo "Feedrate fuer G1: ${FeedG1}"

  sleep 1

  cat - ${i}.ncd > ${i}.gcode <<EOF
%
M3005 S6 ; enable debug output
M3060 ; print firmware version
G90 ; absolute coordinates
M3153 ; output matrix
M3141 ; turn z compensation on
EOF
  sed -i ${i}.gcode -e 's/^G00 Z00.*$/G00 Z0.5/' -e 's/^G01.*$/\0 F'${FeedG1}'/' -e 's/^G00.*$/\0 F'${FeedG0}'/'       \
                    -e 's/^M74$/% \0/' -e 's/^M71$/% \0/' -e 's/^M48$/% \0/' -e 's/^M999.*$/% \0/'                     \
                    -e 's/^M30 .*$/% \0/' -e 's/^G36 .*$/% \0/' -e 's/^T.*$/% \0/'

done