LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA

Solved!
Go to solution

Hello,

 

    I would appreciate any help and or guidence. I am  new to labview. I am running labview 2015 on windows 10, an PCIe-6361, and a futek fsh02057 torque and position sensor.i am trying to make a read VI that will read  and log torque and its  position. I need as much data as i can possibly get. The shaft is running at a constant 1 rpm and i am only rotating it 90 degrees. the futek sensor read every half degree. So I need 180 points with atleast 50 but as many torque values as i can get. My next step is I have to take all of those points and get the average torque value for each position and ouput it to an oriental Nx series servor motor running in tension mode.

 

    Now with that said, I can't get enough readings and I know it has to be the way my VI is set up, but i am at a loss. I have triued to set  the daq up manually instead of using  the Daq assist, but i cant get it configured correctly. If that is what i have to do I am ok with that but i need help setting it up. I tried to set it up in continous sample instead of single sample, but apparently i need an external clock rate for my counter and I am at a loss for that as well. I have went through a bunch of examples and a lot of posts on here but I am still at a loss.

 

   If anyone can help even point me in the right direction or show me how to set  up the Daq or explain what I need to do I would greatly appreciate it. for the record this is not homework I work for a custom machine design and fabrication company that consist of just 2 people. I was given this job and i have only had a few weeks to not only learn labview but to get a working or program up and going. i am using a producer consumer loop for my main program and calling this read VI when the Start Read Test Button is pressed.

 

   Thank you for your time and again any kind of help would be appreciated.

 

Josh Combs

Sewell Machine Design

0 Kudos
Message 1 of 8
(3,812 Views)

Sorry, I cannt see how your express VIs are configured because I don't have DAQmx installed.

 

Some questions:

  • Why is your post titled "FPGA"?
  • Are you really opening and closing the same file with every iteration of the while loop? Seems like a lot of overhead.
  • Yes, you need to do hardware timed acquisition, not single points. I would also try to get away from using dynamic data. Too opaque.

Have you looked at the shipping examples?

0 Kudos
Message 2 of 8
(3,793 Views)

My Post is titled FPGA .... I'm not sure didnt see a header when i posted this.

 

Yes i am opening and closing every iliteration because the only way i could get it to write to my tdms correctly is by appending the file.

 

i would love to get away from using dynamic data, I know it slows the program down.

 

Yes i have looked at them and I have had a hard time intergrating the example into a usable VI that works and writes correctly I was told to try shift registers but it was creating new channels on my tdms each loop and considering I need to be able to  average out the torque values for each position before I can initialize the next step in my program it wouldnt work.

0 Kudos
Message 3 of 8
(3,783 Views)
Solution
Accepted by topic author Sewell_Machine

See if this does what you want.  One of the tricks I did here was set the sample rate of the counter to be the analog input sample clock.  So those two readings will always sychronized and you do not need an external clock.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
Message 4 of 8
(3,771 Views)

Thank you very much. That worked out beautifully and i now see which settings I was incorrectly wiring. again thank you very much.

 

I do have a question about it though I ran it for roughly 15 seconds and applied torque and got it to 90 degrees the only problem i can for see is it was missing some torque and some position values.

since my next step requires me to average out the torque at all the positions this might be an issue i have to look into that a little more but I do appreciate it very much.

0 Kudos
Message 5 of 8
(3,765 Views)

A couple of suggestions here:

1. Use a Producer/Consumer architecture.  The idea here is to have one loop do the acquisition and then another loop do the logging.  This way the logging does not slow down the acquisition.

2. Increase the sample rate.  I had it set to 10kS/s.  But I somehow doubt this is the problem since you are rotating 90 degrees in 15 seconds, that is 6 degrees/s or 12 angles/s.  10kS/s should definately be able to capture that.  So maybe you should actually lower your sample rate to possibly 100S/s.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 8
(3,730 Views)

OK so i Put it into a producer consumer loop and I believe I did it correctly please let me know id i didnt and heres what i am getting.

 

for some reason every now and again it will get a torque measurment but miss a position measurment than on the very next loop miss the torque but get the position.

 

i decreased my samples down to a hundred and it still did it and raised it to 100k and 1M and all it did was cause it to miss more data. I am wondering if its my hdd but i need to be sure before i go get a 250gb ssd to either run my program on and log data or just log data my cpu wasnt being over taked by the 10k or 100k and my memory seamed to be ok as well.

 

again ithank you so much for your time and any ideas would be greatly appreciated.

 

Josh Combs

Sewell Machine

0 Kudos
Message 7 of 8
(3,647 Views)

I think what might be happening is a very slight race condition.  Both DAQmx Reads are set to read all available data.  But if one read happens just enough before the other, you could have an extra sample from the second one.  So the solution to that one would be to have the DAQmx Read read a specified number of samples.  I would start with something like 100 samples.  At 10kHz, that would be 10ms worth of data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 8
(3,625 Views)