G0 rapid move

I understand G0 and G1 is considered the same, according to the reprap specification, and I can see it's impemented accordingly, in the code.

void Commands::processGCode(GCode *com)
{
    uint32_t codenum; //throw away variable
    switch(com->G)
    {
    case 0: // G0 -> G1
    case 1: // G1
        if(com->hasS()) Printer::setNoDestinationCheck(com->S != 0);

Are there any plans by chance that G0 rapid moves would be implemented in the firmware? I have a printer, that can be equipped with a spindle too, and can be used as a CNC machine, but I need a firmware that can do real G0 rapid moves.

Thanks in advance,
Miki.

Comments

  • As far as I remember G0 doe snot need to follow the linear path to reach end point in contrast to G1. Except this there is no difference and this difference does not need different implementation. Of course you need to set F in G0 for faster speeds, but that can be done in cnc software where you can normally define the syntax and adding a F2000 is normally no problem.

    Otherwise copy G1 code to G0 and set F before calling setDestinationSteps and after queuing restore old F.
  • I use CamBam, and yes, I can configure the G0 move to something like "G0 F2000", but CamBam would not add an F to its G1 moves, so all subsequent G1's would run at max speed. In Repetier firmware, the last feedrate is always stored in "Printer::feedrate", and it is used in any G0 or G1 moves if there is no F in the command. In CamBam, I could even change G1 to something like "G1 {cut feedrate}", but sometimes G1 moves are not cuts, but plunges (Z axis move), and it wouldn't be good to plunge with cut rate. CamBam only adds F, if there is a change in G1 speed.

    I implemented a simple (and probably ugly) hack, though. If it's a G0 move, I just backup the current feedrate (in g1_feedrate_backup), and restore it after the move is queued.

    void Commands::processGCode(GCode *com)
    {
        uint32_t codenum; //throw away variable
        volatile float g1_feedrate_backup;
        switch(com->G)
        {
        case 0: // G0 -> G1
        case 1: // G1
            if(com->hasS()) Printer::setNoDestinationCheck(com->S != 0);
            if(Printer::setDestinationStepsFromGCode(com)) // For X Y Z E F
    #if NONLINEAR_SYSTEM
                if (!PrintLine::queueDeltaMove(ALWAYS_CHECK_ENDSTOPS, true, true))
                {
                    Com::printWarningFLN(PSTR("executeGCode / queueDeltaMove returns error"));
                }
    if ( com->G == 0 )
    {
    g1_feedrate_backup = Printer::feedrate;
    Printer::feedrate = Printer::maxFeedrate[X_AXIS];
    PrintLine::queueCartesianMove(ALWAYS_CHECK_ENDSTOPS, true);
    Printer::feedrate = g1_feedrate_backup;
    }
    else
    {
    PrintLine::queueCartesianMove(ALWAYS_CHECK_ENDSTOPS, true);
    }


  • Not that ugly and similar to my proposal which was copy G1 to g0 case and then make your changes. Anyhow both will work fine. 
Sign In or Register to comment.