LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 200279, Motor control and Measurements

Solved!
Go to solution

Hello together,

 

Im trying to control a motor and everything is working seperately but when i put it together this error message occurs.

 

Julsbng_0-1705323713709.png

Im reading a Angle with digital inputs and the Toque as a Analog input. The thought behind the program is that every time the angle changes, the Torque should be measured and given out to the graph over the corresponding angle measured. 

The motor control channel is just starting the motor via button.

The analog output controls the speed of the motor. 

 

The program runs fine for the first minute and then the error is stopping the program. 

 

Im aware that the programm is not the cleanest and i will do the fine tuning when it is running properly without an error. Im using a NI 6212 as data exchange device.

 

Below are the pictures of the Tasks configured in NI MAX. 

Julsbng_1-1705324188346.png

Julsbng_2-1705324289217.png

I hope your able to help me because im stuck and have no idea how to fix this. 

 

Thanks in advance 

 

Best regards 
Julius

0 Kudos
Message 1 of 16
(1,217 Views)
Solution
Accepted by topic author Julsbng

Hallo Julius,

 

bitte nicht per PM um Hilfe zu deinem Thread im Forum fragen…

 


@Julsbng wrote:

Im aware that the programm is not the cleanest and i will do the fine tuning when it is running properly without an error. Im using a NI 6212 as data exchange device.


Comments on your VI:

  • Unfortunately you use a very recent LabVIEW version. I'm stuck on an older version (due to license issues) and so you should downconvert your VI to allow more of us to help you. I prefer LV2019. (File->Save for previous)
  • There is no error handling in your VI. Please add that!
  • Why do you mix different sampling modes in your loop? Set ALL DAQmx tasks to "1 sample on demand"! (This will get rid of the -200279 error.)
  • What's the purpose of the "1 iteration FOR loop"? It's pure Rube-Goldberg! Put the shift registers to the outer while loop so you don't need this "fake" loop!
  • What is the purpose of using two shift registers to hold the very same value?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(1,170 Views)

Hey,

thanks for all the advices and improvements first! I really appreciate.

I will fix the points you mentioned and will upload the Vi in version 2019 tomorrow. 

That’s true with the shift registers and the loop i will fix that! 

Thank you for the first help. 
best regards 

Julius 

0 Kudos
Message 3 of 16
(1,161 Views)

Hello Gerd,

 

Thanks again for all the points you mentioned, the error notification is fixed now. 

I also corrected all other things you mentioned. 

Sadly i got a new problem while fixing this.

When the motor speed is increased the angle measurement is getting worse and incorrect. The motor is rotating in on direction but the angle is not increasing like it should. At higher speeds than 2rpm the measurement goes crazy... It goes from 1.6 degree to -3 without even changing the direction of rotation. 

Do you have any idea how to fix this. 

I attached the program in version 2019. 

Julsbng_0-1705403714191.png

 

0 Kudos
Message 4 of 16
(1,144 Views)

I did not have the problem when the Torque Task where set to Continuous Sample 100 1k.

Thats why i did this. 

0 Kudos
Message 5 of 16
(1,140 Views)

Hi Julius,

 

how fast does your loop iterate?

What is the expected data rate of the Angle sensor? Do you obey Mr. Nyquist?

What happens when you don't update the graph in each iteration?

 

How is the "ANGLE" task defined?

You seem to handle just 2 bits, but the DAQmxRead value is delivered with 32 bits and the lower 3 bits are unused? The Angle calculation only adds/subtracts the value 0.25 all the time!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 16
(1,129 Views)

Hi Gerd,

 

How can i determine how fast my loop iterates? Or change that?

 

 

The angle measurement is a TTL Signal from a Torque measurement shaft. You are right there are only 2 bits used. Would it be better to use P1.0 and p1.1 instead of p1.3 and p.4? I could deliver the DAQmxRead with just the single bits and add them afterwards? So i dont have all 32bits? Yes the 3 lower bits are unused. 

Julsbng_0-1705408031716.png

 

 

 

I also deleted the Graph ones and the angle still didnt work with higher speeds.

I need to ask the company of the sensor about the data rate of the angle measurement. I can only find the cut off frequency of 1kh -3db. 

 

The resolution of the angle sensor is 0.25 degree. So every time the value of digital input changes i add or subtract 0.25 degree corresponding to the direction of rotation. The values which come out of the input are 0 8 24 and 16. if they are in this order the rotation is against the clock and i subtract 0.25 of the angle. In the other direction i add 0.25.

 

 

 

0 Kudos
Message 7 of 16
(1,118 Views)

Hi Julius,

 


@Julsbng wrote:

The resolution of the angle sensor is 0.25 degree. So every time the value of digital input changes i add or subtract 0.25 degree corresponding to the direction of rotation. The values which come out of the input are 0 8 24 and 16. if they are in this order the rotation is against the clock and i subtract 0.25 of the angle. In the other direction i add 0.25.


Does your DAQ devices support AB counters? Then the card itself could count all the encoder pulses, no need stack case structures inside of each other…

 


@Julsbng wrote:

How can i determine how fast my loop iterates?


Place a GetDateTimeInSeconds inside the loop and subtract the current value from the previous one…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 16
(1,109 Views)

Hi,

Yes it supports counters but i have no idea how these counters work and what the outputs are. I need to test this. Could this be the problem of the angle measurement? 



Does your DAQ devices support AB counters? Then the card itself could count all the encoder pulses, no need stack case structures inside of each other…

 

 

 

Place a GetDateTimeInSeconds inside the loop and subtract the current value from the previous one…


Here should be the pace of the loop. 

Julsbng_0-1705410776125.png

Julsbng_1-1705410850279.png

 

 

0 Kudos
Message 9 of 16
(1,102 Views)

Hi Julius,

 


@Julsbng wrote:

Here should be the pace of the loop.


You better subtract previous from current time, even though I wrote the opposite! 🙂

 

The loop needed 7ms for the last iteration...

 


@Julsbng wrote:

Yes it supports counters but i have no idea how these counters work and what the outputs are. I need to test this. Could this be the problem of the angle measurement?


Open MAX and configure a counter task. MAX will show you how to connect your encoder...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 16
(1,025 Views)