Quantcast
Channel: Reprap Forum - Delta Machines
Viewing all articles
Browse latest Browse all 20291

Re: Dual extrusion, E-only move causing XYZ motion, bug in Marlin?

$
0
0
Looks like the tool switch code tries to move the printer in cartesian space not delta... Commenting out the plan_set_position() and prepareMove() shown below fixes this for me.

  else if(code_seen('T'))
  {
    tmp_extruder = code_value();
    if(tmp_extruder >= EXTRUDERS) {
      SERIAL_ECHO_START;
      SERIAL_ECHO("T");
      SERIAL_ECHO(tmp_extruder);
      SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
    }
    else {
      boolean make_move = false;
      if(code_seen('F')) {
        make_move = true;
        next_feedrate = code_value();
        if(next_feedrate > 0.0) {
          feedrate = next_feedrate;
        }
      }
      #if EXTRUDERS > 1
      if(tmp_extruder != active_extruder) {
        // Save current position to return to after applying extruder offset
        memcpy(destination, current_position, sizeof(destination));
      #ifdef DUAL_X_CARRIAGE
        // [removed from post because long and not relevant]
      #else    
        // Offset extruder (only by XY)
        int i;
        for(i = 0; i < 2; i++) {
           current_position = current_position -
                                 extruder_offset[active_extruder] +
                                 extruder_offset[tmp_extruder];
        }
        // Set the new active extruder and position
        active_extruder = tmp_extruder;
      #endif //else DUAL_X_CARRIAGE
        
		// this part doesn't work on a delta. current_position is in cartesian space, not delta
		plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
        // Move to the old position if 'F' was in the parameters
        if(make_move && Stopped == false) {
           prepare_move();
        }
      }
      #endif
      SERIAL_ECHO_START;
      SERIAL_ECHO(MSG_ACTIVE_EXTRUDER);
      SERIAL_PROTOCOLLN((int)active_extruder);
    }
  }


Viewing all articles
Browse latest Browse all 20291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>