03-03-2010 10:51 AM
Hi guys,
I'm basically doing an experiment which involves using 2 x triaxial accelerometers to calculate displacement of the centre of a rotating circular tool (to which an accelerometer is attatched to each side) and I'm using labview 2009 to collect & analyse the data. I know that there are limitations to this due to noise, but thats fine, i'm just going to compare it to some lasers...
However, I think there is a problem in the proceedure/maths of my vi which is causing a completely wrong displacement. I've attatched a screen shot of the front panel in action whilst its running and my vi. It would be great if anyone could point out whats going wrong.
The vi is basically displaying the displacement from the lasers and from the accelerometers simultaneously. for displacement from the accels I am subtracting the acceleration of one axis from the corresponding axis on the opposite accel and halfing it to gain the acceleration due to movement (roughly) of the tool's centre rather than due to rotation. I then double integrate it to give displacement, find the magnitude between the 2 axis i'm interested in and plot it on a polar plot with theta being an angle observed independantly from an encoder. I have no idea whether this is the correct approach, any help will be most welcome!
Regards
Luke
Solved! Go to Solution.
03-03-2010 02:57 PM
Ok this will take a couple steps.
First I change your structure a bit to implement a producer consumer loop. You were not passing valid values into the consumer loop. Your vi enqueued your analog samples until you pressed stop and you only dequeued the first set. Then your second loop started and only had the first data to work with. There was no time relation between the queue data and the counter data. There still is not and we'll get to that eventually.
Check out the LV examples on usuing queues and we'll get back to making the vi work. Your basic approach sounds reasonable. Just a matter of learning enough LabVIEW to execute your desires.
03-04-2010 05:57 AM
03-04-2010 07:51 AM
I wish I could give you more Kudos!
You are heading in the right direction! and learning how to use the examples! These are the types of posts that give us members the greatest reward. I'll take a look at your code later today (time constraint) but I will get back.
03-04-2010 09:01 AM
The Base Archetecture now looks meaningful. GREAT job!
However the math is very questionable and its pretty obvious that you are not going to get meaningful data. I'm going to need a signal map to understand what the several waveforms represent (I don't have your hadrware) So I'll ask you to add comments to the code to describe the signals (good practice- you'll need to rely on them when you look at this in 6months)
Here are some shots of the easy to spot bad math.
Just a start- but we will get there!
03-04-2010 09:07 AM
Ah, it appears that my constants are 0 since it was an older version I adapted! I'll re-post another with comments.
Cheers!
Luke
03-04-2010 10:43 AM
Okay, here's the real deal with comments also. I'll have access to the lab tomorrow so i'll have a look at the waveforms and get a few screenshots maybe. Thanks again for all your help.
Regards
Luke
03-04-2010 11:11 AM
Ok, I believe I understand what you've done. Absolutly time to go to hardware. Your methods look good (eventually you'll need to learn some better style for LV) I can see a few places I would use sub-vis to encapsulate some of the common reusable functions and you've got some Rube Goldberg stuff in there. Yet, I'd Focus on tweaking it to work before I started hitting style (it does come with practice)
lpaza wrote:Okay, here's the real deal with comments also. I'll have access to the lab tomorrow so i'll have a look at the waveforms and get a few screenshots maybe. Thanks again for all your help.
Regards
Luke
My pleasure- (though- if you would be so kind- Kudos for good responses and marked solutions are all we get to show for our efforts and are considered pollite on the forums)
01-10-2022 11:25 AM
Hello, It is possible to get the code, It file can not be downloaded, thanks
01-10-2022 12:29 PM
Hi Gustavo,
@GustavoLab wrote:
Hello, It is possible to get the code, It file can not be downloaded, thanks
Why don't you download the VI attached to message #7?
I can download the VI and open it with LabVIEW2020…