LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating and Displaying Accelerometer tilt

Hi all,

 

Hope I can find some help here, so what I'm trying to do is simulate and display an accelerometer tilt (like in the picture I have attached). I hope to display the Y-axis as Degrees and the X-axis as time. The idea behind this is if someone was doing a Sit to Stand movement they would lean forward and the accelerometer would be on their chest and when they lean forward the Angle would reduce from 90 degrees down to 50 or 45 degrees.

 

I have been thinking that using a Simulate Arbitary Signal as input and then just displaying it would suffice?

Could I get some help/thoughts/advice?

 

Kind Regards,

Mark.

0 Kudos
Message 1 of 5
(3,185 Views)

You could try concatenating a constant (90 degrees) with half of a sine wave (50*sin(2*pi*t)) then concatenate another constant (90 degress) at the end.

 

You could also simulate random input signals by taking the cummulative sum of a random number generator. Use the Gaussian random number generator to create an array of say 1024 elements. Then compute the cummulative sum of the array. This will produce a 'random walk' input. Increase the variance of the Gaussian function to get a larger range of signals. Take it a step further and use a moving average filter to smooth out sharp transitions between successive samples. I find the simulated random walk input method to be an efficient way to evaluate an algorithm or a system in simulation land because the input will be different every time and you might catch something you overlooked during the design process. 

0 Kudos
Message 2 of 5
(3,160 Views)

Hi  jmountney,

 

First of all, thank you for your response. I am unsure on how to produce either of those suggestions. In your first suggestion are you saying to produce a 90 degree angle and then merge it with a sine wave then merge that with another sign wave? How would I create the intial 90 degrees? 

I must apologize, I am still getting use to LabVIEW, so thank you in advance for any help you may give me.

I'm sorry but I don't know what you mean by your second suggestion. I'm a bit confused.

 

Kind Regards,

Mark

0 Kudos
Message 3 of 5
(3,150 Views)

Here is how you could accomplish the first thought.

 

snippet.png

0 Kudos
Message 4 of 5
(3,104 Views)

Hi,

 

Looks fantastic,should I change the properties of the graph if I want it to show it goes down to 0 degrees (but have the turn still at 40 degrees)? If I implement a while loop would it repeat the "dip" so to speak?

Thanks again for your time.

 

Kind Regards,

Mark.

0 Kudos
Message 5 of 5
(3,100 Views)