Permalink
Commits on Jan 17, 2019
  1. hardware-mapping: debounce inputs in TestSwitch()

    bigguiness authored and hzeller committed Jan 17, 2019
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Oct 16, 2018
  1. Detect Estop in PRU and abort motion for arc and bezier moves.

    bigguiness authored and hzeller committed Oct 16, 2018
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  2. Add spindle config parameters for Pololu SMC max-accel/max-decel

    bigguiness authored and hzeller committed Oct 16, 2018
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  3. Make sure spindle is off when setting estop.

    bigguiness authored and hzeller committed Oct 16, 2018
    The Pololu SMC spindle controller needs to be sent a command to
    ensure that the spindle is off when we detect and set the estop
    condition.
    
    The spindle _will_ turn off if the hardware is set up to disable
    the spindle power when an estop is active. But, if the command is
    not sent the SMC will try to automatically reenable the spindle
    as soon as the estop is cleared.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  4. Add max-probe-feedrate axis configuration parameter.

    bigguiness authored and hzeller committed Oct 16, 2018
    The move_to_probe() is done using DirectDrive() steps. Due to this the
    segements may get accelerated to a speed thattt "clunks" the machine
    when the probe limit is finally detected. Allow limiting the G30 probe
    feedrate to a lower value than the axis max-feedrate.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  5. Add support to the PRU code to check the EStop input before each step

    bigguiness authored and hzeller committed Oct 16, 2018
    pulse. If it's detected, update the queue status and change the queue
    header state to STATE_ABORT then abort the step generation for the
    segment. If there are more segments in the queue they will also get
    aborted due to the EStop input being active.
    
    Modify the PRUMotionQueue::Enqueue() to detect the STATE_ABORT and
    return false. This indicates that the motion segment could not be
    added to the queue due to the abort condition caused by the EStop.
    
    Modify all the applicable classes so that the Enqueue failure is
    propogated back to the Planner so that CGodeMachineControl can
    detect the abort condition and then check_for_estop(). This will
    then turn all the aux outputs off, disable the motors, and set the
    homing_state to NEVER_HOMED.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Jul 27, 2018
  1. gcode-machine-control: Allow G28 to be aborted by hardware E-Stop.

    bigguiness authored and hzeller committed Jul 27, 2018
    A G28 (goto limits) will block until all the requested limits have
    been hit and backed-off. This can be a problem sometimes, specifically:
    
    1) If an axis is wired backwards the limit will never be reached.
    2) If a normally-open limit is disconnected it will never be detected.
    3) If a mechanical issue prevents a limit from being reached.
    4) If a G28 needs to be aborted for some other reason.
    
    Modify move_to_endstop() so that the search/back-off will be aborted
    if a hardware E-Stop is detected. Then check_for_estop() at the end
    of go_home() to make sure that the homing_state_ is set correctly.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Jul 21, 2018
  1. spindle-control: remove duplicate Log_debug() for PololuSMCSpindle

    bigguiness authored and hzeller committed Jul 21, 2018
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Jun 16, 2018
Commits on Jun 15, 2018
  1. fd-mux: fix stopping program using a systemd service

    bigguiness authored and hzeller committed Jun 15, 2018
    Using systemd and a startup script to start machine-control causes two
    SIGTERM signals to be sent. The first one is caught by the sigaction
    but the current SA_RESETHAND flag causes the second one to be treated
    as a SIGKILL. This results in machine-control terminating without
    properly shutting down.
    
    Just use '0' for the sa.sa_flags so that the default signal handler
    is not restored after getting the signal.
    
    Thanks to Henner Zeller for the insight to this issue.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Jun 13, 2018
  1. planner: only speed tune short segments (i.e. arc segments)

    bigguiness authored and hzeller committed Jun 13, 2018
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  2. Add speed tuning angle to command line options

    bigguiness authored and hzeller committed Jun 13, 2018
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Jun 7, 2018
  1. Use enum class for E-Stop state.

    bigguiness authored and hzeller committed Jun 7, 2018
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  2. Stub in a 's'tatus command for the status server. Currently this

    bigguiness authored and hzeller committed Jun 7, 2018
    just returns the E-Stop state as JSON {"estop":"status"}, where
    "status" is "hard", "soft", or "none".
Commits on Jun 1, 2018
Commits on May 25, 2018
  1. gcode-machine-control: make the soft/hard e-stop work

    bigguiness authored and hzeller committed May 25, 2018
    For safety, an e-stop (soft or hard) should disable the motors and any
    aux outputs. The e-stop event then needs to be cleared and the machine
    re-homed before motion should be allowed.
    
    For this initial implementation, the hard estop is checked after every
    dwell to avoid reading the gpio while the PRU may be emmiting steps.
    It is also checked when the GCodeStreamer is idle.
    
    Currently a G28 will automatically clear the e-stop event, as long as the
    hard e-stop is cleared, and re-home the machine. A M999 will also clear
    the event (if the hard estop is clear) but a G28 is still needed to re-home
    the machine.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on May 10, 2018
  1. motor-operations: fix the driver_flip_ issues caused by the M114 changes

    bigguiness authored and hzeller committed May 10, 2018
    The only place the driver_flip_ needs to be applied is when the direction_bits
    are being set when a new segment is being added to the PRU queue.
    
    This fixes the issues with SetExternalPosition(), GetCurrentPosition(), and
    AssignMotorSteps() that showed up with the M114 changes that used the
    motor-operations GetPhysicalStatus backend.
    
    The issues only seem to show up with negative motor directions and/or when
    the home position for an axis is 'max'.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on May 8, 2018
  1. gcode-machine-control: Fix probe_axis()

    bigguiness authored and hzeller committed May 8, 2018
    Missed this one when fixing the M114 changes.
    
    probe_axis() calls SetExternalPosition() to set the new Z axis position after
    a probe. If calculates the new position based on the last position + the distance
    moved during the probe. This worked before the M114 changes because the DirectDrive()
    steps did not change the current position.
    
    GetCurrentPosition() uses the motor operations GetPhysicalStatus() to determine the
    current position. Getting the position that way will include the DirectDrive() steps
    since they go through the motor operations Enqueue().
    
    Moving the GetCurrentPosition() call before the move_to_probe() fixes probe_axis().
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on May 5, 2018
  1. Fix missing G28 initialization upstream in motor operations.

    bigguiness authored and hzeller committed May 5, 2018
    Fixes an issue introduced with the M114 patch.
    
    Debugging by Hartley and Leonardo, fix by Hartley.
