585,973 active members*
3,932 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2013
    Posts
    11

    MPG feedback Mach3

    For re-fit project we are using a Kflop in combination with Arduino Modbus and Mach3. The simple setup is working fine. However there are some challenges.

    The lathe needs to have a MPG pendant. How to setup up this corretly any advise ?

    I have seen the example *.c files like MPGSmoothHardwareEnc.c. fore using this file I have the following questions.
    1) For mach3 needst the MPG part to be added *.c file that is used in the "user programbox in plugin?
    2) How does the update of the mach3 DRO's work. If the kflop based upon the MPG input is starting to move, how is this movement updated in mach3 ?
    3) Is the axis selection beeing feedback from kflop to Mach3 ?

    Thanks.

    Best regards,

    mark

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: MPG feedback Mach3

    Hi Mark,

    I have seen the example *.c files like MPGSmoothHardwareEnc.c. fore using this file I have the following questions.
    1) For mach3 needst the MPG part to be added *.c file that is used in the "user programbox in plugin?
    Use KMotion.exe to modify and run the example in a separate KFLOP Thread to test and verify it works well. Then you can merge the code into the end of your Initialization C Program that executes when you push Mach3 RESET. In that way when you run Mach3 and push RESET your system will initialize and then immediately begin looping and servicing the MPG.

    2) How does the update of the mach3 DRO's work. If the kflop based upon the MPG input is starting to move, how is this movement updated in mach3 ?
    The Dynomotion Plugin is always reading the current commanded destinations in KFLOP and passing them to Mach3 for display in the DRO. So if an axis moves the DRO will change.

    3) Is the axis selection beeing feedback from kflop to Mach3 ?
    Not Normally. KFLOP needs to know which axis to move not Mach3. Realize that KFLOP is controlling the motion this is why there is guaranteed response with no delay. The PC, Windows, Mach3, USB is not involved.

    HTH
    Regards
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Dec 2013
    Posts
    11

    Re: MPG feedback Mach3

    Hi Tom,

    Thanks for your quick response. I will give it a try this weekend.

    Small question: the c-program for the MPG is that combined with the "standard" c. program that contains the axis settings such type of input and output. Or is this second program, repating the some settings as in the standard axis program, running in separate thread ?

    Regards,

    Mark

  4. #4
    Join Date
    May 2006
    Posts
    4045

    Re: MPG feedback Mach3

    Hi Mark,

    Not exactly sure I understand the question. But you will end up with one program that:

    #1 sets all parameters for all your axes
    #2 enables your axes
    #3 defines the Coordinate System
    #4 loops doing the MPG

    Regards
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Dec 2013
    Posts
    11

    Re: MPG feedback Mach3

    Tom,

    Without you understanding the question, the provide answer is very clear for me. nice job !

    regards,

    Mark

  6. #6
    Join Date
    Dec 2013
    Posts
    11

    Re: MPG feedback Mach3

    Hi Tom,

    Followed your instructions. It is working perfect. However is working always, hence even if mach3 is stopped / running a program disable the MPG. Because now the machine always reacts when the MPG is touched. Of course a simple hardware button can be added to MPG, but is there also a software possibility from Mach3.

    regards,

    Mark

  7. #7
    Join Date
    May 2006
    Posts
    4045

    Re: MPG feedback Mach3

    Hi Mark,

    We've been asked that before and weren't able to figure out how to find out from Mach3 when it was running a Job. If someone knows where this is documented please let us know. We found a Variable called MainPlanner->MovementDone in Mach3 that seems to do this. It seems to be false when in EStop as well as running a Job but maybe that is a good thing.

    KFLOP has an internal HostStatus variable that can be set by the Host Application (Mach3 Plugin or KMotionCNC) where bit zero indicates a Job is Active. There is a Macro defined in KFLOP to test this called JOB_ACTIVE.

    This new patched plugin should update the Host Status based on MainPlanner->MovementDone (being false). Download and copy it to your Mach3 directory. It will only work with KMotion Version 4.32 (latest release).

    http://www.dynomotion.com/Software/P...Dynomotion.dll

    Here is an example C Program to display the Job Active Status on a KFLOP LED (IO47) to demonstrate it is working:

    Code:
    #include "KMotionDef.h"
    
    main()
    {
        for(;;)
            SetStateBit(47,JOB_ACTIVE);
    }

    In your MPG program you can test the Status with something like:

    if (JOB_ACTIVE)
    // do not do any MPG moves
    else
    // do MPG moves

    Let us know if you have any problems or questions

    Regards
    TK
    http://dynomotion.com

  8. #8
    Join Date
    Dec 2013
    Posts
    11

    Re: MPG feedback Mach3

    Hi Tom,

    thanks for your feedback. Other things needed my time. However last weekend I changde the program and it worked.

    Regards,

    Mark

Similar Threads

  1. Do EMC or Mach3 require spindle encoder feedback to thread?
    By DREXENG2015 in forum Spindles / VFD
    Replies: 6
    Last Post: 03-10-2014, 01:39 PM
  2. encoder feedback from yaskawa drive to mach3
    By Deano7/11 in forum Machines running Mach Software
    Replies: 0
    Last Post: 07-02-2012, 03:23 PM
  3. Feedback on new DIY CNC
    By larris in forum DIY CNC Router Table Machines
    Replies: 3
    Last Post: 01-19-2010, 04:44 PM
  4. Looking for Feedback
    By 5stargn in forum PCB milling
    Replies: 5
    Last Post: 12-22-2009, 07:56 PM
  5. Feedback from Driver, how does Mach3 know where it is?
    By Darc in forum Mach Software (ArtSoft software)
    Replies: 3
    Last Post: 04-14-2006, 07:13 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
  •