Encoder Index Latching


Results 1 to 16 of 16

Thread: Encoder Index Latching

  1. #1
    Registered
    Join Date
    May 2010
    Location
    New Zealand
    Posts
    15
    Downloads
    0
    Uploads
    0

    Default Encoder Index Latching

    Help !
    I have encountered a problem with my homing sequence for any of the 3 axes on my mill. The sequence searches for the home microswitch and then comes off that and searches for the index position on the encoder at which point it zeros the axis. Everything works fine the first time I home but if I home again CamSoft reports that it is already on the index position and sets the machine zero at the microswitch not at the index position !!. The result is that the machine is homed at a slightly different position the second or subsequent times. This has proved to be a disaster when I have homed the machine a second time while half way through a job !

    I used the FINDINDEX command as indicated in the manual but it appears that once found, the index flag (for that axis) is latched, and can only be un-latched by shutting down CamSoft and starting up again.

    Is there an un-documented way of un-latching the index flag(s) ? Or is the problem with the motion control card and do I have to send it a command to un-latch the flag ? And why would you latch up the index, I can't see the logic of that ?

    If there is someone out there who has come across this before can you please help before I scrap another job !

    Chris

    Similar Threads:


  2. #2
    Member Karl_T's Avatar
    Join Date
    Mar 2004
    Location
    Dassel.MN
    Posts
    1542
    Downloads
    2
    Uploads
    0

    Default

    I'd suggest you try low level galil commands. if it solves the problem, you know it was a Camsoft issue. here's a clip out of the galil command reference. be sure and watch your CN command and right homing direction. After you get all axis set, its just COMMAND HM

    Karl




    HM
    FUNCTION: Home
    DESCRIPTION:
    The HM command performs a three-stage homing sequence for servo systems and two stage
    sequence for stepper motor operation.
    For servo motor operation: During first stage of the homing sequence, the motor moves at the
    user programmed speed until detecting a transition on the homing input for that axis. The
    direction for this first stage is determined by the initial state of the homing input. Once
    the homing input changes state, the motor decelerates to a stop. The state of the homing
    input can be configured using the CN command.
    At the second stage, the motor change directions and slowly approach the transition again. When
    the transition is detected, the motor is stopped instantaneously..
    At the third stage, the motor slowly moves forward until it detects an index pulse from the
    encoder. It stops at this point and defines it as position 0.
    For stepper mode operation, the sequence consists of the first two stages.

    Last edited by Karl_T; 10-21-2010 at 12:42 PM.


  3. #3
    Registered
    Join Date
    May 2010
    Location
    New Zealand
    Posts
    15
    Downloads
    0
    Uploads
    0

    Default

    Thanks Karl for that suggestion. I was hoping that someone had actually come across this problem and had a known solution.

    I am not very familiar with using the native Galil commands but in the time I had access to the machine today I read the Galil manual and tried the AL command because it notes in the manual (Page103) that the index latch must be re-armed after a latching event. Thus in Macro.fil I have;

    COMMAND AL Z
    FINDINDEX 3;R

    There was no change - homing a second time causes the index to be found imediately after coming off the home microswitch, rather than moving to find the index.
    The question is; am I using the Galil command properly or is the CamSoft program masking the result by keeping a dummy variable latched after the FINDINDEX ?.

    When I get more time I will try the HM command but do I have to follow it with a BG ? The CamSoft manual does not explain how to use Galil commands that require a sequence be sent to the board.

    Chris



  4. #4
    Registered n174k's Avatar
    Join Date
    Oct 2003
    Location
    Texas
    Posts
    45
    Downloads
    0
    Uploads
    0

    Default

    Chris,

    Are you using an encoder that has Z and complement of Z, /Z If you only have the Z without the complement you will get the described results.

    Del



  5. #5
    Member Karl_T's Avatar
    Join Date
    Mar 2004
    Location
    Dassel.MN
    Posts
    1542
    Downloads
    2
    Uploads
    0

    Default

    Sounds like Del has come accross your issue... I have machines with both kinds of encoders and haven't seen it. (I don't use AL)

    When I bought my first camsoft machine in 2003 it had a Galil command homing macro. Its always worked so its never been changed. it uses a longer form of galil hoiming than the HM command. See below.

    I've never seen or used AL with homing and don't know why that would be needed. Is your home routine based on a .cbk from Camsoft?

    Karl


    [[HOMEALL]]
    IF#23=0THENEXIT
    t=0
    GEAR 2;1:\20=0:BACKLASH MOTOR;;-30
    WAITUNTIL STOP2
    'IF\820>10THENCOMMAND SH:COMMAND CE,0:COMMAND MT,1
    COMMAND SP25000
    COMMAND CN,1
    COMMAND FEX
    COMMAND BGX
    SLEEP .5
    WAITUNTIL STOP1
    MESSAGE FOUND ZHOME
    COMMAND SP1200
    COMMAND CN,1
    COMMAND FEX
    COMMAND BGX
    SLEEP .5
    WAITUNTIL STOP1
    MESSAGE OFF ZHOME
    COMMAND SP3500
    COMMAND JG-400
    COMMAND FIX
    COMMAND BGX
    SLEEP .5
    WAITUNTIL STOP1
    MESSAGE FOUND ZINDEX
    COMMAND SP,15000
    COMMAND CN,-1
    COMMAND FEY
    COMMAND BGY
    SLEEP .5
    WAITUNTIL STOP2
    MESSAGE FOUND HOMEX
    COMMAND SP,800
    COMMAND CN,-1
    COMMAND FEY
    COMMAND BGY
    SLEEP .5
    WAITUNTIL STOP2
    MESSAGE OFF HOMEX
    COMMAND SP,1500
    COMMAND JG,100
    COMMAND FIY
    COMMAND BGY
    SLEEP .5
    WAITUNTIL STOP2
    MESSAGE FOUND INDEXX
    \23=0:\24=0:t=o
    MACHZERO 0;0



  6. #6
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24216
    Downloads
    0
    Uploads
    0

    Default

    The AL is a position capture command, I have never had to use this in a home command.
    Galil accept both single ended and differential encoders and both can use either the individual home commands FE (find edge) and FI (find index) or single combined HM (home) command.
    Unless there is a reason to use the individual commands, the HM is the simplest.
    The HM & FI also sets the axis position to zero.
    Al.

    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  7. #7
    Registered
    Join Date
    May 2010
    Location
    New Zealand
    Posts
    15
    Downloads
    0
    Uploads
    0

    Default

    Many thanks, Del, Karl and Al, I have had success.

    It was not the hardware as in Z complement and my trying to use the AL was a red herring.
    I tried part of Karl's code using the FI command and this works fine the first and subsequent times. I actually kept my own code for finding the microswitches.

    I can only surmise that the CamSoft FINDINDEX command only works once (for each axis) and a flag to say that the index has been found does not get reset.

    If you are reading this CamSoft, please investigate your FINDINDEX command and include a note in the manual to warn of potential position errors - I have scrapped several jobs because of this fault.

    Chris



  8. #8
    Moderator
    Join Date
    Apr 2003
    Location
    United States
    Posts
    332
    Downloads
    0
    Uploads
    0

    Default

    Everything checks out fine. Go ahead and call in if you need further help.

    Tech Support
    CamSoft Corp.
    support@camsoftcorp.com
    PH 951-674-8100
    Fax 951-674-3110
    PC Based CNC Control For The Machine Tool CNC Retrofit And CNC Controller OEM Market

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  9. #9
    Registered n174k's Avatar
    Join Date
    Oct 2003
    Location
    Texas
    Posts
    45
    Downloads
    0
    Uploads
    0

    Default

    Chris,

    Post your logic for the homing sequence that gives you the error for review.

    Del



  10. #10
    Registered
    Join Date
    May 2010
    Location
    New Zealand
    Posts
    15
    Downloads
    0
    Uploads
    0

    Default

    Del,
    Thanks, good suggestion. Here it is for Z. X and Y are similar. This is a copy from my home computer and I am not sure why there are semicolons where there should be commas but when I go to the machine I will check. I can't paste a copy of the new code until I get access to the machine - probably in a few days. Please also note that this was written some 2 or 3 years ago and had presumed to be working all this time :

    [[Home Z]]' Home Z axis ' Called by M120
    'IF\312=0THEN MESSAGE TC arm not safe:EXIT
    STOP:SOFTLIMITS OFF:JOG OFF
    FEEDRATE 1000' Z home feedrate
    IF#3=1THENGOTO :LOOPZ1' If already on switch, go down
    SUSPEND BYPASS:MACHGO ;;9999
    WAITUNTIL #3=1:STOP' Test for switch on
    :LOOPZ1
    MACHZERO ;;0
    FEEDRATE 20' slow down to come off switch
    SUSPEND BYPASS:MACHGO ;;-50
    WAITUNTIL #3=0' Test for switch off
    STOP:WAITUNTIL STOP
    MACHZERO ;;0
    FINDINDEX 3;R' Find encoder index
    MACHZERO ;;0' Double zeroing here to see index
    FEEDRATE 500
    MACHGO ;;\323' offset for TC position see STARTUP.FIL
    WAITUNTIL STOP
    MACHZERO ;;0
    SOFTLIMITS ON
    EXIT' Note: flag set in M120



  11. #11
    Member Karl_T's Avatar
    Join Date
    Mar 2004
    Location
    Dassel.MN
    Posts
    1542
    Downloads
    2
    Uploads
    0

    Default

    Quote Originally Posted by Vector42 View Post
    ...
    MACHGO ;;\323' offset for TC position see STARTUP.FIL
    WAITUNTIL STOP
    MACHZERO ;;0
    SOFTLIMITS ON
    EXIT' Note: flag set in M120
    All those MACHZERO commands is just asking for trouble. Looks to me like you're moving the machine off home and then re-zero again. Follow that \323 and I bet you'll find an issue. I'd have to be at your machine, run a logfile, and set up some special commenting to tace down the problem for sure.

    Del has a point. Its very unlikely that a programming problem exists with FINDINDEX. The Camsoft language has been around for 20 years now and none of the very experienced users have seen this issue.

    Karl

    P.S. its possible that your issue is mechanical. On one machine i did, luck of the draw had the edge of the home switch within a few encoder pulses of the index mark. The machine would stop on either side of the index mark coming off the home switch. Then FINDINDEX would go one full screw revolution and home would be off this much. My "fix" was to move a small amount after coming off the home switch on this axis to make sure FINDINDEX was always the same direction. watch your machine home, see how far it moves on findindex.

    Karl

    P.P.S. Just buy me a plane ticket. I'll fix this for free. I'd love to see NZ in the spring. Winter is setting in up here. My "real job" just finished for the year.

    Karl

    Last edited by Karl_T; 10-26-2010 at 05:00 AM.


  12. #12
    Registered
    Join Date
    May 2010
    Location
    New Zealand
    Posts
    15
    Downloads
    0
    Uploads
    0

    Default

    Thanks Karl for your prompt response as usual. Sorry, I can't buy you a ticket to NZ, but you should come for a holiday !.

    It is not my machine, I am just the poor sod that got the job. I keep getting called out to it to fix things which at installation appeared to be working fine.

    A few notes to my code
    - The \323 variable is used to position the Z axis to align with the tool changer. This is then the final home position. I don't see that this could produce the fault.
    - I have included my new code below. You will see that I have replaced the FINDINDEX command with a Galil sequence and that is all ! It now works. What does that say ?
    - I am a bit worried by your comment that using several MACHZERO's is asking for trouble. Why ? It was done originally so that I could see and take note of the axis position at each step. This sort of tells me that you are yourself not confident of the robustness of the CamSoft software ?
    - I note your point about the index mark being close to the switch change-over point. This is a well known problem and the only permanent remedy is to reposition the switch or encoder during commissioning - something that I have been well aware of and have done. I don't do software kludges for things with permanent hardware solutions.

    [[Home Z]]' Home Z axis
    ' Called by M120
    'IF\312=0THEN MESSAGE TC arm not safe:EXIT
    STOP:SOFTLIMITS OFF:JOG OFF
    FEEDRATE 1000' Z home feedrate
    IF#3=1THENGOTO :LOOPZ1' If already on switch, go down
    SUSPEND BYPASS:MACHGO ;;9999
    WAITUNTIL #3=1:STOP' Test for switch on
    :LOOPZ1
    MACHZERO ;;0
    FEEDRATE 100' slow down to come off switch
    SUSPEND BYPASS:MACHGO ;;-50
    WAITUNTIL #3=0' Test for switch off
    STOP:WAITUNTIL STOP
    MACHZERO ;;0
    ' Index routine 23 Oct 2010
    COMMAND SP ,,100' Set speed for index find
    COMMAND JG ,,-100' Set dir and arbitary distance for index find
    COMMAND FI Z' Prepare to find index
    COMMAND BG Z' Initiate motion
    SLEEP 0.5
    WAITUNTIL STOP3
    MESSAGE Found Z Index

    MACHZERO ;;0' Double zeroing here to see index
    FEEDRATE 500
    MACHGO ;;\323' offset for TC position see STARTUP.FIL
    WAITUNTIL STOP
    MACHZERO ;;0
    SOFTLIMITS ON
    EXIT' Note: flag set in M120

    Chris



  13. #13
    Registered n174k's Avatar
    Join Date
    Oct 2003
    Location
    Texas
    Posts
    45
    Downloads
    0
    Uploads
    0

    Default

    Chris,

    The ( ; ) in CamSoft is a delimiter:
    ie MACHZERO 0;0;0 ~ zero's all axes
    MACHZERO 0 ~ zero's x
    MACHZERO ;0 ~ zero's y
    MACHZERO ;;0 ~ zero's z

    The ( , ) in Galil Native Language is a delimiter:
    ie COMMAND CN,-1 or COMMAND SP,1500

    Delimiter for spacing commands in both, must use ; in CamSoft and , with Galil

    I use the MACHZERO ;;0 as you have programmed in each step to see that the each of the moves are actually being made. Have never had any problem because of the multiple use.

    Karl touched on a very important issue. After you move off the Z home switch you want to move approximately 1/2 revolution of the ballscrew when finding the index marker. Adjustment of either the hoime switch or rotating the encoder wiull produce the desired results.

    How are you trip dogs configured for the home switches, once on do dogs keep the switch energized no matter how far the axis moves in the same direction to the switch?

    What direction is the \323 move, away from the home switch or further onto the switch?

    Don't see any error in the logic, just notes of not required logic. If you are on the home switch the logic will continue, the MACHGO ;;9999 won't even get started as the WAITUNTIL #3=1 will execute and continue down the logic
    to move off the switch, etc.

    Your M120 must have some sequence of:

    [[Home Z]]
    [[Home X]]
    [[Home Y]]


    [[Home Z]]' Home Z axis ' Called by M120
    'IF\312=0THEN MESSAGE TC arm not safe:EXIT
    STOP:SOFTLIMITS OFF:JOG OFF
    FEEDRATE 1000' Z home feedrate

    '**not required** IF#3=1THENGOTO :LOOPZ1' If already on switch, go down

    SUSPEND BYPASS:MACHGO ;;9999
    WAITUNTIL #3=1:STOP' Test for switch on

    '**not required** :LOOPZ1

    MACHZERO ;;0
    FEEDRATE 20' slow down to come off switch
    SUSPEND BYPASS:MACHGO ;;-50
    WAITUNTIL #3=0' Test for switch off
    STOP '**not required** :WAITUNTIL STOP
    MACHZERO ;;0

    FEEDRATE 2 ' **would add this slower rate when finding the marker**

    FINDINDEX 3;R' Find encoder index
    MACHZERO ;;0' Double zeroing here to see index
    FEEDRATE 500
    MACHGO ;;\323' offset for TC position see STARTUP.FIL
    WAITUNTIL STOP
    MACHZERO ;;0
    SOFTLIMITS ON
    EXIT' Note: flag set in M120

    Del



  14. #14
    Member Karl_T's Avatar
    Join Date
    Mar 2004
    Location
    Dassel.MN
    Posts
    1542
    Downloads
    2
    Uploads
    0

    Default

    Chris, if you're sure the problem is fixed - walk away. If it ain't broke don't fix it.

    Now I've had stuff I don't understand happen with machine controls. I call it wierd s#$t. It happens when making a machine do your bidding in all controls, not just camsoft. I do believe there's always a reason, I just don't have time to find it.

    The solution is KISS (keep it simple stupid). I'd start over, use Camsoft's proven example, don't put any extra commands in there. There's two or three examples in macro.mac. I've done a half dozen machines now and just dropped this code in - no trouble. Why re-invent the wheel?

    or, you could comment out every MACHZERO command except the last one, get rid of the stuff Del mentioned. Real good chance just a cleanup would do it.

    just my 2 cents

    Karl



  15. #15
    Gold Member
    Join Date
    Sep 2003
    Location
    USA
    Posts
    552
    Downloads
    0
    Uploads
    0

    Default

    I encountered the index latching while servo orienting a spindle, which had to be done for each tool change. The only way I found to unlatch it was to give a small position command.

    ' servo spindle
    SETUP 4;0;4096;0;1;0;4;N
    #91=1
    SLEEP .2
    f=.1
    POSITION 4;-0.01
    WAITUNTIL STOP4
    FINDINDEX 4;R

    Hope this helps,
    Darek



  16. #16
    Registered
    Join Date
    May 2010
    Location
    New Zealand
    Posts
    15
    Downloads
    0
    Uploads
    0

    Default

    Thanks guys for the comments. To reply:

    Del: Yes, I got a bit confused with the 2 types of delimiters. It has been a while since I worked on the machine. The microswitches are ramp actuated, not latching. The \323 moves away from both the microswitch and the index position. Its purpose is to position the Z axis for the tool changer. Since it is only a small movement of 5mm or so, that becomes the Z axis zero.

    Karl: I will be leaving it now that it is working. My philosophy is a bit different - unless you find the root cause of some problem it will come back and bite you !. Since Darek's posting I am now very suspicious of the FINDINDEX command. Further, I lost confidence in CamSoft's support after the G2 G3 affair (see posting 61355-reverse_circular_motion_3d, I was writing under the machine owner's name Colin then.)

    Darek: Thanks. I think that confirms my suspicions about the FINDINDEX command. I wouldn't mind so much if CamSoft had put a note in the manual warning of the possibility of latchup or that you had to do this or that to reset it.

    Case closed. Unfortunately I still have tool height problems to fix so there may be more postings ...

    Chris



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

Encoder Index Latching

Encoder Index Latching