Implemented pause
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Fri, 5 Jan 2018 09:22:11 +0000 (01:22 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Sun, 14 Jan 2018 23:42:34 +0000 (15:42 -0800)
src/py/bbctrl/Cmd.py
src/py/bbctrl/Planner.py

index f0067e2c89fc492903d6ed77f694a1b893219cee..32107ba96016602960acc2cb9f5651380d77d85b 100644 (file)
@@ -34,10 +34,11 @@ def encode_axes(axes):
 def line_number(line): return '#ln=%d' % line
 
 
-def line(id, target, exitVel, maxJerk, times):
+def line(id, target, exitVel, maxAccel, maxJerk, times):
     cmd = '#id=%u\nl' % id
 
     cmd += encode_float(exitVel)
+    cmd += encode_float(maxAccel)
     cmd += encode_float(maxJerk)
     cmd += encode_axes(target)
 
index 2695a495e09fa611e95d9a6ca84f8fefa24abd2e..f396ec9c76c63b98a5ab6b673a46a592ebd6057f 100644 (file)
@@ -21,7 +21,7 @@ class Planner():
                 axis = 'xyzabc'[int(vars.get('%dan' % i))]
                 axis2motor[axis] = i
 
-        def get_vector(name, scale):
+        def get_vector(name, scale = 1):
             v = {}
             for axis in 'xyzabc':
                 if axis in axis2motor:
@@ -41,9 +41,10 @@ class Planner():
         # Planner config
         self.config = {
             "start": start,
-            "max-vel": get_vector('vm', 1),
+            "max-vel": get_vector('vm'),
+            "max-accel": get_vector('am'),
             "max-jerk": get_vector('jm', 1000000),
-            # TODO max-accel and junction deviation & accel
+            # TODO junction deviation & accel
             }
         log.info('Planner config: ' + json.dumps(self.config))
 
@@ -60,7 +61,8 @@ class Planner():
 
         if type == 'line':
             return Cmd.line(block['id'], block['target'], block['exit-vel'],
-                            block['max-jerk'], block['times'])
+                            block['max-accel'], block['max-jerk'],
+                            block['times'])
 
         if type == 'ln': return Cmd.line_number(block['line'])
         if type == 'tool': return Cmd.tool(block['tool'])