11-05-2007 02:55 PM
11-06-2007 03:43 PM - edited 11-06-2007 03:46 PM
I would like to make sure I understand your issue, let’s first start from: when you say: “I've checked the hardware in max and I can't seem to simulate this problem” I guess that you are creating a “task” in MAX and testing just the counter input of your application and not that you are simulating a DAQ board to test the behavior of its counter.
I’ll be interested in knowing the result if you run; “Measure Angular Position.vi” example VI this way we can isolate the counter input from all the other task you have on your code. Is it the same for the “Slide” and the “Capstan”? Also what happens in your code if instead of doing x4 you try using x1 or X2?
I’m asking you to try this because X4 has a higher resolution of ticks but at the same time is more sensitive to vibrations and noise. Please see the picture attach found in the NI-DAQmx help.
11-06-2007 04:58 PM
Jaime,
Correct in that I created the task in MAX, no simulation. I also tried using both X1 and X2. The behavior still showed up, and it seemed like it might have been less, but it's hard to quantify as it's intermittant. I ran the "Measure Angular Position.vi" example, and was able to see this same "position creep".
Here's a thought that did cross my mind, and could potentially be the cause of this:
The motor controllers that I'm using already close the loop around the encoders, i.e. they try to hold the motor at a certain encoder count, until you give them a step frequency, and direction. (The are not PWM, think more along the lines of steppers, even though they are DC servos). Could the fact that the motor is banging back and forth between a count or two be the cause of this behavior? If so, is there any way to eliminate/minimize this behavior? The controllers are hardcoded, so there's nothing I can do about the back and forth...
With regard to the encoders, would there be any improvement by enabling the Z-index?
I'm currently doing a quick rewire to minimize any possibility of crosstalk, etc.
I appreciate the help!
.jim
11-07-2007 02:47 PM
The back and forth movement of the motor can be the issue of the behavior only if you see this behavior when the motor is slowing down if you see it in any other situation I might be due to a different reason. Regarding using the Z-index I don think it will help since the Z-index is intended to reset the counter after a one revolution is completed. Re-wiring will be very useful in the case you have crosstalk, like you said, or noise in your Laboratory.
11-07-2007 02:55 PM
Can you confirm me if this is how your system is set, I will really appreciate as much help as you can give me since the more descriptive you are the easier for me to come up with a solution.
Also the back and forward should not be an issue if you are manually driving the motor in this case you are only going to be reading the encoders and the controller is isolated from the system. I’ll be very interested if you can to read the output of the encoder into an oscilloscope.
So when you slow down the motor the counter miss one count i.e. you are moving CW and the counts are 2,3,4,5, (slow CW speed) 4,5,6,7 or it completely changes the direction of the counts i.e. you are moving CW 2,3,4,5,(slow CW speed) 4,3,2,1?
11-07-2007 03:09 PM
Jaime,
I attached a picture of how the system is setup. The controller, encoder, and 6602 share a common ground, A, and B. The connections between just the 6602 and the controller are +5v, direction, and step. All of these signals are currently being sent down cat5 cable to the 6602.
It's important to note that the 5v for the encoder is generated by the motor controller, and that the +5v for the encoder is NOT common with the +5v between the 6602 and the motor controller.
.jim
11-07-2007 04:19 PM
11-07-2007 04:40 PM
Kevin,
All good questions:
The motor controller generates the 5 volt supply for the encoder. The encoder ground, A, and B channels are common between the controller and the 6602. (All I meant to say was the the 6602 was not providing the supply voltage for the encoder). No floating outputs as far as I can tell.
One of the encoders does provide differential outputs, the other just provides relative. Coincidently, the encoder that seems to be having a more noticable problem with this jitter is the one that has differential. It also has a lower number of counts per rev. All the negative outputs are disconnected/floating.
Both encoders are optical. One is 500 (2000 quad) the other is 250 (1000).
Interestingly enough, when I put the scope on pin A, the jitter seemed to stop for a while, which makes me suspect wiring. Perhaps all shielded twisted pairs is the way to go?
.jim
11-08-2007 03:22 PM
Some information I have found to reduce noise is to carefully separate motor and all power wires away from encoder wires. Always separate the channels from each other. All encoder wire "should" be shielded and carefully terminated.
Is it possible for you to disconnect the controller from the encoder?, break the loop, to test the read counter by manually driving the motor? I’m wondering if you are driving the counters on the 6602 with enough current (from the specs min 10uA and max 200uA.
I hope it helps.
11-09-2007 09:24 AM
...the encoder that seems to be having a more noticable problem with this jitter is the one that has differential... All the negative outputs are disconnected/floating.
This sounds like an area to investigate further. There's some possibility that the stuff I was talking about may be hurting you here.
The purpose of the differential output is that the +A and -A are *both* allowed to float relative to your overall digital ground shared by the 6602 and the controller. When they both float, then common-mode noise is induced on both to the same degree simultaneously, but the signals maintain the correct ~5V *difference*. When compared to true digital ground however, they may measure out at 6.5V and 1.5V.
If you wire just the +A, +B signals up, and they are pulsetrains that transition between 1.5 and 6.5V relative to the 6602 digital ground, you could expect indeterminate behavior. If the encoder's logic low state comes in at 1.5V, you can't know how the 6602's TTL circuit will respond.
A "line receiver" or differential-to-ttl circuit should be used to convert back to TTL near the 6602 terminal block.
-Kevin P.