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! > Electronics > General Electronics Discussion


General Electronics Discussion Discuss basic electronics, power supplies and anything else electronic related here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 10-17-2011, 08:37 AM
 
Join Date: Apr 2011
Location: USA
Posts: 16
nworroll is on a distinguished road
Encoder counting correct in one direction, double in other direction?

So I built an ISA expansion card with a LS7566 IC quadrature endcoder counter. My MILL has rotary encoders on the ends of the motors.

I made my own software to read the counter IC and convert the counts into inches.

The X and the Y axis are accurate, and function 100%. But the Z axis is only accurate in one direction, but in the other direction the count seems to be double.

I connected the Z encoder to the X or Y inputs on my PC board, with the same results. And connected the X encoder to the Z on the PC board, and it worked 100%. This should eliminate a defect on the Z wiring on my board or a typo in the programming being the problem.

I took the cover off the encoder and ensured 100% that I am using the correct wires.

The encoder has +5, -common, M+, M-, A+, A-, B+, B-. I am using A, B and common.

I'm suspecting that I blew something inside the encoder a while ago when I was trying to get them to work with a different setup. Is this a common failure mode? When I open up the encoder what should I be looking for?

Thanks
Reply With Quote

  #2  
Old 10-17-2011, 09:29 AM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,540
Al_The_Man is on a distinguished road
Buy me a Beer?

Have you tried using the other two /A & /B? They are essentially the same but complement signal.
A double beam 'scope is best to see what is going on, but you can use a meter if you turn very slowly and try and observe the same amount of pulses per same amount of turn, but this may prove more difficult over the scope method.
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

  #3   Ban this user!
Old 10-18-2011, 09:42 AM
 
Join Date: Apr 2011
Location: USA
Posts: 16
nworroll is on a distinguished road

Al, I did us the /A & /B inputs with the same results.
Using a meter I can see that A and B switch from 0 to +5v as I turn it, so they are both "working".
I took the encoder into work, so hopefully I can hook it up to one of the scopes here.
I am guessing I am getting a situation were both are working, but one is bleeding over onto the other, causing some overlap in the signal or something like that. I did accidentally apply +5v to the outputs, so I'm guessing that damaged something. The double scope should show that.
There's not much inside the encoder, two line drivers and two comparators, so I think I'll just change them out and see what happens.
Reply With Quote

  #4  
Old 10-18-2011, 09:57 AM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,540
Al_The_Man is on a distinguished road
Buy me a Beer?

A scope should help, BTW did you try swapping the A & B over with each other?
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

  #5   Ban this user!
Old 10-18-2011, 10:25 AM
 
Join Date: Apr 2011
Location: USA
Posts: 16
nworroll is on a distinguished road

yep, does the same thing, but in the opposite direction
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-18-2011, 03:18 PM
 
Join Date: Apr 2011
Location: USA
Posts: 16
nworroll is on a distinguished road

I put it on the scope. I'm not to savvy with o-scopes, but can use them enough. The one I used is a 4 channel, I set to 2 channels.
It was very hard to get a good reading moving the encoder by hand, if I could have spun it with a constant low speed motor I'm sure I could have gotten perfect little square waves to compare.

The best I could do was spin the encoder VERY small amounts and watch each beam on the O-scope go from high to low. I offset their position slightly so I could see which was which. I had to take the cover off of the encoder and turn the outer edge of the wheel slightly to get it slow enough, but it worked. I could clearly see the step of each on going from high to low. It looked like it did it in correct order in both directions. This is going very slowly tho, who knows what would happen and any real speed.
I ordered the IC chips, and will just replace them and see if that cures it up. I'll post back with the results.
Reply With Quote

  #7  
Old 10-18-2011, 03:33 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,540
Al_The_Man is on a distinguished road
Buy me a Beer?

Originally Posted by nworroll View Post
I offset their position slightly so I could see which was which.
??? The difference should have been obvious as there should have been a 90° (quadrature) difference between the two, if they co-inside it almost sounds like you have a A & /A?
If you were getting 90°, then the other thing to look for is a spurious pulse on one of the A or /A.
Incidentally did you check A against /A?
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

  #8   Ban this user!
Old 10-18-2011, 05:42 PM
 
Join Date: Apr 2008
Location: USA
Posts: 22
amtekinc is on a distinguished road

Had the same thing happen to me. I had the marker pulse hooked up on the not A of the differential inputs. Make sure that it is hooked up correctly as connecting the marker pulse up to the A or B differential inputs will cause this problem.
Reply With Quote

  #9   Ban this user!
Old 10-19-2011, 07:27 AM
 
Join Date: Apr 2011
Location: USA
Posts: 16
nworroll is on a distinguished road

Al, I don't think I was clear. I couldn't spin the encoder by hand steady enough to see a clear enough square wave that was consistent enough speed to do any comparison.
All I could get the scope to do for comparison purposes was to set it so it was just flat lines, that would go up or down on the screen whether it was on or off. So as I turned it super slow I saw 'A' line go higher, followed by 'B', then 'A' dropped, then 'B' dropped, etc.

Amtekinc- I'm gonna get it back on the machine before I start swapping IC chips. You may be right. Originally my 'A' wire had a break in it somewhere. So inside the motor cover I moved the 'M' wire to the 'A' terminal, but looking at it now, it was the /M that I moved, and I think I used the M wire at the computer. I thought I metered it to make sure I had the right wire, but maybe I didn't..... won't get back to the machine till Sunday, I'll update on Monday.
Reply With Quote

  #10   Ban this user!
Old 10-25-2011, 09:22 AM
 
Join Date: Apr 2011
Location: USA
Posts: 16
nworroll is on a distinguished road

I was able to hook it up yesterday. I ensured that I connected the proper wires and it worked! I must have had the wrong wire hooked up.

So now it works 100% on all axes, but when I enable the motor drive board and the transformers and everything turn on, the encoder numbers are jumping all over!!!

I'm getting noise. I have two possible solutions I think-

1) use both the A and /A (and B /B) to go into the board, and into a chip to turn that into a clean pulse. I'm assuming this would take care of any noise.

or

2) Use a 'pull-down' resistor at the A and B inputs of my Counter chip. I think this would work. I'm going to try this tonite.

Any other thoughts are appreciated.

(I am using the original shield twisted pair wiring from the encoders to the PC.)
Reply With Quote

Sponsored Links
  #11  
Old 10-25-2011, 09:38 AM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,540
Al_The_Man is on a distinguished road
Buy me a Beer?

I always use the differential pair if they are available, there are several RS422 drivers or receivers 8 pin or 16.
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

  #12   Ban this user!
Old 10-25-2011, 10:00 AM
 
Join Date: Apr 2011
Location: USA
Posts: 16
nworroll is on a distinguished road

I did a quick search, found a chip LTC488, looks like it will do exactly what I need.
I'm gonna try a pull down resistor for tonite, I just want to see this thing work. I'll order that chip next time we do a digikey order at work, and wire that in.
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
Need Help!- Only Y works correct X don't work Z works one direction only jdgbadenhorst Hobbycnc (Products) 1 05-20-2012 06:26 PM
Mach newbie changing axis direction and lowering encoder count toadjammer Mach Software (ArtSoft software) 2 12-29-2010 03:45 PM
Need a little help in the right direction Utopia General Metal Working Machines 2 03-12-2010 10:10 PM
G320/G340 'Required Direction Setup' and 'Required Direction Hold' times? margni74 Gecko Drives 2 12-05-2008 08:10 PM
Need some direction... mredican CNC Tooling 3 03-09-2008 08:39 PM




All times are GMT -5. The time now is 10:43 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