From: Joseph Coffland Date: Sun, 2 Feb 2020 22:26:26 +0000 (-0800) Subject: Expose junction-accel planning parameter. Re #172 X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=606b41ad989a99e0f45efb9b18ae99be1ec17908;p=bbctrl-firmware Expose junction-accel planning parameter. Re #172 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d27902..deda624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Buildbotics CNC Controller Firmware Changelog - Fix open WiFi access. - Fixes for MJPEG video format. Should help with video on iPhone. - Add axis bounds GCode variables ``#<_x_min>``, ``#<_x_max>``, etc. + - Expose ``junction-accel`` planning parameter. ## v0.4.12 - Segments straddle arc in linearization. diff --git a/src/pug/templates/settings-view.pug b/src/pug/templates/settings-view.pug index 0ce3f10..b939fbf 100644 --- a/src/pug/templates/settings-view.pug +++ b/src/pug/templates/settings-view.pug @@ -61,3 +61,14 @@ script#settings-view-template(type="text/x-template") #[a(href=base + "#gcode:g61-g61.1", target="_blank") G61, G61.1] and #[a(href=base + "#gcode:g64", target="_blank") G64] also affect path planning accuracy. + + h2 Cornering Speed (Advanced) + templated-input(name="junction-accel", + :model.sync="config.settings['junction-accel']", + :template="template.settings['junction-accel']") + + p. + Junction acceleration limits the cornering speed the planner will + allow. Increasing this value will allow for faster traversal of + corners but may cause the planner to violate axis jerk limits and + stall the motors. Use with caution. diff --git a/src/py/bbctrl/Planner.py b/src/py/bbctrl/Planner.py index 623c33e..7cdc03a 100644 --- a/src/py/bbctrl/Planner.py +++ b/src/py/bbctrl/Planner.py @@ -89,9 +89,10 @@ class Planner(): 'max-vel': state.get_axis_vector('vm', 1000), 'max-accel': state.get_axis_vector('am', 1000000), 'max-jerk': state.get_axis_vector('jm', 1000000), - 'rapid-auto-off': config.get('rapid-auto-off'), + 'rapid-auto-off': config.get('rapid-auto-off'), 'max-blend-error': config.get('max-deviation'), 'max-merge-error': config.get('max-deviation'), + 'junction-accel': config.get('junction-accel'), } if with_limits: diff --git a/src/py/bbctrl/Web.py b/src/py/bbctrl/Web.py index 2112608..5b1a46c 100644 --- a/src/py/bbctrl/Web.py +++ b/src/py/bbctrl/Web.py @@ -301,11 +301,10 @@ class PathHandler(bbctrl.APIHandler): if data is None: return meta, positions, speeds = data - self.get_ctrl().state.set_bounds(meta['bounds']) - if dataType == '/positions': data = positions elif dataType == '/speeds': data = speeds else: + self.get_ctrl().state.set_bounds(meta['bounds']) self.write_json(meta) return diff --git a/src/resources/config-template.json b/src/resources/config-template.json index bc2ea45..a4f74fa 100644 --- a/src/resources/config-template.json +++ b/src/resources/config-template.json @@ -15,6 +15,17 @@ "iunit": "in", "scale": 25.4, "default": 0.1 + }, + "junction-accel": { + "help": + "Higher values will increasing cornering speed but may cause stalls.", + "type": "float", + "min": 10000, + "max": 100000000, + "unit": "mm/min²", + "iunit": "in/min²", + "scale": 25.4, + "default": 200000 } }, "motors": {