Skip to content

Commit 684045f

Browse files
author
Stefan Hechenberger
committed
v17.02 ready for beta testing, usb branch merged
2 parents e9d32e0 + d5c9aa6 commit 684045f

20 files changed

Lines changed: 1983 additions & 1774 deletions

TODO.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11

2-
2+
- image raster cuts off some 5mm at the end
33
- when serial port ato changes, fails to do so in flash module
44

55

6-
DriveboardUSB TODO
7-
------------------
8-
- new freq control
9-
10-
116
bugs
127
----
138
- stall between certain x-axis jogs

backend/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
conf = {
2828
'appname': 'driveboardapp',
29-
'version': '17.01-beta',
29+
'version': '17.02-beta',
3030
'company_name': 'com.nortd.labs',
3131
'network_host': '', # '' for all nics
3232
'network_port': 4444,

backend/driveboard.py

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
import serial.tools.list_ports
1313
from config import conf, write_config_fields
1414

15+
try:
16+
from PIL import Image
17+
except ImportError:
18+
print "Pillow module missing, raster mode will fail."
19+
1520

1621
__author__ = 'Stefan Hechenberger <stefan@nortd.com>'
1722

@@ -44,8 +49,8 @@
4449

4550
CMD_AIR_ENABLE = "L"
4651
CMD_AIR_DISABLE = "M"
47-
# CMD_AUX1_ENABLE = "N"
48-
# CMD_AUX1_DISABLE = "O"
52+
CMD_AUX_ENABLE = "N"
53+
CMD_AUX_DISABLE = "O"
4954
# CMD_AUX2_ENABLE = "P"
5055
# CMD_AUX2_DISABLE = "Q"
5156

@@ -144,8 +149,8 @@
144149

145150
"L": "CMD_AIR_ENABLE",
146151
"M": "CMD_AIR_DISABLE",
147-
# "N": "CMD_AUX1_ENABLE",
148-
# "O": "CMD_AUX1_DISABLE",
152+
"N": "CMD_AUX_ENABLE",
153+
"O": "CMD_AUX_DISABLE",
149154
# "P": "CMD_AUX2_ENABLE",
150155
# "Q": "CMD_AUX2_DISABLE",
151156

@@ -931,7 +936,7 @@ def job(jobdict):
931936

932937
# reset vavles
933938
air_off()
934-
# aux1_off()
939+
# aux_off()
935940

936941
# loop passes
937942
for pass_ in jobdict['passes']:
@@ -949,8 +954,8 @@ def job(jobdict):
949954
air_on()
950955
else:
951956
air_on() # also default this behavior
952-
# if 'aux1_assist' in pass_ and pass_['aux1_assist'] == 'pass':
953-
# aux1_on()
957+
# if 'aux_assist' in pass_ and pass_['aux_assist'] == 'pass':
958+
# aux_on()
954959
# seekrate
955960
if 'seekrate' in pass_:
956961
seekrate = pass_['seekrate']
@@ -984,7 +989,6 @@ def job(jobdict):
984989
px_h = int(size[1]/pxsize)
985990
# create image obj, convert to grayscale, scale, loop through lines
986991
print "--- start of image processing ---"
987-
import Image
988992
imgobj = Image.open(io.BytesIO(base64.b64decode(data[22:].encode('utf-8'))))
989993
imgobj = imgobj.resize((px_w,px_h), resample=Image.BICUBIC)
990994
if imgobj.mode == 'RGBA':
@@ -1009,8 +1013,8 @@ def job(jobdict):
10091013
# assists on, beginning of feed if set to 'feed'
10101014
if 'air_assist' in pass_ and pass_['air_assist'] == 'feed':
10111015
air_on()
1012-
# if 'aux1_assist' in pass_ and pass_['aux1_assist'] == 'feed':
1013-
# aux1_on()
1016+
# if 'aux_assist' in pass_ and pass_['aux_assist'] == 'feed':
1017+
# aux_on()
10141018
### go through image lines ####
10151019
pxarray = imgobj.getdata()
10161020
# if len(pxarray) % size[0] != 0:
@@ -1028,6 +1032,7 @@ def job(jobdict):
10281032
end += px_w
10291033
# move to start of line
10301034
feedrate(seekrate)
1035+
# intensity(0.0)
10311036
move(leadinpos, line_y)
10321037
# lead-in
10331038
feedrate(feedrate_)
@@ -1048,8 +1053,8 @@ def job(jobdict):
10481053
# assists off, end of feed if set to 'feed'
10491054
if 'air_assist' in pass_ and pass_['air_assist'] == 'feed':
10501055
air_off()
1051-
# if 'aux1_assist' in pass_ and pass_['aux1_assist'] == 'feed':
1052-
# aux1_off()
1056+
# if 'aux_assist' in pass_ and pass_['aux_assist'] == 'feed':
1057+
# aux_off()
10531058

10541059
elif kind == "fill" or kind == "path":
10551060
path = def_['data']
@@ -1071,8 +1076,8 @@ def job(jobdict):
10711076
# also air_assist defaults to 'feed'
10721077
if 'air_assist' in pass_ and pass_['air_assist'] == 'feed':
10731078
air_on()
1074-
# if 'aux1_assist' in pass_ and pass_['aux1_assist'] == 'feed':
1075-
# aux1_on()
1079+
# if 'aux_assist' in pass_ and pass_['aux_assist'] == 'feed':
1080+
# aux_on()
10761081
# TODO dwell according to pierce time
10771082
if is_2d:
10781083
for i in xrange(1, len(polyline)):
@@ -1083,17 +1088,17 @@ def job(jobdict):
10831088
# turn off assists if set to 'feed'
10841089
if 'air_assist' in pass_ and pass_['air_assist'] == 'feed':
10851090
air_off()
1086-
# if 'aux1_assist' in pass_ and pass_['aux1_assist'] == 'feed':
1087-
# aux1_off()
1091+
# if 'aux_assist' in pass_ and pass_['aux_assist'] == 'feed':
1092+
# aux_off()
10881093

10891094
# assists off, end of pass if set to 'pass'
10901095
if 'air_assist' in pass_:
10911096
if pass_['air_assist'] == 'pass':
10921097
air_off()
10931098
else:
10941099
air_off() # also default this behavior
1095-
# if 'aux1_assist' in pass_ and pass_['aux1_assist'] == 'pass':
1096-
# aux1_off()
1100+
# if 'aux_assist' in pass_ and pass_['aux_assist'] == 'pass':
1101+
# aux_off()
10971102

10981103
# return to origin
10991104
feedrate(conf['seekrate'])
@@ -1150,28 +1155,15 @@ def air_off():
11501155
with SerialLoop.lock:
11511156
SerialLoop.send_command(CMD_AIR_DISABLE)
11521157

1158+
def aux_on():
1159+
global SerialLoop
1160+
with SerialLoop.lock:
1161+
SerialLoop.send_command(CMD_AUX_ENABLE)
11531162

1154-
# def aux1_on():
1155-
# global SerialLoop
1156-
# with SerialLoop.lock:
1157-
# SerialLoop.send_command(CMD_AUX1_ENABLE)
1158-
#
1159-
# def aux1_off():
1160-
# global SerialLoop
1161-
# with SerialLoop.lock:
1162-
# SerialLoop.send_command(CMD_AUX1_DISABLE)
1163-
#
1164-
#
1165-
# def aux2_on():
1166-
# global SerialLoop
1167-
# with SerialLoop.lock:
1168-
# SerialLoop.send_command(CMD_AUX2_ENABLE)
1169-
#
1170-
# def aux2_off():
1171-
# global SerialLoop
1172-
# with SerialLoop.lock:
1173-
# SerialLoop.send_command(CMD_AUX2_DISABLE)
1174-
1163+
def aux_off():
1164+
global SerialLoop
1165+
with SerialLoop.lock:
1166+
SerialLoop.send_command(CMD_AUX_DISABLE)
11751167

11761168
def set_offset_table():
11771169
global SerialLoop

backend/lasersaur.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ def air_on(self):
130130
def air_off(self):
131131
self._request('/air_off')
132132

133-
def aux1_on(self):
134-
self._request('/aux1_on')
133+
def aux_on(self):
134+
self._request('/aux_on')
135135

136-
def aux1_off(self):
137-
self._request('/aux1_off')
136+
def aux_off(self):
137+
self._request('/aux_off')
138138

139139
def offset(self, x, y, z=0.0):
140140
self._request('/offset/%.4f/%.4f/%.4f' % (x,y,z))
@@ -449,8 +449,8 @@ def reset(self):
449449
move = lasersaur.move
450450
air_on = lasersaur.air_on
451451
air_off = lasersaur.air_off
452-
aux1_on = lasersaur.aux1_on
453-
aux1_off = lasersaur.aux1_off
452+
aux_on = lasersaur.aux_on
453+
aux_off = lasersaur.aux_off
454454
offset = lasersaur.offset
455455
clear_offset = lasersaur.clear_offset
456456
### JOBS QUEUE

backend/web.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,19 @@ def air_off():
203203
driveboard.air_off()
204204
return '{}'
205205

206-
# @bottle.route('/aux1_on')
207-
# @bottle.auth_basic(checkuser)
208-
# @checkserial
209-
# def aux1_on():
210-
# driveboard.aux1_on()
211-
# return '{}'
212-
#
213-
# @bottle.route('/aux1_off')
214-
# @bottle.auth_basic(checkuser)
215-
# @checkserial
216-
# def aux1_off():
217-
# driveboard.aux1_off()
218-
# return '{}'
206+
@bottle.route('/aux_on')
207+
@bottle.auth_basic(checkuser)
208+
@checkserial
209+
def aux_on():
210+
driveboard.aux_on()
211+
return '{}'
212+
213+
@bottle.route('/aux_off')
214+
@bottle.auth_basic(checkuser)
215+
@checkserial
216+
def aux_off():
217+
driveboard.aux_off()
218+
return '{}'
219219

220220
@bottle.route('/offset/<x:float>/<y:float>/<z:float>')
221221
@bottle.auth_basic(checkuser)

docs/driveboardusb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ These are the imputs for the limit, door, and chiller switches. Switches are exp
6363

6464
### Laser Control
6565

66-
The control wire connects to the control port of the laser PSU. The typical pins are `| 5V | TH | TL | WP | IN |` and all but TH need to connected as follows.
66+
The control wire connects to the control port of the laser PSU. The typical pins are `| 5V | TH | TL | WP | GND | IN |` and all but TH need to connected as follows.
6767

6868
- LASER, RJ45
6969

0 commit comments

Comments
 (0)