587,790 active members*
3,792 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2013
    Posts
    11

    Kflop spindle PWM control -10 + 10v

    For a upgrade project of Mori Seiki Lathe I'm using Kflop + Mach 3.

    The Kfop works with Mach3 and both X and Y axis. The axis are driven by existing motors, with new servo drive that accepts dir/step signals. the drives are closedloop. Receive feedback from encoder. All other signals are done with existing PLC, which has arduino added to add as modbus interface.

    For spindle control planning to use the existing VFD. This VFD has the following inputs: enable / zero hold and analog -10 +10v. I have made simple circuit that can convert the a PWM signal from -10v (at 0%) upto +10v (at 100%).
    actual speed is measured with encoder.

    questions:
    1) How do you connect this to the Kflop (encoder input and PWM output).
    2) How do configure this in Mach3 and Kflop, because 0%- 50% duty is CW. and 50 - 100% is CCW.

  2. #2
    Join Date
    Dec 2003
    Posts
    24220

    Re: Kflop spindle PWM control -10 + 10v

    If the original spindle controller had ±10vdc analogue input, presumably this was for bi-directional control with 0v being 0rpm?
    If so, inputting a -10v will be full rpm reverse?
    Maybe you require Kanalog for bi-directional analogue control, especially if it has encoder feedback?
    Also many of these drives have at-speed and zero speed outputs.
    The up-to-speed is useful when M3/M4 is issued to wait for this input to prevent premature machining before the spindle is at speed.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  3. #3
    Join Date
    May 2006
    Posts
    4052

    Re: Kflop spindle PWM control -10 + 10v

    Hi Markdir13,

    The first step would be to run the PWM1KHz.c example to test/verify you can control the speed and direction with fixed PWM values.

    KFLOP has single ended quadrature encoder inputs. Does your encoder output quadrature?

    Then you could configure an axis to control the spindle much like a servo using No Output Mode and a program like OutputToPWM.c to do the output to the PWM.

    Regards
    TK
    http://dynomotion.com

  4. #4
    Join Date
    Dec 2013
    Posts
    11

    Re: Kflop spindle PWM control -10 + 10v

    Hi AI,

    Indeed 0V is 0 rpm -10V is full rpm revers. Also I think that the mention outputs are provide. I will check this weekend.

    Tom,

    The encoder is quadrature dualended. Hence I will make conversion to single ended.

    Thanks for the tips. I will test and revert back with any questions.

  5. #5
    Join Date
    Dec 2003
    Posts
    24220

    Re: Kflop spindle PWM control -10 + 10v

    In most case you can just use the A & B and leave the /A & /B unconnected.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  6. #6
    Join Date
    Dec 2013
    Posts
    11

    Re: Kflop spindle PWM control -10 + 10v

    Hi,

    thanks for your feedback. this are the results after testing this weekend:

    a) The spindle has a encoder for feedback. Feedback is connect to kflop. I'm able to read the feedback, but I have not used in any program.
    b) using OutputToPWM.c I'm able to generate a PWM signal that is used by home made print to generate -10v to +10v
    c) Yes the drive has have at-speed and zero speed outputs. Not used yet.
    d) With SpindleMach3PWM.c program was NOT able to get any signal out of the KFLOP. Mach3 and Kflop were communicating, because at M3, M4 or M5 command in Mach3 I saw the response in the console screen of the KFLOP. However speed was always zero.

    Even with changing the code from this:
    Code:
    FPGA(IO_PWMS) = (unsigned char)(255.0f*speed);	// set period
    to This:
    Code:
    FPGA(IO_PWMS) = 128;	// set period
    Did not work, only when I add the for ever loop it work for a few seconds.

    could you please help.

    Mark

  7. #7
    Join Date
    May 2006
    Posts
    4052

    Re: Kflop spindle PWM control -10 + 10v

    Hi Mark,

    So the PWM1KHz.c example works? Also the OutputToPWM.c works as expected with hard coded duty cycles?

    When running Mach3 while watching the KMotion Console Screen does this printout ever occur?

    printf("Spindle Speed Set to %f\n",speed);


    I think there is an option in Mach3 to "Disable Spindle Relays" If this option is selected Mach3 may not send all the Spindle Messages to the Plugin.

    Regards
    TK
    TK
    http://dynomotion.com

  8. #8
    Join Date
    Dec 2013
    Posts
    11

    Re: Kflop spindle PWM control -10 + 10v

    Hi Tom,

    the PWM1KHz.c example worked. Also the "SpindleMach3PWM.c" works fine. I'm able to control the PWM -> voltage output from Mach3. However now it is an open loop. How do I get the encoder feedback in to the program and into Mach3 ?

    Regards,
    Mark

  9. #9
    Join Date
    May 2006
    Posts
    4052

    Re: Kflop spindle PWM control -10 + 10v

    Hi Mark,

    How do I get the encoder feedback in to the program and into Mach3 ?
    The first step is to get the Spindle Encoder wired up to KFLOP and counting. Select an unused Axis Channel, configure it for Encoder Input, and select as InputChan0 the Encoder Channel that it is wired. The KMotion Axis Screen should then show the Position of the Axis Channel counting as the Spindle Rotates.

    Then in the Mach3 Plugin set the Spindle Threading parameters to something like those shown below:



    Mach3 should then display the Spindle RPM.

    After that is working you can consider using the KFLOP Axis Channel to close the feedback loop. The Spindle would then be controlled like a Servo Axis by telling the Axis to Jog at a certain speed. The Servo output would be tied to your PWM signal and automatically varied in a manner to obtain the correct speed.

    HTH
    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. Mach3 + Kflop + VFD = Spindle Speed control?
    By slimneill in forum Dynomotion/Kflop/Kanalog
    Replies: 7
    Last Post: 05-07-2015, 06:22 PM
  2. Replies: 158
    Last Post: 12-08-2014, 05:41 PM
  3. KFLOP: How to modify spindle speed PWM from SpindleMach3PWM.c
    By PapstDFrisco in forum Dynomotion/Kflop/Kanalog
    Replies: 2
    Last Post: 10-04-2013, 08:29 PM
  4. Replies: 139
    Last Post: 07-10-2011, 08:50 PM
  5. Replies: 0
    Last Post: 10-16-2007, 03:46 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
  •