-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfullControlMulti.py
49 lines (38 loc) · 1.29 KB
/
fullControlMulti.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
import os
import time
import serial
import pdb
import numpy as np
from HelperFuncs.printerHelp import setup,DoMove
from HelperFuncs.measControl import Measurement
from HelperFuncs.preMeasure import PreMeas
# Connect the Port For the 3D printer
ser = serial.Serial(port = "COM3", baudrate=115200)
maxX = 25 #mm/s
maxZ = 25 #mm/s
start=np.array([[5, 30],[170,30]])
print(start[0][0])
#pdb.set_trace()
#Setup the printer
setup(ser,maxX,maxZ)
# Create the Measurement Object
Meas = Measurement()
# Specify the Measurement Locations
mLocs = PreMeas(xStart=start[0][0],zStart=start[0][1],xSteps=8,zSteps=16,xSpace=5,zSpace=2.5,path=Meas.storPathPy)
mLocs.genPoints()
mLocs.savePoints()
for coordIn in range(0,(mLocs.measLocs.shape[0])):
# Move to the First Measurement Location
DoMove(ser=ser,coords=mLocs.measLocs[coordIn,:],xSpeed=maxX,zSpeed=maxZ)
time.sleep(0)
Meas.takeMeasure()
#Meas1 = Measurement(initMat=True)
# Specify the Measurement Locations
mLocs = PreMeas(xStart=start[1][0],zStart=start[1][1],xSteps=8,zSteps=16,xSpace=5,zSpace=2.5,path=Meas.storPathPy)
mLocs.genPoints()
mLocs.savePoints()
for coordIn in range(0,(mLocs.measLocs.shape[0])):
# Move to the First Measurement Location
DoMove(ser=ser,coords=mLocs.measLocs[coordIn,:],xSpeed=maxX,zSpeed=maxZ)
time.sleep(0)
Meas.takeMeasure()