Homing each side of ganty indepentently


Results 1 to 15 of 15

Thread: Homing each side of ganty indepentently

  1. #1
    Registered
    Join Date
    Oct 2010
    Location
    USA
    Posts
    61
    Downloads
    0
    Uploads
    0

    Arrow Homing each side of ganty indepentently

    I have a ball screw on each side of my gantry and I drive the nut for each ball screw with its own stepper.

    How can I home each motor independently?

    I would like to do what TomKerekes had mentioned a while back in this post.

    "You can home the two sides independently. Mach3 via the Plugin sends a message to KFlop to home the axis. It is up to you to write a small program to perform the operation. This is a very flexible approach but does require you to write a program (or modify an existing one). A common technique is to home both axes simultaneously but stop each axis independently on separate home switches."

    This is how my steppers are hooked up:

    Left X-axis motor: channel 0 (pins 15 and 16 on JP7)
    Y-axis motor: channel 1 (pins 17 and 18 on JP7)
    Z-axis motor: channel 2 (pins 19 and 20on JP7)
    Right X-axis motor: channel 3 (pins 21 and 22 on JP7)

    The right x-axis motor is slaved to the left x-axis motor in the KMotion configuration.

    If someone could share their homing program with some suggestions on how to address the Right x-axis motor, I could probably take it from there.

    Thanks!

    Dennis

    Similar Threads:


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

    Default

    Hi Dennis,

    The normal way to home slaved axes is to:

    #1 not have them slaved
    #2 Jog both axes at the same time toward the switches
    #3 use a loop watching both switches, if a switch is detected tell the respective axis to start stopping
    #4 exit the loop when both have been told to stop
    #5 wait for both to actually come to a stop
    #6 move both back inside the switches (possibly different amounts to adjust the squaring)
    #7 wait till finished moving
    #8 Zero
    #9 Slave the axes together

    I've attached an example (cnczone didn't like the .c extension so it is .txt) see the function called SquareX. The main routine calls it twice first with a high speed then with a lower speed.

    Hope this helps

    Attached Files Attached Files
    Regards
    TK http://dynomotion.com


  3. #3
    Registered
    Join Date
    Oct 2010
    Location
    USA
    Posts
    61
    Downloads
    0
    Uploads
    0

    Default

    Thanks Tom, this is exactly what I was looking for!

    But,I do have an issue getting any homing routing to work with Mach3.

    I've integrated the code from what you supplied into the HomeMach3.c sample file.

    I copied the code to the Y and Z axis sections and modified to work with these axes. I figured I'd start simple with a single stepper axis and get everything working before moving on to the dual stepper x-axis.

    I can run the homing routines for the Y and Z axes using KMotion, but when I try to run from Mach3 by hitting the Ref All Home button, nothing happens.

    I've configured the plugin to use the HomeMach3.c and you can see from the screen shot that the Thread and Variable Flags are correct.

    Any ideas?

    Thanks,
    Dennis

    Attached Thumbnails Attached Thumbnails Homing each side of ganty indepentently-home-jpg  
    Attached Files Attached Files


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

    Default

    Hi Dennis,

    Everything looks right to me. Is there a printout on the KMotion Console when you REF ALL HOME?

    Regards

    Regards
    TK http://dynomotion.com


  5. #5
    Registered
    Join Date
    Oct 2010
    Location
    USA
    Posts
    61
    Downloads
    0
    Uploads
    0

    Default

    No



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

    Default

    Is Mach3 in EStop?

    What VB code is in the REF ALL HOME button?

    What about the REF Z button on the Diagnostics Screen?

    Regards
    TK http://dynomotion.com


  7. #7
    Registered
    Join Date
    Oct 2010
    Location
    USA
    Posts
    61
    Downloads
    0
    Uploads
    0

    Default

    Tom,

    Is Mach3 in EStop?
    No

    What VB code is in the REF ALL HOME button?

    DoButton( 24 )
    DoButton( 23 )
    DoButton( 22 )
    DoButton( 25 )

    DoOEMButton(133)
    DoOEMButton(134)
    DoOEMButton(135)

    What about the REF Z button on the Diagnostics Screen?
    When pressed, nothing happens and nothing shows in the console.

    Dennis



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

    Default

    Do you have the axes enabled under:

    Config | Ports&Pins | Motor Outputs | XYZ Enables ?

    Mach3 requires the axes you are using to be enabled. If you don't need or use the enables set as port 0.

    Regards

    Regards
    TK http://dynomotion.com


  9. #9
    Registered
    Join Date
    Oct 2010
    Location
    USA
    Posts
    61
    Downloads
    0
    Uploads
    0

    Default

    Tom,

    I'm thinking you may have stumbled across something. If you look at the attached image you'll see that everything is still set to zero. I left it this way because I can jog the axes from within Mach just fine. Is it possible that Mach is not passing any homing commands because, even though the axis is enabled, it doesn't know where to send the commands?

    Thanks,

    Dennis

    Attached Thumbnails Attached Thumbnails Homing each side of ganty indepentently-axis-jpg  


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

    Default

    No I have mine set to all zeros and it works fine. They must be enabled though.

    Please send me your Mach3 XML so I can test if it works for me.

    Regards

    Regards
    TK http://dynomotion.com


  11. #11
    Registered
    Join Date
    Oct 2010
    Location
    USA
    Posts
    61
    Downloads
    0
    Uploads
    0

    Default

    Yeah, Already tried setting the ports and pins and still the homing didn't work.

    Here is the profile I'm using.

    Thanks,

    Dennis

    Attached Files Attached Files


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

    Default

    You have a bunch of Limits and Home inputs enabled in:

    Config | Ports&Pins | Input Signals | X++ X-- X Home ....

    Try disabling them.

    Limits and Homing are all handled by KFLOP. Apparently mach3 refuses to home if they are already indicating at Home.

    Regards

    Regards
    TK http://dynomotion.com


  13. #13
    Registered
    Join Date
    Oct 2010
    Location
    USA
    Posts
    61
    Downloads
    0
    Uploads
    0

    Default

    Finally!

    That was it. Disabled all Limits and Home switches in Mach3 and presto!

    Lesson learned: Enable first in KMotion and see if it works. If not, then try Mach3.

    Thank You!

    Now, I'm just fighting some I/O issues with one of the X-axis home switches. While looking at the I/O in KMotion I was seeing inputs changing state randomly. I found that the ground on the KFlop board itself was loose. After tightening, all but one of my limit switches are working fine. The one that's still flaky I've replace the cable as well as the switch, but no matter which output I have it connected to I still see intermittent changes in state when I run this test code:

    #include "KMotionDef.h"

    main()
    {
    int i=0;
    printf("--------- NEW TEST----------\n");
    do{
    if (ReadBit(24))
    {
    printf("ON\n");
    }

    i++;

    }while (i != 4000000);
    }

    If I disconnect the wire from the input the test runs perfect. As soon as I connect a wire and run the test, I get anywhere from 5 to 100 ON's displayed in the console.

    The cable I have connected to the input right now is industrial high flex network cable (2 pair, only using one) with a shield. Do you think I should hook the shield up? What are your thoughts? FYI, no axis are moving while this is happening.

    Dennis



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

    Default

    Hi Dennis,

    IO bit 24 is the 9th of 10 IOs on JP4. The first 8 of the 10 IOs on both JP4 and JP6 have 150 ohm pull down resistors. So IO 24 is very high impedance input (megohms). So maybe you need a termination resistor.

    But yes you would normally connect the shield on to DC Ground at the KFLOP end of the cable and leave the other end open.

    Regards
    TK

    Regards
    TK http://dynomotion.com


  15. #15
    Registered
    Join Date
    Oct 2010
    Location
    USA
    Posts
    61
    Downloads
    0
    Uploads
    0

    Default

    Everything is working now, limit switches and homing. Thank You very much for your help.

    I've attached my final (for now) homing program. I condensed it to one routine because of issues I was having passing the speed argument from the main function to the SquareX function. Hopefully someone will find it useful.

    Another change I made was removing the commands to save, disable and then enable the limit switches. I'm not sharing any limit switches so I wanted all of the functionality to stay active.

    Thank you again for your help,

    Dennis

    Attached Files Attached Files


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

Homing each side of ganty indepentently

Homing each side of ganty indepentently