Dynomotion

Group: DynoMotion Message: 4867 From: Henk Sterk Date: 5/9/2012
Subject: Homing
Attachments :
    Dear Tom,
     
    I've looked at some of the postings in this forum, they helped a bit, but not enough I'm afraid.
     
    This is what I've got.
     
    Changed the screen buttons using Machscreen.
    I can't get Mach3 to Home, not on DoButton(1022) or DoButton(22) the LED lights goes green (depending if the Home switch is turned off in Ports and Pins ,off=go green on=stay red).
    The Home switches are connected to the Optical inputs on KAnalog and they do register (when triggered) in Mach3 when turned on in Ports and Pins.
    I can't seem to get a message to KMotion through the plugin (on the Console) while the other plugins works fine (do get a messages and triggers).
    Mach3 does not move at all on Reff All or the individual ref's.
    I assume Mach3 would do the Homing and when finished set the encoder back to zero (via the plugin).
     
    I've attached a portion of the Mach3.xml
     
    Hope you can give me some guidelines.
     
    Many thanks
     
    Henk
    Group: DynoMotion Message: 4872 From: Tom Kerekes Date: 5/9/2012
    Subject: Re: Homing [1 Attachment]
    Hi Henk,
     
    I think you have a mis-understanding.  Mach3 can no longer do the homing for you as without the parallel port kernel driver it has no real-time capability (stop immediately when a home switch is detected and so forth).  KFLOP needs to perform the homing in a C Program.  So for example when you push the REFX button in Mach3 it sends a message to the Plugin with a Home Message and a "flags" variable to specify which axis should be homed.  Our Plugin invokes a C Program that you specify in the Plugin Configuration and passes the "flags" parameter to tell the C Program which axis to Home.  The first step is to create a C program to home one axis that you can test using the C Programs Screen in KMotion.  See the SimpleHome.c example.  Let me know how much of this makes sense and I can provide further info.
     
    Regards
    TK

    Group: DynoMotion Message: 4880 From: Henk Sterk Date: 5/10/2012
    Subject: Re: Homing
    Attachments :
      Thanks Tom,
       
      Understand.
       
      After a reboot this morning the communication issue (I mentioned yesterday) went away :-)
      I'm 98% there one small issue.
       
      * when I call DoOEMButton(1022) from the script editor the flag 1 goes across to Kmotion and executes the X-Home (according script,all good) but straight   after that flag 3 comes across as well ?? (see screen caps), can you give me a hind where to look?
       
      * The screen capture shows when Ref all was pressed Ref all axis.
       
      Second question, when homing is finished, I want to tell Mach3,  can you give me an example ?
       
      For the first time I had my machine run some G-Code, SO EXITING :--))))))))
       
      Many thanks
       
      Henk

       
      On Thu, May 10, 2012 at 2:30 AM, Tom Kerekes <tk@...> wrote:
       

      Hi Henk,
       
      I think you have a mis-understanding.  Mach3 can no longer do the homing for you as without the parallel port kernel driver it has no real-time capability (stop immediately when a home switch is detected and so forth).  KFLOP needs to perform the homing in a C Program.  So for example when you push the REFX button in Mach3 it sends a message to the Plugin with a Home Message and a "flags" variable to specify which axis should be homed.  Our Plugin invokes a C Program that you specify in the Plugin Configuration and passes the "flags" parameter to tell the C Program which axis to Home.  The first step is to create a C program to home one axis that you can test using the C Programs Screen in KMotion.  See the SimpleHome.c example.  Let me know how much of this makes sense and I can provide further info.
       
      Regards
      TK

      From: Henk Sterk <henk.sterk@...>
      To: DynoMotion@yahoogroups.com
      Sent: Wednesday, May 9, 2012 2:05 AM
      Subject: [DynoMotion] Homing [1 Attachment]

       
      Dear Tom,
       
      I've looked at some of the postings in this forum, they helped a bit, but not enough I'm afraid.
       
      This is what I've got.
       
      Changed the screen buttons using Machscreen.
      I can't get Mach3 to Home, not on DoButton(1022) or DoButton(22) the LED lights goes green (depending if the Home switch is turned off in Ports and Pins ,off=go green on=stay red).
      The Home switches are connected to the Optical inputs on KAnalog and they do register (when triggered) in Mach3 when turned on in Ports and Pins.
      I can't seem to get a message to KMotion through the plugin (on the Console) while the other plugins works fine (do get a messages and triggers).
      Mach3 does not move at all on Reff All or the individual ref's.
      I assume Mach3 would do the Homing and when finished set the encoder back to zero (via the plugin).
       
      I've attached a portion of the Mach3.xml
       
      Hope you can give me some guidelines.
       
      Many thanks
       
      Henk



      Group: DynoMotion Message: 4882 From: Tom Kerekes Date: 5/10/2012
      Subject: Re: Homing [1 Attachment]
      Hi Henk,

      It is somewhat difficult to explain to a non-programmer, but "flags" is not a code of 1,2,3,4,5...  It is a bit mask where each bit (power of two) is an axis.  ie.

      1 = X
      2 = Y
      4 = Z
      8 = A
      16 = B
      32 = C

      I think the original idea Mach3 had was to allow multiple or simultaneous axis homing.  So for example 1+2+4=7 would be used to home all three xyz axes.  But to my knowledge Mach3 never does this.

      In the C language the "&" operator is used to perform a binary bitwise logical "AND" operation.  So the C statement:

      if (flags & 3)

      Actually is like asking if it is a 1 or 2 or both 1+2 (X or Y).

      Anyways change your 3 to a 4 and it should work properly.

      Regards
      TK

      Group: DynoMotion Message: 4887 From: Henk Date: 5/10/2012
      Subject: Re: Homing
      Yes, you've got me (lol).

      I've done some programming in my time, like VB, and action script, bit this....;--)

      How about talking back to Mach3, I read you can use plugins(18000), but how? do you set that as a bit? I can't find an example, or do you have one?
      Love examples, easier to understand and copy and paste.

      On a different note, I'm supper impressed with your service....thank you.

      Regards

      Henk




      Sent from my iPad

      On 11/05/2012, at 1:10, Tom Kerekes <tk@...> wrote:

       

      Hi Henk,

      It is somewhat difficult to explain to a non-programmer, but "flags" is not a code of 1,2,3,4,5...  It is a bit mask where each bit (power of two) is an axis.  ie.

      1 = X
      2 = Y
      4 = Z
      8 = A
      16 = B
      32 = C

      I think the original idea Mach3 had was to allow multiple or simultaneous axis homing.  So for example 1+2+4=7 would be used to home all three xyz axes.  But to my knowledge Mach3 never does this.

      In the C language the "&" operator is used to perform a binary bitwise logical "AND" operation.  So the C statement:

      if (flags & 3)

      Actually is like asking if it is a 1 or 2 or both 1+2 (X or Y).

      Anyways change your 3 to a 4 and it should work properly.

      Regards
      TK

      Group: DynoMotion Message: 4905 From: Tom Kerekes Date: 5/11/2012
      Subject: Re: Homing
      Hi Henk,
       
      Here is an example of passing double precision floating point values back and forth between Mach3 and KFLOP:
       
       
      But if all you need is completion status for example it would be simpler to use a Virtual IO bit. KFLOP IO bits 48-63 can be used for this.
       
      Regards
      TK