Tuesday, February 1, 2011

Extruder Update

The new extruder parts have arrived and I have built up my new extruder. The build was uneventful, which was nice. Initial tests show that it works reliably, but I still have to dial-in all the settings again as the nozzle appears to be marginally bigger than the previous one. Once I've got it dialed back in I'll be able to continue experimenting with the various skeinforge settings.

I'll document the dial-in process but there is something that's going to interrupt that process. An upcoming house move that is going to disrupt my workshop for a few weeks while it gets packed, moved and unpacked.


import sys

# Preferred Start Codes
startCode = [
'G28 Z0\n'
'G28 X0 Y0\n'
'G92 E0\n'

def AppendCode(fh, codes):
   for code in codes:

def Main(fileName):
   # Counters   
   M101Cnt = 0
   M103Cnt = 0

   # Open Input File
      fh = open(fileName, 'r')
      print 'Cannot open file: %s' % (fileName)
   print '\nProcessing %s' % (fileName)
   # Create Output Filename
   name, ext = fileName.split('.')
   name = name+'_mod'
   opFile = name+'.'+ext
   # Open Output File
   op = open(opFile, 'w')

   # Add preferred Start-up code
   AppendCode(op, startCode)

   # Remove first X lines
   # Skeinforge produces strange start-up code that isn't useful.
   X = 12
   for i in range(X):
   # Process remaining lines in turn
   for line in fh:
      # Remove 'M101' and 'M103' commands, Mendel doesn't use these.
      if line.find('M101')==0:
         M101Cnt +=1
         line = ''
      if line.find('M103')==0:
         line = ''
      # Remove 'M113' command, stepper based extruder doesn't use this
      if line.find('M113')==0:
         M101Cnt +=1
         line = ''
      # Write to output file

   print 'Generated file: %s' % (opFile)
   print 'Removed %s old M101 Codes' % (M101Cnt)
   print 'Removed %s old M103 Codes' % (M103Cnt)
if __name__ == '__main__':