Skip to content

Commit

Permalink
Merge pull request #224 from synthetos/dev-209-random-pauses
Browse files Browse the repository at this point in the history
Dev 209 random pauses
  • Loading branch information
aldenhart authored Jan 8, 2017
2 parents c3f3f08 + e6520e6 commit 306c256
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 90 deletions.
2 changes: 1 addition & 1 deletion g2core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* config.cpp - application independent configuration handling
* This file is part of the g2core project
*
* Copyright (c) 2010 - 2016 Alden S. Hart, Jr.
* Copyright (c) 2010 - 2017 Alden S. Hart, Jr.
*
* This file ("the software") is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 as published by the
Expand Down
4 changes: 2 additions & 2 deletions g2core/json_parser.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* json_parser.h - JSON parser and JSON support
* This file is part of the g2core project
*
* Copyright (c) 2011 - 2016 Alden S. Hart, Jr.
* Copyright (c) 2016 Rob Giseburt
* Copyright (c) 2011 - 2017 Alden S. Hart, Jr.
* Copyright (c) 2016 - 2017 Rob Giseburt
*
* This file ("the software") is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 as published by the
Expand Down
214 changes: 127 additions & 87 deletions g2core/settings/settings_makeblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,67 @@

// Machine configuration settings

#define JUNCTION_INTEGRATION_TIME 0.75 // cornering - between 0.10 and 2.00 (higher is faster)
#define CHORDAL_TOLERANCE 0.1 // chordal tolerance for arcs (in mm)
#define JUNCTION_INTEGRATION_TIME 1.25 // cornering - between 0.10 and 2.00 (higher is faster)
#define CHORDAL_TOLERANCE 0.01 // chordal tolerance for arcs (in mm)

#define SOFT_LIMIT_ENABLE 0 // 0=off, 1=on
#define HARD_LIMIT_ENABLE 0 // 0=off, 1=on
#define SAFETY_INTERLOCK_ENABLE 1 // 0=off, 1=on
#define SOFT_LIMIT_ENABLE 0 // 0=off, 1=on
#define HARD_LIMIT_ENABLE 1 // 0=off, 1=on
#define SAFETY_INTERLOCK_ENABLE 0 // 0=off, 1=on

#define SPINDLE_ENABLE_POLARITY 1 // 0=active low, 1=active high
#define SPINDLE_DIR_POLARITY 0 // 0=clockwise is low, 1=clockwise is high
#define SPINDLE_PAUSE_ON_HOLD true
#define SPINDLE_DWELL_TIME 1.0
#define SPINDLE_ENABLE_POLARITY 1 // 0=active low, 1=active high
#define SPINDLE_DIR_POLARITY 0 // 0=clockwise is low, 1=clockwise is high
#define SPINDLE_PAUSE_ON_HOLD true
#define SPINDLE_DWELL_TIME 1.0

#define COOLANT_MIST_POLARITY 1 // 0=active low, 1=active high
#define COOLANT_FLOOD_POLARITY 1 // 0=active low, 1=active high
#define COOLANT_PAUSE_ON_HOLD false
#define COOLANT_MIST_POLARITY 1 // 0=active low, 1=active high
#define COOLANT_FLOOD_POLARITY 1 // 0=active low, 1=active high
#define COOLANT_PAUSE_ON_HOLD true

/*
#define JUNCTION_INTEGRATION_TIME 0.75 // cornering - between 0.10 and 2.00 (higher is faster)
#define CHORDAL_TOLERANCE 0.1 // chordal tolerance for arcs (in mm)
#define SOFT_LIMIT_ENABLE 0 // 0=off, 1=on
#define HARD_LIMIT_ENABLE 0 // 0=off, 1=on
#define SAFETY_INTERLOCK_ENABLE 1 // 0=off, 1=on
#define SPINDLE_ENABLE_POLARITY 1 // 0=active low, 1=active high
#define SPINDLE_DIR_POLARITY 0 // 0=clockwise is low, 1=clockwise is high
#define SPINDLE_PAUSE_ON_HOLD true
#define SPINDLE_DWELL_TIME 1.0
#define COOLANT_MIST_POLARITY 1 // 0=active low, 1=active high
#define COOLANT_FLOOD_POLARITY 1 // 0=active low, 1=active high
#define COOLANT_PAUSE_ON_HOLD false
*/

// Communications and reporting settings

