585,748 active members*
3,498 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > CNC Machine Related Electronics > Encoder counting correct in one direction, double in other direction?
Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2011
    Posts
    17

    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

  2. #2
    Join Date
    Dec 2003
    Posts
    24220
    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 Custom Machine Design

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

  3. #3
    Join Date
    Apr 2011
    Posts
    17
    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.

  4. #4
    Join Date
    Dec 2003
    Posts
    24220
    A scope should help, BTW did you try swapping the A & B over with each other?
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

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

  5. #5
    Join Date
    Apr 2011
    Posts
    17
    yep, does the same thing, but in the opposite direction

  6. #6
    Join Date
    Apr 2011
    Posts
    17
    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.

  7. #7
    Join Date
    Dec 2003
    Posts
    24220
    Quote 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 Custom Machine Design

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

  8. #8
    Join Date
    Apr 2008
    Posts
    24
    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.

  9. #9
    Join Date
    Apr 2011
    Posts
    17
    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.

  10. #10
    Join Date
    Apr 2011
    Posts
    17
    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.)

  11. #11
    Join Date
    Dec 2003
    Posts
    24220
    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 Custom Machine Design

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

  12. #12
    Join Date
    Apr 2011
    Posts
    17
    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.

  13. #13
    Join Date
    Apr 2008
    Posts
    24
    Quote Originally Posted by nworroll View Post
    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.)
    Make sure your shield is only grounded on one end of the encoder cable. Also, make sure that the encoder cable is not near the motor power cable as this can induce noise into a cable even if shielded. Do use the differential signals A, not A, B, not B, Z, not Z as this will cancel much of the noise. Check your grounds. Good luck.

Similar Threads

  1. Only Y works correct X don't work Z works one direction only
    By jdgbadenhorst in forum Hobbycnc (Products)
    Replies: 2
    Last Post: 06-10-2012, 09:54 PM
  2. Mach newbie changing axis direction and lowering encoder count
    By toadjammer in forum Mach Software (ArtSoft software)
    Replies: 2
    Last Post: 12-29-2010, 10:45 PM
  3. Need a little help in the right direction
    By Utopia in forum Uncategorised MetalWorking Machines
    Replies: 2
    Last Post: 03-13-2010, 05:10 AM
  4. Replies: 2
    Last Post: 12-06-2008, 03:10 AM
  5. Need some direction...
    By mredican in forum CNC Tooling
    Replies: 3
    Last Post: 03-10-2008, 02:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •