Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

myRIO maxon encoder readout suddenly drops/rises every 512ms

Solved!
Go to solution

Hello everyone

 

I am using myRIO to control a maxon [art no. 286433] motor (RE 40/40mm, Graphite Brushes, 150 Watt) and sensor (Encoder MR, Type L, 1024 CPT, 3 Channels, with Line Driver).

 

When I read the [Counter Value] from the myRIO Encoder block in LabVIEW and plot these values over time (sampling frequency 1kHz), the counter value shows a significant drop/rise in fixed time intervals of 512ms. The level of the sudden drop/rise depends on the speed I move the motor (manually). The drops/rises always occur at timepoints 512, 1024, 1536ms etc. after start of the measurement. In the attached screenshot you can see an example of 2 jumps (512ms distance to each other).

 

Since it's periodic the problem seems not to come from the encoder, but more from myRIO/software. Filtering the signal is not a good option for me because I will further use this signal in a real time PID controller.

 

Does anyone have experiences related to this issue?

Any help is much appreciated, thanks!

 

Best,

Martin

0 Kudos
Message 1 of 4
(2,822 Views)

Note: myRIO is connected to the maxon motor/encoder via maxon ESCON 50/5

0 Kudos
Message 2 of 4
(2,795 Views)
Solution
Accepted by topic author martin-albrecht

I think I found the problem:

 

I had a few arrays in my code (to optionally save in "Write to Measurement file") that were continually growing and nothing limited their size. The larger these arrays get, the longer it takes to insert an element into them. This resulted in a lag every 512ms where the code stopped for a few ms (increasing over time). During these breaks, the encoder didn't record the position, what resulted in these sudden drops/rises every 512ms. After removing the arrays, there was no lag anymore.

 

I hope this is helpful for similar problems.

0 Kudos
Message 3 of 4
(2,750 Views)

Hi Martin, 

 

Can you Tell me how you connected the myRio with the Escon 50/5?

 

0 Kudos
Message 4 of 4
(1,986 Views)