Skip to content

Commit

Permalink
v3.9.4
Browse files Browse the repository at this point in the history
Minor bugfix release 3.9.4
Rewrite pen-lift servo initialization, for better consistency and higher performance in some cases
Add a small tolerance on determining when a path is "complete" so that a path paused right at the end will now always be recognized as complete.
Bug fix for res_adj_in manual command
  • Loading branch information
oskay committed Sep 13, 2023
1 parent aa2cb1e commit 394871f
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 145 deletions.
4 changes: 2 additions & 2 deletions cli/axicli/axidraw_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
from plotink.plot_utils_import import from_dependency_import # plotink
exit_status = from_dependency_import("ink_extensions_utils.exit_status")

cli_version = "AxiDraw Command Line Interface 3.9.3"
cli_version = "AxiDraw Command Line Interface 3.9.4"

quick_help = '''
Basic syntax to plot a file: axicli svg_in [OPTIONS]
Expand Down Expand Up @@ -269,7 +269,7 @@ def axidraw_CLI(dev = False):
if args.mode in ("align", "toggle", "cycle", "version", "sysinfo"):
use_trivial_file = True
if args.mode == "manual" and args.manual_cmd not in\
("strip_data", "res_read","res_off_in", "res_adj_mm"):
("strip_data", "res_read","res_adj_in", "res_adj_mm"):
use_trivial_file = True

svg_input = args.svg_in
Expand Down
12 changes: 6 additions & 6 deletions cli/pyaxidraw/axidraw.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding=utf-8
#
# Copyright 2022 Windell H. Oskay, Evil Mad Scientist Laboratories
# Copyright 2023 Windell H. Oskay, Evil Mad Scientist Laboratories
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -23,7 +24,7 @@
Requires Python 3.7 or newer and Pyserial 3.5 or newer.
"""
__version__ = '3.9.2' # Dated 2023-06-25
__version__ = '3.9.4' # Dated 2023-09-09

import math
import gettext
Expand Down Expand Up @@ -116,7 +117,7 @@ def connect(self):

# Query if button pressed, to clear the result:
ebb_motion.QueryPRGButton(self.plot_status.port)
self.pen.servo_setup_wrapper(self)
self.pen.servo_init(self)
self.pen.pen_raise(self) # Raise pen
self.enable_motors() # Set plot resolution & speed & enable motors
return True
Expand All @@ -139,7 +140,7 @@ def plot_setup(self, svg_input=None, argstrings=None):
self.original_document = copy.deepcopy(self.document)
file_ref.close()
file_ok = True
except OSError:
except IOError:
pass # It wasn't a file; was it a string?
if not file_ok:
try:
Expand Down Expand Up @@ -248,7 +249,6 @@ def interactive(self):
self.options.preview = False
self.options.mode = "interactive"
self.plot_status.secondary = False
self.pen.update(self)

def _verify_interactive(self, verify_connection=False):
'''
Expand Down Expand Up @@ -278,7 +278,7 @@ def update(self):
if not self._verify_interactive(True):
return
self.update_options()
self.pen.servo_setup(self)
self.pen.servo_init(self)
if self.plot_status.port:
self.enable_motors() # Set plotting resolution & speed

Expand Down
10 changes: 10 additions & 0 deletions cli/pyaxidraw/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ are at: https://github.com/evil-mad/axidraw/releases



=========================================
v 3.9.4 (September 2023)

Pen-lift servo motor initialization routines rewritten for more consistent behavior.

As part of this, the update() function in the Python API now itself applies pen height
changes. For example, if the pen-up height (pen_pos_up) changes, calling update()
with the pen up will immediately move to the new pen-up height, rather than at the
next penup() command.

=========================================
v 3.9 (May 2023)

Expand Down
2 changes: 1 addition & 1 deletion inkscape driver/axidraw.inx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ support, email contact@evilmadscientist.com or visit axidraw.com/chat
<image width="10" height="5">axidraw_deps/axidrawinternal/inx_img/spacer_10px.svg</image>

<label indent="6"
>Version 3.9.3 — Copyright 2023 Evil Mad Science LLC</label>
>Version 3.9.4 — Copyright 2023 Evil Mad Science LLC</label>



Expand Down
26 changes: 10 additions & 16 deletions inkscape driver/axidraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""
# pylint: disable=pointless-string-statement

__version__ = '3.9.3' # Dated 2023-7-25
__version__ = '3.9.4' # Dated 2023-09-09

