New Machine Build How can I set the Feed Rate from a C file?


Results 1 to 6 of 6

Thread: How can I set the Feed Rate from a C file?

  1. #1

    Default How can I set the Feed Rate from a C file?

    I have a C file, which is capturing the constant Feed Rate in Inches Per Minute (IPM) of what is my Feed Rollers... on the input to a Wood Profiling Machine. This is where the boards, going into the machine, get shaped.

    The speed of this machine, due to the incoming Power Supply, is going up and down, during the day; which does change the speed of the feed rollers, or the IPM.

    My C file, ReadEncoder.c; captures the speed in IPM; based on the files you sent the other day, which I Modified.

    I need this IPM to be the GCode Feed Rate, and to update automatic. I already am getting the Feedrate, and it is my variable "dxx".

    Right now, I am using printf, to write to the Console, only once; when I first start my GCode file via M3, which runs the C file. The C file does not run forever, only a few seconds.

    Then the customer has to manually enter this, into the Gcode program, for the Feed Rate.

    Then restart the GCode file once the right Feed Rate is entered. So not so automatic.

    In my C file, the var.

    double dxx = Captured_Feed_Rate_Calculated;
    __________________________________________________ _____

    How do I pass this to the Interpreter?

    SetFeedRate(dxx);
    SET_FEED_RATE(dxx);
    __________________________________________________ _____

    I was able to pass this to the GCode program, through the Var 199, in KMotionCNC, however; my customer does not want to allow his operators near that much control, such as Jogging, FRO, and such.

    The GCode program is more suitable, for this Automated machine.


    Thanks so much!

    - Jeff

    Similar Threads:
    GOLDCNC5, BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachineautomation.com - ETL UL508A CSA CERTIFIED INDUSTRIAL CONTROL PANEL SHOP


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

    Default Re: How can I set the Feed Rate from a C file?

    Hi Jeff,

    Maybe FRO would be more appropriate to change the Feedrate on-the-fly? There is a function in KFLOP:

    void SetFRO(float FRO); // change from current to the specified FRO (FRO=1.0=Realtime)using a nominal rate based on computed time to change from 1.0 to 0.0



    It isn't clear when/where you want the Feedrate sampled/adjusted. Setting the F word in the Interpreter would have a delayed effect and wouldn't effect motion that was already planned.

    KMotionCNC can accept commands from KFLOP to upload GCode Variables. So at the beginning of your GCode you might add:

    M100 (Upload the desired Feedrate from KFLOP into GCode Variable #199)
    F#199

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  3. #3

    Default Re: How can I set the Feed Rate from a C file?

    Thanks,

    I need to set the Feed Rate, automatically. You have already explained that I cannot pass variables to the Gcode program, in Kmotion.exe... and I verified this. It don't work.

    However, if I can set the Feed Rate in the interpreter... the boards we are profiling... take approx. 15 seconds to run, then less than 2 seconds after that here comes another one.

    It does not matter that the feed rate has a delay in changing. If I set it automatically, every 15 seconds, this means I wont run 100's of boards, without it being corrected. Right now it is only set manually, when they start a job.

    If I can set this Feed Rate, then the machine is not depending on the operator to manually put the info. in correct. The machine will set its own feed rate, based on it own monitored reading. This is an Automated machine.

    This is not a CNC mill, lathe or even close to the like. It is a CNC Profiling machine. It profiles Arc's into the wood. There is actually no Y axis, it only has an X axis, which moves the cutter head, to profile the shape of the wood. The machine tells the machine to Machine an XY move... and monitors the encoder on ch3, to get the feed rate. There is no gearing off the encoder, though some may think that would be good.

    What we do, is set the feed rate, based on the rollers feed rate; in IPM. This feed rate, if correct; will produce an exact part. For instance, G3 X.500 Y100 R10000.25. A 10000.25 inch arc, on this board... the arc is calculated automatic. The Gcode is calculated completely automatic, by the dim. of the board the customer desires.

    I need the feed rate as well to be automatic. I have all the code done. I just need to be able to Set the Feed Rate.

    FRO will not work.

    On one board, it will be cut at 750 inches per minute. Then on another hard wood board, they may run 350 inches per minute. This is set on the machine with a dial... variable belt, to the feed roller, which feed the board through the machine.

    If we can set this, this will increase the accuracy of our machine, and will follow whatever voltage changes or manual changes the customer makes; while the machine is in operation.

    What I really need, and this will eliminate the customer having to do, what should be able to be automated.

    I wish I had you at the machine, to show you; but it is what we need.

    Thanks so much,

    - Jeff R.

    GOLDCNC5, BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachineautomation.com - ETL UL508A CSA CERTIFIED INDUSTRIAL CONTROL PANEL SHOP


  4. #4

    Default Re: How can I set the Feed Rate from a C file?

    OK,

    I admit, that FRO could be used. After thinking about it, I could set the Standard Feed rate to "F1000". Then use my auto program to set it to 750, 500 or whatever it should be.... I will test this. I appologize for being so stubborn about the Feed Rate only idea.

    Thanks again...

    GOLDCNC5, BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachineautomation.com - ETL UL508A CSA CERTIFIED INDUSTRIAL CONTROL PANEL SHOP


  5. #5

    Default Re: How can I set the Feed Rate from a C file?

    I am trying this... as a test of FRO with the Kmotion.exe GCode program... I probally don't know how to implement... can you help me with how to use?

    #include "KMotionDef.h"

    float FRO;

    main()
    {
    FRO = 100 / 1000;
    void SetFRO(FRO);
    }


    GOLDCNC5, BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachineautomation.com - ETL UL508A CSA CERTIFIED INDUSTRIAL CONTROL PANEL SHOP


  6. #6
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: How can I set the Feed Rate from a C file?

    Hi Jeff,

    Regarding "Set Feed Rate" that would need to be added to the code. Or as I suggested you might use KMotionCNC using a GCode Var as suggested. The KMotion.exe GCode Screen is obsolete and replaced by KMotionCNC. Another option that might be simpler that updating KMotion.exe with KMotionCNC.exe functionality would be to use KMotionCNC and hide buttons you don't want to make it look like the old GCode Screen.

    #include "KMotionDef.h"

    float FRO;

    main()
    {
    FRO = 100 / 1000;
    void SetFRO(FRO);
    }
    Integer division of 100/1000 is zero. Try 100.0/1000.0 = 0.1 instead.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


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

How can I set the Feed Rate from a C file?

How can I set the Feed Rate from a C file?