-
Notifications
You must be signed in to change notification settings - Fork 0
/
stir.py
63 lines (49 loc) · 1.2 KB
/
stir.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- coding: utf-8 -*-
#!/usr/bin/python
# Project name: AutoStir for FormLabs 1+ (OpenFL FW)
# Written by Simonepsp (2018)
from OpenFL import Printer, FLP
import sys
import time
import os
# CONFIG
INIT = True # Will init printer and then move to home pos
TOP_BOTTOM_STEPS = -73500
SPEED = 7000
# STIR
STIR_STEPS = 1850
STIR_SPEED = 1200 # Steps / Second
STIR_N = 10 # How many stirs movement will be done
# init printer
p = Printer.Printer()
# Clear screen
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
print('\nAUTOSTIR -- V1\n')
if p.get_machine_information():
print('Printer ONLINE')
else:
sys.exit('Printer OFFLINE :|')
if INIT:
# Move to home pos
print('Initializing...')
p.initialize()
print('Moving to bottom...')
# Move to bottom pos
p.move_z(TOP_BOTTOM_STEPS, SPEED)
else:
print('-- Will not init printer --')
print('Stirring resin')
# Stir
for i in range(0, STIR_N):
print ('... (%d)' % (i + 1))
p.move_z(STIR_STEPS, STIR_SPEED)
p.move_z(-STIR_STEPS, STIR_SPEED)
# Sleep between movements
time.sleep(0.25)
if INIT:
print ('DONE. Moving back to HOME pos\n')
# p.move_z(-TOP_BOTTOM_STEPS, SPEED)
p.initialize()