Newbie set position home


Results 1 to 2 of 2

Thread: set position home

  1. #1
    Member
    Join Date
    Mar 2012
    Location
    00012345
    Posts
    12
    Downloads
    0
    Uploads
    0

    Post set position home

    I'm sure that it's a stupid question.

    I have the home sensor not at 0 but at most (es.5000)
    so I want to run home, Zero (etc.), position set (5000).

    how can I set the axis position so that the home position sensor give me as 5000

    I forgot, kanalog, encoder dac.


    #include "KMotionDef.h"

    main()
    {
    Jog(0,-100); // start moving
    while (!ReadBit(8)) ; // wait for switch (input #8) to change
    Jog(0,0); // stop
    ....setaxisVal....5000
    }

    Similar Threads:


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

    Default Re: set position home

    Hi Fledge2b,

    Try this:
    Code:
    #include "KMotionDef.h"
    
    main()
    {
        double SwitchPosition;
    
        Jog(0,-100); // start moving
        while (!ReadBit(8)) ; // wait for switch (input #8) to change
        SwitchPosition = ch0->Position;  // record where switch changed
        Jog(0,0); // stop
        while (!CheckDone(0)) ; // wait to stop
        Move(0,SwitchPosition); // move back to where switch transitioned
        while (!CheckDone(0)) ; // wait for move to finish
        Delay_sec(0.5);   // wait for everything to settle out
        DisableAxis(0);  // disable axis while adjusting destination and encoder reading
        ch0->Position = 5000;  //....setaxisVal....5000
        EnableAxisDest(0,5000); // now servo to destination of 5000
    }
    HTH
    Regrad

    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

set position home

set position home