Expose junction-accel planning parameter. Re #172
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Sun, 2 Feb 2020 22:26:26 +0000 (14:26 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Sun, 2 Feb 2020 22:28:48 +0000 (14:28 -0800)
CHANGELOG.md
src/pug/templates/settings-view.pug
src/py/bbctrl/Planner.py
src/py/bbctrl/Web.py
src/resources/config-template.json

index 4d279029a81c239f2958dda31e0413073aa97609..deda624ffa2cf64846e083088bd5b040bfd4f5e8 100644 (file)
@@ -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.
index 0ce3f1069ecb7b7621d1c8b9844c023dd143f71e..b939fbff79fdd5e73ccc5326cbf0783d7e4bc351 100644 (file)
@@ -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.
index 623c33ee731ea6d3a70a65e3d2abb3a3dbb52f52..7cdc03a399c10746823d6d7aa8a2a540896aaadd 100644 (file)
@@ -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:
index 2112608f33b9aea88436f9f8593058cbdab565b0..5b1a46c79e24b30523ab8773d09d8e46fad3c1b4 100644 (file)
@@ -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
 
index bc2ea45a9f60ab60abbdcbbd4aaaef6c3773c96a..a4f74faf47031fe415f4b5cf39380a5825cc28ef 100644 (file)
       "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": {