585,761 active members*
3,989 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > Buffer starvation error with Mach3+Kflop/Kanalog
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2013
    Posts
    7

    Buffer starvation error with Mach3+Kflop/Kanalog

    I am having a problem with my machine.
    Every time I try to run a gcode file bigger than 1300 lines I get buffer starvation error on the 4th ot 5th line.

    I tried to switch to a better computer ( intel i3 4gb ram) and it did the same problem.

    What's wrong?

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: Buffer starvation error with Mach3+Kflop/Kanalog

    Hi mitzpetel,

    Do you have a Mach3 License? Does it show in the About Dialog? What Version of Mach3? What Version of KMotion? What Buffer Time do you have set in the Dynomotion Plugin?

    Regards
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Jun 2013
    Posts
    7

    Re: Buffer starvation error with Mach3+Kflop/Kanalog

    The Mach3 is licensed and I am using the latest versions of kmotion (4.32) and mach3 (3.043.66)

    The exact message it shows is "Unexpected motion buffer starved"

    this is the init file:

    #include "KMotionDef.h"

    #define QA 26 // define to which IO bits the AB signals are connected
    #define QB 27

    main()
    {
    int BitA,Change1=0,Change2=0, DiffX2;
    int PosNoWrap, NewPos, Pos=0, wraps;
    double Factor=0;

    FPGA(STEP_PULSE_LENGTH_ADD)=32;

    SetBit(146);
    SetBit(147);
    SetBit(148);

    ch0->InputMode=ENCODER_MODE;
    ch0->OutputMode=DAC_SERVO_MODE;
    ch0->Vel=1000000;
    ch0->Accel=4000000;
    ch0->Jerk=2e+006;
    ch0->P=0.35;
    ch0->I=0.004;
    ch0->D=0.01;
    ch0->FFAccel=0;
    ch0->FFVel=0;
    ch0->MaxI=300;
    ch0->MaxErr=5000;
    ch0->MaxOutput=2000;
    ch0->DeadBandGain=1;
    ch0->DeadBandRange=10;
    ch0->InputChan0=0;
    ch0->InputChan1=1;
    ch0->OutputChan0=0;
    ch0->OutputChan1=1;
    ch0->MasterAxis=-1;
    ch0->LimitSwitchOptions=0x105;
    ch0->LimitSwitchNegBit=136;
    ch0->LimitSwitchPosBit=0;
    ch0->SoftLimitPos=1e+009;
    ch0->SoftLimitNeg=-1e+009;
    ch0->InputGain0=-1;
    ch0->InputGain1=-1;
    ch0->InputOffset0=0;
    ch0->InputOffset1=0;
    ch0->OutputGain=-1;
    ch0->OutputOffset=0;
    ch0->SlaveGain=1;
    ch0->BacklashMode=BACKLASH_OFF;
    ch0->BacklashAmount=0;
    ch0->BacklashRate=0;
    ch0->invDistPerCycle=1;
    ch0->Lead=0;
    ch0->MaxFollowingError=100;
    ch0->StepperAmplitude=250;

    ch0->iir[0].B0=1;
    ch0->iir[0].B1=0;
    ch0->iir[0].B2=0;
    ch0->iir[0].A1=0;
    ch0->iir[0].A2=0;

    ch0->iir[1].B0=1;
    ch0->iir[1].B1=0;
    ch0->iir[1].B2=0;
    ch0->iir[1].A1=0;
    ch0->iir[1].A2=0;

    ch0->iir[2].B0=1;
    ch0->iir[2].B1=0;
    ch0->iir[2].B2=0;
    ch0->iir[2].A1=0;
    ch0->iir[2].A2=0;
    EnableAxisDest(0,0);

    ch1->InputMode=ENCODER_MODE;
    ch1->OutputMode=DAC_SERVO_MODE;
    ch1->Vel=800000;
    ch1->Accel=4000000;
    ch1->Jerk=4e+006;
    ch1->P=1.3;
    ch1->I=0.003;
    ch1->D=0.001;
    ch1->FFAccel=0;
    ch1->FFVel=0;
    ch1->MaxI=2000;
    ch1->MaxErr=100;
    ch1->MaxOutput=2000;
    ch1->DeadBandGain=1;
    ch1->DeadBandRange=0;
    ch1->InputChan0=1;
    ch1->InputChan1=1;
    ch1->OutputChan0=1;
    ch1->OutputChan1=1;
    ch1->MasterAxis=-1;
    ch1->LimitSwitchOptions=0x121;
    ch1->LimitSwitchNegBit=137;
    ch1->LimitSwitchPosBit=0;
    ch1->SoftLimitPos=1e+009;
    ch1->SoftLimitNeg=-1e+009;
    ch1->InputGain0=-1;
    ch1->InputGain1=1;
    ch1->InputOffset0=0;
    ch1->InputOffset1=0;
    ch1->OutputGain=-1;
    ch1->OutputOffset=0;
    ch1->SlaveGain=1;
    ch1->BacklashMode=BACKLASH_OFF;
    ch1->BacklashAmount=0;
    ch1->BacklashRate=0;
    ch1->invDistPerCycle=1;
    ch1->Lead=0;
    ch1->MaxFollowingError=50;
    ch1->StepperAmplitude=250;

    ch1->iir[0].B0=1;
    ch1->iir[0].B1=0;
    ch1->iir[0].B2=0;
    ch1->iir[0].A1=0;
    ch1->iir[0].A2=0;

    ch1->iir[1].B0=1;
    ch1->iir[1].B1=0;
    ch1->iir[1].B2=0;
    ch1->iir[1].A1=0;
    ch1->iir[1].A2=0;

    ch1->iir[2].B0=1;
    ch1->iir[2].B1=0;
    ch1->iir[2].B2=0;
    ch1->iir[2].A1=0;
    ch1->iir[2].A2=0;
    EnableAxisDest(1,0);

    ch2->InputMode=NO_INPUT_MODE;
    ch2->OutputMode=STEP_DIR_MODE;
    ch2->Vel=500;
    ch2->Accel=200;
    ch2->Jerk=6e+006;
    ch2->P=1;
    ch2->I=0;
    ch2->D=0;
    ch2->FFAccel=500;
    ch2->FFVel=0;
    ch2->MaxI=2000;
    ch2->MaxErr=1e+008;
    ch2->MaxOutput=2000;
    ch2->DeadBandGain=1;
    ch2->DeadBandRange=0;
    ch2->InputChan0=4;
    ch2->InputChan1=1;
    ch2->OutputChan0=12;
    ch2->OutputChan1=1;
    ch2->MasterAxis=-1;
    ch2->LimitSwitchOptions=0x120;
    ch2->LimitSwitchNegBit=138;
    ch2->LimitSwitchPosBit=0;
    ch2->SoftLimitPos=1e+009;
    ch2->SoftLimitNeg=-1e+009;
    ch2->InputGain0=1;
    ch2->InputGain1=1;
    ch2->InputOffset0=0;
    ch2->InputOffset1=0;
    ch2->OutputGain=1;
    ch2->OutputOffset=0;
    ch2->SlaveGain=1;
    ch2->BacklashMode=BACKLASH_OFF;
    ch2->BacklashAmount=0;
    ch2->BacklashRate=0;
    ch2->invDistPerCycle=1;
    ch2->Lead=0;
    ch2->MaxFollowingError=10000000;
    ch2->StepperAmplitude=250;

    ch2->iir[0].B0=1;
    ch2->iir[0].B1=0;
    ch2->iir[0].B2=0;
    ch2->iir[0].A1=0;
    ch2->iir[0].A2=0;

    ch2->iir[1].B0=1;
    ch2->iir[1].B1=0;
    ch2->iir[1].B2=0;
    ch2->iir[1].A1=0;
    ch2->iir[1].A2=0;

    ch2->iir[2].B0=1;
    ch2->iir[2].B1=0;
    ch2->iir[2].B2=0;
    ch2->iir[2].A1=0;
    ch2->iir[2].A2=0;

    EnableAxisDest(2,0);

    EnableAxis(0);
    EnableAxis(1);
    EnableAxis(2);

    DefineCoordSystem(0,1,2,-1);

    SetBitDirection( 43, 1);

    SetBitDirection(1024, 1);
    SetBitDirection(1025, 0);
    ClearBit(1024);

    /* while emergency stop wasn't pressed */
    while ( !ReadBit(143) )
    {
    WaitNextTimeSlice();
    }

    printf("EMERGENCY STOP PRESSED");
    /* disable all axises */
    ClearBit(144);
    ClearBit(145);
    ClearBit(146);
    ClearBit(147);
    ClearBit(148);

    DisableAxis(0);
    DisableAxis(1);
    DisableAxis(2);

    SetBit(1024);

    return 0;
    }

  4. #4
    Join Date
    May 2006
    Posts
    4045

    Re: Buffer starvation error with Mach3+Kflop/Kanalog

    Hi mitzpetel,

    That all looks reasonable.

    What Buffer Time do you have set in the Dynomotion Plugin?

    If you run KMotion.exe at the same time are any messages printed on the Console Screen?

    Regards
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Jun 2013
    Posts
    7

    Re: Buffer starvation error with Mach3+Kflop/Kanalog

    The buffer time is 3 seconds.

  6. #6
    Join Date
    May 2006
    Posts
    4045

    Re: Buffer starvation error with Mach3+Kflop/Kanalog

    If you run KMotion.exe at the same time are any messages printed on the Console Screen?
    TK
    http://dynomotion.com

  7. #7
    Join Date
    Jun 2013
    Posts
    7

    Re: Buffer starvation error with Mach3+Kflop/Kanalog

    I solved the problem.

    In the console it said that there is following error on the axis 1.
    I tweaked it a little bit and now it's fine.

    Thanks for the help.

Similar Threads

  1. KFlop Kanalog and DMM
    By slonold in forum Dynomotion/Kflop/Kanalog
    Replies: 5
    Last Post: 12-26-2014, 10:54 PM
  2. KFlop/Kanalog/Mach3
    By keithkyll in forum Dynomotion/Kflop/Kanalog
    Replies: 3
    Last Post: 06-12-2014, 03:32 AM
  3. CNC upgrade with Kflop/Kanalog/mach3
    By Frank_W in forum Dynomotion/Kflop/Kanalog
    Replies: 4
    Last Post: 06-26-2013, 01:04 PM
  4. My Kflop/Kanalog test bed
    By PEU in forum Dynomotion/Kflop/Kanalog
    Replies: 6
    Last Post: 05-31-2013, 04:55 PM
  5. Retrofit old Cnc with kflop-kanalog
    By Scottburley in forum Dynomotion/Kflop/Kanalog
    Replies: 3
    Last Post: 02-23-2013, 12:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •