summaryrefslogtreecommitdiff
path: root/trunk/users/metalab/python/gCalibrator/generate_oozetester_stop.py
blob: 172cabb5581322147111756c436065e0dde405aa (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python

from gcodegen import *
import math

def oozebane_line(x, y, prerun, stop, postrun, feedrate, pwm, steps):
    (x,y) = moveToXY(x - preRun, y)
    

feedrate = 1500.0
layerHeight = 0.372
extruderPWM = 255

testRuns = 15
testHeight = 4
preRun = 5.0
runPauseFactor = 20.0
offLength=40

raftHeight = (testRuns+2)*testHeight
raftWidth = 5.0
raftParts = int(math.ceil((2*preRun+offLength)/raftWidth))


print "G21"
print "G90"
print "G28"
print "M103"
setExtruderPWM(extruderPWM)


print "M101"


(x,y,z)=(0,0,layerHeight/2.0)


#layerStart(z);
moveTo(x,y,z,feedrate);
for i in range(0, raftParts):
    (x, y) = raftPartX(x, y, raftWidth, raftHeight) 

(x,y) = moveToXY(x,y+raftHeight-testHeight)


z += layerHeight
layerStart(z);
moveTo(x,y,z,feedrate);

testStartX = x

for i in range(0, testRuns):
    (x,y) = moveToXY(x - preRun, y)
    setExtruderPWM(-extruderPWM)
    startExtruder()

    pause(i*runPauseFactor)
    stopExtruder()

    (x,y) = moveToXY(x - offLength, y)

    setExtruderPWM(extruderPWM)
    startExtruder()
    pause(i*runPauseFactor)
    #(x,y) = moveToXY(x - preRun, y)
    (x,y) =  moveToXY(0,y)
    (x,y) = sCurveYAbs(x,y,testStartX,y-testHeight)

z += 10
print "M103"
moveTo(x,y,z,feedrate)