05-02-2012 12:11 PM
The DAQ Assistant always uses dynamic data. With the lower level DAQmx functions, the data type is a function of the polymorphic type of DAQmx Read, number of channels, etc.
05-02-2012 12:36 PM
Dear dennis,
Thanks for your feedback.
ok. help to check.
what i intend to do as follows. i want to drive the motor follow the setpoint profile using a pid( at time 0s, setpoint is 0; at time 5s, setpoint is 5; at time 5s, setpoint is 5). The ouput from pid will ask the DAQ assitant to generate the voltage which will drive the motor.
The total distant travel can be calculated using the encoder.
if the (setpoint - total distant travel) < 0 (This means, overshoot is happen) , motor has to be in the reverse direction (this can be done by ON the two Digital Output line)...
help to critics the vi if you found something wrong there.
if possible, help to correct the vi if you found something wrong there.
05-02-2012 08:55 PM
help to spell out what's wrong in the code if can.
05-03-2012 05:44 AM
the said vi give error -200561
-200561.png
what does it means by DAQmx write <analog 1D DBL N Chan 1 samp) ?? help to share
05-03-2012 09:35 AM
John,
That error tells me that you attempted to write a value of 199.84 to your analog output channel. The range of the channel is +/- 10 V. Since the data exceeds that range, you get the error you see.
Dan
05-03-2012 09:39 AM
Additionally, to answer your question:
what does it means by DAQmx write <analog 1D DBL N Chan 1 samp) ??
DAQmx Write (Analog 1D DBL N Chan 1 Samp) is the version of DAQmx write that was called (this is somewhat hidden from you by the DAQ assistant). If you use the lower level DAQmx API directly, there are many different version of DAQmx write to choose from, and you'd pick based on how many channels are in your task, the format of your data, etc.
Hope that helps,
Dan
05-03-2012 10:55 AM
thanks for the explanation....how to improve the vi?
05-03-2012 11:12 AM
Dan,
I failed to find out the following:
What's the right way to define the sinusoid movement (forward for a meters distance and reverse for a meter distance) in the setpoint pid?? help to share..thanks.
05-03-2012 02:06 PM
John,
I'm the first to admit that I haven't done much with PID control before, so maybe someone with more experience can speak up. Is it valid to turn on relays to reverse the motor direction via relay when you see overshoot? I would think that the PID algorithm itself should account for overshoot. By turning on relays and reversing the motor, are you not going to get a non-proportional response?
What is the relationship between your analog output (voltage) and the response of your motor?
Dan
05-03-2012 08:45 PM
analog output will generate the pwm to feed in motor