Newbie Running a custom Mcode in the background?


Results 1 to 3 of 3

Thread: Running a custom Mcode in the background?

  1. #1
    Member CS900's Avatar
    Join Date
    Aug 2006
    Location
    USA
    Posts
    670
    Downloads
    0
    Uploads
    0

    Default Running a custom Mcode in the background?

    Hi all. so I'm fairly new to macro programming in general, but I find myself in need of some help. I'm trying to emulate the Haas spindle speed variation that they use on their lathes...but on a mill. I have a macro that works to vary the spindle speed and will run indefinitely, but I'm having a hard time figuring out how to make it run in the background while the main program code executes. I'm sure there must be a way to do this in a while loop, but for the life of me, I can't seem to think of a solution that works. Ideally I'd love to apply my program to a custom mcode (I know how to do that) so I can use it on a few different programs and have another mcode that cancels it.

    Any thoughts or tips would be appreciated. Thanks.

    Similar Threads:


  2. #2
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Running a custom Mcode in the background?

    hello cs900, generally such oscilations are for linear axis and for rotary axis; the difference is that rotary axis requires much more response time then a linear axis, so, to make the process fast, you may need to use small oscilations and compute the response time

    once you can measure the response time, you may be able to adjust the segmentation of the linear axis, at least theoreticall

    so, if you run at 2000rpm, and change to 1800, what duration is required, and what is the rpm value when cnc confirms rpm change ? ± 15% eg

    if you can't measure such stuff, then is a shot-in-the-dark: it may work when cutting air, but it may succumb when cutting the part; however, in both situations, is hard to tell what is happening, if you don't know the response time ... even so, it can be done, but i preffer working with numbers

    if the variation functions is installed, you don't have to worry about measuring how it works, because it happens automatically inside the controller; but, if the variation functions is not installed, then you need to measure somehow the output of the code, otherwise, even if it will work, it will be hard to 'push the limits', or some unwanted stuff may start to occur at a scale beyond rough measuring, with effects in time

    if i may, why do you wish to put that on the mill ? k
    indly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  3. #3
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: Running a custom Mcode in the background?

    What control?

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  4. #4
    Member CS900's Avatar
    Join Date
    Aug 2006
    Location
    USA
    Posts
    670
    Downloads
    0
    Uploads
    0

    Default Re: Running a custom Mcode in the background?

    Quote Originally Posted by ger21 View Post
    What control?
    it's a fanuc 3ti model A control.


    deadlykitten, We have some very tall parts that like to chatter during our roughing operations. To overcome, the operator quite frequently will manually vary the spindle speed between 90 and 100% to achieve the same effect. I very much dislike relying on the operator to do this, and would love to automate it. At some point i'd love to be able to stick some accelerometer on there to sense vibration and have the control respond accordingly, but first thing is first, just making sure I can actually control the spindle in a reliable manner.



  5. #5
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Running a custom Mcode in the background?

    hi

    ... is there a g-code, or a way, to ignore spindle response ? would help is needed to start moving the linear axis while the spindle is accelerating/decelerating; if this is not possible, then i'm afraid that what you wish for, can't be done by g-code
    Code:
        spindle stopped
        move to home position
        G01 Z-100 F G94 G91 S2500 M03 ( linear and rotary axis, both of them, should begin speeding up at same time  )
    ... actual rpm and desired ±% ( s_min & s_max)
    ... if available, duration to accelerate from s_min to s_max; reverse time
    ... do you wish to check if desired rpm range is within a certain gear ? if so, provide gears range if you wish
    ... actual feed of linear axis G94
    ... linear travel
    ... if available, duration for executing the linear travel, but not in direct mode, but in segmentation mode : made of small segments ( 20 50 10 5 2 1 0.5 0.1 0.05 mm etc; segmentation has to be as small as possible, without succumbing the linear axis )
    ... is there a parameter for in-position ? even better if available from code

    if timings will go well, it will work flawless, otherwise linear axis may get succumbed, or one axis will have to wait for the other to confirm speed / position ( linear waiting for rotary and/or viceversa )

    code can be writen even if times are not available, but is not guaranteed that the desired effect will occur from the 1st run, so more trials will be needed

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  6. #6
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Running a custom Mcode in the background?

    At some point i'd love to be able to stick some accelerometer on there to sense vibration and have the control respond accordingly
    if you could implement a senzor inside the machine, and make it comunicate with the controller, and also make the controller behave conditionally based on senzor response, then it may work ...





    there is a signal sent from the potentiometer to the controller : what about you mess up with that signal, thus without rotating the spindle override knob ? talk with an electronist, so to place something in there ... activate it by M code :
    ... off : normal behaviour
    ... on : oscilation
    ... reseting the cnc + emergency stop + spindle speed override <>100% + other actions that i am not aware at this moment, should also generate "off" behaviour

    this may work, and i believe that is easier to be implemented then the accelerometer / kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


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

Running a custom Mcode in the background?

Running a custom Mcode in the background?