Discussion:
Enquire about acquiring analog signal of wheatstone bridge from DAQ device to labview to read certain voltage values
(too old to reply)
Leni
2008-08-13 07:40:20 UTC
Permalink
DAQ assistant function is being used to acquire analog signal from NI USB-6009. So, to read a voltage values out i used a numeric indicator icon. Is this the correct method?
MikeS81
2008-08-13 07:40:20 UTC
Permalink
Hi Leni,
the correct method for what? What do you want to do? If you want to see the value and it works for you, then it is correct. :smileyhappy:
Mike
Hillman
2008-08-13 08:40:18 UTC
Permalink
Hi Leni.&nbsp;Firstly, as MikeS81 said - we need to know more about your setup to answer your question.&nbsp;However, for your reference.. here are some useful links on wheatstone bridges and reading/converting values. &nbsp;<a href="http://digital.ni.com/public.nsf/allkb/4BF24ED85F80735286256F1000641232?OpenDocument" target="_blank">Link </a>- measurements with strain gauge (dynamic resistance) <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=26616&amp;requireLogin=False" target="_blank">link </a>- converting voltage to x (in this case strain, could be temperature or whatever). <a href="http://forums.ni.com/ni/board/message?board.id=250&amp;message.id=36731" target="_blank">forum </a>- link to a forum post about strain again. &nbsp;Please post back soon so we can discuss things further,Regards
Leni
2008-08-13 09:10:05 UTC
Permalink
Do we need to create a while loop within that DAQ assistant and numeric indicator?
Hillman
2008-08-13 09:10:06 UTC
Permalink
Hi Leni,&nbsp;If you want to continuly update the indicator - then yes. &nbsp;Regards
Leni
2008-08-13 09:40:25 UTC
Permalink
btw do u have any reference for the if else statement regarding true or false condition?
Leni
2008-08-13 09:40:26 UTC
Permalink
DAQ assistant is used to acquire analog signal from NI USB-6009 to read certain voltage out values from our wheatstone bridge.&nbsp;We also generate signal from digital output of NI USB 6009 to move our motor to forward/reverse using our LM293 circuit. This circuit is also called h-bridge. Using an array constant to give toggle switch funtions to 'High' or 'Low'. Pin 1, 2 and 7 are connected to P0.0, P0.1 and P0.2 respectively to generate that signalt to DAQ assistant.&nbsp;When Pin 1 and 2 are switch to 'High', Pin 7 to 'Low', the motor will move forward. Pin 1 and 7 are switch to 'High', Pin 2 to 'Low', the motor will turn reverse and etc. Pin 1 act as enable.&nbsp;So, between wheatstone bridge and h-bridge, what best method can be used to implement the motor to move forward/reverse. Other than using toggle switch for h-bridge, is there other method to do it? Can we create a case structure for our if else statement to automatically toggle the switches so that we can control our wheatstone bridge externally by using the potentiometer?
Hillman
2008-08-13 14:10:07 UTC
Permalink
Hi Leni,&nbsp;You find lots of very good information about controlling motors from LabVIEW with NI motion control hardware under this link:
http://www.ni.com/motion/&nbsp;However, depending on your application this could be over complicated.&nbsp;It sounds like you've got a good circuit for controlling the motor - a hbrdige design is classic and works very well. When you say toggle switches, are you talking about switches on your front panel?&nbsp;If not, then you can connect your BJTs or MOSFETs gates to the output pins of the USB-6009 to control their states.&nbsp;So, just to check I understand, you want to controll your motor depending on Analog input (from potentiometer?) to your vi? This would be possible. Use a DAQmx AI task (see examples in help&gt;&gt;example finder...) then with some code you could either output forward or reverse commands. &nbsp;Regards
Leni
2008-08-14 01:40:05 UTC
Permalink
Yes, i was talking about the switches in the front panel. These switches are for our h-bridge. An array constant is to supply the toggle switch. What is the main function of an array constant? Am i using the correct method? &nbsp;Our potentiometer is to control the motor to turn forward and reverse. That potentiometer is from a wheatstone bridge circuit which we measure voltage out using AI0 of our DAQ device.&nbsp;So, between these wheatstone and h-bridge circuits, we want to control the motor to forward and reverse using an if else statement. When the potentiomenter turns, gives the value of voltage out to let say 5V. What i want to achieve is if 5V are less than 10V, it will return true condition and if its greater than10V return false condition. By using potentiometer, we can control the h-bridge to either left/right.
Leni
2008-08-14 02:10:05 UTC
Permalink
You were saying we can use DAQmx AI task. But we using DAQ assistant instead. Is it better to use that DAQmx function?
Hillman
2008-08-14 08:10:10 UTC
Permalink
&nbsp;Hi&nbsp;DAQ assistant is an express vi - which for full applications we'd recommend you dont use - as its slower and has some over heads.&nbsp;But for prototyping and proofs its fine.&nbsp;But basically they do the same things.&nbsp;Hope this helps,&nbsp;regards
Leni
2008-08-14 08:40:21 UTC
Permalink
The potentiometer from the wheatstone bridge circuit can be adjusted to
have the voltage out values that i want. Now the h-bridge are different
from wheatstone. Potentiometer is the one to control the motor to
certain angles when given specific commands. What i want to achieve is
between wheatstone and h-bridge, i can have this case structure to give
commands to the h-bridge using if else statement.

