Skip to content

Instantly share code, notes, and snippets.

@ansonl
Created April 16, 2022 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ansonl/3f2533b03e7ad4a30a2d9e027644af5c to your computer and use it in GitHub Desktop.
Save ansonl/3f2533b03e7ad4a30a2d9e027644af5c to your computer and use it in GitHub Desktop.
Annealing GCODE generator
# Annealing GCODE generator by Anson Liu
# Best results with a glass bed with annealingTemp set to the greater of buildplate print temp or material specified anneal temp
annealTemp = 110
annealMinutes = 60 * 4
endAnnealTemp = 50
print (';Generated Annealing GCODE from Annealing GCODE generator by Anson Liu ansonliu.com')
print('M300 ;play beep for plastic container reminder')
print('M117 Annealing at {}C. Place plastic container over objects on buildplate now! Waiting for bed to reach {}C... ;PC annealing at 110C for {}hrs'.format(annealTemp, annealTemp, round(annealMinutes/60, 2)))
print('M73 P00 ;reset progress bar to 0')
print('M190 R{}; wait for buildplate to reach temp in C even if cooling'.format(annealTemp))
print('M117 Keep plastic container over objects. Annealing at {}C...'.format(annealTemp))
def generateDwellAndProgressCode(minutes):
print('M73 P0 R{}'.format(minutes))
for x in range(1, minutes+1):
dwellWaitSeconds = 60
print('G4 S{}'.format(dwellWaitSeconds))
progress = round(x/minutes * 100, 2)
remainingMinutes = minutes - x
print('M73 P{} R{}'.format(progress, remainingMinutes))
generateDwellAndProgressCode(annealMinutes)
print('M117 Annealing complete. Gradually lowering bed temperature...')
for x in reversed(range(endAnnealTemp, annealTemp)):
print('M190 S{}; wait for buildplate only if heating'.format(x))
print('G4 S60')
print('M140 S0')
print('M117 Annealing complete.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment