Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Enquire about acquiring analog signal of wheatstone bridge from DAQ device to labview to read certain voltage values

1 view
Skip to first unread message

MikeS81

unread,
Aug 13, 2008, 3:40:20 AM8/13/08
to
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

unread,
Aug 13, 2008, 10:10:07 AM8/13/08
to
Hi Leni, 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/ However, depending on your application this could be over complicated. 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? If not, then you can connect your BJTs or MOSFETs gates to the output pins of the USB-6009 to control their states. 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>>example finder...) then with some code you could either output forward or reverse commands.  Regards

Leni

unread,
Aug 14, 2008, 4:40:21 AM8/14/08
to
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

unread,
Aug 14, 2008, 4:40:05 PM8/14/08
to
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="http://forums.ni.com/ni/attachments/ni/170/349439/1/DAQ_in_out.jpg" 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

unread,
Aug 14, 2008, 9:40:18 PM8/14/08
to

lion-o

unread,
Aug 15, 2008, 10:10:05 AM8/15/08
to
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="http://forums.ni.com/ni/attachments/ni/170/349579/1/if_else.jpg" 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

Hillman

unread,
Aug 13, 2008, 5:10:06 AM8/13/08
to
Hi Leni,&nbsp;If you want to continuly update the indicator - then yes. &nbsp;Regards
0 new messages