CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > CamSoft Products


CamSoft Products Discuss Camsoft PC based CNC controller products here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 10-21-2010, 01:44 AM
 
Join Date: May 2010
Location: New Zealand
Posts: 11
Vector42 is on a distinguished road
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
Reply With Quote

  #2   Ban this user!
Old 10-21-2010, 06:52 AM
Karl_T's Avatar  
Join Date: Mar 2004
Location: Dassel,MN,USA
Posts: 1,318
Karl_T is on a distinguished road

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 11:42 AM.
Reply With Quote

  #3   Ban this user!
Old 10-21-2010, 10:38 PM
 
Join Date: May 2010
Location: New Zealand
Posts: 11
Vector42 is on a distinguished road

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
Reply With Quote

  #4   Ban this user!
Old 10-22-2010, 12:53 AM
 
Join Date: Oct 2003
Location: TEXAS
Posts: 41
n174k is on a distinguished road

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
Reply With Quote

  #5   Ban this user!
Old 10-22-2010, 05:10 AM
Karl_T's Avatar  
Join Date: Mar 2004
Location: Dassel,MN,USA
Posts: 1,318
Karl_T is on a distinguished road

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
Reply With Quote

Sponsored Links
  #6  
Old 10-22-2010, 10:34 AM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,532
Al_The_Man is on a distinguished road
Buy me a Beer?

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 Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #7   Ban this user!
Old 10-23-2010, 05:15 PM
 
Join Date: May 2010
Location: New Zealand
Posts: 11
Vector42 is on a distinguished road

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
Reply With Quote

  #8   Ban this user!
Old 10-25-2010, 11:08 AM
 
Join Date: Apr 2003
Location: United States
Posts: 279
camsoft is on a distinguished road

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)
Reply With Quote

  #9   Ban this user!
Old 10-25-2010, 07:19 PM
 
Join Date: Oct 2003
Location: TEXAS
Posts: 41
n174k is on a distinguished road

Chris,

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

Del
Reply With Quote

  #10   Ban this user!
Old 10-25-2010, 10:04 PM
 
Join Date: May 2010
Location: New Zealand
Posts: 11
Vector42 is on a distinguished road

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
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 10-26-2010, 03:31 AM
Karl_T's Avatar  
Join Date: Mar 2004
Location: Dassel,MN,USA
Posts: 1,318
Karl_T is on a distinguished road

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 04:00 AM.
Reply With Quote

  #12   Ban this user!
Old 10-26-2010, 05:22 PM
 
Join Date: May 2010
Location: New Zealand
Posts: 11
Vector42 is on a distinguished road

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
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using encoder index for homing and a axes position rokag3 General Electronics Discussion 22 10-16-2009 06:57 AM
Looking for cheap encoder with index channel JasonCampbell Servo Motors and Drives 12 09-12-2007 09:31 PM
spindle index, encoder, home/limit switch Wm McNett General Electronics Discussion 10 01-13-2006 06:39 AM
Optical encoder index - what is it good for? medved General Electronics Discussion 8 10-03-2005 05:26 PM
How to tell if my motor is Pulse encoder or quadrature encoder? Darc Servo Motors and Drives 0 07-22-2005 03:51 AM




All times are GMT -5. The time now is 01:32 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361