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


Page 5 of 13 FirstFirst ... 2345678 ... LastLast
Results 49 to 60 of 156

Thread: K2cnc spindle stopped for KG-4925

  1. #49
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1345
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    Clearly the routine is getting called but "speed" does not appear to be getting passed. You could add a few more printf in the program but the speed variable seems to be the issue. You could prove this by hard coding a speed in the code and compile and download and when you call the spindle would turn on, just a test.

    Russ



    #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
    }



  2. #50
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2790
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Hi Robert,

    Do you have the Var configured for 35 as the C Program is expecting in the KMotionCNC Tool Setup S?

    Regards

    TK
    http://dynomotion.com


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

    Default Re: K2cnc spindle stopped for KG-4925

    Tom,

    Great catch, NO he has the VAR on the KmotionCNC set to VAR 31.

    Robert you can change this on the KmotionCNC screen look at the S command that call the Spindle routine and based on the screenshots you sent earlier the VAR for spindle is setup for 31, change that to 35 and it should start working.

    Russ



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

    Default Re: K2cnc spindle stopped for KG-4925

    Tom and Russ,

    I just tested it after changing the VAR from 31 to 34 with out any luck. I noticed that M4 also lists VAR 31 so I tried changing that one as well with out a change.

    Robert



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

    Default Re: K2cnc spindle stopped for KG-4925

    Sorry, I meant VAR 35 not 34.



  6. #54
    Registered
    Join Date
    Jul 2015
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    However, the console now says this!

    Fri, Jul 24, 2015, 01:08:10 KMotion Program Started
    Spindle Set to 9000.000000 pwm 128




  7. #55
    Registered
    Join Date
    Jul 2015
    Posts
    69
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Tom,

    Should the M4 also be VAR 35?

    Robert



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

    Default Re: K2cnc spindle stopped for KG-4925

    Russ,

    Retested ACM/AUI pins for voltage for S3000, S6000 and S9000. Still reading same for all - 0.067 DVC
    Retested Aux1-Pin 11 Still reading 0.5 DVC

    Robert



  9. #57
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1345
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    I actually think what they have listed for the two C programs for M3, M4, and M5 are not actually what they are using. M4 is not really required at all unless you plan on running the spindle in reverse. Some actual CNC machines implement the M4 command for rigid tapping. The turn the spindle slowly forward to turn in the tap, stop, reverse the motor and remove the tap. This is the most common use of M4, there are some reverse cut bits that are designed for the spindle to run CCW but they are rare.

    what you would normally do is configure the M3 command to set bit 34 to a 1, and M5 command would set bit 35 to a 0.

    The fact that Kmotion now is printing out the the console the spindle is set to a given RPM and PWM signal is good. Are you still hearing the relay click when you issue the M3 command? Keep in mind the spindle will not turn even in you have the speed signal if the M3 command does not close the relay. Did this spindle ever work correctly? If the relay is indeed closing and the PWM signal is really there we need to troubleshoot the components that convert the PWM signal into a analog voltage. With Spindle set at 9000 RPM the voltage going to the spindle should actually be 5V.

    Russ



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

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    Correction to my last post, M3 and M5 should be controlling bit 34.

    Russ



  11. #59
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2790
    Downloads
    0
    Uploads
    0

    Default Re: K2cnc spindle stopped for KG-4925

    Hi Robert,

    KFLOP Aux1-Pin 11 is PWM generator #4

    Your Spindle C Program is specifed to use PWM #5

    Regards

    TK
    http://dynomotion.com


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

    Default Re: K2cnc spindle stopped for KG-4925

    Robert,

    JP6 - AUX1

    PIN-12
    IO31
    Gen Purpose LVTTL I/O (3.3V Only) or PWM5 out

    Check this pin to see if you have a voltage between Pin-12 and GROUND.


    Russ



Page 5 of 13 FirstFirst ... 2345678 ... 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