From 0e2c4bc3e90ab177d483e8a7aa61467e55e46e23 Mon Sep 17 00:00:00 2001 From: David Carley Date: Wed, 3 Mar 2021 07:44:00 -0800 Subject: [PATCH 01/10] Fixed a bogus link in the Settings page. --- src/pug/templates/settings-view.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pug/templates/settings-view.pug b/src/pug/templates/settings-view.pug index 62b4392..bd596c7 100644 --- a/src/pug/templates/settings-view.pug +++ b/src/pug/templates/settings-view.pug @@ -63,7 +63,7 @@ script#settings-view-template(type="text/x-template") - var base = '//linuxcnc.org/docs/html/gcode/g-code.html' p. GCode commands - #[a(href=base + "#gcode:g61-g61.1", target="_blank") G61, G61.1] and + #[a(href=base + "#gcode:g61", target="_blank") G61, G61.1] and #[a(href=base + "#gcode:g64", target="_blank") G64] also affect path planning accuracy. From 504c77f96b8a21bad458d6ce3119e269749fed64 Mon Sep 17 00:00:00 2001 From: David Carley Date: Thu, 4 Mar 2021 12:49:26 -0800 Subject: [PATCH 02/10] Slowed the probe-fast-seek from 100 to 75 --- src/resources/onefinity_machinist_defaults.json | 2 +- src/resources/onefinity_woodworker_defaults.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/onefinity_machinist_defaults.json b/src/resources/onefinity_machinist_defaults.json index 66602e0..568594e 100644 --- a/src/resources/onefinity_machinist_defaults.json +++ b/src/resources/onefinity_machinist_defaults.json @@ -16,7 +16,7 @@ "probe": { "probe-ydim": 53.975, "probe-slow-seek": 25, - "probe-fast-seek": 100, + "probe-fast-seek": 75, "probe-zdim": 15.4, "probe-xdim": 53.975 }, diff --git a/src/resources/onefinity_woodworker_defaults.json b/src/resources/onefinity_woodworker_defaults.json index 2942263..0299269 100644 --- a/src/resources/onefinity_woodworker_defaults.json +++ b/src/resources/onefinity_woodworker_defaults.json @@ -16,7 +16,7 @@ "probe": { "probe-ydim": 53.975, "probe-slow-seek": 25, - "probe-fast-seek": 100, + "probe-fast-seek": 75, "probe-zdim": 15.4, "probe-xdim": 53.975 }, From df4137b1ceb4c84ed2a094c6f93d486e57157e8b Mon Sep 17 00:00:00 2001 From: David Carley Date: Thu, 4 Mar 2021 12:51:11 -0800 Subject: [PATCH 03/10] Tweak to homing procedure --- src/py/bbctrl/Mach.py | 16 ++++++++++++---- src/py/bbctrl/Planner.py | 6 ++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/py/bbctrl/Mach.py b/src/py/bbctrl/Mach.py index b3f6af8..ba4a8c5 100644 --- a/src/py/bbctrl/Mach.py +++ b/src/py/bbctrl/Mach.py @@ -50,9 +50,15 @@ axis_homing_procedure = ''' G90 G28.3 %(axis)s[#<_%(axis)s_home_position>] ''' +# The stepper drivers have a stall flag that is reset +# by moving the motors without a stall condition. +# The "wiggle" in the stall procedure is to clear the flag. +# This was to correct the issue where the stepper motors +# may already be in a stall condition when homing is started. +# For example, if a user tried to home twice in a row +# the second homing attempt would immediately think it +# was stalled if we didn't first back it up a bit stall_homing_procedure = ''' - G91 G1 %(axis)s [#<_%(axis)s_zero_backoff> * -1] F[#<_%(axis)s_search_velocity>] - G4 P0.25 G91 G1 %(axis)s [#<_%(axis)s_zero_backoff>] F[#<_%(axis)s_search_velocity>] G4 P0.25 G28.2 %(axis)s0 F[#<_%(axis)s_search_velocity>] @@ -275,11 +281,13 @@ class Mach(Comm): # Home axis self.mlog.info('Homing %s axis' % axis) self._begin_cycle('homing') + if mode.startswith('stall-'): procedure = stall_homing_procedure else: procedure = axis_homing_procedure - self.planner.mdi(procedure % {'axis': axis}, False) - # self.planner.mdi(axis_homing_procedure % {'axis': axis}, False) + gcode = procedure % {'axis': axis} + + self.planner.mdi(gcode, False) super().resume() diff --git a/src/py/bbctrl/Planner.py b/src/py/bbctrl/Planner.py index e5fc20b..2dda848 100644 --- a/src/py/bbctrl/Planner.py +++ b/src/py/bbctrl/Planner.py @@ -96,6 +96,12 @@ class Planner(): 'junction-accel': config.get('junction-accel'), } + # We place an upper limit of 1000 km/min^3 on jerk for MDI movements + if mdi: + for axis in 'xyzabc': + if axis in cfg['max-jerk']: + cfg['max-jerk'][axis] = min(1000 * 1000000, cfg['max-jerk'][axis]) + if with_limits: minLimit = state.get_soft_limit_vector('tn', -math.inf) maxLimit = state.get_soft_limit_vector('tm', math.inf) From 4411b0167d2780fd5bb4f2390e72ab88c3337875 Mon Sep 17 00:00:00 2001 From: David Carley Date: Fri, 5 Mar 2021 11:57:56 -0800 Subject: [PATCH 04/10] Had to refactor probing logic to handle imperial --- src/js/control-view.js | 123 +++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 71 deletions(-) diff --git a/src/js/control-view.js b/src/js/control-view.js index 1039e9a..f76e540 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -346,68 +346,54 @@ module.exports = { }, probe_xyz() { - let xoffset = this.config.probe["probe-xdim"]; - let yoffset = this.config.probe["probe-ydim"]; - let zoffset = this.config.probe["probe-zdim"]; - let fastSeek = this.config.probe["probe-fast-seek"]; - let slowSeek = this.config.probe["probe-slow-seek"]; + const xdim = this.config.probe["probe-xdim"]; + const ydim = this.config.probe["probe-ydim"]; + const zdim = this.config.probe["probe-zdim"]; + const slowSeek = this.config.probe["probe-slow-seek"]; + const fastSeek = this.config.probe["probe-fast-seek"]; - xoffset += this.tool_diameter / 2.0; - yoffset += this.tool_diameter / 2.0; - - if (this.mach_units !== "METRIC") { - xoffset /= 25.4; - yoffset /= 25.4; - zoffset /= 25.4; - slowSeek /= 25.4; - fastSeek /= 25.4; - } - const zlift = 1; - + const xoffset = xdim + (this.tool_diameter / 2.0); + const yoffset = ydim + (this.tool_diameter / 2.0); + const zoffset = zdim; + + const metric = this.mach_units == "METRIC"; + const mm = n => (metric ? n : n / 25.4).toFixed(5); + const speed = s => `F${mm(s)}`; + // After probing Z, we want to drop the bit down: // Ideally, 12.7mm/0.5in // And we don't want to be more than 75% down on the probe block - let plunge = Math.min(12.7, zoffset * 0.75); - plunge += zlift; // Compensate for the fact that we lift after probing Z - - xoffset = xoffset.toFixed(5); - yoffset = yoffset.toFixed(5); - zoffset = zoffset.toFixed(5); - slowSeek = slowSeek.toFixed(5); - fastSeek = fastSeek.toFixed(5); - plunge = plunge.toFixed(5); - - slowSeek = `F${slowSeek}`; - fastSeek = `F${fastSeek}`; - + // Also, add zlift to compensate for the fact that we lift after probing Z + const plunge = Math.min(12.7, zoffset * 0.75) + zlift; + this.send(` - G21 + ${metric ? "G21" : "G20"} G92 X0 Y0 Z0 - G38.2 Z -25.4 ${fastSeek} - G91 G1 Z 1 - G38.2 Z -2 ${slowSeek} - G92 Z ${zoffset} + G38.2 Z ${mm(-25.4)} ${speed(fastSeek)} + G91 G1 Z ${mm(1)} + G38.2 Z ${mm(-2)} ${speed(slowSeek)} + G92 Z ${mm(zoffset)} - G91 G0 Z ${zlift} - G91 G0 X 20 - G91 G0 Z -${plunge} - G38.2 X -20 ${fastSeek} - G91 G1 X 1 - G38.2 X -2 ${slowSeek} - G92 X ${xoffset} + G91 G0 Z ${mm(zlift)} + G91 G0 X ${mm(20)} + G91 G0 Z ${mm(-plunge)} + G38.2 X ${mm(-20)} ${speed(fastSeek)} + G91 G1 X ${mm(1)} + G38.2 X ${mm(-2)} ${speed(slowSeek)} + G92 X ${mm(xoffset)} - G91 G0 X 1 - G91 G0 Y 20 - G91 G0 X -20 - G38.2 Y -20 ${fastSeek} - G91 G1 Y 1 - G38.2 Y -2 ${slowSeek} - G92 Y ${yoffset} + G91 G0 X ${mm(1)} + G91 G0 Y ${mm(20)} + G91 G0 X ${mm(-20)} + G38.2 Y ${mm(-20)} ${speed(fastSeek)} + G91 G1 Y ${mm(1)} + G38.2 Y ${mm(-2)} ${speed(slowSeek)} + G92 Y ${mm(yoffset)} - G91 G0 Y 3 - G91 G0 Z 25.4 + G91 G0 Y ${mm(3)} + G91 G0 Z ${mm(25.4)} G90 G0 X0 Y0 M2 @@ -415,33 +401,28 @@ module.exports = { }, probe_z() { - let fastSeek = this.config.probe["probe-fast-seek"]; - let slowSeek = this.config.probe["probe-slow-seek"]; - let zoffset = this.config.probe["probe-zdim"]; - - if (this.mach_units !== "METRIC") { - zoffset /= 25.4; - slowSeek /= 25.4; - fastSeek /= 25.4; - } + const xdim = this.config.probe["probe-xdim"]; + const ydim = this.config.probe["probe-ydim"]; + const zdim = this.config.probe["probe-zdim"]; + const slowSeek = this.config.probe["probe-slow-seek"]; + const fastSeek = this.config.probe["probe-fast-seek"]; - zoffset = zoffset.toFixed(5); - slowSeek = slowSeek.toFixed(5); - fastSeek = fastSeek.toFixed(5); + const zoffset = zdim; - slowSeek = `F${slowSeek}`; - fastSeek = `F${fastSeek}`; + const metric = this.mach_units == "METRIC"; + const mm = n => (metric ? n : n / 25.4).toFixed(5); + const speed = s => `F${mm(s)}`; this.send(` - G21 + ${metric ? "G21" : "G20"} G92 Z0 - G38.2 Z -25.4 ${fastSeek} - G91 G1 Z 1 - G38.2 Z -2 ${slowSeek} - G92 Z ${zoffset} + G38.2 Z ${mm(-25.4)} ${speed(fastSeek)} + G91 G1 Z ${mm(1)} + G38.2 Z ${mm(-2)} ${speed(slowSeek)} + G92 Z ${mm(zoffset)} - G91 G0 Z3 + G91 G0 Z ${mm(3)} M2 `); From 565a8324fb472d271828b8e4853e5a939b8aa8b0 Mon Sep 17 00:00:00 2001 From: David Carley Date: Fri, 5 Mar 2021 15:32:10 -0800 Subject: [PATCH 05/10] Improved version comparison logic --- src/js/app.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index f724022..526f822 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -30,27 +30,27 @@ var api = require('./api'); var cookie = require('./cookie')('bbctrl-'); var Sock = require('./sock'); -const { exec } = require('child_process'); -function compare_versions(a, b) { - var reStripTrailingZeros = /(\.0+)+$/; - var segsA = a.replace(reStripTrailingZeros, '').split('.'); - var segsB = b.replace(reStripTrailingZeros, '').split('.'); - var l = Math.min(segsA.length, segsB.length); +function is_newer_version(current, latest) { + const pattern = /(\d+)\.(\d+)\.(\d+)(.*)/; + const currentParts = current.match(pattern); + const latestParts = latest.match(pattern); - for (var i = 0; i < l; i++) { - var diff = parseInt(segsA[i], 10) - parseInt(segsB[i], 10); - if (diff) return diff; - } + // Normal version comparisons + const major = latestParts[1] > currentParts[1]; + const minor = latestParts[2] > currentParts[2]; + const patch = latestParts[3] > currentParts[3]; - return segsA.length - segsB.length; + // If current is a pre-release, and latest is a release + const prerelease = latestParts[4].length === 0 && currentParts[4].length > 0; + + // 'latest' is newer than 'current' if any of them are true + return major || minor || patch || prerelease; } - function is_object(o) {return o !== null && typeof o == 'object'} function is_array(o) {return Array.isArray(o)} - function update_array(dst, src) { while (dst.length) dst.pop() for (var i = 0; i < src.length; i++) @@ -292,7 +292,7 @@ module.exports = new Vue({ show_upgrade: function () { if (!this.latestVersion) return false; - return compare_versions(this.config.version, this.latestVersion) < 0; + return is_newer_version(this.config.version, this.latestVersion); }, update: function () { From 9d2549ebb6d52578d3bbefe3602ad91917d7b81c Mon Sep 17 00:00:00 2001 From: David Carley Date: Fri, 5 Mar 2021 18:40:34 -0800 Subject: [PATCH 06/10] Beta's were considered older than all normals --- src/js/app.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 526f822..bf0b67c 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -36,16 +36,28 @@ function is_newer_version(current, latest) { const currentParts = current.match(pattern); const latestParts = latest.match(pattern); + if (!currentParts || !latestParts) { + return false; + } + // Normal version comparisons - const major = latestParts[1] > currentParts[1]; - const minor = latestParts[2] > currentParts[2]; - const patch = latestParts[3] > currentParts[3]; + const major = latestParts[1] - currentParts[1]; + const minor = latestParts[2] - currentParts[2]; + const patch = latestParts[3] - currentParts[3]; // If current is a pre-release, and latest is a release - const prerelease = latestParts[4].length === 0 && currentParts[4].length > 0; + const betaToRelease = latestParts[4].length === 0 && currentParts[4].length > 0; + + switch (true) { + case major > 0: + case major === 0 && minor > 0: + case major === 0 && minor === 0 && patch > 0: + case major === 0 && minor === 0 && patch === 0 && betaToRelease: + return true; - // 'latest' is newer than 'current' if any of them are true - return major || minor || patch || prerelease; + default: + return false; + } } function is_object(o) {return o !== null && typeof o == 'object'} From 5bbf7e4659407357d02fab678fb5aec8b38a250a Mon Sep 17 00:00:00 2001 From: David Carley Date: Fri, 5 Mar 2021 19:45:53 -0800 Subject: [PATCH 07/10] Metric-only for max-deviation and junction-accel --- src/resources/config-template.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/resources/config-template.json b/src/resources/config-template.json index 71277ff..a2368bc 100644 --- a/src/resources/config-template.json +++ b/src/resources/config-template.json @@ -12,8 +12,6 @@ "min": 0.001, "max": 100, "unit": "mm", - "iunit": "in", - "scale": 25.4, "default": 0.1 }, "junction-accel": { @@ -23,8 +21,6 @@ "min": 10000, "max": 100000000, "unit": "mm/min²", - "iunit": "in/min²", - "scale": 25.4, "default": 200000 } }, From 0347b24bdeaae6d3b81fdc22038409572f3f2c26 Mon Sep 17 00:00:00 2001 From: David Carley Date: Fri, 5 Mar 2021 20:07:12 -0800 Subject: [PATCH 08/10] Fixed junction-accel value to 200000 --- src/resources/onefinity_machinist_defaults.json | 2 +- src/resources/onefinity_woodworker_defaults.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/onefinity_machinist_defaults.json b/src/resources/onefinity_machinist_defaults.json index 66602e0..f07754d 100644 --- a/src/resources/onefinity_machinist_defaults.json +++ b/src/resources/onefinity_machinist_defaults.json @@ -27,7 +27,7 @@ "load-2": "disabled" }, "settings": { - "junction-accel": 199999.999, + "junction-accel": 200000, "max-deviation": 0.001, "units": "METRIC" }, diff --git a/src/resources/onefinity_woodworker_defaults.json b/src/resources/onefinity_woodworker_defaults.json index 2942263..77c303b 100644 --- a/src/resources/onefinity_woodworker_defaults.json +++ b/src/resources/onefinity_woodworker_defaults.json @@ -27,7 +27,7 @@ "load-2": "disabled" }, "settings": { - "junction-accel": 199999.999, + "junction-accel": 200000, "max-deviation": 0.001, "units": "METRIC" }, From 33a1fecd870b8b32c0180a01d9e4d6cd2cc2f158 Mon Sep 17 00:00:00 2001 From: David Carley Date: Fri, 5 Mar 2021 21:30:43 -0800 Subject: [PATCH 09/10] Increased icon and text sizes on control buttons --- src/pug/index.pug | 2 +- src/pug/templates/control-view.pug | 37 +++++++++++++++++------------- src/stylus/style.styl | 19 +++++++++++++-- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/pug/index.pug b/src/pug/index.pug index 8d40cbb..177a5d1 100644 --- a/src/pug/index.pug +++ b/src/pug/index.pug @@ -113,7 +113,7 @@ html(lang="en") a.upgrade-version(v-if="show_upgrade()", href="#admin-general") | Upgrade to v{{latestVersion}} .fa.fa-check(v-if="!show_upgrade() && latestVersion", - title="Firmware up to date") + title="Firmware up to date" style="font-size: inherit") .p {{get_ip_address()}} {{get_ssid()}} .estop(:class="{active: state.es}") diff --git a/src/pug/templates/control-view.pug b/src/pug/templates/control-view.pug index 58baee0..e329921 100644 --- a/src/pug/templates/control-view.pug +++ b/src/pug/templates/control-view.pug @@ -79,7 +79,7 @@ script#control-view-template(type="text/x-template") table(width="99%") tr td(style="white-space: nowrap;") - table(table-layout="fixed") + table.control-buttons(table-layout="fixed") colgroup col(style="width:100px") col(style="width:100px") @@ -88,11 +88,13 @@ script#control-view-template(type="text/x-template") col(style="width:100px") tr td(style="height:100px",align="center") - button(style="height:100px;width:100px",@click="jog_fn(-1,1,0,0)") ⬁ + button(style="height:100px;width:100px",@click="jog_fn(-1,1,0,0)") + .fa.fa-arrow-right(style="transform: rotate(-135deg);") td(style="height:100px",align="center") button(style="height:100px;width:100px",@click="jog_fn(0,1,0,0)") Y+ td(style="height:100px",align="center") - button(style="height:100px;width:100px",@click="jog_fn(1,1,0,0)") ⬀ + button(style="height:100px;width:100px",@click="jog_fn(1,1,0,0)") + .fa.fa-arrow-right(style="transform: rotate(-45deg);") td td(style="height:100px",align="center") button(style="height:100px;width:100px",,@click="jog_fn(0,0,1,0)") Z+ @@ -101,7 +103,7 @@ script#control-view-template(type="text/x-template") button(style="height:100px;width:100px",@click="jog_fn(-1,0,0,0)") X- td(style="height:100px",align="center") button(style="height:100px;width:100px",@click="ask_zero_xy_msg = true") - .fa.fa-bullseye + .fa.fa-bullseye(style="font-size: 172%") td(style="height:100px",align="center") button(style="height:100px;width:100px",@click="jog_fn(1,0,0,0)") X+ td @@ -109,11 +111,13 @@ script#control-view-template(type="text/x-template") button(style="height:100px;width:100px",@click='ask_zero_z_msg = true') Z0 tr td(style="height:100px",align="center") - button(style="height:100px;width:100px",@click="jog_fn(-1,-1,0,0)") ⬃ + button(style="height:100px;width:100px",@click="jog_fn(-1,-1,0,0)") + .fa.fa-arrow-right(style="transform: rotate(135deg);") td(style="height:100px",align="center") button(style="height:100px;width:100px",@click="jog_fn(0,-1,0,0)") Y- td(style="height:100px",align="center") - button(style="height:100px;width:100px",@click="jog_fn(1,-1,0,0)") ⬂ + button(style="height:100px;width:100px",@click="jog_fn(1,-1,0,0)") + .fa.fa-arrow-right(style="transform: rotate(45deg);") td td(style="height:100px",align="center") button(style="height:100px;width:100px",@click="jog_fn(0,0,-1,0)") Z- @@ -130,7 +134,8 @@ script#control-view-template(type="text/x-template") //th.tstate Max th.actions button.pure-button(:disabled="!can_set_axis", - title="Zero all axis offsets.", @click="zero()",style="height:60px;width:60px") ∅ + title="Zero all axis offsets.", @click="zero()",style="height:60px;width:60px") + .fa.fa-map-marker button.pure-button(title="Home all axes.", @click="home()", :disabled="!is_idle",style="height:60px;width:60px") @@ -170,7 +175,8 @@ script#control-view-template(type="text/x-template") button.pure-button(:disabled="!can_set_axis", title=`Zero {{'${axis}' | upper}} axis offset.`, - @click=`zero('${axis}')`,style="height:60px;width:60px") ∅ + @click=`zero('${axis}')`,style="height:60px;width:60px") + .fa.fa-map-marker button.pure-button(:disabled="!is_idle", @click=`home('${axis}')`, title=`Home {{'${axis}' | upper}} axis.`,style="height:60px;width:60px") @@ -220,7 +226,7 @@ script#control-view-template(type="text/x-template") title=`Home {{'${axis}' | upper}} axis.`, @click=`set_home('${axis}', axis_position)`) Set tr - td(style="white-space: nowrap;") + td.control-buttons(style="white-space: nowrap;") button(style="height:100px;width:100px;font-weight:normal",id="jog_button_fine",@click=`set_jog_incr('fine')`) 0.1 button(style="height:100px;width:100px;font-weight:bold",id="jog_button_small",@click=`set_jog_incr('small')`) 1.0 button(style="height:100px;width:100px;font-weight:normal",id="jog_button_medium",@click=`set_jog_incr('medium')`) 10 @@ -305,7 +311,7 @@ script#control-view-template(type="text/x-template") label {{(progress || 0) | percent}} .bar(:style="'width:' + (progress || 0) * 100 + '%'") tr - td(style="white-space: nowrap;text-align:center") + td.control-buttons(style="white-space: nowrap;text-align:center") message(:show.sync=`probe_test`) h3(slot="header") Test probe connection @@ -389,12 +395,11 @@ script#control-view-template(type="text/x-template") input(type="file", @change="upload", :disabled="!is_ready", accept="text/*,.nc,.gcode,.gc,.ngc,.txt,.tap,.cnc") - a.pure-button(:disabled="!state.selected", download, - :href="'/api/file/' + state.selected", - title="Download the selected GCode program.",style="height:100px;width:100px") - br - br - .fa.fa-download + a(:disabled="!state.selected", download, + :href="'/api/file/' + state.selected", + title="Download the selected GCode program.") + button.pure-button(style="height:100px;width:100px") + .fa.fa-download button.pure-button(title="Delete current GCode program.", @click="deleteGCode = true", diff --git a/src/stylus/style.styl b/src/stylus/style.styl index 6219eca..da2ee4e 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -120,6 +120,12 @@ tt .success background green +.fa + font-size 150% + +.modal-mask .fa + font-size inherit + .fa.error background inherit color red @@ -252,6 +258,17 @@ span.unit table border-collapse collapse + // Make sure buttons don't turn into circles + button + -webkit-appearance none + border-radius 2px + border-width 1px + border-color darkgrey + + // The jogging buttons, etc. + .control-buttons button + font-size 150% + &:first-child margin 0.5em 0 @@ -330,7 +347,6 @@ span.unit text-align left .fa - font-size 140% margin-left 2px margin-right 6px @@ -341,7 +357,6 @@ span.unit text-align left .fa - font-size 140% margin-left 2px margin-right 6px From b3c21a983123935680e146dcca9d528f642f5474 Mon Sep 17 00:00:00 2001 From: David Carley Date: Fri, 5 Mar 2021 22:03:33 -0800 Subject: [PATCH 10/10] Force set a handful of config values for 1.0.7 --- src/py/bbctrl/Config.py | 44 +++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/src/py/bbctrl/Config.py b/src/py/bbctrl/Config.py index 83d61c8..9dc3685 100644 --- a/src/py/bbctrl/Config.py +++ b/src/py/bbctrl/Config.py @@ -141,35 +141,23 @@ class Config(object): version = version.split('b')[0] # Strip off any "beta" suffix version = tuple(map(int, version.split('.'))) # Break it into a tuple of integers - if version < (0, 2, 4): + if version < (1, 0, 7): + config['settings']['max-deviation'] = 0.001 + config['settings']['junction-accel'] = 200000 for motor in config['motors']: - for key in 'max-jerk max-velocity'.split(): - if key in motor: motor[key] /= 1000 - - if version < (0, 3, 4): - for motor in config['motors']: - for key in 'max-accel latch-velocity search-velocity'.split(): - if key in motor: motor[key] /= 1000 - - if version <= (0, 3, 22): - if 'tool' in config: - if 'spindle-type' in config['tool']: - type = config['tool']['spindle-type'] - if type == 'PWM': type = 'PWM Spindle' - if type == 'Huanyang': type = 'Huanyang VFD' - config['tool']['tool-type'] = type - del config['tool']['spindle-type'] - - if 'spin-reversed' in config['tool']: - reversed = config['tool']['spin-reversed'] - config['tool']['tool-reversed'] = reversed - del config['tool']['spin-reversed'] - - if version <= (0, 4, 6): - for motor in config['motors']: - if 2 < motor.get('idle-current', 0): motor['idle-current'] = 2 - if 'enabled' not in motor: - motor['enabled'] = motor.get('power-mode', '') != 'disabled' + motor['stall-microstep'] = 8 + motor['stall-current'] = 1 + motor['max-accel'] = 750 + if motor['axis'] == 'X' or motor['axis'] == 'Y': + motor['search-velocity'] = 1.688 + motor['max-velocity'] = 10 + motor['max-jerk'] = 15000 + motor['zero-backoff'] = 1.5 + if motor['axis'] == 'Z': + motor['search-velocity'] = 0.675 + motor['max-velocity'] = 3 + motor['max-jerk'] = 1000 + motor['zero-backoff'] = 1 config['version'] = self.version