LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control and simulation Module Spring Mass

Solved!
Go to solution

In case you need in 2011... you can't open this snippet created in 2010 into 2011.

SIM with max inside the loop (2011).png

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 11 of 59
(2,980 Views)

I had tried this earlier and I kept getting a broken line.

 

I have add a screen picture.

 

When I use the ptByPt MaxMin I get a different max value, ptbypt Max equals 0.0606269 ( calculated result 17.294). When I use the maximum from the collector fuction I get 0.061572 (calculated result 17.160).

 

This differance will mean a failure of the test.

0 Kudos
Message 12 of 59
(2,964 Views)
Solution
Accepted by R_ATS

OK, the problem is that you are have an array as input of your collector. In this case, each index of the array is collected separately as a signal. So, if your initial array has 2 elements, then you need to use an index array and then use the "unbundle by name"

 

SIM with vector array.png

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 13 of 59
(2,942 Views)

I will try when I am back at work.

 

All I feed in is an acceleration trace.

 

I also connect the sample rate to the Dt input of the simulation.

0 Kudos
Message 14 of 59
(2,922 Views)

Hi !

 

Right now, I would like to make similar (or same) simulation as in the SIMULINK (example is for the mass-spring simulation with friction damper). There is very useful command Generate arbitrarily shaped periodic signal, which makes the easy for engineer to simulate working profile (load).

 

Among the LV C&S commands, I could not find something similar ... Lookup Table 1D Function .... is very close, but gives very "funny" results .... even for the Interpolate/extrapolate ....

 

Have any idea how to cope with it ?!

 

Thanks!

Vasco-simulation-signal-profile.jpg

0 Kudos
Message 15 of 59
(2,887 Views)

There are some problems with your code. The Step Size (s) you are using is "1". This means that the simulation will a point every second and it will not generate the sharper corners on your profile. If you reduce the "Step Size (s)" to 0.01, then it will have the sharp corners. Also, your cluster for XY Graph is reversed.

 

Try to reduce the Step Size and see if that would work for you.

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 16 of 59
(2,880 Views)

HI!

 

I have found solution fo the problem - the simulation time has to be same as the biggest x value for the Lookup table 1D function (upon table).

 

This could be very useful command fro MATLAB/SIMULINK Generate arbitrarily shaped periodic signal, which makes the easy for engineer to simulate working profile (load).

 

Do You know how to make step/pulse profile - see attached figure, which could help me to test mass-spring model - harmonic stimulus (e.g.400 rpm) for 5 seconds - then sharp step - (e.g. 600 rpm) for 10 seconds and so on.... lower graph is arbitrary step function given by the Table control.... 

 Vasco-simulation-signal-step-profile.jpg

Have any idea how to cope with it ?!

 

I have tried and got this reply for second Lookuptable ...

Error.jpg

0 Kudos
Message 17 of 59
(2,870 Views)

Hi!

 

I would like also to attach signal analysis tool - peaks - to extract some signal features ....

Damper-simulation-peaks.jpg

 

I got answer ....

Error-peaks.jpg

 

Do you know,what might be wrong ?!

0 Kudos
Message 18 of 59
(2,866 Views)

Vasco

 

To be able to use any of the functions that accept 'waveform datatype', they need you to feed an evenly spaced signal. Simulation does give you only point after point. So, you have to accumulate the result and convert to evenly spaced waveform. To do that, you can use the "collector" in the Simulation Palette and the Resample Waveform (single shot) in the Signal Processing Palette. This should give you the ability to obtain the expected results. See the snipped below:

collection and graphing.png

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 19 of 59
(2,860 Views)

By the way, don't change the chart Scaling Factor of the graph. Although we support this feature, it is sometimes hard to know when you have different multiplied. I notice that Scaling Factors or Model-1 has Multiplier 0.35. 

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 20 of 59
(2,859 Views)