587,427 active members*
5,054 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2014
    Posts
    52

    Setting Feed and spindle by C program?

    Hi

    The retrofitting of the old OKK is moving along.

    I have a couple of questions about some inputs to KmotionCNC.

    Is it possible to have say a code running in the init file that ca change to current Feed speed and spindle speed?

    I was thinking of using the old dials from the Fanuc control. Wire them to some inputs on the Konnectboard. Then change the feed or spindle speed while a Gcode program is running. This is because i like to have some real dials to turn while running.

    So, is there a command to send to the Kflop or KmotionCNC to change these values?

    Thank you for all the help!

    /Lars

  2. #2
    Join Date
    Feb 2014
    Posts
    52

    Re: Setting Feed and spindle by C program?

    Is SetFRO the right cmd for Feed Rate Override?

    And ex. "SetFRO 2" sets Feedrate at 200% ?

    Any cmd for spindle speed override?

    /Lars

  3. #3
    Join Date
    May 2006
    Posts
    4047

    Re: Setting Feed and spindle by C program?

    Hi Lars,

    Not sure what type your "dials" are? Switches? Potentiometers? Encoders?

    Do you want incremental or absolute settings?

    SetFRO is a Script command from the PC to KFLOP.

    To send a command from KFLOP to KMotionCNC use:

    DoPCFloat(PC_COMM_SET_FRO,FRO);
    or
    DoPCFloat(PC_COMM_SET_SSO,SSO);

    Available KFLOP to KMotionCNC Commands are listed in PC-DSP.h

    I've attached 3 examples where FRO or SSO are adjusted by potentiometer inputs or encoder inputs.

    HTH
    Regards
    TK
    http://dynomotion.com

  4. #4
    Join Date
    Feb 2014
    Posts
    52

    Re: Setting Feed and spindle by C program?

    Thank you! I will look at the files.

    The "dial" will be the old Fanuc dials. The FeedRate Override one has 21 positions.
    It has 5 cables comming out from it. My guess is that it will "send" out a binary code with 00000 as 0% and 10101 as 200%. Going to mesure out the wires and see what will come out.
    My thought is to connect them to 5 inputs on the KonnectBoard1 and run 24 VDC like it was connected before on the fanuc control.

    Any easy way to transform say input 8 to 12 to a binary variable, or even better to a float if that is the correct type to send with DoPCFloat(PC_COMM_SET_FRO,Value);

    Picture of Dials:

    Attachment 264310

    /Lars

  5. #5
    Join Date
    Feb 2014
    Posts
    52

    Re: Setting Feed and spindle by C program?

    Hi

    I have mesured the "Dial" and come up with some binary values.

    I have wrote a basic program to use for the Feedrate override switch. It has a ton of ( if ) commands and it can probably be made alot faster/smaller.

    I will attach the C file, please give it a look.



    /Lars
    Attached Files Attached Files

  6. #6
    Join Date
    May 2006
    Posts
    4047

    Re: Setting Feed and spindle by C program?

    Hi Lars,

    Very good. But two things:

    I think its is better to read all the inputs once per time slice. I also used a formula instead of all the comparisons.

    The second issue is if the switches bounce and/or don't change exactly the same time there can be invalid values while they are changing. Consider the selector changing from 01111 to the next value 10000. For an instant 10101 might be momentarily be present. If sampled at exactly that instant an undesirable FRO might be set. I changed the code to sample the switches for a while to make sure the value has been unchanged for a while before accepting the new value.

    See attached.
    Regards
    TK
    http://dynomotion.com

  7. #7
    Join Date
    Feb 2014
    Posts
    52

    Re: Setting Feed and spindle by C program?

    Hi Tom

    Thanks for the code! I still have som wiring to do before i´m able to test the FRO function.

    I will update with a video later on when things are working as they should,

    /Lars

  8. #8
    Join Date
    May 2006
    Posts
    4047

    Re: Setting Feed and spindle by C program?

    Can't wait for the video

    Please don't forget to include KFLOP, KMotionCNC, and Dynomotion Tags

    Thanks
    TK
    http://dynomotion.com

Similar Threads

  1. Replies: 1
    Last Post: 11-21-2014, 09:32 PM
  2. Acramatic 2100 pedant feed setting
    By acra2100 in forum Controller & Computer Solutions
    Replies: 2
    Last Post: 10-02-2013, 10:23 PM
  3. Zero setting from program.
    By ProToZyKo in forum Fanuc
    Replies: 13
    Last Post: 03-13-2012, 08:10 PM
  4. Problem setting Feed rate w G-code
    By mlind in forum G-Code Programing
    Replies: 11
    Last Post: 07-26-2011, 08:05 AM
  5. Feed-Forward setting
    By Larken in forum Viper Servo drives
    Replies: 0
    Last Post: 04-10-2009, 05:03 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
  •