LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQms sampling and Control and Simulation

Hi,

 

I am doing a motor control application in Labview. I am sampling the speed out from DC motor real time through a DAQ. (my sampling time is 1000 samples per second)

 

Then the speed in input to a Simulation loop (Control design and simulation) and inside the simulation loop I have a PID controller. The PID has the motor actual speed from DAQ and motor reference speed as the input.

 

Motor reference speed is taken from the signal generator (Control design and simulation- Simulation) and is a square waveform.

My step size to the motor is 1000.

I am running this application real time and plotting the reference signal and motor actual signals.I am running in to several problems with regard to timing.

 

1. When I change the step size of the simulation loop , the reference squarewave frequency also seems to change. Eg. When step size=1000 , pulse length= 1s. When step size=100 ,  pulse length=0.1 .(My pulse frequency is 1Hz , Simulation clock - 10KHz) . How can the step size affect the pulse width.

 

2. Also can some one please explain to me the relationship between  DAQ sampling time , Simulation loop step size , Simulation loop period.

 

3. If I want to gather different data sets using different sampling times , it is OK to change DAQ sampling time without changing Step size of the simulation.

 

Also would like to highlight that the DAQmx timing under sample clock mode is placed in front of simulation loop and the output is fed to the simulation loop.

 

Appreciate any help.

0 Kudos
Message 1 of 4
(3,083 Views)

Hi,

 

Can you perhaps clarify a few things.  When you say step size = 1000, step size = 100, what exactly do you mean?  Do you mean the step size input terminal on the left side of the simulation loop? 

 

When calculating the derivative or integral in a simulation loop, you can choose several methods.  These methods use a delta t to calculate either the derivative or integral between 1 points.   The step size should not have any effect on the pulse width of your generated signal.  Check your chart history length because perhaps you are not displaying all of your points. 

 

20143iAE273AE7AAA03F84

 

DAQ sampling refers to the rate at which the hardware is sampling, which by default is set with respect to the onboard clock on the card.  That shouldn't be really be related to your simulation loop step size or your loop period either. 

 

I hope this helps.

 

 

Tejinder Gill
National Instruments
Applications Engineer
Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 2 of 4
(3,059 Views)

hi,

   i am using DAQmx with sample on demand with control and simulation loop with runga kutta 4 solver and step size of 0.001 with end time as Inf. i want graph result in real time. which display format gives it most accurate.?

when i tried with floting time it gives 16000 as time axis to stable my system which can't be possible as time so i tried with relative time which gives me 3 minutes to stable in graph which is also not possible in real scenario .so is there any calculation i have to do with step size and display format to get real time axis.? 

0 Kudos
Message 3 of 4
(2,928 Views)

DAQmx LABVIEW 9,

 

In the future, we request that you do not bump old posts, but instead start a new thread with your question. This helps keep each thread focused on a single topic, which helps users find answers better when they search later.

 

As for your question, it will depend on what format you are taking your data in. Could you provide a snippet of code which you are working off of? We need to make sure that we are giving the graph time data along with the data from the Runge-kutta solver. 

 

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 4
(2,913 Views)