Manual tool change with KmotionCNC


Results 1 to 4 of 4

Thread: Manual tool change with KmotionCNC

  1. #1
    Registered
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    30
    Downloads
    0
    Uploads
    0

    Default Manual tool change with KmotionCNC

    I would like to intercept M6 in KmotionCNC, and have kflop do the following:

    1. Go to a certain point on Z axis (equivalent of a rapid move, if possible) and pause. I would then change the tool.
    2. Allow me to move the Z axis to account for a any tool length difference.
    3. Resume the program after I push a button (preferably a physical button connected to an IO)

    I had limited success with 1 and 3, and would like to get an opinion on how to do this properly.

    Few questions:
    - Is there an easy way to create a rapid move from C program (something account for max velocity, acceleration)?
    - What would be a good way to do step 2?
    - Is calling a KmotionCNC with DoPC() possible from such a handler? (I had the program freeze)?
    - What does "resync interpreter positions" mean in "Execute a C Program in the KMotion Control Board + wait for it to terminate + resync Interpreter positions"?

    Similar Threads:


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

    Default Re: Manual tool change with KmotionCNC

    Hi ticica,

    Go to a certain point on Z axis (equivalent of a rapid move, if possible) and pause. I would then change the tool.
    You might do that in GCode. Or from C Code you can call the Move() function. The units of the Move function are in counts or steps.


    Allow me to move the Z axis to account for a any tool length difference.
    Jogging is not normally allowed while GCode is executing. How do you intend to move? Using the KMotionCNC Jog Buttons? External buttons or MPG? Probe Motion? You might consider displaying a Message in the GCode and then stopping with M0. After the tool change and positioning the tool tip to a surface you could then press cycle start to resume. Otherwise if you wish to allow KMotionCNC to Jog while running GCode there are new KFLOP to KMotionCNC commands in the later Test Versions to allow this (see in PC_DSP.h):

    #define PC_COMM_ENABLE_JOG_KEYS 37 // Allow User to Push Jog Buttons while JOB is running
    #define PC_COMM_DISABLE_JOG_KEYS 38 // Disable allowing User to Push Jog Buttons while Job is Running

    Resume the program after I push a button (preferably a physical button connected to an IO)
    This can be done either by waiting for an external Input, or if GCode is stopped the external I/O can invoke Cycle Start with a normal External Button approach.

    Is calling a KmotionCNC with DoPC() possible from such a handler? (I had the program freeze)?
    Yes it is possible but there are some restrictions. #1 Programs invoked from the GUI (User Buttons not GCode) can not use the GUI such as to display messages. #2 Programs invoked from GCode can not invoke other GCode. These cases currently result in a deadlock.

    What does "resync interpreter positions" mean in "Execute a C Program in the KMotion Control Board + wait for it to terminate + resync Interpreter positions"?
    The GCode Interpreter maintains a current position. Any commanded movements will assume this is the starting point of the motion. Any C Program that moves anything should request a resync after the movement in order for the Interpreter to update its internal state. Otherwise there may be a discontinuity in the next motion path.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  3. #3
    Registered
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    30
    Downloads
    0
    Uploads
    0

    Default Re: Manual tool change with KmotionCNC

    You might do that in GCode. Or from C Code you can call the Move() function. The units of the Move function are in counts or steps.
    If I am correct, the C program move commands do not know about max velocity and acceleration. I would need to program those myself. If this is the case, what would be a good way to do this? I noticed there is an exponential move command MoveExp() to perhaps help out a bit with not pushing a stepper motor too fast. Also, the axis parameters structs contain the max velocity and acceleration, as far as a recall. So it all seems doable neatly in the C. Are there any examples perhaps?

    Jogging is not normally allowed while GCode is executing. How do you intend to move? Using the KMotionCNC Jog Buttons? External buttons or MPG? Probe Motion?
    One idea I had is to do it all automatically (in C). Go to a certain X,Y, Z and drop Z until it touches a probe. Then, knowing the new Z, go back and resume.

    You might consider displaying a Message in the GCode and then stopping with M0. After the tool change and positioning the tool tip to a surface you could then press cycle start to resume.
    Would cycle start just resume from where it had left off? This might be a reasonable way to do it then. I don't want to manually track the position in code. Is there a way to "automate" M6 to also do M0, other than massaging the G code?

    The GCode Interpreter maintains a current position. Any commanded movements will assume this is the starting point of the motion. Any C Program that moves anything should request a resync after the movement in order for the Interpreter to update its internal state. Otherwise there may be a discontinuity in the next motion path.
    If I understand correctly, the C program Move() commands will not update the G-code interpreter, unless sync happens?



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

    Default Re: Manual tool change with KmotionCNC

    Hi ticica,

    If I am correct, the C program move commands do not know about max velocity and acceleration. I would need to program those myself. If this is the case, what would be a good way to do this? I noticed there is an exponential move command MoveExp() to perhaps help out a bit with not pushing a stepper motor too fast. Also, the axis parameters structs contain the max velocity and acceleration, as far as a recall. So it all seems doable neatly in the C. Are there any examples perhaps?
    The Move() command will obey the Axis Parameter Max Velocity, Acceleration, and Jerk which are the same values used for Rapids. You might read this wiki article:
    Dynomotion

    Would cycle start just resume from where it had left off?
    Yes

    Is there a way to "automate" M6 to also do M0, other than massaging the G code?
    The command:

    #define PC_COMM_HALT_NEXT_LINE 36 // Stop Application at the Next Line of code

    Will stop the GCode Execution and leave the execution point on the next line after the M6

    If I understand correctly, the C program Move() commands will not update the G-code interpreter, unless sync happens?
    Yes

    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

Manual tool change with KmotionCNC

Manual tool change with KmotionCNC