starting my C program, any guidance would be appreciated. - Page 3


Page 3 of 10 FirstFirst 123456 ... LastLast
Results 41 to 60 of 199

Thread: starting my C program, any guidance would be appreciated.

  1. #41
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3744
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Ok, Max following error, and tuning were my last resort after I reflashed and reinstalled KMotion. Those were the only things you mentioned so I tried all of them.
    I asked you to try simulation mode.

    Do you see anything wrong in trajectory planner in post 30?
    Ah yes. Cnts/Inch are set to 0. That will cause a division by 0. Set any unused axis to 100.

    I guess I dont know what I'm looking for with Trips, because it is not giving me good results when entering the information in KMotion. When getting settings in Trips what am I supposed to be looking for, do you have an example of what a good looking Trips looks like?
    Can you see that the bottom blue plot in TripsWPF is the same as the blue Command Plot in KMotion? What do each show at t=3 seconds?

    Regards
    TK http://dynomotion.com


  2. #42
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by TomKerekes View Post
    I asked you to try simulation mode.
    Same error came up.

    Quote Originally Posted by TomKerekes View Post
    Ah yes. Cnts/Inch are set to 0. That will cause a division by 0. Set any unused axis to 100.
    Ill try that when I get home tonight
    Quote Originally Posted by TomKerekes View Post
    Can you see that the bottom blue plot in TripsWPF is the same as the blue Command Plot in KMotion? What do each show at t=3 seconds?
    Somewhat, about 16000?



  3. #43
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    I changed the Cnts/Inch to 100 for all the axis I'm not using which are, (UVABC), and all the Vel in/sec and Accel in/sec² I left at 0.

    I now get an error that says "Invalid buffer times in Trajectory Planner".



  4. #44
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    354
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    I've just had a skim through this thread, and it appears you're just randomly changing things to try and get things to work.
    So lets take a bit of step back, and work through things a bit more methodically.

    Quote Originally Posted by Gunmachinist View Post
    Same error came up.
    If you're still getting an error message when the simulate button in KMotionCNC is ticked, then it's the GCode itself that's causing the problem not the machine. In simulate, the KFlop configuration doesn't matter, as it's only the PC doing the simulating.
    However with the error messages you're getting, I would expect some kind of additional error to be displayed via the console. Although KMotionCNC will pop-up an error message saying the G-code has been aborted, the KFlop will output to the console the reason why it's aborted, so try having the console open within KMotion while trying to run GCode in KMotionCNC.


    Another area I think needs clarified, is around all the Vel/Acc settings.
    The channel settings (what goes in your C program) control how fast each axis can move (IIRC these are what are used for G0/rapid moves - Tom can you clarify that?)
    Then the settings within KMotionCNC control how fast the axes can move when carrying out feed rate (G1/2/3) moves.



  5. #45
    Member
    Join Date
    Dec 2020
    Posts
    1
    Downloads
    0
    Uploads
    0

    Thumbs up re: starting my C program, any guidance would be appreciated.



  6. #46
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3744
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    I asked you to try simulation mode.
    Same error came up.
    It would have been helpful if you would have told us you did it and what happened.

    I now get an error that says "Invalid buffer times in Trajectory Planner".
    Could you elaborate? When does this occur? Any output on KMotion's Console? Do any of the axes become disabled?

    Please re post your Init.c Program and Trajectory planner settings.

    The channel settings (what goes in your C program) control how fast each axis can move (IIRC these are what are used for G0/rapid moves - Tom can you clarify that?)
    Then the settings within KMotionCNC control how fast the axes can move when carrying out feed rate (G1/2/3) moves.
    Correct. Described here.

    Can you see that the bottom blue plot in TripsWPF is the same as the blue Command Plot in KMotion? What do each show at t=3 seconds?
    Somewhat, about 16000?
    Very good. Can you see what maximum Velocity and Acceleration are used?

    Regards
    TK http://dynomotion.com


  7. #47
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by m_c View Post
    If you're still getting an error message when the simulate button in KMotionCNC is ticked, then it's the GCode itself that's causing the problem not the machine. In simulate, the KFlop configuration doesn't matter, as it's only the PC doing the simulating.
    However with the error messages you're getting, I would expect some kind of additional error to be displayed via the console. Although KMotionCNC will pop-up an error message saying the G-code has been aborted, the KFlop will output to the console the reason why it's aborted, so try having the console open within KMotion while trying to run GCode in KMotionCNC.
    At this point, after I changed the Cnts/Inch to 100 for all the axis I'm not using I'm not getting the error code, G-code has been aborted (only). I tried the simulate check box and run button, but it blinks but doesn't actually do anything (no error code). If I attempt to run one of the stock G-code files I get the pop-up "Invalid buffer times in Trajectory Planner" and then pop up error message saying the G-code has been aborted.

    Quote Originally Posted by TomKerekes View Post
    It would have been helpful if you would have told us you did it and what happened.
    Ok, Nothing happened. I can check the simulate box and push the run button all day and nothing.

    Quote Originally Posted by TomKerekes View Post
    Could you elaborate? When does this occur? Any output on KMotion's Console? Do any of the axes become disabled?

    Please re post your Init.c Program and Trajectory planner settings.
    I can't elaborate as noting happens the computer screen will blink, that's it.
    The error occurs after i click on the green arrow button in KMotionCNC and after the first 2-3 lines.
    Not sure what you mean by any output on KMotion CNC console.
    All the axis are disabled.



  8. #48
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by TomKerekes View Post
    Please re post your Init.c Program and Trajectory planner settings.
    #include "KMotionDef.h"

    // Default Initial Configuration for 3 Axis Analog DAC Servo with encoder feedback
    //
    // Note Low Gains, Limited Max Limits, No Limit Options, No Soft Limits,
    // Large allowed Following Error, No Feed Forward, No Filters, etc

    void main()
    {
    SetBit(152); // enable AMPS
    SetBit(157);
    SetBit(158);

    ch0->InputMode=ENCODER_MODE;
    ch0->OutputMode=DAC_SERVO_MODE;
    ch0->Vel=35000;
    ch0->Accel=35000;
    ch0->Jerk=50000;
    ch0->P=4;
    ch0->I=0.0001;
    ch0->D=1;
    ch0->FFAccel=0.0001;
    ch0->FFVel=0.0009;
    ch0->MaxI=2047;
    ch0->MaxErr=1000;
    ch0->MaxOutput=2047;
    ch0->DeadBandGain=1;
    ch0->DeadBandRange=0;
    ch0->InputChan0=0;
    ch0->InputChan1=1;
    ch0->OutputChan0=0;
    ch0->OutputChan1=1;
    ch0->MasterAxis=-1;
    ch0->LimitSwitchOptions=0x12f;
    ch0->LimitSwitchNegBit=136;
    ch0->LimitSwitchPosBit=136;
    ch0->SoftLimitPos=1e+09;
    ch0->SoftLimitNeg=-1e+09;
    ch0->InputGain0=1;
    ch0->InputGain1=1;
    ch0->InputOffset0=0;
    ch0->InputOffset1=0;
    ch0->OutputGain=1;
    ch0->OutputOffset=0;
    ch0->SlaveGain=0;
    ch0->BacklashMode=BACKLASH_OFF;
    ch0->BacklashAmount=1;
    ch0->BacklashRate=10;
    ch0->invDistPerCycle=1;
    ch0->Lead=0;
    ch0->MaxFollowingError=1000;
    ch0->StepperAmplitude=250;

    ch0->iir[0].B0=0.570375;
    ch0->iir[0].B1=-1.07753;
    ch0->iir[0].B2=0.508907;
    ch0->iir[0].A1=1.91629;
    ch0->iir[0].A2=-0.918042;

    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;

    ch1->InputMode=ENCODER_MODE;
    ch1->OutputMode=DAC_SERVO_MODE;
    ch1->Vel=30000;
    ch1->Accel=30000;
    ch1->Jerk=100000;
    ch1->P=27;
    ch1->I=0.0001;
    ch1->D=6;
    ch1->FFAccel=0.0001;
    ch1->FFVel=0.0008;
    ch1->MaxI=2047;
    ch1->MaxErr=1000;
    ch1->MaxOutput=2047;
    ch1->DeadBandGain=1;
    ch1->DeadBandRange=0;
    ch1->InputChan0=1;
    ch1->InputChan1=1;
    ch1->OutputChan0=1;
    ch1->OutputChan1=1;
    ch1->MasterAxis=-1;
    ch1->LimitSwitchOptions=0x110;
    ch1->LimitSwitchNegBit=138;
    ch1->LimitSwitchPosBit=138;
    ch1->SoftLimitPos=1e+09;
    ch1->SoftLimitNeg=-1e+09;
    ch1->InputGain0=1;
    ch1->InputGain1=1;
    ch1->InputOffset0=0;
    ch1->InputOffset1=0;
    ch1->OutputGain=1;
    ch1->OutputOffset=0;
    ch1->SlaveGain=0;
    ch1->BacklashMode=BACKLASH_OFF;
    ch1->BacklashAmount=0;
    ch1->BacklashRate=0;
    ch1->invDistPerCycle=1;
    ch1->Lead=0;
    ch1->MaxFollowingError=1000;
    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;

    ch2->InputMode=ENCODER_MODE;
    ch2->OutputMode=DAC_SERVO_MODE;
    ch2->Vel=30000;
    ch2->Accel=300000;
    ch2->Jerk=100000;
    ch2->P=10;
    ch2->I=0.0001;
    ch2->D=2;
    ch2->FFAccel=0.0001;
    ch2->FFVel=0.0009;
    ch2->MaxI=2047;
    ch2->MaxErr=200;
    ch2->MaxOutput=2047;
    ch2->DeadBandGain=3;
    ch2->DeadBandRange=0;
    ch2->InputChan0=2;
    ch2->InputChan1=1;
    ch2->OutputChan0=2;
    ch2->OutputChan1=1;
    ch2->MasterAxis=-1;
    ch2->LimitSwitchOptions=0x11f;
    ch2->LimitSwitchNegBit=137;
    ch2->LimitSwitchPosBit=137;
    ch2->SoftLimitPos=1e+30;
    ch2->SoftLimitNeg=-1e+30;
    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=200;
    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;

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

    DefineCoordSystem(2,1,0,-1);// define XYZA axes
    }

    Attached Thumbnails Attached Thumbnails starting my C program, any guidance would be appreciated.-screenshot-56-jpg   starting my C program, any guidance would be appreciated.-screenshot-57-jpg  


  9. #49
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    354
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by Gunmachinist View Post
    At this point, after I changed the Cnts/Inch to 100 for all the axis I'm not using I'm not getting the error code, G-code has been aborted (only). I tried the simulate check box and run button, but it blinks but doesn't actually do anything (no error code). If I attempt to run one of the stock G-code files I get the pop-up "Invalid buffer times in Trajectory Planner" and then pop up error message saying the G-code has been aborted.

    Ok, Nothing happened. I can check the simulate box and push the run button all day and nothing.
    That tells us the G-Code file itself is fine. If you were to open the G Viewer, you should see the simulated motion.

    I can't elaborate as noting happens the computer screen will blink, that's it.
    The error occurs after i click on the green arrow button in KMotionCNC and after the first 2-3 lines.
    Not sure what you mean by any output on KMotion CNC console.
    All the axis are disabled.
    If you open KMotion (not KMotionCNC), there is an option to display the Console-
    starting my C program, any guidance would be appreciated.-kmotion-console-png

    This will often show more information about why GCode has been aborted, for example if an axis disables for some reason, the KFlop will output a message to the console saying what axis disabled, whereas KMotionCNC will simply tell you GCode has been aborted.
    However buffer errors are not something I know anything about, so I'll let Tom suggest why you're receiving them.



  10. #50
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by m_c View Post
    That tells us the G-Code file itself is fine. If you were to open the G Viewer, you should see the simulated motion.


    If you open KMotion (not KMotionCNC), there is an option to display the Console-
    starting my C program, any guidance would be appreciated.-kmotion-console-png

    This will often show more information about why GCode has been aborted, for example if an axis disables for some reason, the KFlop will output a message to the console saying what axis disabled, whereas KMotionCNC will simply tell you GCode has been aborted.
    However buffer errors are not something I know anything about, so I'll let Tom suggest why you're receiving them.
    Ok, thanks that helps. I didn't think about the Veiwer.



  11. #51
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3744
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    This probably isn't your problem but I see you changed the Trajectory Planner Feed Rate Overrides to 0. Set them both to 1. A Max Rapid FRO = 0 means Rapids will all be overridden down to a speed of zero.

    Regards
    TK http://dynomotion.com


  12. #52
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by TomKerekes View Post
    This probably isn't your problem but I see you changed the Trajectory Planner Feed Rate Overrides to 0. Set them both to 1. A Max Rapid FRO = 0 means Rapids will all be overridden down to a speed of zero.
    Ok, done. I attempted to run G-code again and I get "Jogging Spindle Stop"; along with the other fault, in the console screen. Here is a screen shot with the G-code viewer and console screen visible.

    Attached Thumbnails Attached Thumbnails starting my C program, any guidance would be appreciated.-screenshot-58-jpg  


  13. #53
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    354
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    What have you got setup for the M0-M30 functions in Setup?

    That jogging stop message is from the C program to stop the spindle.



  14. #54
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by m_c View Post
    What have you got setup for the M0-M30 functions in Setup?

    That jogging stop message is from the C program to stop the spindle.
    Not much setup in M0-M30.

    Attached Thumbnails Attached Thumbnails starting my C program, any guidance would be appreciated.-screenshot-59-jpg  


  15. #55
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    354
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    I'm guessing whatever is causing the problem, is then triggering an EStop in the KFlop, which will trigger an M5 (spindle off), so that message is just a symptom, and not the problem.

    Is it the buffer error you're still getting?



  16. #56
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by m_c View Post
    I'm guessing whatever is causing the problem, is then triggering an EStop in the KFlop, which will trigger an M5 (spindle off), so that message is just a symptom, and not the problem.

    Is it the buffer error you're still getting?
    Yes, Could it be that the Vel In/Sec and Acc in/sec2 calculated correctly? I'm not sure how to calculate that 100%, I read it in another thread but not sure I did it correct.



  17. #57
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3744
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Yes, Could it be that the Vel In/Sec and Acc in/sec2 calculated correctly? I'm not sure how to calculate that 100%, I read it in another thread but not sure I did it correct.
    No those wrong settings would give you different errors.

    I'm able to run with your configuration without any errors without having any motors or hardware by turning off limits and following errors. You might try that. I've attached your Init file with those changes.

    To simplify things further you might set the KMotionCNC M3, M4, M5 Actions to "none"

    #1 disconnect power to your hardware (motors)
    #2 power cycle KFLOP
    #3 from KMotion.exe C Program Screen Thread #1 load attached GunInit.c and Save/Compile/Download/Execute it
    #4 Verify on Axis Screen first 3 axes are enabled
    #5 KMotionCNC load circles.ngc into File #1
    #6 Cycle Start


    Describe in detail which of these steps you understood, which you did, and what happens. Reference each step by number in your response.

    You might also post your KMotionCNC fixture offsets screen and all Tool Setup Screens

    Regards
    TK http://dynomotion.com


  18. #58
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    I don't have the GunInit.c file attached anywhere that I can download.

    I may have located it, the tool lengths were not set in my tool file. I no longer get the error code, so I reconnected the servos to power and rebooted Kflop from the console screen. when I run the G-code it doesn't move the machine.

    Attached Thumbnails Attached Thumbnails starting my C program, any guidance would be appreciated.-screenshot-62-jpg   starting my C program, any guidance would be appreciated.-screenshot-63-jpg   starting my C program, any guidance would be appreciated.-screenshot-64-jpg   starting my C program, any guidance would be appreciated.-screenshot-66-jpg  

    starting my C program, any guidance would be appreciated.-screenshot-67-jpg   starting my C program, any guidance would be appreciated.-screenshot-65-jpg  
    Last edited by Gunmachinist; 12-29-2020 at 01:14 PM.


  19. #59
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3744
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Oops somehow Guninit.c wasn't attached.

    But anyway I think I see the problem. Somehow the G54 Fixture ABC offsets got set to nan (not a number/infinity). Try clearing those to zero.

    Regards
    TK http://dynomotion.com


  20. #60
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    225
    Downloads
    0
    Uploads
    0

    Default re: starting my C program, any guidance would be appreciated.

    Quote Originally Posted by TomKerekes View Post
    Oops somehow Guninit.c wasn't attached.

    But anyway I think I see the problem. Somehow the G54 Fixture ABC offsets got set to nan (not a number/infinity). Try clearing those to zero.
    I cleared the G54 offsets and now when I hit send the red pointer will go through the program extremely fast and if I hit send again I get the buffer fault.



Page 3 of 10 FirstFirst 123456 ... LastLast

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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

starting my C program, any guidance would be appreciated.

starting my C program, any guidance would be appreciated.

starting my C program, any guidance would be appreciated.