#define COMM_MODE JSON_MODE // one of: TEXT_MODE, JSON_MODE
#define XIO_ENABLE_FLOW_CONTROL FLOW_CONTROL_RTS // FLOW_CONTROL_OFF, FLOW_CONTROL_RTS
#define USB_SERIAL_PORTS_EXPOSED 1

#define TEXT_VERBOSITY TV_VERBOSE // one of: TV_SILENT, TV_VERBOSE
#define JSON_VERBOSITY JV_MESSAGES // one of: JV_SILENT, JV_FOOTER, JV_CONFIGS, JV_MESSAGES, JV_LINENUM, JV_VERBOSE
#define QUEUE_REPORT_VERBOSITY QR_OFF // one of: QR_OFF, QR_SINGLE, QR_TRIPLE

#define STATUS_REPORT_VERBOSITY SR_FILTERED // one of: SR_OFF, SR_FILTERED, SR_VERBOSE

#define STATUS_REPORT_MIN_MS 200 // milliseconds - enforces a viable minimum
#define STATUS_REPORT_INTERVAL_MS 250 // milliseconds - set $SV=0 to disable

#define STATUS_REPORT_DEFAULTS "line","posx","posy","posz","vel","unit","stat","feed","coor","momo","plan","path","dist","mpox","mpoy","mpoz","admo","frmo","cycs","hold"

/*
#define COMM_MODE JSON_MODE // one of: TEXT_MODE, JSON_MODE
#define TEXT_VERBOSITY TV_VERBOSE // one of: TV_SILENT, TV_VERBOSE
#define JSON_VERBOSITY JV_MESSAGES // one of: JV_SILENT, JV_FOOTER, JV_CONFIGS, JV_MESSAGES, JV_LINENUM, JV_VERBOSE
#define QUEUE_REPORT_VERBOSITY QR_OFF // one of: QR_OFF, QR_SINGLE, QR_TRIPLE
#define STATUS_REPORT_VERBOSITY SR_FILTERED // one of: SR_OFF, SR_FILTERED, SR_VERBOSE
#define STATUS_REPORT_MIN_MS 100 // milliseconds - enforces a viable minimum
#define STATUS_REPORT_INTERVAL_MS 250 // milliseconds - set $SV=0 to disable
#define STATUS_REPORT_MIN_MS 100 // milliseconds - enforces a viable minimum
#define STATUS_REPORT_INTERVAL_MS 250 // milliseconds - set $SV=0 to disable
//#define STATUS_REPORT_DEFAULTS
//"line","posx","posy","posz","posa","bcr","feed","vel","unit","coor","dist","admo","frmo","momo","stat"
Expand All @@ -70,85 +104,91 @@
//#define STATUS_REPORT_DEFAULTS
//"line","vel","mpox","mpoy","mpoz","mpoa","coor","ofsa","ofsx","ofsy","ofsz","dist","unit","stat","homz","homy","homx","momo"
//#define STATUS_REPORT_DEFAULTS "_ts1","_cs1","_es1","_xs1","_fe1","line","posx","posy","posz","vel","stat"

*/
// Gcode startup defaults
#define GCODE_DEFAULT_UNITS MILLIMETERS // MILLIMETERS or INCHES
#define GCODE_DEFAULT_PLANE CANON_PLANE_XY // CANON_PLANE_XY, CANON_PLANE_XZ, or CANON_PLANE_YZ
#define GCODE_DEFAULT_COORD_SYSTEM G54 // G54, G55, G56, G57, G58 or G59
#define GCODE_DEFAULT_PATH_CONTROL PATH_CONTINUOUS
#define GCODE_DEFAULT_DISTANCE_MODE ABSOLUTE_DISTANCE_MODE
#define GCODE_DEFAULT_UNITS MILLIMETERS // MILLIMETERS or INCHES
#define GCODE_DEFAULT_PLANE CANON_PLANE_XY // CANON_PLANE_XY, CANON_PLANE_XZ, or CANON_PLANE_YZ
#define GCODE_DEFAULT_COORD_SYSTEM G54 // G54, G55, G56, G57, G58 or G59
#define GCODE_DEFAULT_PATH_CONTROL PATH_CONTINUOUS
#define GCODE_DEFAULT_DISTANCE_MODE ABSOLUTE_DISTANCE_MODE

// *** motor settings ************************************************************************************

