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


Page 2 of 11 FirstFirst 12345 ... LastLast
Results 21 to 40 of 215

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

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

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

    You aren't answering questions so it makes it hard to have progress.

    Which KFLOP axis is your Z axis? Does your Z axis work in KMotion.exe?

    Regards
    TK http://dynomotion.com


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

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

    Quote Originally Posted by TomKerekes View Post
    You aren't answering questions so it makes it hard to have progress.

    Which KFLOP axis is your Z axis? Does your Z axis work in KMotion.exe?
    0 is my Z axis and works when i run it in KMotion but not KMotioncnc.



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

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

    I don't know why, but they are all working/counting correctly now. I couldn't get it last night, but it's working now. Freaking gremlins!



  4. #24
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    252
    Downloads
    0
    Uploads
    0

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

    I'm trying to run G code to test axis movement and keep getting (Gcode error Gcode Aborted) seemes to happen on G0.



  5. #25
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

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

    Most likely the Velocities and Accelerations in KFLOP are set too high.

    Regards
    TK http://dynomotion.com


  6. #26
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    252
    Downloads
    0
    Uploads
    0

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

    Quote Originally Posted by TomKerekes View Post
    Most likely the Velocities and Accelerations in KFLOP are set too high.
    So do I need to reduce that in Kmotion or in KmotionCNC (Trajectory Planner) What should a normal Velocity and Acceleration look like. Mine are currently about 50000 and 500000.



  7. #27
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

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

    KMotion.exe used to set, test, and create the Init C Program control G0 Rapid rates. The settings are dependent on your system. See also here.

    A common problem is to have too high of settings and not realize it when only testing small moves. This is like stating your car can go 300mph but then only test it in your driveway.

    Regards
    TK http://dynomotion.com


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

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

    Quote Originally Posted by TomKerekes View Post
    KMotion.exe used to set, test, and create the Init C Program control G0 Rapid rates. The settings are dependent on your system. See also here.

    A common problem is to have too high of settings and not realize it when only testing small moves. This is like stating your car can go 300mph but then only test it in your driveway.
    I reduced the V and A 20% in KMotion and then updated the C code file. I also changed the KMotion CNC Trajectory Planner. The G code still will not run and now stops at G01.

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


  9. #29
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

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

    Hi Gunmachinist,

    Please put more effort into your responses otherwise we don't know what you are doing and can't help.

    Please determine your Velocities, Accelerations, and Jerks as described here. Describe what you did and post the results. Test big enough moves that reach full velocity and post them.

    Regards
    TK http://dynomotion.com


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

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

    Quote Originally Posted by TomKerekes View Post
    Hi Gunmachinist,

    Please put more effort into your responses otherwise we don't know what you are doing and can't help.

    Please determine your Velocities, Accelerations, and Jerks as described here. Describe what you did and post the results. Test big enough moves that reach full velocity and post them.
    I have read and reread Dynomotion wiki. I have re-tuned the servos and after tuning I decreased Velocity, and Acceleration by 20% and updated my C program. X and Y axis are at 40000 Velocity and 400000 Acceleration, Z is 32000, and 320000. Jerk is set at 100000 for all three axes. I entered the information in Kmotion CNC for XYZ axis and attempted to run a short program just to verify that the axis would work, and I get the message Gcode error/Gcode aborted. I've tried different G code programs with the same results. At this point I dont know what more to include, It may help if you guys would ask questions.

    Here is C code as it is now.

    #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=32000;
    ch0->Accel=320000;
    ch0->Jerk=100000;
    ch0->P=26.68;
    ch0->I=0.0001;
    ch0->D=32.332;
    ch0->FFAccel=0.0001;
    ch0->FFVel=0.0009;
    ch0->MaxI=2047;
    ch0->MaxErr=100;
    ch0->MaxOutput=2047;
    ch0->DeadBandGain=3;
    ch0->DeadBandRange=0;
    ch0->InputChan0=0;
    ch0->InputChan1=1;
    ch0->OutputChan0=0;
    ch0->OutputChan1=1;
    ch0->MasterAxis=-1;
    ch0->LimitSwitchOptions=0x11f;
    ch0->LimitSwitchNegBit=136;
    ch0->LimitSwitchPosBit=136;
    ch0->SoftLimitPos=1e+30;
    ch0->SoftLimitNeg=-1e+30;
    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=10000000;
    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;

    ch1->InputMode=ENCODER_MODE;
    ch1->OutputMode=DAC_SERVO_MODE;
    ch1->Vel=40000;
    ch1->Accel=400000;
    ch1->Jerk=100000;
    ch1->P=22;
    ch1->I=0.0001;
    ch1->D=12;
    ch1->FFAccel=0.0001;
    ch1->FFVel=0.0006;
    ch1->MaxI=2047;
    ch1->MaxErr=100;
    ch1->MaxOutput=2047;
    ch1->DeadBandGain=4;
    ch1->DeadBandRange=0;
    ch1->InputChan0=1;
    ch1->InputChan1=1;
    ch1->OutputChan0=1;
    ch1->OutputChan1=1;
    ch1->MasterAxis=-1;
    ch1->LimitSwitchOptions=0x11f;
    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=10000000;
    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=40000;
    ch2->Accel=400000;
    ch2->Jerk=100000;
    ch2->P=6;
    ch2->I=0.0001;
    ch2->D=6;
    ch2->FFAccel=0.0001;
    ch2->FFVel=0.0009;
    ch2->MaxI=2047;
    ch2->MaxErr=1000;
    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=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;

    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-45-jpg   starting my C program, any guidance would be appreciated.-screenshot-46-jpg   starting my C program, any guidance would be appreciated.-screenshot-47-jpg   starting my C program, any guidance would be appreciated.-screenshot-48-jpg  

    starting my C program, any guidance would be appreciated.-screenshot-49-jpg  


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

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

    Actually I see now the Following Errors are set huge so regardless of how bad the tuning is you wouldn't get any error. It must be something unrelated to tuning.

    I see "Launch on Power up" is set so you have modified KFLOP. Please remove those changes by re-flashing "New Version"

    I can't think of why you would get a "G Code Error" without some other message. Is there any? You might try simulating the GCode.

    Maybe the installation is messed up. You might reinstall it after making a copy of your current installation.

    Regards
    TK http://dynomotion.com


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

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

    Quote Originally Posted by TomKerekes View Post
    Actually I see now the Following Errors are set huge so regardless of how bad the tuning is you wouldn't get any error. It must be something unrelated to tuning.

    I see "Launch on Power up" is set so you have modified KFLOP. Please remove those changes by re-flashing "New Version"
    also.

    The max following errors in the configuration or step response screen? I reflashed

    Quote Originally Posted by TomKerekes View Post
    I can't think of why you would get a "G Code Error" without some other message. Is there any? You might try simulating the GCode.
    No other message that gcode error/gcode aborted.

    Quote Originally Posted by TomKerekes View Post
    Maybe the installation is messed up. You might reinstall it after making a copy of your current installation.
    I assume your talkning about KMotion and KMotion CNC?



  13. #33
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

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

    also.
    huh?

    The max following errors in the configuration or step response screen?
    Configuration Screen

    I reflashed
    And?

    I assume your talkning about KMotion and KMotion CNC?
    Yes, but actually the full installation on the PC

    Regards
    TK http://dynomotion.com


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

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

    Quote Originally Posted by TomKerekes View Post
    huh?
    Not sure where that came from.

    Quote Originally Posted by TomKerekes View Post
    Configuration Screen

    And?
    I'm working on the Max following errors to get them down. When I started it basically stopped the axis from working. How low should the Max following error be?



  15. #35
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

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

    I'm working on the Max following errors to get them down. When I started it basically stopped the axis from working. How low should the Max following error be?
    Observe what your following errors are under normal conditions and set to a larger value.

    Regards
    TK http://dynomotion.com


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

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

    I did some work with tuning my axis and have been able to get the Max Following Errors down, but when trying to run G-code I still get and the same error code. Here is my current screen shots of each axis. I ve also been playing with TripsWPF, and could you explain how I'm supposed to use the check all?

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


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

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

    It seems you miss-understood my post #31 where I tried to explain following error was not the problem and to try other things. So then you focused on following error and ignored the other suggestions.

    Its good your playing with TripsWPF. Hopefully you get a better understanding of Velocity, Acceleration, Jerk, and distance.

    Regarding TripsWPF Check All button: You wouldn't use it. Its for our use to apply many sets of parameters to TripsWPF to check it is able to solve them all correctly.

    Regards
    TK http://dynomotion.com


  18. #38
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    252
    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. If tuning isn't the problem with why im getting the G-code error then then Im guessing it's in setting up KMotionCNC trajectory planner. Do you see anything wrong in trajectory planner in post 30? What else could be the reason all I get is gcode aborted message?

    Last edited by Gunmachinist; 12-26-2020 at 11:58 PM.


  19. #39
    Member Gunmachinist's Avatar
    Join Date
    May 2020
    Posts
    252
    Downloads
    0
    Uploads
    0

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

    Oops

    Last edited by Gunmachinist; 12-26-2020 at 11:56 PM.


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

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

    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?

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


Page 2 of 11 FirstFirst 12345 ... 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.