resolve merge conflicts for pull request

This commit is contained in:
Alden Hart
2016-11-29 14:56:20 -05:00
7 changed files with 33 additions and 36 deletions

2
Motate

Submodule Motate updated: 1e1be74e8b...7bc5653845

0
g2core/board/Archim/board_xio.cpp Executable file → Normal file
View File

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>

View File

@@ -21,7 +21,7 @@
#ifndef G2CORE_INFO_H_ONCE
#define G2CORE_INFO_H_ONCE
#define G2CORE_FIRMWARE_BUILD 100.11 // Power Management Fixes
#define G2CORE_FIRMWARE_BUILD 100.12 // Fix UART flow control
#ifdef GIT_VERSION
#define G2CORE_FIRMWARE_BUILD_STRING GIT_VERSION
#else

50
g2core/plan_arc.cpp Executable file → Normal file
View File

@@ -173,9 +173,8 @@ stat_t cm_arc_feed(const float target[], const bool target_f[], // target en
if (fabs(arc.radius) < MIN_ARC_RADIUS) { // radius value must be > minimum radius
return (STAT_ARC_RADIUS_OUT_OF_TOLERANCE);
}
// test that center format absolute distance mode arcs have both offsets specified
} else {
}
else { // test that center format absolute distance mode arcs have both offsets specified
if (cm.gm.arc_distance_mode == ABSOLUTE_MODE) {
if (!(offset_f[arc.plane_axis_0] && offset_f[arc.plane_axis_1])) { // if one or both offsets are missing
return (STAT_ARC_OFFSETS_MISSING_FOR_SELECTED_PLANE);
@@ -214,18 +213,25 @@ stat_t cm_arc_feed(const float target[], const bool target_f[], // target en
// *** now get down to the rest of the work setting up the arc for execution ***
cm.gm.motion_mode = motion_mode;
cm_set_work_offsets(&cm.gm); // capture the fully resolved offsets to gm
memcpy(&arc.gm, &cm.gm, sizeof(GCodeState_t)); // copy GCode context to arc singleton - some will be overwritten to run segments
copy_vector(arc.position, cm.gmx.position); // set initial arc position from gcode model
cm_set_work_offsets(&cm.gm); // capture the fully resolved offsets to gm
memcpy(&arc.gm, &cm.gm, sizeof(GCodeState_t)); // copy GCode context to arc singleton - some will be overwritten to run segments
copy_vector(arc.position, cm.gmx.position); // set initial arc position from gcode model
// setup offsets
arc.offset[OFS_I] = _to_millimeters(offset[OFS_I]); // copy offsets with conversion to canonical form (mm)
arc.offset[OFS_J] = _to_millimeters(offset[OFS_J]);
arc.offset[OFS_K] = _to_millimeters(offset[OFS_K]);
if (arc.gm.arc_distance_mode == ABSOLUTE_MODE) { // adjust offsets if in absolute mode
arc.offset[OFS_I] -= cm.gmx.position[AXIS_X];
arc.offset[OFS_J] -= cm.gmx.position[AXIS_Y];
arc.offset[OFS_K] -= cm.gmx.position[AXIS_Z];
arc.offset[OFS_I] -= arc.position[AXIS_X];
arc.offset[OFS_J] -= arc.position[AXIS_Y];
arc.offset[OFS_K] -= arc.position[AXIS_Z];
}
if ((fp_ZERO(arc.offset[OFS_I])) && // it's an error if no offsets are provided
(fp_ZERO(arc.offset[OFS_J])) &&
(fp_ZERO(arc.offset[OFS_K]))) {
return (cm_alarm(STAT_ARC_OFFSETS_MISSING_FOR_SELECTED_PLANE, "arc offsets missing or zero"));
}
// compute arc runtime values
@@ -235,12 +241,12 @@ stat_t cm_arc_feed(const float target[], const bool target_f[], // target en
stat_t status = _test_arc_soft_limits();
if (status != STAT_OK) {
cm.gm.motion_mode = MOTION_MODE_CANCEL_MOTION_MODE;
copy_vector(cm.gm.target, cm.gmx.position); // reset model position
copy_vector(cm.gm.target, arc.position); // reset model position
return (cm_alarm(status, "arc soft_limits")); // throw an alarm
}
cm_cycle_start(); // if not already started
arc.run_state = BLOCK_ACTIVE; // enable arc to be run from the callback
cm_cycle_start(); // if not already started
arc.run_state = BLOCK_ACTIVE; // enable arc to be run from the callback
cm_finalize_move();
return (STAT_OK);
}
@@ -273,7 +279,7 @@ static stat_t _compute_arc(const bool radius_f)
}
// Test arc specification for correctness according to:
// http://linuxcnc.org/docs/html/gcode/gcode.html#sec:G2-G3-Arc
// https://github.com/synthetos/g2/wiki/Gcodes#g2-g3-arc-at-feed-rate
// "It is an error if: when the arc is projected on the selected plane, the distance from
// the current point to the center differs from the distance from the end point to the
// center by more than (.05 inch/.5 mm) OR ((.0005 inch/.005mm) AND .1% of radius)."
@@ -302,19 +308,13 @@ static stat_t _compute_arc(const bool radius_f)
} else {
if (arc.angular_travel > 0) { arc.angular_travel -= 2*M_PI; }
}
// apply XZ plane (G18) correction
if (arc.gm.select_plane == CANON_PLANE_XZ) {
if (arc.angular_travel >= 0) { arc.angular_travel -= 2*M_PI; }
else { arc.angular_travel += 2*M_PI; }
}
// add in travel for rotations
if (arc.angular_travel >= 0) { arc.angular_travel += 2*M_PI * arc.rotations; }
else { arc.angular_travel -= 2*M_PI * arc.rotations; }
}
// Compute full-circle arcs
} else {
if (cm.gm.motion_mode == MOTION_MODE_CCW_ARC) { arc.rotations *= -1; }
if (arc.gm.select_plane == CANON_PLANE_XZ) { arc.rotations *= -1; }
else {
if (arc.gm.motion_mode == MOTION_MODE_CCW_ARC) { arc.rotations *= -1; }
arc.angular_travel = 2 * M_PI * arc.rotations;
}
@@ -428,8 +428,8 @@ static stat_t _compute_arc(const bool radius_f)
static void _compute_arc_offsets_from_radius()
{
// Calculate the change in position along each selected axis
float x = cm.gm.target[arc.plane_axis_0] - cm.gmx.position[arc.plane_axis_0];
float y = cm.gm.target[arc.plane_axis_1] - cm.gmx.position[arc.plane_axis_1];
float x = arc.gm.target[arc.plane_axis_0] - arc.position[arc.plane_axis_0];
float y = arc.gm.target[arc.plane_axis_1] - arc.position[arc.plane_axis_1];
// *** From Forrest Green - Other Machine Co, 3/27/14
// If the distance between endpoints is greater than the arc diameter, disc will be
@@ -446,7 +446,7 @@ static void _compute_arc_offsets_from_radius()
float h_x2_div_d = (disc > 0) ? -sqrt(disc) / hypotf(x,y) : 0;
// Invert the sign of h_x2_div_d if circle is counter clockwise (see header notes)
if (cm.gm.motion_mode == MOTION_MODE_CCW_ARC) {
if (arc.gm.motion_mode == MOTION_MODE_CCW_ARC) {
h_x2_div_d = -h_x2_div_d;
}

5
g2core/plan_exec.cpp Executable file → Normal file
View File

@@ -120,9 +120,8 @@ stat_t mp_plan_move()
if (block->exit_velocity > block->cruise_velocity) {
__asm__("BKPT"); // exit > cruise after calculate_block
}
if (block->head_length < 0.00001 && block->body_length < 0.00001 && block->tail_length < 0.00001) {
__asm__("BKPT"); // zero or negaitve length block
__asm__("BKPT"); // zero or negative length block
}
bf->buffer_state = MP_BUFFER_PLANNED;
@@ -156,7 +155,6 @@ stat_t mp_exec_move()
__asm__("BKPT"); // mp_exec_move() buffer is not prepped
// IMPORTANT: We can't rpt_exception from here!
st_prep_null();
return (STAT_NOOP);
}
if (bf->nx->buffer_state < MP_BUFFER_PREPPED) {
@@ -169,7 +167,6 @@ stat_t mp_exec_move()
if (cm.motion_state == MOTION_RUN) {
__asm__("BKPT"); // we are running but don't have a block planned
}
// We need to have it planned. We don't want to do this here, as it
// might already be happening in a lower interrupt.
st_request_plan_move();

8
g2core/plan_line.cpp Executable file → Normal file
View File

@@ -412,12 +412,12 @@ static mpBuf_t* _plan_block(mpBuf_t* bf)
// +++++
if (bf->buffer_state == MP_BUFFER_EMPTY) {
// _debug_trap("Exec apparently cleared this block while we were planning it.");
// _debug_trap("Exec apparently cleared this block while we were planning it.");
break; // exit the loop, we've hit and passed the running buffer
}
// if (fp_ZERO(bf->exit_velocity) && !fp_ZERO(bf->exit_vmax)) {
// _debug_trap(); // why zero?
// }
// if (fp_ZERO(bf->exit_velocity) && !fp_ZERO(bf->exit_vmax)) {
// _debug_trap(); // why zero?
// }
// We might back plan into the running or planned buffer, so we have to check.
if (bf->buffer_state < MP_BUFFER_PREPPED) {