import copy
import gettext
Expand Down Expand Up @@ -205,7 +205,6 @@ def update_options(self):
self.options.speed_pendown = plot_utils.constrainLimits(self.options.speed_pendown, 1, 110)
self.options.speed_penup = plot_utils.constrainLimits(self.options.speed_penup, 1, 200)
self.options.accel = plot_utils.constrainLimits(self.options.accel, 1, 110)
self.pen.update(self)


def effect(self):
Expand Down Expand Up @@ -414,7 +413,7 @@ def effect(self):
return

self.query_ebb_voltage()
self.pen.servo_setup_wrapper(self)
self.pen.servo_init(self)
self.pen.pen_raise(self)
self.enable_motors()
self.go_to_position(self.params.start_pos_x, self.params.start_pos_y)
Expand Down Expand Up @@ -443,15 +442,14 @@ def setup_command(self):
return

self.query_ebb_voltage()
self.pen.servo_setup_wrapper(self)
self.pen.servo_init(self)

if self.options.mode == "align":
self.pen.pen_raise(self)
ebb_motion.sendDisableMotors(self.plot_status.port, False)
elif self.options.mode == "toggle":
self.pen.toggle(self)
elif self.options.mode == "cycle":
self.pen.cycle(self)
# Note that "toggle" mode is handled within self.pen.servo_init(self)

def manual_command(self):
""" Manual mode commands that need USB connectivity and don't need SVG file """
Expand Down Expand Up @@ -511,17 +509,15 @@ def manual_command(self):

self.query_ebb_voltage() # Next: Commands that also require both power to move motors:
if self.options.manual_cmd == "raise_pen":
self.pen.servo_setup_wrapper(self)
self.pen.pen_raise(self)
self.pen.servo_init(self) # Initializes to pen-up position
elif self.options.manual_cmd == "lower_pen":
self.pen.servo_setup_wrapper(self)
self.pen.pen_lower(self)
self.pen.servo_init(self) # Initializes to pen-down position
elif self.options.manual_cmd == "enable_xy":
self.enable_motors()
elif self.options.manual_cmd == "disable_xy":
ebb_motion.sendDisableMotors(self.plot_status.port, False)
else: # walk motors or move home cases:
self.pen.servo_setup_wrapper(self)
self.pen.servo_init(self)
self.enable_motors() # Set plotting resolution
if self.options.manual_cmd == "walk_home":
if versions.min_fw_version(self.plot_status, "2.6.2"):
Expand Down Expand Up @@ -703,7 +699,7 @@ def plot_document(self):
self.plot_status.progress.launch(self)

try: # wrap everything in a try so we can be sure to close the serial port
self.pen.servo_setup_wrapper(self)
self.pen.servo_init(self)
self.pen.pen_raise(self)
self.enable_motors() # Set plotting resolution

Expand Down Expand Up @@ -939,10 +935,8 @@ def pause_check(self):
if self.options.mode not in ("plot", "layers", "res_plot"):
return # Don't update pause_dist in res_home or repositioning modes

if not math.isclose(self.plot_status.resume.new.pause_dist,
self.plot_status.stats.down_travel_inch): # Only update if changed
self.plot_status.resume.new.pause_dist = self.plot_status.stats.down_travel_inch
self.plot_status.resume.new.pause_ref = self.plot_status.stats.down_travel_inch
self.plot_status.resume.new.pause_dist = self.plot_status.stats.down_travel_inch
self.plot_status.resume.new.pause_ref = self.plot_status.stats.down_travel_inch

def serial_connect(self):
""" Connect to AxiDraw over USB """
Expand Down
2 changes: 1 addition & 1 deletion inkscape driver/axidraw_saveplob.inx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gui-text="Specific layer selection:">1</param>

<spacer />
<spacer />
<label indent="6">Version 3.9.3. Copyright 2023 Evil Mad Scientist</label>
<label indent="6">Version 3.9.4. Copyright 2023 Evil Mad Scientist</label>

</page>

Expand Down
3 changes: 2 additions & 1 deletion inkscape driver/path_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,8 @@ def crop(self, distance):
for path in layer.paths:

path_length = path.length()
if (dist_so_far + path_length) <= distance: # Remove this full path
skip_length_tol = min(path_length/100, 0.001) # Tighter tolerance for short paths
if (dist_so_far + path_length) <= (distance + skip_length_tol):
dist_so_far += path_length
start_index += 1 # This count will be used to slice the path out.
layer.props.delay = None # No delay, since not on first path of layer.
Expand Down
Loading

0 comments on commit 394871f

Please sign in to comment.