#define MOTOR_POWER_MODE MOTOR_POWERED_IN_CYCLE // default motor power mode (see cmMotorPowerMode in stepper.h)
#define MOTOR_POWER_TIMEOUT 2.00 // motor power timeout in seconds

#define M1_MOTOR_MAP AXIS_X // 1ma
#define M1_STEP_ANGLE 1.8 // 1sa
#define M1_TRAVEL_PER_REV 36.576 // 1tr 2.032mm pitch * 18 teeth per revolution
#define M1_MICROSTEPS 8 // 1mi 1,2,4,8
#define M1_POLARITY 0 // 1po 0=normal, 1=reversed
#define M1_POWER_MODE MOTOR_POWER_MODE // 1pm TRUE=low power idle enabled
#define M1_POWER_LEVEL 0.4

#define M2_MOTOR_MAP AXIS_Y
#define M2_STEP_ANGLE 1.8
#define M2_TRAVEL_PER_REV 36.576
#define M2_MICROSTEPS 8
#define M2_POLARITY 0
#define M2_POWER_MODE MOTOR_POWER_MODE
#define M2_POWER_LEVEL 0.4

#define M3_MOTOR_MAP AXIS_Z // Imaginary Z axis. FOr testing
#define M3_STEP_ANGLE 1.8
#define M3_TRAVEL_PER_REV 1.25
#define M3_MICROSTEPS 8
#define M3_POLARITY 0
#define M3_POWER_MODE MOTOR_POWER_MODE
#define M3_POWER_LEVEL 0.4
#define MOTOR_POWER_MODE MOTOR_POWERED_IN_CYCLE // default motor power mode (see stPowerMode in stepper.h)
// 0=MOTOR_DISABLED,
// 1=MOTOR_ALWAYS_POWERED,
// 2=MOTOR_POWERED_IN_CYCLE,
// 3=MOTOR_POWERED_ONLY_WHEN_MOVING
#define M1_POWER_LEVEL 0.4 // 0.0 = off, 1.0 = max
//.#define MOTOR_POWER_TIMEOUT 2.00 // motor power timeout in seconds
#define MOTOR_POWER_TIMEOUT 10.00 // motor power timeout in seconds

#define M1_MOTOR_MAP AXIS_X // 1ma
#define M1_STEP_ANGLE 1.8 // 1sa
#define M1_TRAVEL_PER_REV 36.576 // 1tr 2.032mm pitch * 18 teeth per revolution
#define M1_MICROSTEPS 8 // 1mi 1,2,4,8,16,32
#define M1_POLARITY 0 // 1po 0=normal, 1=reversed
#define M1_POWER_MODE MOTOR_POWER_MODE // 1pm 0=MOTOR_DISABLED, 1=MOTOR_ALWAYS_POWERED, 2=MOTOR_POWERED_IN_CYCLE, 3=MOTOR_POWERED_ONLY_WHEN_MOVING
#define M1_POWER_LEVEL 0.4

#define M2_MOTOR_MAP AXIS_Y
#define M2_STEP_ANGLE 1.8
#define M2_TRAVEL_PER_REV 36.576
#define M2_MICROSTEPS 8
#define M2_POLARITY 0
#define M2_POWER_MODE MOTOR_POWER_MODE
#define M2_POWER_LEVEL 0.4

#define M3_MOTOR_MAP AXIS_Z // Imaginary Z axis. For testing
#define M3_STEP_ANGLE 1.8
#define M3_TRAVEL_PER_REV 1.25
#define M3_MICROSTEPS 8
#define M3_POLARITY 0
#define M3_POWER_MODE MOTOR_POWER_MODE
#define M3_POWER_LEVEL 0.4

// *** axis settings **********************************************************************************

#define JERK_MAX 5000

#define X_AXIS_MODE AXIS_STANDARD // xam see canonical_machine.h cmAxisMode for valid values
#define X_VELOCITY_MAX 40000 // xvm G0 max velocity in mm/min
#define X_FEEDRATE_MAX X_VELOCITY_MAX // xfr G1 max feed rate in mm/min
#define X_TRAVEL_MIN 0 // xtn minimum travel for soft limits
#define X_TRAVEL_MAX 420 // xtm travel between switches or crashes
#define X_JERK_MAX JERK_MAX // xjm jerk * 1,000,000
#define X_JERK_HIGH_SPEED 20000 // xjh
#define X_HOMING_INPUT 1 // xhi input used for homing or 0 to disable
#define X_HOMING_DIRECTION 0 // xhd 0=search moves negative, 1= search moves positive
#define X_SEARCH_VELOCITY 3000 // xsv minus means move to minimum switch
#define X_LATCH_VELOCITY 100 // xlv mm/min
#define X_LATCH_BACKOFF 4 // xlb mm
#define X_ZERO_BACKOFF 2 // xzb mm