Commits on Mar 28, 2018
  1. gcode-parser: reorder the GCodeParserAxis enum

    bigguiness authored and hzeller committed Mar 28, 2018
    Move AXIS_E to the end of the enum. This makes the axis enumeration
    a bit more logical:
    
    X/Y/Z are the "normal" cartesian axes
    A/B/C are the "rotary" axes in the X/Y/Z planes
    U/V/W are the "parallel" axes in the X/Y/Z planes
    E is the Extruder axis
    
    For completeness, also reorder the switch statements associated with
    this enum.
    
    Of course, the "real" use of all the axes is determined by the user.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Mar 27, 2018
  1. hardware_mapping: remove driver_flip_ from GetAxisSteps()

    bigguiness authored and hzeller committed Mar 27, 2018
    This function should just return the current step position of a given axis.
    The driver_flip_ should only be applied when new steps are assigned to an
    axis by AssignMotorSteps().
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Dec 14, 2017
  1. gcode-machine-control: add some debounce for the pause switch clear

    bigguiness authored and hzeller committed Dec 14, 2017
    Due to noise on the input signal, the wait for the pause switch to go
    inactive may finish before the pause switch has actually been cleared.
    
    Add some debounce logic to the wait to ensure that the switch has been
    cleared.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Dec 8, 2017
  1. gcode-machine-control: wait for pause switch to clear

    bigguiness authored and hzeller committed Dec 8, 2017
    If the machine configuration has a pause switch, the switch will be
    checked after a dwell() if it has been enabled by an M120 command.
    If the switch is active wait_for_start() will be called. If the
    machine also has a start switch, wait_for_start() will then block
    until the switch is active.
    
    If the pause switch is actually something like a light curtian the
    wait_for_start() needs to wait until the pause switch is disabled
    before waiting for the start switch.
    
    Fix wait_for_start() to ensure that the pause switch is disabled.
    Add some feedback to the stream about the pause and start switch.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Sep 4, 2017
  1. gcode-parser: add M500/M501 support to load/save parameters

    bigguiness authored and hzeller committed Sep 4, 2017
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  2. gcode-parser: move the parameters filename into struct Config

    bigguiness authored and hzeller committed Sep 4, 2017
    This allows moving the paramfile.empty() checks into the load/save
    routines. It also will allow programatically loading and saving of
    the parameters instead of just loading them when machine-control
    starts and saving them on a clean exit.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Aug 18, 2017
  1. gcode-machine-control: add helpers to turn on/off the spindle

    bigguiness authored and hzeller committed Aug 18, 2017
    The PRU queue needs to be flushed before turning on/off the spindle
    to ensure that motion has stopped.
    
    For clarity, add some helper functions to turn on/off the spindle
    and make sure they do a planner_->BringPathToHalt() first.
    
    Now that we have the guarantee that we statically modify the aux bits,
    modify set_output_flags() to make sure that the GPIO outputs are
    set. This makes the delays work correctly. It also fixes the
    PololuSMCSpindle implementation when it uses a "spindle" output
    to enable the power to the SMC module.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Aug 17, 2017
  1. machine-control: don't bail if spindle cannot be initialized

    bigguiness authored and hzeller committed Aug 17, 2017
    Currently, if the spindle.Init() fails when machine-control starts the progam
    terminates.
    
    The 'simple-pwm' type always returns true from its Init() but the "pololu-smc"
    type will return false if the USB virtual serial port cannot be opened.
    
    Modify the code so that it doesn't bail if the spindle cannot be initialized.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  2. gcode-parser: allow parameters to be queried.

    bigguiness authored and hzeller committed Aug 17, 2017
    Setting a parameter is done with "#<name>=<value>".
    
    Examples:
    
    This allows the parameters to be queried by using a set parameter command
    without the '='.
    Note: this functionality is not intended to be used in a GCode program but
    helps while debugging.
    
    Examples:
    // #1 = 10.000000
    // #index = 5.000000
    // #paramwithspaces = 4.30000
    
    This worked in the original c code but appears to have got dropped
    in the c++ conversion.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  3. gcode-parser: fix debug output in gcodep_set_parameter()

    bigguiness authored and hzeller committed Aug 17, 2017
    The 'log_name' is a string not an integer value.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  4. gcode-machine-control: separate the endstop and probe moves

    bigguiness authored and hzeller committed Aug 17, 2017
    The move to an endstop is always unlimited until the switch is
    triggered. It then has a backoff until the switch is not triggered.
    
    Probe moves are limited to the max range of the axis and do not
    have a backoff.
    
    Separate the two moves and use the new "probe" switch-mapping for
    the probe switch.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  5. hardware-mapping: parse a "probe" switch-mapping

    bigguiness authored and hzeller committed Aug 17, 2017
    This switch-mapping will be used for the G30 probe.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
  6. hardware-mapping: add a helper function to test a input switch

    bigguiness authored and hzeller committed Aug 17, 2017
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Jul 26, 2017
  1. hardware-mapping: add a named output for a dry-run laser pointer

    bigguiness authored and hzeller committed Jul 26, 2017
    This output can be used in a GCode program to simulate the Z axis moves
    by replacing all down moves with a M64 Px and all up moves with a M65 Px
    where x is the aux pin number that the laser pointer is connected to.
    
    Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Commits on Jul 25, 2017