07-02-2010 11:03 AM
Hello again!
Does anyone worked with this VI ?? I cannot read any value from the sensor when executing it. Obviously, the VI is placed inside a While loop structure to get values continously.
Thanks for your help!
Solved! Go to Solution.
07-05-2010 02:07 AM
Hi Francisco,
Could you pleasse post the VI or provide some link to download it? I'd like to have a look at its block diagram. Thanks in advance.
Regards,
07-05-2010 05:34 PM
Hi David,
You can download this VI from here: http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NSK1042
I use it inside a while loop structure and with a constant input and some indicators. I run the new VI in a debug mode, executing a NXT[USB] instance of the VI
07-07-2010 08:43 AM
We use them all of the time. The code from HiTechnic is for the older NXT toolkit. For the new LabView 2009 NXT module, The sensor is supported natively.
It is under NXTIO-additional Sensors. It works fine.
I usually have a case structure set up for T/F on the detected output, and use the direction output for Steering. Works fine.
For the older toolkit, copy the sensor under the vi.lib/addons directory. It will appear under the function pallet.
Good luck
07-12-2010 06:16 AM
Hi again!
I've found the native VI for the HiTechnique sensor, but I have problems with the output values for sensor stenghts. The VI i've just created for using the native VI doesn't show any value from the sensor, so the robot keep on steering all the time. The VI shows the this outputs disabled.
Do you have any example of how to use this VI?
Thanks!
07-12-2010 08:21 AM
Well, it was my fault actually, because I didn't connect the appropriate port number. But still, I can't read the strengths values ...
07-12-2010 08:43 AM
The only trick that I know is that since the outputs are a cluster, you need to split them before using. The direction output is an interger, and the detected output is a T/F
My normal class demo is
While loop -> IR Seaker -> Case (T/F wired to detected)
Case False is Spin
Case True is (Direction-5)*3 wired into the stering input of the Stering Motor VI.
It will chase the IR ball OK. Better math on the steering works better,
I hope that helps
07-12-2010 09:05 AM
Yeah! Now it works, following your steps. I supose that the (Distance-5)*3 is the "power" input to the steering value. And I supose that I can multiply this (Distance-5) per any value, right?
Thanks for your help!
07-12-2010 10:46 AM
On the Motor Steering VI (Located under NXTIO-Complete-Motors) you pass in a steering input and a power. Steering of 0 makes the motors go straight(It uses the rotation encorders to adjust power) Positive turns one way, and negative turns the other. A steering input of +/-100 will spin in place.
And yes, the multiplier is determined experimentally. Ideally I would like to use a power law (2^difference) but I have not made that work.
If you really want control, you can set up a 9 way case statement and customize each case.
Good luck and glad I could help.
08-31-2010 07:28 PM
AP from NJ,
Since the code from HiTechnic is also for the toolkit, do you know how to use HiTechnic Color Sensor with LabVIEW 2009 NXT module?
Many thanks,
John