#define Y_AXIS_MODE AXIS_STANDARD
#define Y_VELOCITY_MAX 40000
#define Y_FEEDRATE_MAX Y_VELOCITY_MAX
#define Y_TRAVEL_MIN 0
#define Y_TRAVEL_MAX 420
#define Y_JERK_MAX JERK_MAX
#define Y_JERK_HIGH_SPEED 20000
#define Y_HOMING_INPUT 3
#define Y_HOMING_DIRECTION 0
#define Y_SEARCH_VELOCITY 3000
#define Y_LATCH_VELOCITY 100
#define Y_LATCH_BACKOFF 4
#define Y_ZERO_BACKOFF 2

#define Z_AXIS_MODE AXIS_STANDARD
#define Z_VELOCITY_MAX 1200
#define Z_FEEDRATE_MAX Z_VELOCITY_MAX
#define Z_TRAVEL_MAX 0
#define Z_TRAVEL_MIN -95
#define Z_JERK_MAX 500
#define Z_JERK_HIGH_SPEED 1000
#define Z_HOMING_INPUT 6
#define Z_HOMING_DIRECTION 1
#define Z_SEARCH_VELOCITY (Z_VELOCITY_MAX * 0.66666)
#define Z_LATCH_VELOCITY 25
#define Z_LATCH_BACKOFF 4
#define Z_ZERO_BACKOFF 2
#define X_AXIS_MODE AXIS_STANDARD // xam see canonical_machine.h cmAxisMode for valid values
#define X_VELOCITY_MAX 40000 // xvm G0 max velocity in mm/min
#define X_FEEDRATE_MAX X_VELOCITY_MAX // xfr G1 max feed rate in mm/min
#define X_TRAVEL_MIN 0 // xtn minimum travel for soft limits
#define X_TRAVEL_MAX 420 // xtm travel between switches or crashes
#define X_JERK_MAX JERK_MAX // xjm jerk * 1,000,000
#define X_JERK_HIGH_SPEED 20000 // xjh
#define X_HOMING_INPUT 1 // xhi input used for homing or 0 to disable
#define X_HOMING_DIRECTION 0 // xhd 0=search moves negative, 1= search moves positive
#define X_SEARCH_VELOCITY 3000 // xsv minus means move to minimum switch
#define X_LATCH_VELOCITY 100 // xlv mm/min
#define X_LATCH_BACKOFF 4 // xlb mm
#define X_ZERO_BACKOFF 2 // xzb mm

#define Y_AXIS_MODE AXIS_STANDARD
#define Y_VELOCITY_MAX 40000
#define Y_FEEDRATE_MAX Y_VELOCITY_MAX
#define Y_TRAVEL_MIN 0
#define Y_TRAVEL_MAX 420
#define Y_JERK_MAX JERK_MAX
#define Y_JERK_HIGH_SPEED 20000
#define Y_HOMING_INPUT 3
#define Y_HOMING_DIRECTION 0
#define Y_SEARCH_VELOCITY 3000
#define Y_LATCH_VELOCITY 100
#define Y_LATCH_BACKOFF 4
#define Y_ZERO_BACKOFF 2

#define Z_AXIS_MODE AXIS_STANDARD
#define Z_VELOCITY_MAX 1200
#define Z_FEEDRATE_MAX Z_VELOCITY_MAX
#define Z_TRAVEL_MAX 0
#define Z_TRAVEL_MIN -95
#define Z_JERK_MAX 500
#define Z_JERK_HIGH_SPEED 1000
#define Z_HOMING_INPUT 6
#define Z_HOMING_DIRECTION 1
#define Z_SEARCH_VELOCITY (Z_VELOCITY_MAX * 0.66666)
#define Z_LATCH_VELOCITY 25
#define Z_LATCH_BACKOFF 4
#define Z_ZERO_BACKOFF 2

0 comments on commit 306c256

Please sign in to comment.