Need Help! K2cnc spindle stopped for KG-4925 - Page 3


Page 3 of 13 FirstFirst 123456 ... LastLast
Results 25 to 36 of 156

Thread: K2cnc spindle stopped for KG-4925

  1. #25
    Registered
    Join Date
    Jul 2015
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Quote Originally Posted by CNCMAN172 View Post
    Thanks M_C,

    Robert as he shared you can measure the voltage between ground and AUX1 - Pin 11. This should have a PWM signal coming out that pin and the pulse width should vary when you issue various M3 S3000, M3 S6000, M3 S10000, type commands. This will make a small voltage change, but a much better way to see this would be to put an oscilloscope on that pin, then you could watch the pulse width actually change. Because of how the board is pressed into the KFLOP with those three connectors you might need to trace where the signal from AUX1 - PIN-11 comes up to the K2CNC breakout board. I know it will head over to the parts identified earlier near the spindle connector but a quick check with an ohm meter can confirm a good spot to test from while running those experiments.

    Russ
    Hi Russ,

    I don't have an Oscilloscope but I do have an ohm meter. But I put everything back together the other day to start messing with the Threads. I am beginning to think how the Threads are loaded and other memory flashed may be the issue. After I feel that I've loaded the memory and programs correctly and if things still aren't working, then I will start to focus again on the hardware side of things. The spindle program seems to be in the files but I don't see it in the Threads. I see it referenced in the user tab setup in KMotionCNC but I'm not sure if my "Init" button works. or for that matter how any of that relates. So, I'm going to focus more on this part.

    Thanks,
    Robert



  2. #26
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1345
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    Keep in mind NOTHING has to be FLASHED in the KFLOP to get this stuff to work. If you have compiled the C programs and downloaded them into the KFLOP from a given thread they will run will called.

    Your screen shot on the Tool Setup tab shows the K2_M3.c file and the K2spindlePWM.c file both listed for thread 2. We already know the the M3 command is working you have already proven that fact. You probably just need to start up Kmotion.exe and examine each thread to make sure they are compiled and downloaded into KFLOP.

    You might want to do some screen shots inside of KMOTION not KmotionCNC and look at each thread one at a time. Especially thread 2.

    Don't get hung up on the flashing aspect until you know everything works manually.

    Russ



  3. #27
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1345
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    I understand you don't have an oscilloscope, but when you say you have an ohm meter I am assuming you mean a multimeter so you can also measure voltage. If that is the case you can at least see if you have a voltage on that AUX pin. First check that the C program is listed in KMOTION.exe in thread 2 and that it is compiled and downloaded. Then if you do all that you can start up kmotioncnc again and run the tests with M3 S8000 etc.

    Russ



  4. #28
    Registered
    Join Date
    Jul 2015
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Russ,

    Keep in mind NOTHING has to be FLASHED in the KFLOP to get this stuff to work. If you have compiled the C programs and downloaded them into the KFLOP from a given thread they will run will called.
    OK. But I'm still not sure what should be in the Threads or the best way to clear the Threads to load new configurations like the one Tom suggested. I tried clearing by re-flashing the new version but I don't know if that is correct.

    Where do you think the spindle program should be located? Threads? or "Init" tab? or can they be in both? You mentioned screen shots of KMotion. Which ones may be helpful?

    Sorry, but I'm more used to working with things I can hammer.

    Robert



  5. #29
    Registered
    Join Date
    Jul 2015
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Russ, I did not see this part of your post.

    Yes, I will locate the AUX pin and check it.

    First check that the C program is listed in KMOTION.exe in thread 2
    Yes, there is a program in thread 2. this is how it is listed at the top of the screen:

    #include "KMotionDef.h"
    // Defines axis 0, 1, 2 as simple step dir outputs
    // enables them
    // sets them as an xyz coordinate system for GCode

    And I have compiled and downloaded it.

    Robert



  6. #30
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1345
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    OK, how about a few basics to start. The threads all run at the same time, the best way to think about them is Round Robin. First thread 1 runs for a few milliseconds, then thread 2, then thread 3, etc. You DO NOT need to have anything in some threads. The reason it is setup this way is a method of multitasking, doing several things at the same time. While they are not really all at the same time from our perspective they are all happening so fast we think of them happening all at the same time.

    The Initialization tab or program is normally only called once, if you actual examine sample initialization programs they initialize key information and then they are done. In some cases the program is written to initialize key elements like the axis parameters, motors, etc. and some programmers actually have the program loop after these to handle things like MPG pendants, etc. Normal is you press the init button once when you first start, in the case of K2CNC they had that program flashed so it initialized automatically, again not a requirements.

    The homing function is normally on a separate thread, the spindle is on a separate thread, etc.

    How to you change what is on a given thread? Highlight all the text while in kmotion.exe on a given thread and press the delete key. The c code will disappear and you can paste in new code or load a file. Once you load the given file into a given thread you can compile that code and then after it compiles successfully you can download the compiled code into KFLOP where it can be executed. In KmotionCNC when you see a C program listed next to say a KEY function like S, it is telling you when you use an "S" command it will call that given program. When you press the "M3" or use it in a command it will call that C program listed, etc.

    Provide some screen shot of each thread using Kmotion.exe and we can guide you.

    Russ



  7. #31
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1345
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    Screenshot work better, but this looks like the beginning of the initialization code which does not seem to match watch has been populated in KmotionCNC, so that would example why the spindle commands are not working. Do a screenshot on each thread and we can get you fixed.

    Russ


    Yes, there is a program in thread 2. this is how it is listed at the top of the screen:

    #include "KMotionDef.h"
    // Defines axis 0, 1, 2 as simple step dir outputs
    // enables them
    // sets them as an xyz coordinate system for GCode

    And I have compiled and downloaded it.

    Robert



  8. #32
    Registered
    Join Date
    Jul 2015
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Thanks Russ.



  9. #33
    Registered
    Join Date
    Jul 2015
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Quote Originally Posted by CNCMAN172 View Post
    Thanks M_C,

    Robert as he shared you can measure the voltage between ground and AUX1 - Pin 11. This should have a PWM signal coming out that pin and the pulse width should vary when you issue various M3 S3000, M3 S6000, M3 S10000, type commands. This will make a small voltage change, but a much better way to see this would be to put an oscilloscope on that pin, then you could watch the pulse width actually change. Because of how the board is pressed into the KFLOP with those three connectors you might need to trace where the signal from AUX1 - PIN-11 comes up to the K2CNC breakout board. I know it will head over to the parts identified earlier near the spindle connector but a quick check with an ohm meter can confirm a good spot to test from while running those experiments.

    Russ
    Hi Russ,

    I've been working on some of the things that you had mentioned. So, I found where the AUX1-Pin 11 joins the K2 breakout board and made my measurements directly from there. If you think that I need to trace it to where the spindle wires attach I can do the test again. The results yield no changes in DCV when the S number is changed 3000/6000/10000. I'm getting -.5 DCV. Even if I turn off BIT 31 it still reads -.5 DCV. If I reverse the testing probes I will get +.5 DCV


    This file seems to imply that PWM sign comes out of 26 + 5 = 31. If you look at bit 31 that should be changing. Tom can probably explain exactly where you can look for this signal. They use two commands to the FPGA to enable the PWM output.
    I also, watched the I/O Bits to see what happens when I activated/pushed the screen buttons. BIT 31 OutPut and State boxes start out unchecked.
    BIT 34 OutPut box is checked at power up and the State Box Checks on with "M3" and unchecks with "M5" and "OFF" buttons.
    Results:
    "M4" button checks BIT 31 OutPut and State Boxes but leaves Bit 34 State box unchecked.
    "ON CW" button checks BIT 31 OutPut and State boxes and also checks BIT 34 State box.
    Once the boxes of BIT 31 are activated the stay activated. The only box that can be unchecked through KMotionCNC is BIT 34 State box using "M5" or "OFF" button.

    Robert



  10. #34
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1345
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    The voltage on a PWM signal is a little tricky. Keep in mind the PWM signal is a square type wave, meaning it has a voltage that turns on and off very quickly. This pulse train never ends, the width of the pulse is controlled by software. I would have expected that voltage to be closer to 2.5 to 3VDC. This seems to point back to the thought that the program that controls that signal is not running correctly.

    If you look in kmotion.ext you should find one thread the the program K2_SpindlePWM.c. KmotionCNC expected that to be in thread 2. You can see the entire program listed below. Check all the threads and see if this program is listed anywhere when using kmotion.exe. The initialization program should also be in a thread and you can look in the C programs to see the name but if you do some screen shots we can pin point your issue.

    Russ




    K2_SpindlePWM.c File


    #include "KMotionDef.h"

    #define MAX_RPM 18000.0f
    #define PWM_NUMBER 5 //0-7
    #define pdSpindleRPM 35

    //#define INVERT

    main()
    {
    int pwm;
    float speed = *(float *)&persist.UserData[pdSpindleRPM]; // value stored is actually a float

    pwm = speed/MAX_RPM * 255.0f;

    if (pwm > 255) pwm=255; // limit to max pwm value
    #ifndef INVERT
    pwm = 255 - pwm; // set the PWM
    #endif

    //pwm = 128;//165-175

    printf("Spindle Set to %f pwm %d\n",speed, pwm); // print the desired speed
    SetBitDirection(26+PWM_NUMBER,1); // Set bit PWM pin as an output
    FPGA(IO_PWMS+2*PWM_NUMBER+1) = 1; // enable the PWM
    FPGA(IO_PWMS+2*PWM_NUMBER) = pwm; // set the PWM
    }



  11. #35
    Registered
    Join Date
    Jul 2015
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Quote Originally Posted by CNCMAN172 View Post
    If you look in kmotion.ext you should find one thread the the program K2_SpindlePWM.c. KmotionCNC expected that to be in thread 2. You can see the entire program listed below. Check all the threads and see if this program is listed anywhere when using kmotion.exe. The initialization program should also be in a thread and you can look in the C programs to see the name but if you do some screen shots we can pin point your issue.
    Russ,

    I took some screen shots. See attached. It doesn't look like the spindle program is in the threads. Also, you will notice that the init.c program in listed in thread 6 and 7.

    Robert

    Attached Files Attached Files


  12. #36
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1345
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    Thanks for the screenshots, I have a two hour meeting this afternoon, but will investigate this issue. You are correct the Spindle PWM program is not in any of the threads. I need to look at the ones listed to see if any of those call these routines. This would be my guess that they are no longer loaded. These were probably initially flashed and when you upgrade they got killed. More to follow... Thanks

    Russ



Page 3 of 13 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

K2cnc spindle stopped for KG-4925

K2cnc spindle stopped for KG-4925