584,830 active members*
5,503 visitors online*
Register for free
Login
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    12

    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
    }

  2. #2
    Join Date
    May 2006
    Posts
    4043

    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
    TK
    http://dynomotion.com

Similar Threads

  1. Home position
    By shredder in forum OKK
    Replies: 2
    Last Post: 01-21-2014, 03:57 AM
  2. new home position
    By caddisfly in forum Haas Mills
    Replies: 2
    Last Post: 12-08-2011, 07:27 PM
  3. HOME position
    By Toko in forum DynaTorch
    Replies: 0
    Last Post: 11-10-2011, 03:20 AM
  4. Home Position of CNC
    By Ashish B in forum CNC Machining Centers
    Replies: 4
    Last Post: 07-11-2010, 08:46 AM
  5. Replies: 4
    Last Post: 10-28-2009, 06:39 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
  •