Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I perform an index search on a second encoder on a single axis

I am using the NI PCI-7344 to control a brushless motor.  The motor is fitted with two encoders, both with A, B and Index.  The indexes are offset from each other.  I am using axis 3 with encoder 1 as the primary feedback, and as the control output.  Axis 4 is used with encoder 2 as the primary feedback.  I can perform an index search on axis 3 and the index is found.  However if I try an index search on axis 4 the motor does not move.  Alternatively, if I configure axis 3 to use encoder 2, once the index search has completed for encoder 1, it finds the index of encoder 1 again.  I can read the encoder count of both encoders.  Any suggestions?
0 Kudos
Message 1 of 5
(3,675 Views)
Before I try to find an answer I want to make sure that I have understood your mechanical setup correctly.
  1. There is only one motor with two encoders.
  2. There is only one physical control output (output #3) connected to the drive of this motor and it is assigned to two different axes.
Please answer also the following questions:
  1. Which NI-Motion driver version are you using?
  2. What are the encoders' resolutions?
  3. Do you use the same set of PID parameters for both axes?
  4. Do you disable axis 4 when you are using axis 3 and vice versa?
  5. Is it possible to move axis 4 with encoder 2 at all?
  6. How did you switch the encoder for axis 3? Did you do it in MAX? Have you reinitialized the board to apply the changes?
It would be also helpful if you could explain in a few words why you have to use this quite unusual setup.

Best regards,

Jochen Klier
National Instruments Germany
0 Kudos
Message 2 of 5
(3,648 Views)
Hi Jochen,
Thanks for your reply.
 
  1. I am using the National Instruments PCI-7344 with my own design driver.  This takes the control voltage from the DAC 3 output, and uses the 1st encoder for sinusoidal commutation.

  2. The encoder resolution is 20,000 counts/rev
  3. The PID parameters are the same for Axis 3 and Axis 4
  4. No, I do not disable the axis that I am not currently using.
  5. It works correctly when using the 2nd encoder, except for finding the index.
  6. I switched the encoder for axis 3 using the “Configure Axis Resources” VI. 

 

To explain a little more about my application:-  My design is for test equipment to control an existing mechanism.  This mechanism consists of a two phase brushless motor, fitted with two encoders.  Each encoder has A, B, and Index channels, and the indexes are aligned 180 degrees apart.

 

I use Axis 3 configured with a DAC output for the control voltage and the 1st encoder as the feedback.  Axis 4 is configured using the 2nd encoder as the feedback and an unconnected DAC output as the control.  I use the “Read Position” VI to monitor the encoder counts on Axis 3 and Axis 4.  Axis 3 encoder is set to zero on finding the index.  I am also able to set Axis 4 encoder to zero on finding the axis 3 encoder index.

 

What I am trying to do, is verify the distance between the indexes of the two encoders.  To do this I would like to find index 1, reset encoder 1 to zero, then find index 2 resetting the encoder to zero.  I can then continue reading the positions of Axis 3 and 4, verifying that 180 degrees separation is maintained during operation.

0 Kudos
Message 3 of 5
(3,635 Views)
Gary,

I think you could simplify things by using the High-Speed-Capturing (HSC) feature of the PCI-7344. To do this you should connect the second encoder's index signal to the trigger input of axis 3. The move sequence would look like this now:
  1. Find Index using encoder 1 and reset the position
  2. Enable HSC.
  3. Move motor for 1 revolution.
  4. Now you should be able to read the exact position of your second encoder's index signal
I hope this helps,

Jochen
0 Kudos
Message 4 of 5
(3,628 Views)

Hi Jochen,

Thanks for your quick reply.

High speed capture was successful.  However it is important to reset both encoders to zero when the index has been found for the 1st encoder.

This was not my ideal solution to the problem as it involves a change to the hardware, however as we have only produced a few sets of test equipment it is acceptable.

0 Kudos
Message 5 of 5
(3,624 Views)