This is the link for my L293 circuit. But i'm using only one portion since i'm using only one motor.

http://www.me.umn.edu/courses/me2011/robot/technotes/L293/L293.html

I
have Pin 1 as enable, pin 2 and 7 to control my motor to forward and
reverse. I use P0.0, P0.1 and P0.2 to give digital output to pin1, 2
and 7 respectively.+5V connect to pin 8 and 16, GND connect to pin 4
and 5.
So far, i can control the motor to forward and reverse in a
while loop but it won't stop unless i unable the toggle switch of pin 1
to 'Low'.

The operation looks something like:

Power supply(+10V) to wheatstone bridge circuit
Acquire voltage out from NI UBS-6009 by AI0, GND using DAQ assistant function
Gives
commands to case structure like if else statement, for examples if
voltage out data 5V is less than 10V, it return true condition and if
its greater than 10V, it return false condition and etc.
From case structure to while loop of h-bridge to dc motor
Lastly to my pendulum.
lion-o
2008-08-14 20:40:05 UTC
Permalink
Hi Leni,&nbsp;From what you've described, I don't even think you need any sort of Case Structure. Consider using the Select Function when possible as well.&nbsp; Here's an example I created real quick. The first DAQ Assistant obtains the voltage from AI0 of the 6009 and the second outputs to port 0.0, 0.1, and 0.2. Does this do everything you need?&nbsp;<img src="Loading Image..." border="0"> Message Edited by lion-o on 08-14-2008 03:16 PM


DAQ_in_out.jpg:
http://forums.ni.com/ni/attachments/ni/170/349439/1/DAQ_in_out.jpg
Leni
2008-08-15 01:40:18 UTC
Permalink
But i want an if else statement function. And in between wheatstone and h-bridge i need to build a case structure.
Leni
2008-08-15 01:40:18 UTC
Permalink
Gives
commands to case structure like if else statement, for examples if
voltage out data 5V is less than 10V, it return true condition and if
its greater than 10V, it return false condition and etc.
lion-o
2008-08-15 14:10:05 UTC
Permalink
Hi Leni,&nbsp;I don't understand why you'd want to use an if-else type of statement for this situation, but it's pretty easy to just insert a case structure in the example I attached to achieve that functionality. I attached a screenshot of 3 different ways to accomplish what you just stated. The first way uses a case structure that allows you to achieve your if-else statement just like you would expect. The second way uses a select function which also can be used for if-else type statements except it doesn't have the ability to keep code from executing. The third way simply returns the same result without ever having to perform any type of if-else functionality and will be the most efficient and preferred method. If you need something more complex than just returning a True or False, then the Case Structure may become needed.&nbsp;<img src="Loading Image..." border="0"> Message Edited by lion-o on 08-15-2008 08:59 AM


if_else.jpg:
http://forums.ni.com/ni/attachments/ni/170/349579/1/if_else.jpg

Loading...