From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-27-2017 02:26 AM
Hello,
I'm using 6 accelerometers connected to a cDAQ-9174 with NI 9215 modules to calculate angular accelerations of a rigid body in accordance with algorithms in literature.
I require angular velocities therefore wish to integrate the angular acceleration waveform signals iteratively within my consumer loop. I need the integral to use the current data element and the previous data element of the acceleration waveform.
I'm currently using the integral block with the initial condition set to zero and the data component of the angular acceleration waveform connected to the X. Would this be functioning the way I want it to as stated above?
Please find my code attached below. The integral is located within my consumer loop with wz as its output.
Thank you 🙂
04-28-2017 11:20 AM
Hi Rach_17,
Are you talking about the Integral x(t) VI found here? This would be a good approach for the first integral, but to continue integrating the current and previous data element the initial condition would have to be updated. A way to do this could be to use shift registers to pass the value of the current loop iteration to the previous data of the next iteration.
Thanks,
ShaneK
Applications Engineering
04-30-2017 09:08 AM
Hi ShaneK,
Thank you for your response.
That is the integral VI i'm referring to.
Using the shift registers I connected the data from the previous iteration to the initial condition, and the data in the current loop iteration to the X. I found with each iteration, arrays of dimensions 1x2000 were entering the VI as the final and initial conditions rather than individual, subsequent elements. As a result the block provided no outputs. Would it be necessary to record the data first and perform the integral in post-processing, or is there a way of making this work within my consumer loop?
Thanks,
Rach_17
05-01-2017 10:38 AM
Hi Rach_17,
How are you initializing these shift registers? This function should work fine in a consumer loop generally. Would you be able to provide a screenshot of how you have things currently set up?
Thanks,
ShaneK
National Instruments
05-04-2017 01:34 AM
Hi Shanek,
Thanks for your previous response.
I've altered my code significantly since and I'm now using the Integral x(t) PtbyPt.vi. The data is still dequeuing into my consumer loop as a 1D array rather than individual elements. My samples per channel is set to 1000 and consequently the arrays produced for each iteration of my consumer loop are of size 1x1000.
To iterate through the array I've used a for-loop with an auto-indexing tunnel that then passes each element into the Integral PtbyPt vi.
My initial condition is set to zero however I only want this to occur for the first array of data. Will this reset to zero for each iteration of my consumer loop?
I've attached my code and some screenshots below.
Thanks,
Rach_17
05-04-2017 03:30 AM
Also would the integral x(t) PtbyPt.vi be using trapezoidal integration?
Thanks,
Rach_17
05-05-2017 12:32 PM
Hi Rach_17,
The way you have your code set up currently it will always have the initial condition set to zero. A way around this would be to feed the the past value you want as your next initial condition into a shift register that can then be used on the next iteration.
I'm not sure if this function uses trapezoidal integration, does your application require a trapezoidal integration?