Hello,
I'm very sorry to bother you again. I figured out that my quadrature curve is shifted in motion angle. The shift is arbitrary and occurs every time. The values should oscillate between -20 to 20 but indeed they vary between i.a. -25 and 15, or -12 and 28. The z-signal resets the zero after some samples, but not to 0 as it should? (See attached picture of the retrievd data from the LJ T7 DAQLJ.png) I can follow the curve with drive manufacturers software solution. I have attached a plot of the values of the drive manufacturer's scope (workBenchKollmorgen.png).
I use stream mode and configured the LJ Board, for A,B and Z-signals with the following script lines following the documentation:
# Configure the quadrature digital input coming from the AKD
# Digital input 6 for signal A of enc
fioA = "DIO6"
fioB = "DIO7" #Digital input for signal B of enc
# Configures the counter
ljm.eWriteName(self.handle, fioA+"_EF_ENABLE", 0) # shut off input sigA
ljm.eWriteName(self.handle, fioB+"_EF_ENABLE", 0) # shut off input sigB
# activate quad mode & define input 6 as A signal
ljm.eWriteName(self.handle, fioA+"_EF_INDEX", 10)
# activate quad mode & define input 7 as B signal
ljm.eWriteName(self.handle, fioB+"_EF_INDEX", 10)
ljm.eWriteName(self.handle, fioA+"_EF_ENABLE", 1) # enable input 6
ljm.eWriteName(self.handle, fioB+"_EF_ENABLE", 1) # enable input 7
ljm.eWriteName(self.handle, fioA+"_EF_CONFIG_A", 1) # enabling z-phase
ljm.eWriteName(self.handle, fioA+"_EF_CONFIG_B", 5) # Z-phase DIO number
ljm.eWriteName(self.handle, fioB+"_EF_CONFIG_A", 1) # enabling z-phase
ljm.eWriteName(self.handle, fioB+"_EF_CONFIG_B", 5) # Z-phase DIO number
I verified that the error occurs both with eRead() and eStream() method, reading only a single quad signal or multiple ports in a list. I checked the quad signal with an oscilloscope to verify the z-signal:
-> Z signal comes reliable and in time, 5V, triangle pulse 400us
I wrote a routine to catch the shift error by setting an offsetValue. But this is no satisfying solution.
Any hints? Thank you very much in advance.
My best guess is that there are some pulses coming in after the z-phase. We have had customers solve similar issues by being careful about backlash in their machine. Slowing down before coming to a complete stop can help. Try using the oscilloscope set to trigger on z-phase and read one of the quadrature lines as well. Then zoom out the time scan a bit. With a little luck that will give us a clue.
Hello,
thank you for the reply.
Point is, that I do never stop at 0 deg. Indeed at 0 deg the motor is at the fastest point in the oscillation motion. So, A and B have to give a signal with Z as well? Or didn't I understand your point?
What I did, to solve the problem is to start the measurement with standing machine turned to 0 deg and then start the oscillation after the aquisition without reading the Z signal. This seems to work. However I won't capture in this case if a count is lost and so error will raise with each pulse which was not counted.
Is there another way to do?
Thank you
"So, A and B have to give a signal with Z as well?"
That's right. The z-phase is not detected, rather it is checked when an edge on A or B is detected.