11-16-2013 11:15 PM
Hello,
I am currently trying to simulate the current within my motor when I apply a step voltage for 20 ms. In order to do this I plan to use an FIR filter within the control and simulation module which simulates other parts of the motor.
However, I have found that the FIR filter seems to be behaving strangely. When I change the order of the simulation from Runge-Kutta 1 to Runge-Kutta 2 it effects the output of the FIR filter PtbyPt VI. The two attached images show how the results for the convolution of the IR and the voltage, the FIR filter outside the simulation loop and the FIR filter within a loop using Runge-Kutta 1 are the same. However, the second image shows that under Runge-Kutta 2, the FIR filter in the simulation loop has a different response.
Why does this occur? As I understand, the simulation type should have little effect on the application of an FIR filter on a pt by pt basis. I have not changed the timestep or any other parts of the simulation. I want to use a higher order simulation for other parts so Runge-Kutta 1 will not be sufficient for the simulation.
I am using LabVIEW 2011 SP1.
Thanks,
Rhys
Solved! Go to Solution.
11-18-2013 08:18 AM
When you try to use RK-2 or higher order, the VIs that you dropped inside the Control and Simulation Loop, by default, they will execute in the 'minor' time-steps too. Which means in your case, the VI will be executed 'twice' every time-step.
To properly configure those VIs, you need to 'right-click' on the VI and select "Sub-VI node setup". This will bring a configuration page that the second-half will allow you to choose under "Simulation subVI execution type" to 'remove' the check box for "Include minor time steps" and press OK. When you do that, the subVI will be annotated on the top-right corner with blue "C" and when you execution, it should provide a similar result as RK-1.
Notice that in that dialog you can also select Discrete, which in several cases, it is the right selection for 'discrete' systems.
I hope this helps...