LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MyRIO Motor Adaptor - Encoder Readings

Hi,

I'm currently using two digilent myRIO motor adaptors to control 4 quadrature motors. However, I've came to notice an issue with the motor adaptor boards, they do support two DC motors but only provide one encoder reading.

Therefore, I plan to use the MSP connector to reach the encoder signals, however I was wondering if the wires could be directly wired to the pin headers of the adaptor? Do I need to attach a power+ground also?

 

Any help is appreciated.

0 Kudos
Message 1 of 27
(2,272 Views)

Hi all,

 

So I get C/ENC1 to wotk with port B and the two seperate motors get two seperate encoder readings etc. However my problem is with C/ENC0. Motor 1 is getting an encoder reading however it's not changing the polarity of the count when the motor changes direction. It only changes polarity when motor 4 changes direction.

 

I'm not to sure what is going wrong as I've doubled checked the connetions. I've attached the code also.

0 Kudos
Message 2 of 27
(2,235 Views)

Hi ar38160.

How do you guess that it returns the wrong value?

0 Kudos
Message 3 of 27
(2,207 Views)

Hi!

 

I've tried switching the encoder signals around ( C/ENC0 to MXP B and C/ENC1 to MXP A) and when C/ENC1 is connected with MXP A motor 1 +4  work perfectly! But when C/ENC0 is connected MXP B the same behaviour as seen on MXP A is shown in Motor 3 (count direction). I've attached a photo to show this.

 

Basically the behaviour seen on MXP B is not the same on MXP A. Possibly due to the encoder signal or PWM signal. I've connected Motor 1 to A/ENC now and it counts up/down fine on it's own. However, motor 4 is now connected to C/ENC0 and the counter direction still doesn't change unless motor 1 counter direction changes.

0 Kudos
Message 4 of 27
(2,204 Views)

Do you use something like in the attached picture?

IMG20180731105447.jpg

 

0 Kudos
Message 5 of 27
(2,196 Views)

Sort of, but I have 4 DC Geared Motors and 2 myRIO Motor Adaptors. 

MXPA( motor adaptor 1) has Motor 1(A/ENC) and Motor 4(C/ENC0).

MXPB( motor adaptor 2) has Motor 2(B/ENC) and Motor 3(C/ENC1).

 

I've attached an images to show the layout of the robot.

Download All
0 Kudos
Message 6 of 27
(2,193 Views)

I found the  LabVIEW code. Can you try to change this code and write the result? 

Digilent Motor Adapter for myRIO Example Code - NI Community

0 Kudos
Message 7 of 27
(2,190 Views)
0 Kudos
Message 8 of 27
(2,187 Views)

I tried the code and the same results happend.

  • Motor 1 counts up and down fine by itself.
  • Motor 4 doesn't count when tested by itself however it still changes direction if the direction switch is toggled.
  • Testing Motor 1 and Motor 4 together produced the same results as my code. Motr 4 count direction only changes when Motor 1 count direction changes. Again, the direction of the motor still changes when the direction switch is toggled.
0 Kudos
Message 9 of 27
(2,178 Views)

Can you try to put every motor in different loops? Whats the result?

0 Kudos
Message 10 of 27
(2,156 Views)